Smart contracts on blockchain cannot achieve true randomness due to the deterministic nature of blockchains, pushing developers to use pseudo-random number generators (PRNGs). Methods relying on block properties or blockhashes are susceptible to miner tampering and predictability. External solutions like Chainlink VRF and onchain VRFs like Harmony VRF offer more secure random number generation but come with additional costs. The Signidice algorithm and the commit-reveal approach provide additional methodologies, each with their own sets of advantages and limitations. The choice of method depends on the specific requirements and incentives of the contract.

7m read timeFrom coinsbench.com
Post cover image
Table of contents
Relying on Block PropertiesRelying on BlockhashVerifiable Random Function (VRF)SignidiceCommit-reveal
3 Comments

Sort: