Zero Knowledge Proofs involve making a commitment to data and not revealing it. Overall, there are three main methods we can use to create this commitment: Hash-based, Pedersen and polynomial.
Hash-based commitments
With hash-based, we basically create a hash of the data and then can reveal later that we can match the data to the hash.
Pedersen commitments
With a Pedersen commitment, Bob has a secret, and then creates a random number (r), and then generates a commitment (c) from the secret and the random value). At some time in the future, Bob can reveal to Alice that he has the secret value:
To register the secret initially, we take two large prime numbers (p and q) and we create a generator value (g) which is of the order of q and a subgroup of Z∗p. Then s becomes a secret from 0 to Zq, and we calculate:
The sender now creates a commitment for a message (m) and with a random number (r):
The sender can then send c to the receiver. Next, the sender will then reveal m and r for the commitment, and the receiver verifies with:
