A polynomial commitment scheme (PCS) allows a prover to commit to a polynomial and later prove its evaluations at points chosen by the verifier. The verifier can then check that the evaluations are consistent with the committed polynomial. Most practical SNARKs (Succinct Non-interactive Arguments of Knowledge) are constructed using a PCS. It consists of the following three algorithms:
-
: Given an upper bound on the degree, it outputs public parameters used to commit to polynomials of degree less than . -
: Takes public parameters and a polynomial of degree , and outputs a commitment to the polynomial. -
: An interactive protocol where the prover convinces the verifier that . The verifier outputs 1 (accept) or 0 (reject).
Informally, two key properties of a PCS are:
-
Binding: The prover
cannot lie about the evaluations of the polynomial they committed to. -
Hiding: A computationally bounded adversary should learn nothing about the polynomial from the commitment.
One of the most widely used PCS is KZG10, due to its constant proof size and verification time. It is used to construct various SNARKs such as Sonic and Plonk. In this post, we explore KZG variants for univariate polynomials. But first, let’s introduce some notation and preliminaries.
Notation and Preliminaries
We denote
We assume the existence of groups
An essential property of pairings is bilinearity, meaning that for scalars
Polynomial Identities
In this section, we introduce some foundational facts about polynomials that will be helpful in understanding the various constructions covered later.
For a polynomial
More generally, evaluating
where
Let us understand the above with an example.
Suppose and .
Then and .
Now, is the polynomial such that and .
We can interpolate using these points, and find that:
Also, the vanishing polynomial is:
Now, should be divisible by .
Using polynomial long division, we find the quotient polynomial to be:
With the notation and preliminaries in place, we can now look at the first construction.
Plain KZG
This is the most basic construction, as described in Section 3.2 of KZG10. The key idea is that after receiving a commitment
If equation
The algorithms for the construction are defined as follows:
-
- Sample a random
- Discard
- Sample a random
-
-
where
are coefficients of
-
-
computes and sends it to samples an element and requests an opening of at computes the quotient polynomial using equation and sends its commitment to along with the evaluationNote that checking equation
is same as checking the validity of the following equation: The verifier will check this equation at the secret value using pairings. verifies the opening proof and outputs 1 if the following equation holds; otherwise, it outputs 0.
This scheme is homomorphic i.e. given commitments
We have seen how to open a single polynomial at a single point. Now, let’s extend this to opening multiple polynomials at multiple points.
One straightforward approach is to open each polynomial individually and verify each opening proof. However, this would make the number of opening proofs sent by the prover and the number of pairing checks performed by the verifier — proportional to the number of polynomials.
Can we open multiple polynomials at multiple points more efficiently? We can use batching.
Batched Variants
In this section we will look at schemes that enable efficient opening of multiple evaluation points across multiple polynomials. Instead of opening each evaluation separately, we batch all required openings together. This approach leverages the homomorphic property of KZG commitments.
A batch opening protocol for a single polynomial at multiple evaluation points is described in Section 3.4 of KZG10. A variant for opening multiple polynomials at two evaluation points is presented in Section 3 of Plonk. In this section, we focus on more general variants that allow opening multiple polynomials at multiple points, as described in BDFG20.
In this setting, the prover
The prover
We focus on the
sends to , as commitments to polynomials , respectively samples sets and asks to open at for all sends random (used to combine all the openings) does the following:- Compute
using equation - Send commitment to
i.e. to along with the claimed evaluations of over for all
- Compute
Note that verifying the validity of equation
Method I
The verifier
Note that in the above check, the verifier
The opening proof in this method consists of a single group element, namely
Method II
In this approach, an additional random point is sampled, and the validity of equation
-
samples a random challenge and sends it to will have to prove that equation is valid at i.e. computes the polynomial such that Then, shows that . Note that the values , , and can all be computed by the verifier . -
sends an opening proof that evaluates to 0 at , i.e., the commitment to the polynomial , where:Now, verifying the validity of equation
is reduced to checking whether the following equation holds.
We apply the same idea as before—if the above equation is valid at a randomly chosen point, then with high probability, it is valid at all points (by the Schwartz-Zippel Lemma). Therefore, the verifier checks the validity of this equation at the secret value using pairings. -
computes , the commitment to , using the homomorphic property of KZG:Then,
outputs 1 if the following equation holds; otherwise, it outputs 0:
In this case, the opening proof is two group elements i.e.
Unconditionally Hiding
In all the schemes we have seen so far, the commit algorithm
Informally, unconditionally hiding means that even a computationally unbounded adversary learns no information about the underlying polynomial from the commitment. This is achieved by adding randomness to the commitment so that it becomes uniformly distributed over the entire group. As a result, after seeing the commitment, the best an adversary can do is make a random guess about the polynomial.
An unconditionally hiding PCS is crucial in settings where privacy is important, as it enables the construction of zkSNARKs — that is, SNARKs with the zero-knowledge property. The methods to achieve an unconditionally hiding PCS are as follows.
Method I: Using a random polynomial
This method is described in Section 3.3 of KZG10. It leverages the homomorphic property to achieve unconditionally hiding by combining two commitments: one to the polynomial
-
- Sample random elements
. The value will be used to combine the commitments to and . - Discard
- Sample random elements
-
-
Sample a random polynomial
-
where
are coefficients of and are coefficients of .The commitment
can also be viewed as a commitment to the polynomial , where .
-
-
computes and sends it to samples an element and asks to open at computes the quotient polynomials , and sends the commitment to along with the evaluations andThis reduces the check
to checking that i.e. checking the following equation is valid: Using the same idea as before, will check the above equation at using the evaluations and commitments sent by outputs 1 if the following holds, otherwise 0:
In this method, we blind the polynomial using a random polynomial to achieve unconditionally hiding. However, the same property can also be achieved using just a single random group element, as shown in the following method.
Method II: Using a random group element
This method achieves unconditionally hiding using a single random group element. It is described in Section 3.5.3 of Zeromorph. The main idea is to add a random group element to the original commitment, ensuring that the resulting commitment is uniformly distributed across the group. The algorithms are as follows:
-
- Sample random elements
- Discard
- Sample random elements
-
- choose a random element
(used to randomize the commitment to polynomial )
where are coefficients of .The commitment
can be viewed as a commitment to polynomial .
- choose a random element
-
-
computes and sends it to -
samples an element and asks to open at -
samples a random (used to randomize the commitment to quotient polynomial ) and computes the commitment , and sends it to along with the evaluation . Additionally, also sends , which is the corrective term to account for the randomness in and .The commitment
can be viewed as commitment to the polynomial . From our previous discussion, we know that checking the evaluation is equivalent to checking that the following equation is valid. However, the verifier cannot check the above equation directly at (the secret value), because they do not have commitments to and . Instead, they possess the randomized commitments and .
Let us incorporate the corresponding randomness and rearrange the terms to derive an equation that can verify using the commitments , , and a pairing check. This process will also provide insight into the corrective term . We begin by adding the randomness of , i.e., , to both sides: Add the randomness of i.e. on both sides: Note that in the above equation the term corresponds to , the term corresponds to and the term corresponds to . Thus, can verify the above equation at the secret value using pairings. -
outputs 1 if the following holds; otherwise, it outputs 0:
-
In this method, we achieve the unconditionally hiding property using a single random group element. However, the opening proof consists of two group elements, namely
Conclusion
In this post, we explored various univariate variants of the KZG polynomial commitment scheme, including techniques for batching multiple openings and achieving the unconditionally hiding property. In the next part of this series, we will delve into the multivariate setting.