There is no commentSelect some text and then click Comment, or simply add a comment to this page from below to start a discussion.
Notes on Plonk Prover's and Verifier's Algorithm
Disclaimer: This documentation was written on July, 2021. It is intended to give readers a high-level understanding. The codebase is the canonical source of truth, and over time this document might fall behind the implementation details of the code.
Author: Arijit
This is a brief note about my understanding of the prover's and verifier's algorithms in the Plonk paper. The note directly jumps to Section 8.4 of the paper and tries to answer some questions which I had while going through the various steps of the algorithms. I would like to acknowledge the help and clarifications I got from Zac, Ariel, and Suyash in writing this note.
The goal of the prover is described in the language given in Section 8.3 of the paper. In the polynomial setting, this boils down to proving knowledge of the wire polynomials , , and the permutation polynomial such that,
holds for all , where is the set containing the roots of unity.
holds for all .
holds for all . As explained in the paper, the first condition will validate the gate contraints (the witnesses satisfy the plonk circuit) and the second and third conditions will validate the copy constraints (all the connections of the plonk circuit are verified by the grand product argument). However, the prover should prove that the above conditions hold in zero-knowledge i.e. without revealing the polynomials ,, and . To do so the prover proceeds as follows.
Round 1:
The prover constructs the polynomials , and with some randomizations. Then it computes the commitments of , and as per the Kate's polynomial commitment scheme. Here the commitment to a polynomial is defined as the evaluation of the polynomial at the unknown SRS point in the exponent of the generator of the first group i.e.,
Note: The random parts of , and are, respectively. Note that they have zero contributions when the polynomials are evaluated at the roots of unity. This is due to the multiplication with the vanishing polynomial which has all roots of unity as its roots. Q: Why do we need two random scalars to randomize and . A: The prover needs to send the commitments to , and and also their evaluations at to the verifier. Roughly, the two revelations costs two random scalars for the protocol to satisfy the special honest-verifier zero-knowledge (SHVZK) property.
Round 2:
Like the wire polynomials, the permutation polynomial is computed by adding some randomization. In Section 5 (Polynomial protocols for identifying permutations), it is explained what should be the value of for each roots of unity. Those values are set by using the Lagrange bases s. Q: Why do we need three random scalars to randomize . A: Unlike , and , the permutation polynomial has been used to evaluate two opening proof polynomials and . This costs three random scalars to ensure the SHVZK property of the protocol.
Round 3:
Q: What is the quotient polynomial and why it is computed? A: The quotient polynomial has four elements. The numerators of the four elements are from the three conditions given above that the prover has to satisfy. Each of them are divided by and added after some random scaling by and . The fact that the prover has successfully computed a "valid" commitment to will ensure that does not have any term. This is because the SRS used to compute the commitment does not have any term.
This in turn proves that divides all the numerator i.e. the numerators evaluate to zero at every roots of unity. Hence the three conditions given above are satisfied.
Instead of computing commitment to , the prover breaks into three parts , , and and computes their commitments. This is done because of the folloing reasons.
We want the max degree of our polynomials to be n.
Kate opening proof computation (in terms of ) would require committing to size 3n polynomials which is very inefficient.
Round 4:
To prove the definition of , , , , , are evaluated at a random challenge point which is generated non-interactively by Fiat-Shamir heuristic. Q: Why every polynomial in is not evaluated? A: This is because of the linearization trick (described in page 18) where a partial evaluation of polynomials is done to prove an identity involving them. This is to reduce the communication cost of the prover. Q: Why is evaluated at a different point ? A: In , both and appear. We do not evaluate to make use of the linearization trick and only evaluate at . As is opened in instead of , we need a separate opening polynomial for defined in Round 5.
Round 5
Q: What is the linearization polynomial ? A: To simplify, let This implies, is zero if it is evaluated at . Here has a mixed form of polynomials and evaluations at .
Note that the verifier can calculate the commitment of using the elements of the proof generated so far i.e. . Thus the prover does not have to send the commitment to to prove that it vanishes at .
Now let us observe . Let, If the prover can compute the commitment to , then it is verified that divides (As the SRS does not have negetive exponents of ). Now consider each part of . As is random, divides each term. divides implies . Similarly divides implies is the evaluation of at .
To show that if divides , then . We have . Putting , we get .
This applies for other polynomials and their evaluations as well. In this way the commitment to verifies every evaluations of the polynomials and also .
As discussed above, we need a separate opening polynomial to validate the evaluation of the polynomial at .
Finally, the prover outputs commitments , to these two opening polynomials and construct the proof .
Verifier's algorithm:
In steps 1 to 3, the verifier checks the sanity of different elements of . Steps 4 to 11 are the various steps that prepare the verifier for the pairing check.
Let and . After rearranging we get, Combining these two identities with the multi-point evolution challenge gives, Step 12 checks the above identity in the exponent using pairing and all the commitments and the evaluations of polynomials sent by the prover. Using the polynomial commitments, the unknown SRS value is used instead of the indeterminate and accumulated in . The components involving constant terms and evaluations are accumulated in . This is similar to the batch verification of the Kate commitment scheme described in Section 3 of the paper.
This validates the opening commitments , and all the three statements to be proved by the prover are verified.