Commitment Scheme
Binding and hiding qualities
A cryptographic commitment scheme is a method to commit to a secret value , without revealing it. A commitment scheme must be both binding and hiding.
Binding: Given a commitment , it is not possible to forge the commitment with another value such that and .
Hiding: Given a commitment , where , it is not possible to discover .
An analogy is writing a secret password on a piece of paper, placing it in a safe, and handing it to a friend. Without opening the safe, your friend cannot determine the password - this is the hiding property. Once you have given the safe away you can no longer change the password - this is the binding property. You have committed to the password using the safe, and you can later reveal the password by opening the safe.
Prover and verifier
Commitment schemes involve a prover and a verifier. The prover has the secret value known only to themelves, and creates a commitment which they share with the verifier. At a later time the prover can share more information (including the secret value ) with the verifier to 'open' or 'reveal' the commitment. The verifier can then verify that was the value used to generate .
In our analogy, you are the prover and the secret password is . When you place the password into the safe you have created a commitment . You can later open the commitment by opening the safe, and your friend - the verifier - can confirm that the password inside the safe is what you claim it to be.
Commit and reveal phases
Cryptographic commitment schemes can be broken down into two steps - commit phase and reveal phase. Commit-reveal schemes are another name for a cryptographic commitment scheme.
In the commit phase the prover with exclusive knowledge of secret value , creates a commitment to share with the verifier. In this phase the verifier does not know anything about , other than that is a commitment to it. In our analogy this is storing our password in the safe, and sharing the safe with our friend.
In the reveal phase the prover reveals the secret value , and the verifier is able to confirm that was created from . In our analogy this is opening the safe and our friend confirming the contained password.
Using an additional random number
So far we have omitted the detail that to create a commitment , the prover typically uses a random value in addition to the secret value . is also kept secret in the commit phase. In our analogy is the combination to open the safe.
In the reveal phase, the prover shares and so that the verifier can verify that the commitment is binding with respect to both and . This is akin to sharing both our password and the safe combination with our friend, so that our friend can open the safe and confirm our committed password.
Thus more formal descriptions of a cryptographic commitment scheme refer to .
Committing to an additional random number in addition to a secret value significantly enhances the hiding and binding properties of a commitment scheme. Someone attempting to guess from a public commitment , would need to correctly guess both and . This stops brute force attacks on , and conceals repeated use of values for .