Questions tagged [randomness]
158 questions
3
votes
1 answer
Are future block hashes viable as an RNG?
Let's say I want to make a gambling contract. Anyone can call the createWager function to create a new bet to flip a coin. When they win, in order to collect the payment for the wager, they have to call the collectPayment function, which uses the…
Jay
- 33
- 2
3
votes
0 answers
How can the "Random Beacon" proposal guard against bribes?
The Random Beacon proposal suggests a scheme where K-of-N signatures are used to sign a random number. It suggests that the only way for a random number to be corrupted if all K signers are corrupt; it takes only one honest signer to make the…
MaiaVictor
- 3,177
- 2
- 17
- 37
2
votes
1 answer
Rolling a die at some point in the future
This question has been asked previously by someone else but the answers weren't quite sufficient.
I want to write a simple contract that will yield an immutable 'random' number after a period of time.
My thought is to write it with reference to the…
Richard Boland
- 21
- 1
2
votes
1 answer
Random number between 0 and 1 - quick little question
I know that the topic of random number has been discussed tremendous amount of times already but I have one small question.
I need to get a pseudo random number (not ungamealbe), as simply as possible. The problem is that I need the number to be…
lemme
- 131
- 7
2
votes
2 answers
Need of a random number oracle
I am looking for the less gas consuming random number generator. I think i need an oracle but can you direct me to the best ?
Thanks
Nova Lova
- 41
- 1
- 3
2
votes
0 answers
How bad are future blockhashes as source of entropy exactly?
This is not a duplicate (see below)
Before you answer “bad, the miner can influence them”, please let me specify the question.
It’s clear that things like timestamp should not flow into a random number computation because the miner mining the block…
matthias_buehlmann
- 733
- 6
- 14
1
vote
1 answer
Is the blockhash enough for a treasure generating function?
Suppose your contract has a function which generates a random treasure, as illustrated below:
function generateTreasure() returns (Treasure) {
if (msg.value < 1 ether) return; // cost of calling the message
uint8 rnd = randomUint8();
if…
MaiaVictor
- 3,177
- 2
- 17
- 37
1
vote
0 answers
How can I securely generate a random number in my smart contract at POA?
I heard that a block of random function results can be dropped by a malicious miner.
Can POA prevent this?
How can I securely generate a random number in my smart contract?
KIMS
- 21
- 1
1
vote
1 answer
Accessing RANDAO value from a smart contract
is there a way to access the block randomness from within a smart contract or does the value reside only on the consensus layer?
Jan Beneš
- 569
- 1
- 7
- 14
0
votes
0 answers
Create a random number (that no one knows) at time A and reveal it when event B occurs
Similar things have been discussed before, but the requirement is - no one (no one non neutral that is) should have access to the secret before the reveal, so commit-and-reveal scheme doesn't work.
If we had an honest neutral custodian this would be…
Phosphorescent
- 1
- 1
0
votes
1 answer
Can this simple RNG be hacked?
For a game I have implemented Chainlink VRF and a basic RNG for small games where the fee of Chainlink wouldn't make sense.
For the 3rd parameter to abi.encodePacked (some seed data? docs suck so not exactly sure), I pass all the public keys of…
Dominic
- 117
- 6