3 ms·
There are various solutions for randomness. Funfair's is for the user and the house to generate chains of hashes, e.g. hash(hash(hash(secret))). Each posts the
by DennisP 8y ago
There are various solutions for randomness. Funfair's is for the user and the house to generate chains of hashes, e.g. hash(hash(hash(secret))). Each posts the outermost hash to the smart contract. Then each can reveal successive preimages, and the contract can XOR each pair to get a random number.
Here's an article on an idea very similar to theirs, with sample code: https://www.blunderingcode.com/gamble-channels-fast-verifiable-off-chain-gambling/ https://www.blunderingcode.com/gamble-channels-fast-verifiab...