Crypto glossary

Commit-reveal scheme

Definition

A commit-reveal scheme is a two-step pattern where users first submit a hidden commitment and later reveal it, preventing others from copying or front-running.

On a public blockchain every pending transaction is visible, so anyone submitting a vote, bid or game move in the clear can be copied or front-run. Commit-reveal splits the action in two. In the commit phase, each participant submits a hash of their choice plus a secret salt. Once the commit window closes, they submit the choice and salt, and the contract checks that they match the earlier hash.

The pattern is widely used. ENS name registration requires a commit transaction followed by a short wait and a reveal, so bots watching the mempool cannot snipe a desired name. Sealed-bid auctions, on-chain rock-paper-scissors, private voting and some randomness beacons follow the same logic, since each participant's secret contributes to an outcome nobody could predict.

The main weakness is the reveal step: a participant who dislikes the likely outcome can simply refuse to reveal, which is why designs often require deposits that are lost if no reveal happens. Two transactions mean more gas and slower interaction, and salts must be truly random, or a hidden value with few possibilities can be guessed by brute force.

Example

In a DAO's private vote, members submit hashes of yes or no plus random salts during three days, then reveal their votes during the next two; the tally only counts reveals that match their commitments.

Related terms