KZG Polynomial Commitment Scheme
KZG polynomial commitment scheme KZG10 plays an important role in making the polynomial constraints of PlonK's arithmetization become a zkSNARK GWC19.
In this section, we provide the syntax and security requirements of a polynomial commitment scheme (PCS) in Polynomial Commitment Scheme - Definition. Then, we show some instantiations of the scheme by discussing its technical overview in Technical Overview.
Author(s): khaihanhtang
Polynomial Commitment Scheme - Definition
In this section, we provide the definition of polynomial commitment scheme including syntax and security requirements. Syntax describes how the scheme works through algorithms while security requirements enforce the scheme to satisfy in order to make it secure.
Syntax is presented in Syntax and security requirements are presented in Security Requirements.
Syntax
A polynomial commitment scheme, for polynomials over a field , is a tuple of algorithms working as follows:
- On inputs security parameter and a degree bound , this algorithm returns a commitment key . The key allows to commit any polynomial in whose degree is at most .
Above we use the notation to denote the field extension of . For intuition, this field extension contains every polynomial of the form where is the degree of and for all . Hence, with the algorithm on input , we can assume that it allows to commit to any polynomial satisfying .
We may have a question about what will happen if we try to use to commit to a polynomial whose degree is larger than . In this case, the execution and correctness of the algorithms below or the security of the scheme are not guaranteed.
-
On inputs commitment key and polynomial , this algorithm returns a commitment and an opening (or decommitment) . We note that here is recommended to have degree at most with respect to output by .
-
On inputs commitment key , polynomial , commitment and opening , this algorithm deterministically returns a bit to specify whether is a correct commitment to . If is such a correct commitment, then . Otherwise, .
At this moment, we may wonder why does output both and does use both . In fact, when participating in an interactive protocol, one party may commit to some secret by exposing commitment to other parties. This commitment guarantees that the secret behind, namely, polynomial in this case, is still secret, guaranteed the hiding property to be discussed later.
On the other hand, since we abuse the word commit, it means that the party publishing has only one opening, namely, , to show that is a correct commitment to . It is extremely hard for this party to show that is correct commitment to some other polynomial . This is guaranteed by the binding property of the polynomial commitment scheme, to be discussed later.
- On inputs commitment key , polynomial , index and opening , this algorithm returns a witness to ensure that , related to opening , is commitment to whose evaluation at index is equal to .
Let us explain in detail the use of . Assume that a party published which is a commitment to . It then publishes a point and claims that without exposing . By using the algorithm defined below, this claim is assured if is actually equal to . Moreover, for all other indices satisfying , if has not been opened before, then is unknown to any party who does not know .
We also remark that, from basic algebra, if we know evaluations at distinct indices, we can recover the polynomial . Therefore, the above claim assumes that other parties do not know up to distinct evaluations.
- On inputs commitment key , commitment , index , evaluation and witness , this algorithm returns deciding whether is a commitment key satisfying .
Security Requirements
In this section, we briefly discuss the security requirement for polynomial commitment schemes.
A polynomial commitment scheme is said to be secure if it satisfies the following properties:
-
Correctness. The correctness property says that if the scheme is executed honestly then the verification algorithms, namely, and , always returns . In particular, assume that and . Then, always returns . And, for any output by , algorithm always returns .
-
Polynomial Binding. For a given commitment key output by , this property says that it is hard to output commitment and two tuples and such that and are distinct and have degrees at most , and is commitment to both and with respect to openings and , respectively. More precisely, it is hard to make and if , and .
-
Evaluation Binding. The evaluation binding property says that a committed polynomial evaluating on an index cannot produce two different outcomes and . More precisely, an adversary cannot provide an index and tuples and satisfying such that and .
-
Hiding. An adversary who knows at most evaluations of a committed polynomial cannot determine any evaluation that it does not know before.
We remind that knowing different evaluations helps to determine polynomial, and hence all other evaluations. Therefore, we use the bound here as a maxmimum number of evaluations that the adversary is allowed to know in order not to correctly obtain the evaluations of all other indices.
Technical Overview
From the syntax of polynomial commitment scheme presented in Polynomial Commitment Scheme - Syntax, a realization, or equivalently, a construction, can be separated into components:
- Commiting polynomial includes the algorithms and .
- Evaluating polynomial includes the algorithms and .
Based on those components, we present the high level idea of constructions, namely, conditional and unconditional, of polynomial commitment scheme separated into little parts. The first and second parts, to be presented in Commitment to Polynomial Without Hiding Property and Correct Evaluation from the Commitment, respectively, focus on constructing the realization of conditional version. And, in the third part, to be presented in Dealing with Hiding, regarding condition and unconditional hidings, we discuss the modification of conditional version to achieve the unconditional one.
Commitment to Polynomial Without Hiding Property
In the construction of KZG10, the main idea to commit a polynomial is to evaluate it on a secret index. For example, assume that . The secret index can be thought of as some value that the committer does not know. So, how can committer evaluate on that secret index without any knowledge about it? In fact, cryptography can magically help you do that. For instance, by putting into the form of powers to some base element , e.g., , it helps to hide those values . Moreover, it alows you to evaluate as desired by computing Thus, is computed without any knowledge about . Hence, that is whatever the committer needs to do in the commit step, namely, executing the algorithm to output the commitment . So the commitment key for this algorithm is the hidden indices wrapped under powers of , namely, the set sequence . And, therefore, is also the output of the algorithm . At this point, we might think about a few things:
- How to verify the commitment by executing .
- How to guarantee that the commitment satisfies the polynomial binding property.
For the first question, to verify , the decommitment of the construction is itself. Committer simply send the entire polynomial to verifier, namely, by sending coefficients . Having the polynomial and the commitment key , the verifier can check easily by repeating steps similar to the algorithm .
For the second question, to show the satisfaction of binding property, we can assume that the committer is able to break the binding property by introducing another polynomial where . So we have .
Correct Evaluation from the Commitment
Warning. This part explains by the use of algebra. You may skip if you feel it is complicated.
For an index given to the committer, since committer knows , he can compute definitely. The algorithm is constructed based on the fact that divides . At this point, there is something difficult to realize here since it regards to the use of algebra. However, we know that is the output of on input . Therefore, we see that is among the roots of , i.e., which says that is a root of . Therefore, divides . Hence, to guarantee the evaluation binding property, committer needs to show that is divisible by .
Example. Consider polynomial in . Let . Then, in . Hence, divides . In fact, It is obvious that is a factor of .
Equivalently, we can say that if and only if divides .
To show such divisibility holds, we can compute , where is assumed to be , and define witness by using output by the algorithm .
At this point, for the verifier to verify, committer needs to show that . Let's closely take a look at this formula. We observe the followings:
- No one knows . Hence, is not known to anyone.
- Committer and verifier know which is equal to the commitment . Moreover, they also know since belongs to commitment key , is public and is publicly claimed by committer.
- Verifier can easily compute .
Clearly, having and , we do not know any efficient way to compute since computing is hard due to Diffie-Hellman assumption.
Using Bilinear Pairing to Handle Correct Multiplications
Recall the bilinear pairing where and are some groups of the same cardinality. This bilinear pairing has properties: bilinearity and non-degeneracy. However, to avoid confusion, we only care about the bilinearity and temporarily skip the notice to non-degeneracy.
- Bilinearity. For and , for any where .
The validity of the witness can be check easily by using pairing, namely, where is the commitment to . If the above identity holds, with non-negligible probability, it says that .
To show identity implies with non-negligible probability, we consider . Hence,
Notice that, if the person providing and does not know , then we have the following possibilities:
- This person correctly guesses and . This happens with negligible probability if we assumes that field cardinality, namely, number of elements in field , is large.
- The person incorrectly provides and . Specificially, either is not equal to or is incorrect. Assume that . This case happens when is the root of . By Schwartz–Zippel lemma, this case also happens with negligible probability if the field cardinality is large and that person does not know , as at the beginning was assumed to be hidden index.
Dealing with Hiding
In the previous sections, namely, Commitment to Polynomial Without Hiding Property and Correct Evaluation from the Commitment, we discussed the high level idea of the construction of algorithms as well as the polynomial and evaluation binding properties. One remaining thing is the hiding property. In KZG10, the authors proposed constructions from discrete logarithm assumption, for conditional hiding, and Pedersen commitment, for unconditional hiding.
Remark. We now make clear the notions here, namely, conditional hiding and unconditional hiding.
Conditional hiding of a commitment to a polynomial is the property protecting the polynomial from being compromised with a condition that some assumption employed is assumed to be hard. Usually, the hardness of the assumption is against probabilistic polynomial-time adversaries. Here, probabilistic polynomial-time adversaries stand for the machines that attack the scheme with limited amount of time, and this amount of time is upper-bounded by a polynomial on input the security parameter given to the scheme. Probabilistic polynomial time is a notion in the theory of computation. If you would like to know more about the detail, we prefer to check some textbooks. For example, we prefer Sipser2012-introduction-to-theory-of-computation in this blog.
On the other hand, unconditional hiding means that we cannot extract any information about the polynomial behind. For example, if and , given that are independently and uniformly sampled from , then completely hides since are uniform in .
Conditional hiding from discrete logarithm assumption
The former, namely, discrete logarithm assumption, guarantees the hiding by its own hardness assumption. In particular, given and for some secret integer , there is no way to extract any piece of information about from and due to hardness of discrete logarithm problem. Therefore, the hiding here is conditional, i.e., discrete logarithm assumption is hard.
Unconditional hiding from Pedersen commitment
The latter, namely, using Pedersen commitment, exploits the use of an additional part to achieve unconditional hiding property, which is secure against powerful adversaries and not limited to PPT ones. Roughly speaking, the external part can be informally thought of as a commitment to a random polynomial with conditional hiding. To perform this, we extend the commitment key to contain additional elements where is another generator of different from . Hence, the commitment key now is the tuple . Therefore, whenever committing to a polynomial , we additionally sample a polynomial . The sampling process can be conducted easily by sampling each uniformly and independently from .
The algorithm now can be evaluated by computing
namely, the original conditional-hiding commitment to multiplying with the condition-hiding commitment to random polynomial becomes an unconditional commitment where auxiliary information can be set to be the tuple . Hence, now, the adversary knows nothing about the evaluations of any index in . We can see clearly that the commitment hides unconditionally since is chosen uniformly from and, hence, is uniform in . It also implies that is uniform in .
Since , we can say that is the multiplication of two parts, namely, the message part and the randomness part .
We now discuss how algorithms and work with respect to introductory of the additional part, namely, .
Creating witness in unconditional hiding mode
For a given index , the witness output by algorithm is also a multiplication of parts. We simply call the message evaluation and randomness evaluation parts.
The message evaluation part is computed identically to the conditional version of the commitment scheme. That is, we compute the formula where .
The randomness evaluation part is also conducted similarly. Notice that, since we employ as a polynomial of degree , we can compute witness for the correct evaluation on the same index , namely, . This randomness evaluation part is equal to where .
Remark. As previously said, is unknown to committer. Therefore, the computation of and must depend on the commitment key by employing the elements . Notice that we do not you and since and are polynomials of degrees at most .
The output of algorithm is then equal to where is the multiplication of message evaluation and randomness evaluation parts and . Notice that is attached to witness in order to help the evaluation verification algorithm, to be described below, work.
Verifying correct evaluation in unconditional mode
The evaluation verification algorithm receives as inputs the commitment key , commitment to , index , value assumed to be equal to and . This algorithm is expected to return is is equal to with the use of associated witness .
To verify whether , it is worth to verify both correct computations of and . More precisely, verifier needs to confirm that and . To this end, again, we imitate the verification process of the conditional hiding case. Hence, we employ again bilinear pairing which maps to . However, there is an obstacle here. Observe that, in this pairing, we use only generator while our commitment employs different generators and both generating . In order to enable the bilinear pairing, we enforce for some hidden . This enforcement works because is the generator of and belongs to . Hence, our commitment can be alternatively written as
which is a conditional commitment to with unknown to both committer and verifier.
Moreover, the witness can also be interpreted as
which is also a witness for correct evaluation at index with respect to polynomial whose is not known to both parties, namely, committer and verifier.
We now observe that . Hence, it is worth to guarantee the following equation holds:
We now describe the process for verifying the above equation by employing the bilinear pairing function . Since the above equation has a multiplication, we apply the bilinear pairing by checking
where and are unknown to both parties. Since and are not known to both parties, it is inconvenient to evaluate the bilinear pairing function. However, since and are public inputs, we can replace the appearances of and in the above equation by those of and . The above computation of bilinear pairing hence becomes
since .