There is no commentSelect some text and then click Comment, or simply add a comment to this page from below to start a discussion.
IPA Commitment Scheme Specification
tags: aztec-3, honk
In this document, we try to answer the following questions:
How the Inner Product Argument (IPA) Polynoimial Commitment Scheme (PCS) works?
How are we going to use IPA PCS in Aztec 3?
How Does the IPA PCS Work?
We consider the IPA PCS described in Section 3 of the Halo paper. We don't need it to be zero-knowledge. In high level, this is because the IPA PCS will be used at the last stage of Aztec 3 (similar to the smart contract/root verifier as in Aztec connect).
Notation: We denote vectors by bold letters, group elements by capital letters, and scalars by small letters. Multiplication of a scalar with a group element i.e., added to itself times, is denoted by .
Now we describe the IPA PCS.
Let be a polynopmial of degree where for some integer . The vector stores the coefficients of the polynomial . Let be a random evaluation point and the evaluation of at . Let the vector represent the consecutive powers of i.e., . Then we have .
Let denote the publicly known vector of group elements (srs points to be precise). Then the commitment to the polynomial is defined as (we are ignoring the blinding factor as we do not need zero-knowledge)
Given as public input ( are also known publicly), the IPA PCS enables a prover to convince the verifier that is indeed the commitment to the polynomial and is indeed the evaluation of on the challenge point i.e. it is a perfect special honest verifier zero-knowledge argument of knowledge for the relation:
The steps of the protocol is described below.
First, the verifier sends a random group element (referred as aux_generator in the code) to the prover. Both prover and verifier compute the quantity We are coupling the commitment of the polynomial with the evaluation of the polynomial to simultaneously show that and are computed correctly. Notice that can be alternatively expressed as IPA PCS is an argument of knowledge where the prover proves the knowledge of a vector such that equation (1) holds with a communication cost logarithmic to the length of . As the prover does not know in advance, this proves that (a) is the commitment to the polynomial at the srs points i.e., and (b) is the evaluation of at i.e. . The next steps are as follows.
Let . We shall iterate over starting from to 1. We initialize The prover computes the quantities and sends to the verifier. Here, the vector denotes the lower half over the vector and the vector denotes the upper half of the vector . The verifier generates a Fiat-Shamir challenge and sends to the prover. For the next th round, the prover computes the following quantities At the end (), the prover has computed the following quantities where the vectors contain respectively the elements , group elements each. represent the times folded versions of , , and are a group and a couple of field elements respectively.
At the begining, the verifier has computed We have , , , as initialized above. For the th round, we have Following the same approach, we can inductively write,
Following equation (2), we can alternatively express as,
Suppose, the prover provides and along with and to the verifier. The verification proceeds as follows. (i) The verifier computes as in equation (3). (ii) The verifier checks if provided by the prover is computed correctly. (iii) The verifier checks if provided by the prover is computed correctly. (iv) The prover proves knowledge of such that holds. Below we describe steps (ii), (iii), and (iv) in more details.
Steps (ii) and (iii)
From the section 3.1 of the Halo paper, we define the vector as Because of the binary structure of the folding of , we have As observed in the Halo paper (Equation 3, https://eprint.iacr.org/2019/1021.pdf, we notice that the equation is wrong), can be efficiently computed by the verifier by defining the polynomial, and evaluating it at x, i.e., The above can be computed in logarithmic time. However, computing still requires a linear-time () multiscalar multiplication (MSM). However as discussed in the paper, this cost can be amortized by delegating all these step (iv) verifications at the last step of IPA verifications. We discuss more on this in the subsequent section.
Q: How to check ? A: Rather than giving a formal inductive proof, we give a small example for a better intuition. Let , . The round challenges are and . Then for the first round, And for the next and the last round we have, Similarly we can show that . Next lets verify . Given the evaluation point, we have , which verifies the claim.
Step (iv)
In step (iv), the prover proves knowledge of such that holds. The paper uses a generalized Schnorr protocol to achieve this. (a) The prover samples random . Then she computes . The prover sends to the verifier. (b) The verifier samples a random challenge from and sends it to the prover. ( c) The prover computes and sends it to the verifier. The verifier accepts if However, as we are not concerned with zero knowledge, in code the prover directly reveals as a part of the proof.
Summary of IPA-PCS
Let the underlying field be , the number of points on the curve is .
Public inputs: , , .
Prover's witness: .
Proof: .
Verifier's work:
Compute: .
Compute: .
Check: (field operation in as we need to check modulo for all quantities).
Check: (group operation in as the underlying and co-ordinates are the elements of the field ).
Check: .
Accumulation of IPA-PCS and Recursive Process in Aztec 3
The below idea was described by Zac in Istanbul.
In the diagram below, we sketch the idea of recursive process in Aztec 3. Suppose circuit and operate over the BN254 curve and circuit operates over the Grumpkin curve. As depicted in the diagram, let the BN254 curve be designed over and the number of points in the elliptic curve group is . As a result, operations over is expensive and operations over is cheap.
For the Grumkin curve, the opposite is true, i.e., it is designed over and the number of points in the elliptic curve group is . As a result, operations over is expensive and operations over is cheap.
Note: In the code, we refer a scalar in the field as barretenberg::fr or grumpkin::fq. Also a scalar in the field is referred as barretenberg::fq or grumpkin::fr.
Suppose circuit produces a IPA proof and circuit verifies it i.e., it produces a proof which attests that is verified successfully. As discussed in the previous section, to verify , circuit needs to perform
Field opeartions in (step 3 in the above section).
Group operations in (step 4 in the above section). As mentioned above, the second operation is very expensive for circuit . The idea is to delegate step 2 in the following way.
We construct another circuit over the Grumpkin curve, which accumulates (say) proofs and produces another IPA proof that linear MSMs of all s are computed correctly. To elaborate on this, let be the group elements of IPA proofs. As described in Section 3.2 of the Halo paper, checking the correctness of these quantities can be batched by taking a linear combination of these elements and calling the IPA once.
Now circuit needs to fully verify . However as circuit is defined over the Grumpkin curve instead of the BN254 curve, circuit needs to do,
Field opeartions in (step 3 in the above section),
Group operations in (step 4 in the above section), which are cheaper than group operations in for circuit as it is designed over the BN254 curve (designed over , # points ).
Optimizations:
There can be some optimizations over the above protocol which follows the Halo paper. We write them below.
(1)
In the above protocol, in the rounds, the prover computes Instead of the above, we define the quantities for the next round as This was originally proposed in Figure 3 of the Halo Infinite paper. As we can see, this reduces the number of scalar multiplication by the prover. As a result, For the th round, we have Following the same approach, we can inductively write, Note: It also changes the and . Below we compute them.
To compute and such that . Again, rather than giving a formal inductive proof, we give a small example for a better intuition. Let , . The round challenges are and . Then for the first round, And for the next and the last round we have, From this we have . For general , we get,
Next lets compute such that . By observation we have (by change in variable in the previous equation) . For the example, we verify this below, Given the evaluation point, we have , which verifies the claim.