Modified: October 23, 2022
commitment scheme
This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.A commitment scheme allows for one party to publicly commit to some value without revealing that value. For example, Alice wants to bet on the outcome of a coin that Bob will flip. If Alice simply announces her call, Bob can cheat to win the bet by simply announcing the opposite outcome. A commitment scheme allows Alice to commit to her call but not reveal what it is until after Bob has flipped the coin and announced the result.
A commitment scheme should satisfy two properties:
- Hiding: for all messages and , the distributions of the respective commitments COM() and are indistinguishable (e.g., to a polynomial-time algorithm). This guarantees that the message cannot be recovered before being revealed. Note that this property requires commitment schemes to be randomized.
- Binding: for a given commitment COM, there is exactly one such that the receiver will accept a reveal of .
Commitment using one-way functions
A general outline for a commitment scheme using a one-way function is that Alice chooses a random value , then sends and . This basically works, but some subtleties need to be considered.
First, we need to ensure binding: that Alice can't fake a different suchsimply check that . This can be done trivially by requiring the one-way function to be injective (one-to-one).
Second, we need ensure hiding: that cannot be recovered from . In general a one-way function guarantees only that we can't recover its full input; it can still leak some bits. We need to rely on a stronger property, namely the existence of a hard-core predicate that is guaranteed to be unrecoverable from .
This motivates the Blum commitment scheme, which exploits the fact that any 1-1 one-way function can be augmented to explicitly define a hard-core bit . To commit to a bit , Alice samples randomly from the domain of , and sends
To reveal, she then later sends
Bob can then simply check that matches what was sent earlier. This succeeds at hiding , because to recover it Bob would have to recover the hard-core bit , which is intractable by assumption. And it succeeds at binding Alice to by the assumption that is one-to-one, so collisions are impossible.
We can relax the 1-1 requirement and allow to be a hash function where collisions are simply hard to find, rather than impossible. This adds the subtlety that we no longer want to let Alice have exclusive control of , since she could choose an input for which a collision is known, so the scheme must be augmented with an extra round of communication (see here: https://en.wikipedia.org/wiki/Commitment_scheme#Bit-commitment_from_a_pseudo-random_generator).
Commitment allowing for a partial reveal
In zero knowledge proof schemes, the prover may want to reveal only part of the message they committed to. This is trivially possible by simply generating separate commitments for each part of the message, and only sending the reveal message for the relevant part(s). However, in this scheme the size of the commitment grows with the number of message parts, which can be undesirable.
A more efficient scheme is for Alice to construct a Merkle tree with the individual commitments as the leaves, so that internal nodes represent hashes of all commitments below them. Alice commits to the full tree by simply transmitting the root hash, of size . She can then reveal any leaf by sending her concrete commitments to that leaf and its sibling (from which the parent hash can be computed) along with the hashes of all sibling nodes along the path to the root --- a proof of size --- so that Bob can check that these commitments are consistent with the root hash she originally sent.