Table of contents
Open Table of contents
What it is
A commitment scheme is a mechanism that ensures that a value a user has chosen can’t be changed afterwards.
Commitment schemes need to adhere to two properties:
- The value one has committed to has to remain hidden (i.e. given a commitment, one can’t determine the value that was committed to)
- The value one has committed to can’t be altered once the commitment was generated
How it works
The Pedersen Commitment Scheme presented here is based on Elliptic Curve Cryptography.
We’ll be using an Elliptic Curve that is of order . The curve has a generator . All calculations are done if not stated otherwise.
In our example Alice will commit to a value whereas Bob verifies that Alice did in fact commit to such value.
As a prerequisite, Alice and Bob need to agree on a point on the Elliptic Curve of which both don’t know the secret value that was used to derive (i.e. no one knows ).
If this invariant can’t be ensured, then commitments can be forged. More on that later.
Once Alice and Bob agreed on , Alice can start and define the value she wants to commit to. In our case Alice samples that value randomly from :
Next up, Alice generates by sampling a random value from :
The commitment will be the value multiplied by the generator to which multiplied by is added:
Note that the addition of acts as a mask to ensure that looks like a random value to Bob.
Alice can now send the commitment to Bob.
Bob can verify that she indeed committed to by requesting access to and and checking if:
Why it works
The first thing to note is that the randomly sampled value that’s multiplied by acts as a mask to ensure that looks like a random value to Bob.
This implementation detail guarantees that the aforementioned property #1 of zero information leakage for commitment schemes is ensured.
Because the value such that is unknown to both Alice and Bob, it’s impossible for Alice to commit to a value (in combination with ) while later on convincing Bob that she committed to a value (in combination with ).
This guarantee ensures that the aforementioned property #2 of commitment schemes (once a value is committed to, it can’t be changed) is covered.
When is known
As mentioned above, it’s critical to guarantee that is unknown to both Alice, and Bob as otherwise commitments can be forged.
The following is an outline why that is from a mathematical point-of-view.
Let’s assume that a commitment to a value with an has been made which according to the protocol results in:
The goal now is to find the values and such that :
Taking the logarithm of () allows us to calculate the secret :
As the equation shows, the committer would be able to recover .