Predicting Random Numbers in Ethereum Smart Contracts
summary
Scans find 72 implementations of on-chain RNGs and the audit labels 43 vulnerable, with concrete failure modes: using miner-tied block variables, calling blockhash incorrectly (the blockhash of the current block equals 0), requesting old blockhashes past the 256 limit, exposing “private” storage, and simple front‑running. Examples include a lottery that lost 400 ether and games exploitable by replaying the RNG in an exploit contract; safer patterns use commit‑reveal plus a future blockhash or an auditable oracle.
AI-written summary · about
chapters (14)
- 0:00Start
- 3:05Blockchain properties
- 3:38Blockchain evolution
- 5:54Contract accounts
- 7:35HANDS ON VULNERABLE
- 7:453649 contracts
- 9:36PRNCS based on block variables
- 17:26Blockhash of an old block
- 20:24Blockhash with a private seed
- 23:43Front-running
- 26:07ZeroNights ICO Hacking Contest
- 28:46External oracles Oraclize
- 35:31Commit-reveal with a single party
- 37:41A better commit-reveal: Randaa
related talks
19mRNG and Me: A Peek Behind The Random Number Generator Curtain
20mVerifiable lotteries
01h 30mRandom
41mCybersecurity and random number generators
43mOutsmarting Smart Contracts
20mSolidity's most common security pitfalls and its best safeguards
50mHow random is Random? Pitfalls of Random in .NET 6
51mCybersecurity and Random Number Generators
