Applied cryptography

commitment scheme

A commitment scheme is the digital equivalent of sealing a guess in an envelope: you commit to a value now, reveal it later, and cannot change it in between — yet the sealed envelope tells observers nothing about what is inside. It splits an action into a binding 'commit' phase and a checkable 'reveal' phase.

Two properties define it. Hiding: the commitment c leaks nothing about the value v. Binding: you cannot later open c to any different value v'. A simple hash commitment is c = H(v ‖ r), where r is a random blinding factor; revealing (v, r) lets anyone recompute and check. There is an unavoidable trade-off — a scheme can be perfectly hiding and computationally binding, or computationally hiding and perfectly binding, but not perfectly both. A hash commitment is (roughly) perfectly binding and computationally hiding; Pedersen is the reverse.

Commitments are everywhere in blockchain. Commit-reveal voting and randomness post hashes first, then reveal, so no one can front-run others' choices; sealed-bid auctions hide bids until close; confidential transactions commit to amounts; and polynomial commitments — a specialized cousin — sit at the heart of modern zero-knowledge proofs and rollups. The blinding factor r is essential: without it, a low-entropy v (say 'yes'/'no' or a price in a known range) could simply be brute-forced out of c.

c = H(v || r)

A hash commitment without a random nonce is not hiding for small input spaces — if v is yes/no or a price in a known range, an attacker just hashes every candidate and compares. Always commit H(v ‖ r) with a high-entropy r.