Skip to content
commit-reveal Source  →

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

  1. 01 Commit phase: each bidder computes commitment = H(bid ‖ salt) and publishes only the commitment.
  2. 02 The salt (32 random bytes) stays secret, so the commitment reveals nothing about the bid amount.
  3. 03 Reveal phase: after the deadline, bidders reveal (bid, salt); the timing-safe reveal check confirms each matches its commitment.
  4. 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)

Read the full sealed-bid walkthrough