Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

RANDAO

RANDAO is a decentralized, on-chain random number generation mechanism used in proof-of-stake blockchains where validators collectively contribute entropy to produce a verifiably random output.
Chainscore © 2026
definition
ETHEREUM CONSENSUS MECHANISM

What is RANDAO?

RANDAO is a decentralized, on-chain random number generator that is a critical component of Ethereum's proof-of-stake consensus.

RANDAO (Random Number DAO) is a cryptoeconomic primitive that generates verifiably random numbers on the Ethereum blockchain by aggregating secret commitments from validators. Each validator submits a hash of a secret number during a commit phase, and later reveals the secret in a reveal phase. The final random output is the XOR (exclusive OR) combination of all revealed secrets, making it unpredictable and resistant to manipulation as long as at least one participant is honest. This process is executed once per epoch (every 6.4 minutes) to produce the randomness used for critical protocol functions.

The primary use of RANDAO's output is in the block proposer selection algorithm. The random seed determines which validator is chosen to propose the next block, ensuring a fair and unpredictable distribution of this right. It is also a key ingredient in the committee assignment process, where validators are randomly shuffled into smaller committees to attest to block validity. This randomness is essential for the security of the protocol, as it prevents attackers from predicting or influencing future leadership, thereby protecting against targeted attacks and ensuring liveness.

RANDAO's security model is based on cryptoeconomic incentives. Validators have a strong financial incentive to participate correctly: submitting a commitment and later revealing the preimage. Failure to reveal a committed value results in a small penalty, while attempting to manipulate the output by withholding a reveal is economically irrational, as a single honest participant's reveal ensures the final output remains random. This design makes RANDAO a bias-resistant and unpredictable source of entropy, forming a trustless backbone for Ethereum's consensus layer.

While highly secure, the basic RANDAO design has a known vulnerability: a last-revealer bias. The last validator to reveal their secret can see the aggregate of all previous reveals. If the outcome is unfavorable to them, they could choose to withhold their reveal, sacrificing a small penalty to force a different, more favorable random output in the next round. To mitigate this, Ethereum uses RANDAO with VDF (Verifiable Delay Function). A VDF would impose a mandatory time delay on the final output, eliminating the last-revealer's advantage by making the computation of the result slower than the time available to decide to withhold.

RANDAO is a foundational example of blockchain-native randomness, distinct from traditional oracle-based solutions. Its output is generated entirely on-chain through protocol rules and validator participation, requiring no external trust. This makes it ideal for core consensus mechanics. For applications requiring randomness within smart contracts (e.g., gaming, lotteries), developers often use RANDAO as a seed, sometimes combined with other techniques like Chainlink VRF (Verifiable Random Function) to achieve application-level randomness that is both secure and user-verifiable.

etymology
TERM ORIGIN

Etymology & Origin

The term RANDAO is a portmanteau that combines the concept of a random number generator with the decentralized, autonomous nature of a DAO (Decentralized Autonomous Organization).

The name RANDAO is a compound of RANdom number and DAO. It was first formally proposed in 2015 by Ethereum researchers, including Vitalik Buterin, as a cryptoeconomic primitive for generating unpredictable and unbiasable randomness on-chain. The design was a direct response to the need for a secure, decentralized alternative to traditional Verifiable Random Functions (VRFs) or trusted oracles, which were either too computationally expensive or introduced centralization risks for applications like blockchain lotteries and proof-of-stake consensus.

The core innovation of RANDAO lies in its mechanism, which is a specific implementation of a commit-reveal scheme. In this scheme, many participants first submit a cryptographic commitment to a secret number. After all commitments are collected, participants then reveal their secrets. The final random value is generated by combining all revealed values. This process ensures that the outcome cannot be manipulated by any single participant, as they cannot know others' inputs before committing their own, and cannot change their revealed value after seeing others'. This mechanism embodies the DAO aspect by being governed by the collective actions of its participants without a central authority.

RANDAO's most significant application is within the Ethereum consensus layer, where it is integrated into the Beacon Chain as a source of randomness for critical functions. Here, it is used to randomly select the committee of validators for proposing and attesting to blocks, a process essential for the security and fairness of Ethereum's proof-of-stake protocol. The specific implementation is enhanced with BLS signatures for efficiency and is often combined with a VDF (Verifiable Delay Function) in a system called RANDAO+VDF to prevent last-revealer manipulation and provide future randomness, making it a cornerstone of Ethereum's cryptoeconomic security.

key-features
RANDAO

Key Features

RANDAO is a decentralized, on-chain random number generator (RNG) used in Ethereum's proof-of-stake consensus. It aggregates contributions from validators to produce a verifiably random beacon value.

01

Commit-Reveal Scheme

RANDAO operates on a commit-reveal mechanism to ensure fairness and unpredictability.

  • Commit Phase: Each validator submits a hash of a secret number.
  • Reveal Phase: In a later block, validators reveal their secret numbers.
  • The final random output is the XOR (exclusive OR) of all revealed secrets, making it impossible to predict before the reveal phase completes.
02

Beacon Chain Integration

RANDAO is a core component of the Ethereum Beacon Chain, providing the randao_mix value for each epoch.

  • This value is used to pseudo-randomly select block proposers and attestation aggregators.
  • It also serves as a foundational source of randomness for smart contracts and layer 2 solutions via the BLOCKHASH opcode and beacon block roots.
03

BLS Signature Aggregation

Validator contributions are secured using BLS signatures.

  • Each validator's secret is signed, and the signatures are aggregated efficiently.
  • This cryptographic foundation ensures the random output is tamper-proof and verifiable by any network participant, preventing manipulation by individual validators or coalitions.
04

Predictability & Manipulation Resistance

The design prioritizes resistance to predictability and last-revealer manipulation.

  • The final output is only known after all validators in a committee have revealed.
  • While a last revealer has marginal influence, the economic penalties (slashing) for withholding a reveal and the large validator set make meaningful manipulation economically irrational.
05

Contrast with VDFs (Verifiable Delay Functions)

RANDAO is often discussed alongside VDFs (Verifiable Delay Functions).

  • RANDAO provides unpredictability but is vulnerable to last-revealer bias.
  • A VDF introduces a forced time delay, making any revealed secret stale and eliminating this bias.
  • Ethereum's roadmap includes integrating a VDF to work in tandem with RANDAO, creating a bias-resistant random beacon.
06

Use Cases & Dependencies

The random beacon output is critical for multiple Ethereum protocol functions:

  • Validator Duties: Selecting block proposers and committees.
  • Sharding: Assigning validators to specific shards.
  • Applications: Enabling fair NFT mints, lotteries, and gaming protocols that require on-chain, trustless randomness.
how-it-works
RANDOM NUMBER GENERATION

How RANDAO Works

RANDAO is a decentralized, on-chain random number generator that leverages the collective contributions of Ethereum validators to produce verifiably unpredictable and bias-resistant outputs.

RANDAO, short for Random Number DAO, is a cryptoeconomic mechanism embedded in the Ethereum consensus layer that generates a collective random seed. Each time a validator is selected to propose a block, they must publish a randomness commitment by hashing a secret number. In a subsequent step, they reveal this secret, which is then mixed into the accumulating RANDAO value. This process ensures that no single participant can predict or control the final output, as it depends on the unrevealed secrets of all future block proposers.

The core security of RANDAO relies on a commit-reveal scheme and economic incentives. A validator commits to their contribution by submitting hash(secret, nonce) and later reveals the secret. If they fail to reveal, they are penalized, making withholding economically irrational. The final random value for an epoch is the XOR (exclusive OR) of all revealed secrets, creating a single, cumulative beacon chain randomness. This design makes the output unpredictable because the final contributor cannot know the aggregate value before they must submit their own reveal, and bias-resistant because influencing the result requires controlling a majority of block proposals.

RANDAO's output, specifically the RANDAO mix stored in the beacon state, serves as a foundational randomness beacon for the Ethereum ecosystem. Its primary application is in validator committee assignment and shard block proposer selection in Ethereum's proof-of-stake system, ensuring fair and unpredictable distribution of these critical duties. Furthermore, smart contracts on the execution layer can access this randomness via the BLOCKHASH opcode or precompiles like beacon_randao, enabling decentralized applications (dApps) for gaming, lotteries, and NFT minting to leverage its robust properties.

While highly secure, basic RANDAO has a known vulnerability: the last-revealer bias. The final participant in an epoch sees the aggregate value before revealing their secret and could theoretically withhold their contribution if the result is unfavorable. To mitigate this, Ethereum employs RANDAO with VDF (Verifiable Delay Function). A VDF imposes a mandatory, sequential time delay on the final output, preventing the last revealer from having any advantage, as they cannot compute the final value faster than the VDF's fixed computation time, thus guaranteeing unbiasability.

primary-use-cases
RANDAO

Primary Use Cases

RANDAO is a decentralized, on-chain random number generator (RNG) used within Ethereum's proof-of-stake consensus. Its primary function is to provide a source of verifiable, unpredictable randomness for critical protocol operations.

03

On-Chain Applications & Gaming

Smart contracts use RANDAO as a source of verifiable randomness for applications like:

  • NFT minting and trait generation
  • Blockchain gaming mechanics (e.g., loot boxes, matchmaking)
  • Fair lottery and prediction market resolution Developers access it via the block.prevrandao (post-Merge) or block.difficulty (pre-Merge) field, though they must be aware of its manipulability within a single block.
04

Cryptographic Sortition & Sampling

RANDAO enables cryptographic sortition, a process for randomly selecting a subset of participants from a larger group with probability proportional to their stake. This is used for:

  • Forming attestation committees within a slot
  • Selecting validators for sync committees in light client protocols This ensures statistical security and prevents any single entity from controlling group formation.
ecosystem-usage
RANDAO

Ecosystem Usage

RANDAO is a decentralized, on-chain random number generator (RNG) used primarily in Ethereum's Proof-of-Stake consensus. Its applications extend beyond block proposal to powering verifiable randomness in smart contracts and decentralized applications.

02

Verifiable Random Function (VRF) Source

RANDAO provides a cryptographically verifiable source of randomness for on-chain applications. Smart contracts can use the current RANDAO output, combined with a user's seed, to generate random outcomes that are provably fair and cannot be manipulated after the fact. This is foundational for:

  • NFT minting and rarity distribution
  • Gaming and lottery dApps
  • Governance processes requiring random sampling
03

Commit-Reveal Scheme

RANDAO operates on a commit-reveal scheme to prevent manipulation. Validators first submit a hash (commitment) of their secret number. In a later round, they reveal the number. The final random value is the XOR of all revealed numbers. This prevents a validator from seeing others' contributions before submitting their own, ensuring the output's integrity.

04

Randomness Beacon for L2 & dApps

Layer 2 solutions and decentralized applications often use RANDAO as a trust-minimized randomness beacon. By consuming the RANDAO output from the Ethereum mainnet, they inherit its security guarantees without operating their own validator set. This is used in:

  • Optimistic Rollup sequencer selection
  • ZK-Rollup proof generation ordering
  • Cross-chain random number requests
05

Limitations & Enhancements

While decentralized, basic RANDAO has known limitations. A validator who is the last to reveal can withhold their contribution, potentially biasing the result. To mitigate this, Ethereum uses RANDAO with BLS signatures and combines it with VDFs (Verifiable Delay Functions) in the long term. This creates a bias-resistant random beacon by adding a mandatory time delay to the final output.

06

Key Implementation Example

In the Ethereum consensus specs, RANDAO is implemented via the randao_mix in the Beacon State. Each epoch, a new random value is generated by mixing the current randao_mix with the revealed contributions from the proposers in that epoch. This value is stored and used for proposer selection in the subsequent epoch, creating a continuous, evolving chain of randomness.

security-considerations
RANDAO

Security Considerations & Limitations

While RANDAO provides a decentralized source of randomness, its security model introduces specific attack vectors and operational constraints that must be understood.

01

Last Revealer Manipulation

The final participant to reveal their commitment in a RANDAO round can predict the final output and choose to withhold their reveal if the result is unfavorable, effectively censoring a block or influencing on-chain applications like lotteries. This is a form of MEV (Maximal Extractable Value). Mitigations include using a commit-reveal scheme with penalties for non-revelation and combining RANDAO with a VDF (Verifiable Delay Function) to eliminate last-mover advantage.

02

Predictability & Bias in Liveness

RANDAO's output is deterministic once all commitments for an epoch are revealed. This makes the sequence predictable for the remainder of the epoch, which can be exploited if an attacker knows the future random values. Furthermore, if validators go offline, the RANDAO output can become biased, as it relies on the specific subset of participants who are live to contribute. This reduces the entropy and security of the generated value.

03

Validator Collusion

A sybil attack or collusion among a significant portion of validators (theoretically >50% of the committee in a given slot) could allow them to control or predict the RANDAO output. While expensive on a network like Ethereum, this remains a theoretical attack vector. The security is directly tied to the cryptoeconomic security of the underlying proof-of-stake chain; a compromised consensus layer compromises RANDAO.

04

Application-Level Risks

Smart contracts using block.prevrandao (EVM) or block.random (Move) must understand the randomness is public and predictable one block ahead. This makes it unsuitable for applications requiring unpredictability, like instant poker hands, without additional techniques. Best practices include:

  • Using a commit-reveal scheme for the application itself.
  • Mixing in user-provided entropy.
  • Utilizing a randomness oracle that combines RANDAO with other delay mechanisms.
06

Entropy Quality & Mixing

RANDAO does not produce cryptographically secure randomness in isolation; it produces a beacon of public verifiable entropy. Its quality depends on the number and honesty of participants. For high-value applications, RANDAO output should be used as a seed and cryptographically mixed (e.g., via a hash function with other inputs) to derive a final random number. It is a building block, not a complete solution.

RANDOMNESS GENERATION

RANDAO vs. Verifiable Random Function (VRF)

A comparison of two primary cryptographic methods for generating on-chain randomness, highlighting their core mechanisms, trust assumptions, and typical blockchain applications.

FeatureRANDAOVerifiable Random Function (VRF)

Core Mechanism

Commit-Reveal Scheme

Cryptographic Function

Trust Model

Trust in the committee of participants

Trust in the secret key holder

Verifiability

Ex-post (after reveal)

Ex-ante (cryptographic proof)

Output Predictability

Predictable after commit phase

Unpredictable until proof is published

Primary Use Case

Ethereum consensus (Beacon Chain)

Oracle-based applications (e.g., Chainlink VRF)

Liveness Requirement

Requires honest majority to reveal

Requires a single honest operator

On-chain Cost

Low (built into consensus)

Higher (requires oracle fee)

Bias Resistance

Vulnerable to last-revealer attack

Cryptographically guaranteed

evolution-vdf
SECURITY ENHANCEMENT

Evolution: RANDAO with VDF

RANDAO, Ethereum's on-chain random number generator, was augmented with Verifiable Delay Functions (VDFs) to mitigate a critical vulnerability to last-revealer manipulation.

RANDAO with VDF is a hybrid cryptographic construction designed to produce unpredictable and unbiasable randomness for Ethereum's proof-of-stake consensus. The core RANDAO mechanism aggregates commitments from validators, but its output could be manipulated by the last participant to reveal their number. To neutralize this threat, the output of RANDAO is fed into a Verifiable Delay Function (VDF), a computation that is intrinsically sequential and cannot be parallelized, creating a forced time delay before the final random value is known. This delay eliminates any last-revealer advantage, as the outcome is already cryptographically sealed before any participant can act on it.

The integration works in a two-step process. First, the RANDAO committee generates a seed value r through its commit-reveal scheme. This seed is immediately used as the input to a VDF, which begins its fixed-duration computation (e.g., expected to take minutes or hours). The VDF's output, VDF(r), becomes the final, provably random value used for critical protocols like validator committee assignment and block proposer selection. Because computing the VDF takes significant, predictable time, any validator who reveals their RANDAO contribution cannot foresee the final output in time to decide whether to withhold it—the manipulation window is closed.

This evolution addresses the predictability attack, where a malicious last-revealer could simulate the VDF outcome based on known inputs and then choose to abort their reveal if the result was unfavorable, effectively censoring the random output. With the VDF in place, the attacker cannot compute the result faster than the honest network. The design ensures public verifiability: anyone can quickly verify that VDF(r) is correct using a short proof, but no one can compute it faster than the mandated delay. This property is crucial for maintaining the liveness and fairness of the protocol.

Implementing RANDAO with VDFs represents a significant advancement in cryptographic sortition, providing the strong, manipulation-resistant randomness required for modern proof-of-stake blockchains. It transforms a game-theoretically vulnerable mechanism into a robust source of public entropy. While RANDAO provides the initial entropy gathering from a distributed set of participants, the VDF acts as a cryptographic mixer and temporal firewall, ensuring the final output is not influenced by any single entity. This combination is a foundational primitive for applications beyond consensus, including on-chain gaming, lotteries, and randomized governance processes.

RANDAO

Frequently Asked Questions (FAQ)

RANDAO (RANdom DAO) is a decentralized, on-chain random number generator used primarily in Ethereum's proof-of-stake consensus. These questions address its core mechanics, security, and role in the network.

RANDAO is a decentralized, on-chain random number generator that aggregates contributions from Ethereum validators to produce a verifiably random output. It works through a multi-round commit-reveal scheme where each validator in a committee submits a random number, and the final output is the XOR (exclusive OR) of all revealed values. This process is executed in each epoch (every 32 slots) to provide a fresh, unpredictable seed for critical protocol functions like validator committee assignments and block proposer selection. The security relies on the economic cost of withholding a reveal, as validators who fail to reveal their commitment are penalized, making predictable manipulation economically irrational.

further-reading
RANDAO

Further Reading

Explore the core mechanisms, related concepts, and practical implementations of the RANDAO protocol for on-chain randomness.

02

Commit-Reveal Scheme

RANDAO is built on a commit-reveal cryptographic protocol. This two-phase process is fundamental to its security:

  • Commit Phase: Participants submit a cryptographic hash (commitment) of their secret number.
  • Reveal Phase: Participants later disclose their original secret. The final random value is generated by XOR-ing or hashing all revealed secrets. This scheme prevents participants from changing their contribution after seeing others', ensuring the output's integrity.
04

Last Revealer Problem

A key vulnerability in basic RANDAO is the last-revealer attack or grinding attack. The final participant to reveal their secret can compute the resulting random number before broadcasting. If this outcome is unfavorable, they can choose to withhold their reveal, causing the round to fail and forcing a fallback (often less secure). This creates an incentive to manipulate the result. Solutions include slashing penalties for non-revealers and combining RANDAO with a VDF.

05

Randomness in Proof of Stake

RANDAO is critical for cryptoeconomic security in Proof of Stake (PoS) blockchains. It provides a verifiable and unbiased source for:

  • Validator Selection: Choosing the next block proposer from the active set.
  • Committee Formation: Shuffling validators into committees for attestation duties.
  • Shard Allocation: In sharded designs, assigning validators to specific shards. This transparent, on-chain process is essential for preventing predictable attacks and ensuring the network's liveness and fairness.
ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team