Multilinear KZG Polynomial commitment scheme
exploring KZG polynomial commitment scheme on Multilinear polynomial
Similar to the Univariate KZG Polynomial commitment scheme, this interface of this commitment scheme entails;
Generate SRS
Commit function
Opening
Verification
Because we would be dealing with multiple variables, finding a way to efficiently find tone these functions to meet the demands placed my these multiple variables in terms of security and succinctness.
KZG PCS on multilinear polynomials is quite different compare to that of the Univariate polynomial, first this multilinear polynomial is expressed as an evaluation of the polynomial of the Boolean hypercube where the size of the Boolean hypercube n is directly proportional to the number of variables n_var of the multilinear polynomial.
Example; Given this multilinear polynomial, f(x,y)=2xy+x+y+4
it evaluation form can be expressed in this manner;
0,0
f(0,0)
4
0,1
f(0,1)
5
1,0
f(1,0)
5
1,1
f(1,1)
8
f(x,y)=[4,5,5,8]
Generating the Shared Reference String (SRS)
The structured reference string (SRS) now consists of encodings in $G$ of all powers of all Lagrange basis polynomials evaluated at a randomly chosen input τ∈Fℓ. That is, if χ1,...,χ2ℓ denotes an enumeration of the 2ℓ Lagrange basis polynomials, the SRS equals (gχ1(τ),...,gχ2ℓ(τ)). Once again, the toxic waste that must be discarded because it can be used to destroy binding is the value τ having in mind that ℓ is the number of variable of the multilinear polynomial.
pub struct MultiLinearSRS<P: Pairing> {
pub g1_power_of_taus: Vec<P::G1>, // this is an expression of g1^tau^i over the boolean hypercube (every possible combination of each monomial)
pub g2_power_of_taus: Vec<P::G2>, // this is a vector of g2^tau^i
}This is the interface of MultilinearSRS, ww have already obtained g1_power_of_taus, getting `` g2_power_of_taus is relatively easier, we just need to perform the group operation on the vector of tau using the generator from G2;
g2_power_of_taus = gτ0....gτℓ−1
Commit Function
This function simply commits to the polynomial return a Group element representing the commitment to this polynomial and can be used for verification in the future. This is how the function interface looks like;
Function takes in the srs, poly to commit to and returns the commitment to the polynomial.
This commit function is quite simple, it involves performing the group operation on the element in the srs and the evaluation element in the poly. Representing this mathematically;
if q(X)=∑2ℓi=0ciχi(X), then
which can be computed given the values gχi(r) for all i=0,...,2ℓ even without knowing τ.
Opening Function
This is also known as making an evaluation and creating a proof for this evaluation;
This is how the interface of the open_fn would look like;
This function would take in the srs, poly, the points at which the polynomial would be evaluated at points returning the evaluation of this polynomial and commitment to this polynomial Vec<GroupElements> where is element is a commitment associated with one variable of the polynomial.
Mathematically
To open the commitment at input z∈Fpℓ to some value v, i.e., to prove that q(z)=v, the committer computes a series of ℓ “witness polynomials” w1,...,wℓ, defined in the following fact. For any fixed z=(z1,...,zℓ)∈Fpℓ and any multilinear polynomial q, q(z)=v if and only if there is a unique set of ℓ multilinear polynomials w1,...,wℓ such that;
If q(X)−v can be expressed as the right part of the equation above then clearly q(z)−v=0, and hence q(z)=v.
On the other hand, suppose that q(z) = v. Then by dividing the polynomial q(X)−v by the polynomial (X1−z1), we can identify multilinear polynomials w1 and s1 such that;
where s1(X2,X3,...,Xℓ) is the remainder term, and does not depend on variable X1. Iterating this process, we can divide s1 by the polynomial (X2−Z2) to write;
and so forth until we have written;
where sℓ depends on no variables, i.e., sℓ is simply an element in Fp. Since q(z)−v=0, it must hold that sℓ=0, completing the proof.
To open the commitment at input z∈Fpℓ to value v, the prover computes w1,...,wℓ and sends to the verifier values y1,...,yℓ claimed to equal gwi(τ) for i=1,...,ℓ. Again, since each wi is multilinear, gwi(τ) can be computed from the SRS despite the fact that the prover does not know τ.
Verification
The verification stage is less trouble than the opening fn, this major operations that would be done here are creation of some elliptic curve pairings, summation of some pairings and a pairing assertion.
Mathematically, this can be represented by;
This look complete, yes! it is, but still confusing...
Example
given a polynomial;
f(x,y)=2xy+4x+3
This is it representation in evaluation form over the boolean hypercube;
0,0
f(0,0)
3
0,1
f(0,1)
3
1,0
f(1,0)
7
1,1
f(1,1)
9
f(x,y)=[3,3,7,9]
Trusted Setup
Generate a vector of tau where the length of this vector is the number of variables in the polynomial.
Perform the SRS generation step;
0,0
(1−2)(1−4)
3
0,1
(1−2)4
−4
1,0
2(1−4)
−6
1,1
2⋅4
8
Commitment
f(x,y)=[3,3,7,9]
[g3,g−4,g−6,g8]
[(g3)3+(g−4)3+(g−6)7,(g8)9]
commitment=[g9+g−12+g−42,g72]=g27
Opening
open at x=2, y=3;
factors = (x−2) and (y−3)
evaluating => 2(2*3) + 4(2) + 3 = 12 + 8 + 3 = 23
2xy+4x+3−23=0=>2xy+4x−20
qpx=2xy+4x−20/x−2=2y+4 rem 4y−12
qpy=4y−12/y−3=4
proofx=2y+4=2(4)+4=8+4=12 proofy=4
Verification
g34=g30+g34
g34=g34
Special credit to;
Proofs, Arguments, and Zero-Knowledge by Justin Thaler
Rust Implementation:
Last updated