Polynomial commitments and Fiat–Shamir heuristic
In cryptographic schemes like PLONK, the prover needs to commit to certain polynomials to ensure that they do not change these polynomials later in the protocol.
Later in the protocol, the prover usually needs to prove that these polynomials evaluate at a certain point to the claimed values.
But this certain point must not be known ahead of time.
Let’s have a polynomial . The prover computes the commitment to this polynomial: .
At some point in the protocol, the verifier chooses a random , gives it to the prover, and the prover returns .
The messages go like:
The prover then has to prove that it knows a polynomial that evaluates to at . We say the prover opens at .
Remember, when using KZG commitments, the prover computes such that:
The prover opens at by sending to the verifier:
Usually, the prover needs to prove some relations between the polynomials. Let’s say there is another polynomial . And let’s say the prover would like to prove the relation:
Let’s denote .
The prover doesn’t want to reveal and . Instead, it proves that it knows a polynomial that evaluates to at and that it knows a polynomial that evaluates to at .
The prover computes the commitment to : . It then computes such that:
The verifier is given , , , and checks whether:
Note that can be easily computed having , , and : .
What if the challenge is known ahead of time?
So, what if the prover knows ahead of time?
Well, the prover could take an arbitrary polynomial (of the proper degree) that evaluates to at . Let’s denote such a polynomial by :
It then computes such that:
The prover sends and to the verifier (instead of and ).
The following check that verifier executes turns out to be true:
Note that the verifier doesn’t compute out of and because that’s not possible—Kate commitments are not fully homomorphic; they are only additively homomorphic.
Fiat-Shamir
So, it’s crucial that the prover doesn’t know the challenge in advance. However, in real-world applications, it’s often beneficial to reduce communication between the involved parties. The Fiat–Shamir heuristic eliminates the need for the verifier to choose and send a challenge to the prover by computing the challenge using a cryptographic hash function."
However, how to guarantee that the challenge has been computed only after the prover committed to ? Remember, otherwise the prover could choose some arbitrary that evaluates to at and then commit to instead of .
To prevent such a scenario, the challenge needs to be computed by taking into account the commitment to .
So, part of the input to hash function to compute the challenge needs to be the commitment to . Note that the inputs to hash function need to be known to both parties - prover and verifier. Obviously, they both need to compute the challenges.
So, part of the input to the hash function to compute the challenge needs to be the commitment to . Note that the inputs to the hash function need to be known to both parties—the prover and the verifier. Obviously, they both need to compute the challenge.