Auction and RWA marketplace designers
Sealed-bid auctions
No bidder can peek at another’s bid before the deadline.
Bidders commit to their bids during a sealed window, then reveal after it closes. Because a commitment leaks nothing about the value, no late bidder — and not even the auctioneer — can react to earlier bids.
The problem
In an open auction, whoever bids last has an information advantage: they can see every prior bid. A sealed-bid auction removes that advantage, but only if the sealing is cryptographically enforced rather than promised.
How commit-reveal does it
- 01 Commit phase: each bidder computes commitment = H(bid ‖ salt) and publishes only the commitment.
- 02 The salt (32 random bytes) stays secret, so the commitment reveals nothing about the bid amount.
- 03 Reveal phase: after the deadline, bidders reveal (bid, salt); the timing-safe reveal check confirms each matches its commitment.
- 04 A bidder who never reveals is simply excluded — they cannot change their committed bid after the fact.
The code
scheme = CommitRevealScheme()
# --- commit phase (before the deadline) ---
commitment, salt = scheme.commit("bid:42.50 SOL")
publish(commitment) # salt stays with the bidder
# --- reveal phase (after the deadline) ---
assert scheme.reveal("bid:42.50 SOL", salt, commitment) More use cases
Anti-MEV & fair ordering
Front-runners cannot react to orders they cannot yet see.
Verifiable on-chain AI
Independent agents answer without copying each other.
Fair-launch randomness
Uniform, unmanipulable randomness with no trusted oracle.
Hidden ballots & market resolution
Vote or resolve in secret, prove the reveal is honest.
Teaching cryptography
A readable, zero-dependency reference you can teach from.