←
Previous Module
Account Abstraction (EIP-4337)

🎲 Verifiable Randomness: Provably Fair RNG

Learn how Chainlink VRF and VDFs ensure tamper-proof randomness

What is Verifiable Randomness?

**Verifiable randomness** is cryptographically provable random number generation for blockchain applications. Unlike traditional RNG, verifiable randomness provides a proof that numbers were generated fairly without manipulationβ€”critical for gaming, lotteries, NFT minting, and validator selection.

The challenge: blockchains are deterministic by design. Every node must compute the same result. True randomness breaks consensus. Solutions like VRF (Verifiable Random Functions) and VDF (Verifiable Delay Functions) enable provably fair randomness on-chain.

🎲 Why Verifiable Randomness Matters

1.
Gaming & Lotteries
$1B+ blockchain gaming market requires provably fair outcomes
2.
NFT Minting
Random trait assignment and fair launch mechanics (Azuki, Moonbirds)
3.
Validator Selection
Ethereum beacon chain uses RANDAO for unbiased validator rotation
4.
Security Protocols
Sampling, sharding, and consensus mechanisms need unpredictable randomness

Interactive: Randomness Method Comparison

Compare different approaches to generating random numbers on blockchain and understand their security tradeoffs.

Block Hash

Use block.prevrandao (formerly blockhash)

Security
Low
Cost
Free
Latency
Instant
Manipulable
Yes
Primary Risk
Miners can manipulate by withholding blocks

Test Random Generation

Note: This is a demo using JavaScript Math.random() - not blockchain VRF

The Determinism Problem

❌ Why blockhash() fails

Miners can see the block hash before committing and withhold blocks with unfavorable outcomes.

Attack: Miner discards block if random outcome doesn't favor them

⚠️ Why oracles are risky

Centralized oracles can be compromised, censored, or go offline. Single point of failure.

Risk: Trust assumption violates decentralization

βœ“ Why VRF/VDF work

Cryptographic proofs ensure randomness cannot be predicted or manipulated before commitment.

Solution: Mathematical guarantees replace trust

🎯 Real-World Usage

Chainlink VRF
Most popular solution
1000+ projects, $10B+ secured
API3 QRNG
Quantum randomness
ANU quantum source
Ethereum RANDAO
Beacon chain
Validator selection