Varun Thakore

Variants of KZG: Part III, Multilinear Commitments with Zeromorph

This is Part III of a five-part series on different variations of the KZG protocol. The original appeared on the ZK Security blog.


In Part II, we studied PST, which checks the multilinear quotient identity directly using multivariate public parameters. PST requires a specialized setup containing cross-products of several hidden values, and its pairing cost grows linearly with the number of variables.

Zeromorph instead encodes the multilinear quotient identity as a univariate identity. It is a generic construction that builds a multilinear PCS using an additively homomorphic univariate PCS and a degree-check protocol. It works with any additively homomorphic univariate PCS, but we will specifically look at its instantiation with univariate KZG.

Notation. We continue to use the notation from Part II. We write F[X0,…,Xn−1]⪯1\mathbb{F}[X_0,\ldots,X_{n-1}]^{\preceq 1} for the set of nn-variate multilinear polynomials and F[X]<d\mathbb{F}[X]^{< d} for the set of univariate polynomials of degree at most d−1d-1. Univariate polynomials are denoted with a hat, while multilinear polynomials are denoted without a hat. For a univariate polynomial p^(X)=∑jpjXj\hat p(X)=\sum_jp_jX^j, we write p^<d(X)=∑j=0d−1pjXj\hat p^{< d}(X)=\sum_{j=0}^{d-1}p_jX^j for its truncation to terms of degree less than dd.

The starting point of Zeromorph is the same as that of PST. Checking f(u0,…,un−1)=?vf(u_0,\ldots,u_{n-1})\stackrel{?}{=}v is equivalent to checking the following multilinear quotient identity:

f(X0,…,Xn−1)−v  =?  ∑k=0n−1(Xk−uk)⋅qk(X0,…,Xk−1). f(X_0,\ldots,X_{n-1})-v \; \stackrel{?}{=} \; \sum_{k=0}^{n-1}(X_k-u_k) \cdot q_k(X_0,\ldots,X_{k-1}).

Instead of checking this identity over multivariate polynomials, as we did with PST in Part II, Zeromorph checks this identity over univariate polynomials. This requires an encoding from multilinear polynomials to univariate polynomials, which we will study next.

Univariatization Map#

The linear map from nn-variate multilinear polynomials to univariate polynomials of degree at most 2n−12^n - 1 is defined as follows:

Un:F[X0,…,Xn−1]⪯1→F[X]<2n. \mathcal{U}_n: \mathbb{F}[X_0,\ldots,X_{n-1}]^{\preceq 1} \rightarrow \mathbb{F}[X]^{<2^n}.

For a multilinear polynomial ff, its univariate encoding is defined as

f^(X)=Un(f)(X)=∑b⃗∈{0,1}nf(b⃗)⋅X∑i=0n−1bi2i. \hat f(X)=\mathcal{U}_n(f)(X) = \sum_{\vec{b}\in\{0,1\}^n} f(\vec{b}) \cdot X^{\sum_{i=0}^{n-1}b_i2^i}.

In other words, the evaluations of ff over the Boolean hypercube become the coefficients of the univariate polynomial. For example, when n=2n=2,

U2(f)(X)=f(0,0)+f(1,0)X+f(0,1)X2+f(1,1)X3. \mathcal{U}_2(f)(X) =f(0,0)+f(1,0)X+f(0,1)X^2+f(1,1)X^3.

The map Un\mathcal{U}_n has the following properties:

  1. Linearity: For multilinear polynomials f,gf,g and scalars α,β∈F\alpha,\beta\in\mathbb{F},

    Un(α⋅f+β⋅g)(X)=α⋅Un(f)(X)+β⋅Un(g)(X). \mathcal{U}_n(\alpha \cdot f+\beta \cdot g)(X) = \alpha \cdot \mathcal{U}_n(f)(X) + \beta \cdot \mathcal{U}_n(g)(X).
  2. One-to-one correspondence: Each evaluation f(b⃗)f(\vec b) is stored as a distinct coefficient of Un(f)\mathcal{U}_n(f). Thus, we can recover all the evaluations of ff by reading the coefficients of Un(f)\mathcal{U}_n(f). These evaluations uniquely determine the multilinear polynomial ff, so no information is lost. Conversely, the coefficients of any univariate polynomial of degree less than 2n2^n determine the evaluations of exactly one multilinear polynomial over the Boolean hypercube. A map with this property is called bijective.

Therefore, Un\mathcal{U}_n is linear and bijective. A map with both these properties is called a linear isomorphism.

In the next section, we will apply this univariatization map Un\mathcal{U}_n to the multilinear quotient identity and get the univariate identity.

Multilinear-to-Univariate Identity#

Applying the univariatization map Un\mathcal{U}_n to the multilinear quotient identity gives

Un(f(X0,…,Xn−1)−v)=?Un(∑k=0n−1(Xk−uk)qk(X0,…,Xk−1)) \mathcal{U}_n \Big(f(X_0,\ldots,X_{n-1})-v\Big) \stackrel{?}{=} \mathcal{U}_n\Bigg(\sum_{k=0}^{n-1}(X_k-u_k)q_k(X_0,\ldots,X_{k-1})\Bigg)

Using linearity of Un\mathcal{U}_n,

Un(f)−Un(v)=?∑k=0n−1(Un(Xkqk)−ukUn(qk)). \mathcal{U}_n(f)-\mathcal{U}_n(v) \stackrel{?}{=} \sum_{k=0}^{n-1} \left( \mathcal{U}_n(X_kq_k)-u_k\mathcal{U}_n(q_k) \right).

We will now see how to further decompose each of Un(v)\mathcal{U}_n(v), Un(qk)\mathcal{U}_n(q_k), and Un(Xk⋅qk)\mathcal{U}_n(X_k \cdot q_k).

Univariatization of vv#

Consider the constant nn-variate multilinear polynomial defined by

g(X0,…,Xn−1)=v. g(X_0, \ldots, X_{n-1}) = v.

It is independent of X0,…,Xn−1X_0, \ldots, X_{n-1} and takes the same value vv over the nn-dimensional Boolean hypercube.

Let us understand this with the help of the following table. The first two columns list the points on the Boolean hypercube and the corresponding evaluations of gg, while the last two columns list the corresponding monomials and coefficients in the univariate encoding.

Multilinear PolynomialUnivariate Encoding
Xn−1,…,X2,X1,X0X_{n-1}, \ldots, X_2, X_1, X_0g(X0,X1,X2,…,Xn−1)g(X_0, X_1, X_2, \ldots, X_{n-1})MonomialCoefficient
0,…,0,0,00, \ldots, 0, 0, 0vvX0X^0vv
0,…,0,0,10, \ldots, 0, 0, 1vvX1X^1vv
0,…,0,1,00, \ldots, 0, 1, 0vvX2X^2vv
0,…,0,1,10, \ldots, 0, 1, 1vvX3X^3vv
⋮\vdots⋮\vdots⋮\vdots⋮\vdots
1,…,1,1,11, \ldots, 1, 1, 1vvX2n−1X^{2^n-1}vv

Thus, the univariatization of vv is

Un(v)=v⋅X0+v⋅X1+…+v⋅X2n−1=v⋅(X0+X1+…+X2n−1)=v⋅Φn(X), \begin{aligned} \mathcal{U}_n(v) &=v \cdot X^0+v \cdot X^1+\ldots+v \cdot X^{2^n-1}\\ &=v \cdot \left(X^0+X^1+\ldots+X^{2^n-1}\right)\\ &=v \cdot \Phi_n(X), \end{aligned}

where Φn(X)=1+X+⋯+X2n−1\Phi_n(X)=1+X+\cdots+X^{2^n-1}.

Univariatization of qkq_k#

Let us understand this for k=2k=2, that is, for q2(X0,X1)q_2(X_0, X_1), which is multilinear in X0,X1X_0, X_1 and independent of the variables X2,…,Xn−1X_2, \ldots, X_{n-1}.

Suppose the evaluations of q2(X0,X1)q_2(X_0, X_1) are as follows:

q2(0,0)=a,q2(1,0)=b,q2(0,1)=c,q2(1,1)=d. q_2(0, 0) = a, \quad q_2(1, 0) = b, \quad q_2(0, 1) = c, \quad q_2(1, 1) = d.

The resulting table is as follows:

Multilinear PolynomialUnivariate Encoding
Xn−1,…,X2,X1,X0X_{n-1}, \ldots, X_2, X_1, X_0q2(X0,X1)q_2(X_0, X_1)MonomialCoefficient
0,…,0,0,00, \ldots, 0, 0, 0aaX0X^0aa
0,…,0,0,10, \ldots, 0, 0, 1bbX1X^1bb
0,…,0,1,00, \ldots, 0, 1, 0ccX2X^2cc
0,…,0,1,10, \ldots, 0, 1, 1ddX3X^3dd
0,…,1,0,00, \ldots, 1, 0, 0aaX4X^4aa
0,…,1,0,10, \ldots, 1, 0, 1bbX5X^5bb
0,…,1,1,00, \ldots, 1, 1, 0ccX6X^6cc
0,…,1,1,10, \ldots, 1, 1, 1ddX7X^7dd
⋮\vdots⋮\vdots⋮\vdots⋮\vdots
1,…,1,0,01, \ldots, 1, 0, 0aaX2n−4X^{2^n-4}aa
1,…,1,0,11, \ldots, 1, 0, 1bbX2n−3X^{2^n-3}bb
1,…,1,1,01, \ldots, 1, 1, 0ccX2n−2X^{2^n-2}cc
1,…,1,1,11, \ldots, 1, 1, 1ddX2n−1X^{2^n-1}dd

Thus, the univariatization of q2q_2 is

Un(q2)(X)=a+bX+cX2+dX3+aX4+bX5+cX6+dX7+⋯+aX2n−4+bX2n−3+cX2n−2+dX2n−1=(a+bX+cX2+dX3)⋅(1+X4+X8+⋯+X2n−4)=q^2(X)⋅Φn−2(X4). \begin{aligned} \mathcal{U}_n(q_2)(X) ={}&a+bX+cX^2+dX^3+aX^4+bX^5+cX^6+dX^7+\cdots\\ &+aX^{2^n-4}+bX^{2^n-3}+cX^{2^n-2}+dX^{2^n-1}\\ ={}&(a+bX+cX^2+dX^3) \cdot \left(1+X^4+X^8+\cdots+X^{2^n-4}\right)\\ ={}&\hat q_2(X) \cdot \Phi_{n-2}(X^4). \end{aligned}

Here, q^2(X)=Un(q2)<4(X)=a+bX+cX2+dX3\hat q_2(X)=\mathcal{U}_n(q_2)^{<4}(X)=a+bX+cX^2+dX^3 is the truncation of Un(q2)\mathcal{U}_n(q_2) to terms of degree less than 44.

For a general k∈{0,…,n−1}k\in\{0,\ldots,n-1\}, define q^k(X)=Un(qk)<2k(X)\hat q_k(X)=\mathcal{U}_n(q_k)^{<2^k}(X). The univariatization Un(qk)\mathcal{U}_n(q_k) begins with the 2k2^k coefficients of q^k(X)\hat q_k(X). This block of coefficients repeats 2n−k2^{n-k} times in Un(qk)\mathcal{U}_n(q_k). Therefore,

Un(qk)(X)=q^k(X)⋅(1+X2k+X2⋅2k+⋯+X2n−2k)=q^k(X)⋅Φn−k(X2k) \begin{aligned} \mathcal{U}_n(q_k)(X) ={}&\hat q_k(X) \cdot \left( 1+X^{2^k}+X^{2\cdot 2^k}+\cdots+X^{2^n-2^k} \right)\\ ={}&\hat q_k(X) \cdot \Phi_{n-k}\left(X^{2^k}\right) \end{aligned}

where Φn(X)=1+X+⋯+X2n−1\Phi_n(X)=1+X+\cdots+X^{2^n-1}.

Univariatization of Xk⋅qkX_k \cdot q_k#

Let us first understand this for k=2k=2. Since q2(X0,X1)q_2(X_0,X_1) is independent of X2X_2, multiplying it by X2X_2 makes its evaluation zero whenever X2=0X_2=0. When X2=1X_2=1, its evaluations are the same as those of q2q_2. This is shown in the following table:

Multilinear PolynomialUnivariate Encoding
Xn−1,…,X2,X1,X0X_{n-1},\ldots,X_2,X_1,X_0X2⋅q2(X0,X1)X_2 \cdot q_2(X_0,X_1)MonomialCoefficient
0,…,0,0,0,00,\ldots,0,0,0,000X0X^000
0,…,0,0,0,10,\ldots,0,0,0,100X1X^100
0,…,0,0,1,00,\ldots,0,0,1,000X2X^200
0,…,0,0,1,10,\ldots,0,0,1,100X3X^300
0,…,0,1,0,00,\ldots,0,1,0,0aaX4X^4aa
0,…,0,1,0,10,\ldots,0,1,0,1bbX5X^5bb
0,…,0,1,1,00,\ldots,0,1,1,0ccX6X^6cc
0,…,0,1,1,10,\ldots,0,1,1,1ddX7X^7dd
⋮\vdots⋮\vdots⋮\vdots⋮\vdots
1,…,1,0,0,01,\ldots,1,0,0,000X2n−8X^{2^n-8}00
1,…,1,0,0,11,\ldots,1,0,0,100X2n−7X^{2^n-7}00
1,…,1,0,1,01,\ldots,1,0,1,000X2n−6X^{2^n-6}00
1,…,1,0,1,11,\ldots,1,0,1,100X2n−5X^{2^n-5}00
1,…,1,1,0,01,\ldots,1,1,0,0aaX2n−4X^{2^n-4}aa
1,…,1,1,0,11,\ldots,1,1,0,1bbX2n−3X^{2^n-3}bb
1,…,1,1,1,01,\ldots,1,1,1,0ccX2n−2X^{2^n-2}cc
1,…,1,1,1,11,\ldots,1,1,1,1ddX2n−1X^{2^n-1}dd

Thus, the univariatization of X2⋅q2X_2 \cdot q_2 is

Un(X2⋅q2)(X)=aX4+bX5+cX6+dX7+aX12+bX13+cX14+dX15+⋯+aX2n−4+bX2n−3+cX2n−2+dX2n−1=X4⋅q^2(X)⋅(1+X8+X16+⋯+X2n−8)=X4⋅q^2(X)⋅Φn−3(X8). \begin{aligned} \mathcal{U}_n(X_2 \cdot q_2)(X) ={}&aX^4+bX^5+cX^6+dX^7 +aX^{12}+bX^{13}+cX^{14}+dX^{15}+\cdots\\ &+aX^{2^n-4}+bX^{2^n-3}+cX^{2^n-2}+dX^{2^n-1}\\ ={}&X^4 \cdot \hat q_2(X) \cdot \left(1+X^8+X^{16}+\cdots+X^{2^n-8}\right)\\ ={}&X^4 \cdot \hat q_2(X) \cdot \Phi_{n-3}(X^8). \end{aligned}

For a general k∈{0,…,n−1}k\in\{0,\ldots,n-1\}, multiplication by XkX_k makes the evaluation zero whenever Xk=0X_k=0. The coefficients of q^k\hat q_k occur when Xk=1X_k=1, starting at degree 2k2^k, and repeat every 2k+12^{k+1} powers. Therefore,

Un(Xkqk)(X)=X2k⋅q^k(X)⋅∑j=02n−k−1−1Xj2k+1=X2k⋅q^k(X)⋅Φn−k−1(X2k+1) \begin{aligned} \mathcal{U}_n(X_kq_k)(X) ={}&X^{2^k} \cdot \hat q_k(X) \cdot \sum_{j=0}^{2^{n-k-1}-1}X^{j2^{k+1}}\\ ={}&X^{2^k} \cdot \hat q_k(X) \cdot \Phi_{n-k-1}\left(X^{2^{k+1}}\right) \end{aligned}

where Φn(X)=1+X+⋯+X2n−1\Phi_n(X)=1+X+\cdots+X^{2^n-1} and, for k=n−1k=n-1, Φ0(X)=1\Phi_0(X)=1.

Univariate Identity#

Now that we have the decompositions for Un(v)\mathcal{U}_n(v), Un(qk)\mathcal{U}_n(q_k), and Un(Xk⋅qk)\mathcal{U}_n(X_k \cdot q_k), we substitute them into the following identity:

Un(f)−Un(v)=?∑k=0n−1(Un(Xk⋅qk)−ukUn(qk)) \mathcal{U}_n(f)-\mathcal{U}_n(v) \stackrel{?}{=} \sum_{k=0}^{n-1} \left( \mathcal{U}_n(X_k \cdot q_k)-u_k\mathcal{U}_n(q_k) \right)

This gives us the univariate identity

f^(X)−v⋅Φn(X)=?∑k=0n−1(X2k⋅Φn−k−1(X2k+1)−uk⋅Φn−k(X2k))⋅q^k(X) \begin{aligned} \hat f(X)-v \cdot \Phi_n(X) \stackrel{?}{=} \mathop{\Large\sum}_{k=0}^{n-1} \Bigg( &X^{2^k} \cdot \Phi_{n-k-1}\left(X^{2^{k+1}}\right) - u_k \cdot \Phi_{n-k}\left(X^{2^k}\right) \Bigg) \cdot \hat q_k(X) \end{aligned}

where f^(X)=Un(f)(X)\hat f(X) = \mathcal{U}_n(f)(X) and q^k(X)=Un(qk)<2k(X)\hat q_k(X)=\mathcal{U}_n(q_k)^{<2^k}(X).

Note

We express the above identity in terms of Φn(X)=1+X+⋯+X2n−1\Phi_n(X)=1+X+\cdots+X^{2^n-1} because the verifier can efficiently evaluate Φn(X)\Phi_n(X) at a random point. Since

(X−1)⋅Φn(X)=X2n−1, (X-1) \cdot \Phi_n(X) = X^{2^n} - 1,

the evaluation Φn(x)=(x2n−1)/(x−1)\Phi_n(x)=(x^{2^n}-1)/(x-1) can be computed using n+1n+1 multiplications, 22 additions and 11 inversion.

Define the following univariate polynomial:

Z(X)=f^(X)−v⋅Φn(X)−∑k=0n−1(X2k⋅Φn−k−1(X2k+1)−uk⋅Φn−k(X2k))⋅q^k(X) \begin{aligned} Z(X) ={}&\hat f(X)-v \cdot \Phi_n(X)\\ &-\mathop{\Large\sum}_{k=0}^{n-1} \Bigg( X^{2^k} \cdot \Phi_{n-k-1}\left(X^{2^{k+1}}\right) -u_k \cdot \Phi_{n-k}\left(X^{2^k}\right) \Bigg) \cdot \hat q_k(X) \end{aligned}

By the Schwartz-Zippel Lemma, if the verifier checks that Z(τ)=0Z(\tau)=0 at the randomly sampled secret setup value τ\tau, then, with high probability, Z(X)Z(X) is the zero polynomial and the univariate identity holds. However, the verifier cannot directly check Z(τ)=?0Z(\tau) \stackrel{?}{=} 0 because τ\tau is secret and the verifier cannot compute the following term for the pairing check:

(τ2k⋅Φn−k−1(τ2k+1)−uk⋅Φn−k(τ2k)) \Bigg( \tau^{2^k} \cdot \Phi_{n-k-1}\left(\tau^{2^{k+1}}\right) - u_k \cdot \Phi_{n-k}\left(\tau^{2^k}\right) \Bigg)

To address this issue, the verifier samples a random point x∈Fx\in\mathbb{F} and asks the prover to prove that Z(x)=0Z(x)=0. To do so, the prover constructs the following polynomial Zx(X)Z_x(X), in which the coefficients multiplying the quotient polynomials are evaluated at xx:

Zx(X)=f^(X)−v⋅Φn(x)−∑k=0n−1(x2k⋅Φn−k−1(x2k+1)−uk⋅Φn−k(x2k))⋅q^k(X) \begin{aligned} Z_x(X) ={}&\hat f(X)-v \cdot \Phi_n(x)\\ &-\mathop{\Large\sum}_{k=0}^{n-1} \Bigg( x^{2^k} \cdot \Phi_{n-k-1}\left(x^{2^{k+1}}\right) -u_k \cdot \Phi_{n-k}\left(x^{2^k}\right) \Bigg) \cdot \hat q_k(X) \end{aligned}

Note that Z(x)=Zx(x)Z(x) = Z_x(x). Thus, the prover proves that Zx(x)=0Z_x(x)=0. The verifier can compute the commitment to ZxZ_x using the commitments to f^\hat f and the q^k\hat q_k, since the commitments are additively homomorphic.

However, only checking Zx(x)=?0Z_x(x) \stackrel{?}{=} 0 is not enough. The KZG opening will verify that Zx(x)=0Z_x(x)=0, but it does not ensure that each committed polynomial q^k\hat q_k has the degree required to encode a multilinear quotient in the first kk variables. Without this check, the prover could use a polynomial of degree greater than 2k−12^k-1. Therefore, the protocol must additionally check that for every kk, deg⁡(q^k)<2k\deg\left(\hat{q}_k\right)<2^k.

At first, it seems that the protocol must also check that deg⁡(f^)<2n\deg\left(\hat{f}\right) < 2^n. However, this bound follows from the quotient degree bounds and the polynomial identity below.

f^(X)−v⋅Φn(X)=?∑k=0n−1(X2k⋅Φn−k−1(X2k+1)−uk⋅Φn−k(X2k))⋅q^k(X). \begin{aligned} \hat{f}(X)-v \cdot \Phi_n(X) \stackrel{?}{=} \mathop{\Large\sum}_{k=0}^{n-1} \Bigg( &X^{2^k} \cdot \Phi_{n-k-1}\left(X^{2^{k+1}}\right) - u_k \cdot \Phi_{n-k}\left(X^{2^k}\right) \Bigg) \cdot \hat{q}_k(X) \end{aligned}.

If, for every kk, deg⁡(q^k)<2k\deg\left(\hat{q}_k\right)<2^k, then each summand on the right has degree at most (2n−2k)+(2k−1)=2n−1(2^n-2^k)+(2^k-1)=2^n-1. Since deg⁡(Φn)=2n−1\deg\left(\Phi_n\right) = 2^n - 1, the identity automatically implies deg⁡(f^)<2n\deg\left(\hat{f}\right) < 2^n. Thus, no separate degree check on f^\hat{f} is required.

To summarize, we have reduced the claim f(u0,…,un−1)=vf(u_0,\ldots,u_{n-1})=v to the following checks:

  • the identity check Zx(x)=?0Z_x(x)\stackrel{?}{=}0;
  • the nn degree checks deg⁡(q^k)<2k\deg\left(\hat q_k\right)<2^k for k∈{0,…,n−1}k\in\{0,\ldots,n-1\}.

Zeromorph batches the nn degree checks and reduces them to a single KZG opening that also enforces a degree bound. We study this degree-bounded KZG opening protocol next.

Degree-Bounded KZG Opening#

Let Nmax⁡N_{\max} be a strict upper bound on the degree of polynomials supported by the KZG commitment scheme. Thus, the commitment key contains

ck=([1]1,[τ]1,[τ2]1,…,[τNmax⁡−1]1). ck=\left([1]_1,[\tau]_1,[\tau^2]_1,\ldots,[\tau^{N_{\max}-1}]_1\right).

Given a univariate polynomial f^(X)\hat f(X) and a claimed degree bound dd, the goal is to prove both

f^(u)=vanddeg⁡(f^)≤d. \hat f(u)=v \qquad\text{and}\qquad \deg(\hat f)\leq d.

This protocol is a simple modification of univariate KZG. We start with the following KZG identity:

f^(X)−v=?q^(X)⋅(X−u). \hat f(X)-v \stackrel{?}{=} \hat q(X) \cdot (X-u).

Multiplying both sides by XNmax⁡−dX^{N_{\max}-d} gives

(f^(X)−v)⋅XNmax⁡−d=?q^(X)⋅XNmax⁡−d⋅(X−u). (\hat f(X)-v) \cdot X^{N_{\max}-d} \stackrel{?}{=} \hat q(X) \cdot X^{N_{\max}-d} \cdot (X-u).

The prover commits to q^shift(X)=q^(X)⋅XNmax⁡−d\hat q_{\mathrm{shift}}(X)=\hat q(X) \cdot X^{N_{\max}-d}, and the verifier checks the following identity at the secret setup value τ\tau using bilinear pairings:

(f^(X)−v)⋅XNmax⁡−d=?q^shift(X)⋅(X−u) (\hat f(X)-v) \cdot X^{N_{\max}-d} \stackrel{?}{=} \hat q_{\mathrm{shift}}(X) \cdot (X-u)

Note that deg⁡(q^shift)≤(d−1)+(Nmax⁡−d)=Nmax⁡−1\deg(\hat q_{\mathrm{shift}})\leq(d-1)+(N_{\max}-d)=N_{\max}-1. Therefore, q^shift\hat q_{\mathrm{shift}} can be committed using the KZG commitment key.

The end-to-end protocol is described as follows:

  1. P\mathcal{P} sends comf^com_{\hat f} to V\mathcal{V}.
  2. V\mathcal{V} samples u∈F∗u \in \mathbb{F}^* and requests an opening at uu.
  3. P\mathcal{P} sends the evaluation vv and the commitment cm=[q^shift(τ)]1=[q^(τ)τNmax⁡−d]1. cm=[\hat q_{\mathrm{shift}}(\tau)]_1 =\left[\hat q(\tau)\tau^{N_{\max}-d}\right]_1.
  4. V\mathcal{V} accepts if and only if e(cm,[τ]2−u[1]2)=?e(comf^−v[1]1,[τNmax⁡−d]2). e\left(cm,[\tau]_2-u[1]_2\right) \stackrel{?}{=} e\left(com_{\hat f}-v[1]_1,[\tau^{N_{\max}-d}]_2\right).

Note that in addition to [1]2[1]_2 and [τ]2[\tau]_2, the verifier key contains the higher power [τNmax⁡−d]2[\tau^{N_{\max}-d}]_2.

The protocol enforces f^(u)=v\hat f(u)=v only when u≠0u\neq0. Thus, the verifier samples uu from F∗\mathbb{F}^*. The condition u≠0u\neq0 is essential: if u=0u=0, then X−u=XX-u=X shares a factor with XNmax⁡−dX^{N_{\max}-d}, allowing a dishonest prover to claim any value vv and set

q^shift(X)=(f^(X)−v)⋅XNmax⁡−d−1. \hat q_{\mathrm{shift}}(X)=(\hat f(X)-v) \cdot X^{N_{\max}-d-1}.

When deg⁡(f^)≤d\deg(\hat f)\leq d, the above polynomial has degree at most Nmax⁡−1N_{\max}-1 and satisfies the identity

q^shift(X)⋅X=?(f^(X)−v)⋅XNmax⁡−d \hat q_{\mathrm{shift}}(X) \cdot X \stackrel{?}{=} (\hat f(X)-v) \cdot X^{N_{\max}-d}

even when f^(0)≠v\hat f(0)\neq v. Thus, the pairing check could accept an incorrect evaluation claim at u=0u=0.

The protocol also enforces deg⁡(f^)≤d\deg(\hat f)\leq d. If deg⁡(f^)>d\deg(\hat f)>d, then deg⁡(q^)≥d\deg(\hat q)\geq d, and hence

deg⁡(q^shift)≥d+(Nmax⁡−d)=Nmax⁡. \deg(\hat q_{\mathrm{shift}}) \geq d+(N_{\max}-d) =N_{\max}.

The prover therefore cannot commit to q^shift\hat q_{\mathrm{shift}}, since the commitment key supports polynomials of degree at most Nmax⁡−1N_{\max}-1.

We will now look at the batched degree-check protocol.

Batched Degree-Check Protocol#

For univariate polynomials q^0(X),…,q^n−1(X)\hat q_0(X),\ldots,\hat q_{n-1}(X), the goal is to prove that

deg⁡(q^k)≤dk,where dk=2k−1,k∈{0,…,n−1}. \deg(\hat q_k)\leq d_k, \qquad \text{where }d_k=2^k-1, \quad k\in\{0,\ldots,n-1\}.

The idea is to shift each polynomial so that the shifted polynomials have the same degree bound and then combine them using a random challenge. We can then run the degree check on this single combined polynomial.

Let d∗≥max⁡kdkd^*\geq\max_k d_k and y∈Fy\in\mathbb{F} be the random challenge. For q^k\hat q_k with deg⁡(q^k)≤dk\deg(\hat q_k)\leq d_k, the shifted polynomial is

Xd∗−dk+1⋅q^k(X). X^{d^*-d_k+1} \cdot \hat q_k(X).

Note that if deg⁡(q^k)≤dk\deg(\hat q_k)\leq d_k, then the corresponding shifted polynomial has degree at most d∗+1d^*+1. We take a random linear combination of these shifted polynomials:

Q^(X)=∑k=0n−1yk⋅Xd∗−dk+1⋅q^k(X). \hat Q(X) = \sum_{k=0}^{n-1}y^k \cdot X^{d^*-d_k+1} \cdot \hat q_k(X).

If every q^k\hat q_k satisfies its degree bound, then deg⁡(Q^)≤d∗+1\deg(\hat Q)\leq d^*+1. Conversely, if any q^k\hat q_k violates its degree bound, then, with high probability over the random challenge yy, deg⁡(Q^)>d∗+1\deg(\hat Q)>d^*+1. Thus, the nn degree checks reduce to the following two checks:

  • a single degree check on Q^\hat Q, that is, deg⁡(Q^)≤d∗+1\deg(\hat Q)\leq d^*+1;
  • a check that Q^\hat Q is well-formed, that is, its commitment is consistent with the commitments to the q^k\hat q_k.

The verifier samples a random point x∈Fx\in\mathbb{F}, after which the prover computes

ζx(X)=Q^(X)−∑k=0n−1yk⋅xd∗−dk+1⋅q^k(X). \zeta_x(X) = \hat Q(X) - \sum_{k=0}^{n-1} y^k \cdot x^{d^*-d_k+1} \cdot \hat q_k(X).

The prover then proves the following:

  • deg⁡(ζx)≤d∗+1\deg(\zeta_x)\leq d^*+1: This proves that deg⁡(Q^)≤d∗+1\deg(\hat Q)\leq d^*+1, which implies that deg⁡(q^k)≤dk\deg(\hat q_k)\leq d_k.
  • ζx(x)=0\zeta_x(x)=0: This proves that the commitment to Q^\hat Q is consistent with the commitments to the q^k\hat q_k.

At this point, the claim f(u0,…,un−1)=vf(u_0,\ldots,u_{n-1})=v has been reduced to the following checks:

  • the identity check Zx(x)=?0Z_x(x)\stackrel{?}{=}0;
  • the evaluation and degree checks ζx(x)=?0\zeta_x(x)\stackrel{?}{=}0 and deg⁡(ζx)≤d∗+1\deg(\zeta_x)\leq d^*+1.

In the final Zeromorph opening protocol, we choose d∗=2n−2d^*=2^n-2 so that ζx\zeta_x and ZxZ_x have the same degree bound, 2n−12^n-1. The verifier then samples a random challenge z∈Fz\in\mathbb{F} and uses it to combine the two polynomials:

H^x(X)=ζx(X)+z⋅Zx(X). \hat H_x(X)=\zeta_x(X)+z\cdot Z_x(X).

Finally, the prover and verifier run the degree-bounded KZG opening protocol to prove that H^x(x)=0\hat H_x(x)=0 and deg⁡(H^x)≤2n−1\deg(\hat H_x)\leq2^n-1. With high probability over zz, this single invocation enforces both evaluation checks and the required degree bound.

We now have all the building blocks needed to present the end-to-end Zeromorph opening protocol.

End-to-End Opening Protocol#

The end-to-end opening protocol proceeds as follows:

  1. P\mathcal{P} computes the univariate encoding of ff,

    f^(X)=Un(f)(X) \hat f(X)=\mathcal U_n(f)(X)

    and sends the commitment C=[f^(τ)]1C=[\hat f(\tau)]_1 to V\mathcal{V}.

  2. V\mathcal{V} samples (u0,…,un−1)←$Fn(u_0, \ldots, u_{n-1})\xleftarrow{\raisebox{0pt}{\textdollar}}\mathbb F^n and sends it to P\mathcal{P}.

  3. P\mathcal{P} computes the multilinear quotient polynomials q0,…,qn−1q_0,\ldots,q_{n-1} and their univariate encodings

    q^k(X)=Un(qk)<2k(X). \hat q_k(X)=\mathcal U_n(q_k)^{<2^k}(X).

    It sends the commitments Ck=[q^k(τ)]1,  k∈{0,…,n−1}, C_k=[\hat q_k(\tau)]_1, \; k\in\{0,\ldots,n-1\}, and the evaluation vv to V\mathcal V.

  4. V\mathcal V samples a random challenge y←$Fy\xleftarrow{\raisebox{0pt}{\textdollar}}\mathbb F (used to batch degree checks) and sends it to P\mathcal P.

  5. P\mathcal P computes the shifted random linear combination

    Q^(X)=∑k=0n−1ykX2n−dk−1q^k(X) \hat Q(X) = \sum_{k=0}^{n-1} y^kX^{2^n-d_k-1}\hat q_k(X)

    and sends its commitment CQ^=[Q^(τ)]1 C_{\hat Q}=[\hat Q(\tau)]_1 to V\mathcal V.

  6. V\mathcal V samples x←$F∗x\xleftarrow{\raisebox{0pt}{\textdollar}}\mathbb F^* (a nonzero opening point) and z←$Fz\xleftarrow{\raisebox{0pt}{\textdollar}}\mathbb F (used to batch ZxZ_x and ζx\zeta_x), and sends both challenges to P\mathcal P. Using the homomorphic property of KZG commitments, V\mathcal V computes the commitments to ZxZ_x and ζx\zeta_x as follows:

    CZx=C−v⋅Φn(x)[1]1−∑k=0n−1(x2kΦn−k−1(x2k+1)−ukΦn−k(x2k))⋅Ck,Cζx=CQ^−∑k=0n−1ykx2n−dk−1Ck. \begin{aligned} C_{Z_x} &=C-v \cdot \Phi_n(x)[1]_1 -\mathop{\Large\sum}_{k=0}^{n-1} \Bigg( x^{2^k}\Phi_{n-k-1}\left(x^{2^{k+1}}\right) -u_k\Phi_{n-k}\left(x^{2^k}\right) \Bigg) \cdot C_k,\\ C_{\zeta_x} &=C_{\hat Q} -\sum_{k=0}^{n-1} y^kx^{2^n-d_k-1}C_k. \end{aligned}

    Then V\mathcal V combines the two commitments as

    CH^x=Cζx+z⋅CZx. C_{\hat H_x}=C_{\zeta_x}+ z \cdot C_{Z_x}.
  7. P\mathcal P computes the corresponding polynomials ZxZ_x and ζx\zeta_x.

    Zx(X)=f^(X)−vΦn(x)−∑k=0n−1(x2k⋅Φn−k−1(x2k+1)−uk⋅Φn−k(x2k))⋅q^k(X),ζx(X)=Q^(X)−∑k=0n−1ykx2n−dk−1q^k(X). \begin{aligned} Z_x(X) &=\hat f(X)-v\Phi_n(x) \\ & \quad \quad -\mathop{\Large\sum}_{k=0}^{n-1} \Bigg( x^{2^k} \cdot \Phi_{n-k-1}\left(x^{2^{k+1}}\right) -u_k \cdot \Phi_{n-k}\left(x^{2^k}\right) \Bigg) \cdot \hat q_k(X), \\ \zeta_x(X) &=\hat Q(X) -\sum_{k=0}^{n-1} y^kx^{2^n-d_k-1}\hat q_k(X). \end{aligned}

    Then P\mathcal P combines the two polynomials as

    H^x(X)=ζx(X)+z⋅Zx(X). \hat H_x(X) = \zeta_x(X) + z \cdot Z_x(X).
  8. P\mathcal P and V\mathcal V run the degree-bounded KZG opening protocol on CH^xC_{\hat H_x}, with opening point xx, claimed evaluation 00, and degree bound 2n−12^n-1. This proves

    H^x(x)=0anddeg⁡(H^x)≤2n−1. \hat H_x(x)=0 \qquad\text{and}\qquad \deg(\hat H_x)\leq 2^n-1.

We will now study the complexity of the opening protocol.

Complexity of the Opening Protocol#

For an nn-variate multilinear polynomial with 2n2^n coefficients, the complexity of the opening protocol is explained as follows.

  • Proof Size: The prover sends the nn quotient commitments C0,…,Cn−1C_0,\ldots,C_{n-1}, the commitment CQ^C_{\hat Q} and the final opening proof π\pi. Therefore, the proof contains n+2n+2 elements in G1\mathbb{G}_1. Assuming each G1\mathbb{G}_1 element is encoded by two field elements, the proof size is O(n)O(n) field elements.

  • Prover Cost: The major prover costs include the following operations:

    • Compute and commit to the quotient polynomials: As shown in the complexity analysis of PST in Part II, computing the quotient polynomials and the claimed evaluation v=f(u⃗)v=f(\vec u) requires O(2n)O(2^n) field operations. Committing to ff requires an MSM of size 2n2^n, while committing to all the quotient polynomials requires MSMs with a combined size of 2n−12^n-1. The same bounds apply to the univariate encodings f^\hat f and q^k\hat q_k because they contain the same number of coefficients.
    • Compute the batched polynomials: The quotient encodings contain 2n−12^n-1 coefficients in total, and each batching or division step makes a linear pass over at most 2n2^n coefficients. Therefore, computing Q^\hat Q, ZxZ_x, ζx\zeta_x, H^x\hat H_x, and the final opening quotient requires O(2n)O(2^n) field operations.
    • Commit to Q^\hat Q: Every shifted term X2n−dk−1q^k(X)X^{2^n-d_k-1}\hat q_k(X) ends at degree at most 2n−12^n-1. Thus, computing CQ^C_{\hat Q} requires at most 2n−12^n-1 group scalar multiplications.
    • Compute quotient commitment in degree-bound KZG: The polynomial H^x\hat H_x has degree at most 2n−12^n-1, so its opening quotient has at most 2n−12^n-1 coefficients. Computing the shifted commitment π\pi therefore requires an MSM of size at most 2n−12^n-1.
  • Verifier Cost: The verifier receives the quotient commitments C0,…,Cn−1C_0,\ldots,C_{n-1} from the prover. It computes the field values needed to form CZxC_{Z_x} and CζxC_{\zeta_x}, including the required powers of xx and yy and the evaluations of the Φi\Phi_i. This requires O(n)O(n) field operations. The verifier then forms CZxC_{Z_x} and CζxC_{\zeta_x} as linear combinations of the received commitments, requiring O(n)O(n) group scalar multiplications. Additionally, the final check has two pairing terms.

Equivalently, excluding the cost of the original commitment CC, the opening costs can be summarized as follows:

ComponentCost
Proof sizeO(n)O(n) field elements
Prover workO(2n)O(2^n) field operations, O(2n)O(2^n) group scalar mults
Verifier workO(n)O(n) field operations, O(n)O(n) group scalar mults, two pairing terms

Conclusion#

In the previous part and this part, we studied two quotient-based methods for extending KZG to multilinear polynomials. PST checks the multilinear quotient identity directly using multivariate public parameters, while Zeromorph encodes the same identity as a univariate identity and enforces the required quotient structure through degree checks.

In the next part, we will study folding-based methods. These constructions repeatedly fold a multilinear evaluation claim until it can be verified using univariate KZG.