Questions tagged [randomness]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
2answers
2k views

Honest lottery winner generation - pseudo random number obtaining

Suppose I would like to organize a honest lottery and prevent cheating when we need to find a winner. I known problem of random number in the known network arises. I would like to try the following ...
0
votes
1answer
23 views

How does this 4-line labyrinth contract work?

contract Labyrinth { uint entropy; function getRandomNumber() public returns (uint) { entropy ^= uint(blockhash(entropy % block.number)); return entropy; } } I found this weird gist ...
3
votes
0answers
1k views

Is this approach to an ethereum lottery sound and/or novel?

I'm looking at making gambling apps is ethereum. Currently made a contract that can flip a coin. After looking at this question: How can I securely generate a random number in my smart contract? and ...
3
votes
1answer
868 views

Any Pseudo Random Number Generator that can generate different numbers in the same block?

All the Pseudo Random Number Generators that depend on block hash or block time seems to generate the same "random" number for the same block. Is there any way to generate different numbers in the ...
1
vote
0answers
39 views

PoA (like rinkeby) safer to generate random number (RNG) this function than POW/POS?

How can I securely generate a random number in my smart contract? I heard that a block of random function results can be dropped by a malicious miner. Can POA prevent this?
0
votes
2answers
312 views

Why aren't block hashes a reliable source of randomness?

I just saw this answer that informed me that block hashes were not a reliable source of randomness. In what situation are block hashes not a reliable way to obtain randomness?