Hot answers tagged


Tezos doesn't provide any randomness though Michelson currently. PVSS features are expected to come in future proposals which can enable randomness generation. Currently, the best solution is probably to use an oracle(decentralized or not) to achieve the necessary randomness.


So my specific questions: Is there a way to get the next block hash within a smart contract? No, there is no instruction in Michelson to query a block hash. Or some other way to get a value that isn't known at the time the contract is called? You could use the CREATE_CONTRACT instruction that is usually meant to originate a new contract, it returns the ...


Some sketches of a response: You also need to trust that the oracle actually generates random values. Note that you can distribute the trust by using the several oracles and combining the result. I don't know of any such libraries. Hard to say without knowing the exact details of 2, but there are no conceptual difficulties. Michelson supports several hash ...

Only top voted, non community-wiki answers of a minimum length are eligible