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 for the set of n-variate multilinear polynomials and F[X]<d for the set of univariate polynomials of degree at most d−1. Univariate polynomials are denoted with a hat, while multilinear polynomials are denoted without a hat. For a univariate polynomial p^(X)=∑jpjXj, we write p^<d(X)=∑j=0d−1pjXj for its truncation to terms of degree less than d.
The starting point of Zeromorph is the same as that of PST. Checking f(u0,…,un−1)=?v is equivalent to checking the following multilinear quotient identity:
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.
The linear map from n-variate multilinear polynomials to univariate polynomials of degree at most 2n−1 is defined as follows:
Un:F[X0,…,Xn−1]⪯1→F[X]<2n.
For a multilinear polynomial f, its univariate encoding is defined as
f^(X)=Un(f)(X)=b∈{0,1}n∑f(b)⋅X∑i=0n−1bi2i.
In other words, the evaluations of f over the Boolean hypercube become the coefficients of the univariate polynomial. For example, when n=2,
U2(f)(X)=f(0,0)+f(1,0)X+f(0,1)X2+f(1,1)X3.
The map Un has the following properties:
Linearity: For multilinear polynomials f,g and
scalars α,β∈F,
Un(α⋅f+β⋅g)(X)=α⋅Un(f)(X)+β⋅Un(g)(X).
One-to-one correspondence: Each evaluation f(b) is stored as a distinct coefficient of Un(f). Thus, we can recover all the evaluations of f by reading the coefficients of Un(f). These evaluations uniquely determine the multilinear polynomial f, so no information is lost. Conversely, the coefficients of any univariate polynomial of degree less than 2n determine the evaluations of exactly one multilinear polynomial over the Boolean hypercube. A map with this property is called bijective.
Therefore, Un 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 to the multilinear quotient identity and get the univariate identity.
Consider the constant n-variate multilinear polynomial defined by
g(X0,…,Xn−1)=v.
It is independent of X0,…,Xn−1 and takes the same value v over the n-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 g, while the last two columns list the corresponding monomials and coefficients in the univariate encoding.
Here, q^2(X)=Un(q2)<4(X)=a+bX+cX2+dX3 is the truncation of Un(q2) to terms of degree less than 4.
For a general k∈{0,…,n−1}, define q^k(X)=Un(qk)<2k(X). The univariatization Un(qk) begins with the 2k coefficients of q^k(X). This block of coefficients repeats 2n−k times in Un(qk). Therefore,
Let us first understand this for k=2. Since q2(X0,X1) is independent of X2, multiplying it by X2 makes its evaluation zero whenever X2=0. When X2=1, its evaluations are the same as those of q2. This is shown in the following table:
For a general k∈{0,…,n−1}, multiplication by Xk makes the evaluation zero whenever Xk=0. The coefficients of q^k occur when Xk=1, starting at degree 2k, and repeat every 2k+1 powers. Therefore,
By the Schwartz-Zippel Lemma, if the verifier checks that Z(τ)=0 at the randomly sampled secret setup value τ, then, with high probability, Z(X) is the zero polynomial and the univariate identity holds. However, the verifier cannot directly check Z(τ)=?0 because τ is secret and the verifier cannot compute the following term for the pairing check:
(τ2k⋅Φn−k−1(τ2k+1)−uk⋅Φn−k(τ2k))
To address this issue, the verifier samples a random point x∈F and asks the prover to prove that Z(x)=0. To do so, the prover constructs the following polynomial Zx(X), in which the coefficients multiplying the quotient polynomials are evaluated at x:
Note that Z(x)=Zx(x). Thus, the prover proves that Zx(x)=0. The verifier can compute the commitment to Zx using the commitments to f^ and the q^k, since the commitments are additively homomorphic.
However, only checking Zx(x)=?0 is not enough. The KZG opening will verify that Zx(x)=0, but it does not ensure that each committed polynomial q^k has the degree required to encode a multilinear quotient in the first k variables. Without this check, the prover could use a polynomial of degree greater than 2k−1. Therefore, the protocol must additionally check that for every k, deg(q^k)<2k.
At first, it seems that the protocol must also check that deg(f^)<2n. However, this bound follows from the quotient degree bounds and the polynomial identity below.
If, for every k, deg(q^k)<2k, then each summand on the right has degree at most (2n−2k)+(2k−1)=2n−1. Since deg(Φn)=2n−1, the identity automatically implies deg(f^)<2n. Thus, no separate degree check on f^ is required.
To summarize, we have reduced the claim f(u0,…,un−1)=v to the following checks:
the identity check Zx(x)=?0;
the n degree checks deg(q^k)<2k for k∈{0,…,n−1}.
Zeromorph batches the n 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.
Let Nmax 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).
Given a univariate polynomial f^(X) and a claimed degree bound d, the goal is to prove both
f^(u)=vanddeg(f^)≤d.
This protocol is a simple modification of univariate KZG. We start with the following KZG identity:
f^(X)−v=?q^(X)⋅(X−u).
Multiplying both sides by XNmax−d gives
(f^(X)−v)⋅XNmax−d=?q^(X)⋅XNmax−d⋅(X−u).
The prover commits to q^shift(X)=q^(X)⋅XNmax−d, and the verifier checks the following identity at the secret setup value τ using bilinear pairings:
(f^(X)−v)⋅XNmax−d=?q^shift(X)⋅(X−u)
Note that deg(q^shift)≤(d−1)+(Nmax−d)=Nmax−1. Therefore, q^shift can be committed using the KZG commitment key.
The end-to-end protocol is described as follows:
P sends comf^ to V.
V samples u∈F∗ and requests an opening at u.
P sends the evaluation v and the commitment
cm=[q^shift(τ)]1=[q^(τ)τNmax−d]1.
V accepts if and only if
e(cm,[τ]2−u[1]2)=?e(comf^−v[1]1,[τNmax−d]2).
Note that in addition to [1]2 and [τ]2, the verifier key contains the higher power [τNmax−d]2.
The protocol enforces f^(u)=v only when u=0. Thus, the verifier samples u from F∗. The condition u=0 is essential: if u=0, then X−u=X shares a factor with XNmax−d, allowing a dishonest prover to claim any value v and set
q^shift(X)=(f^(X)−v)⋅XNmax−d−1.
When deg(f^)≤d, the above polynomial has degree at most Nmax−1 and satisfies the identity
q^shift(X)⋅X=?(f^(X)−v)⋅XNmax−d
even when f^(0)=v. Thus, the pairing check could accept an incorrect evaluation claim at u=0.
The protocol also enforces deg(f^)≤d. If deg(f^)>d, then deg(q^)≥d, and hence
deg(q^shift)≥d+(Nmax−d)=Nmax.
The prover therefore cannot commit to q^shift, since the commitment key supports polynomials of degree at most Nmax−1.
We will now look at the batched degree-check protocol.
For univariate polynomials q^0(X),…,q^n−1(X), the goal is to prove that
deg(q^k)≤dk,where dk=2k−1,k∈{0,…,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∗≥maxkdk and y∈F be the random challenge. For q^k with deg(q^k)≤dk, the shifted polynomial is
Xd∗−dk+1⋅q^k(X).
Note that if deg(q^k)≤dk, then the corresponding shifted polynomial has degree at most d∗+1. We take a random linear combination of these shifted polynomials:
Q^(X)=k=0∑n−1yk⋅Xd∗−dk+1⋅q^k(X).
If every q^k satisfies its degree bound, then deg(Q^)≤d∗+1. Conversely, if any q^k violates its degree bound, then, with high probability over the random challenge y, deg(Q^)>d∗+1. Thus, the n degree checks reduce to the following two checks:
a single degree check on Q^, that is, deg(Q^)≤d∗+1;
a check that Q^ is well-formed, that is, its commitment is consistent with the commitments to the q^k.
The verifier samples a random point x∈F, after which the prover computes
ζx(X)=Q^(X)−k=0∑n−1yk⋅xd∗−dk+1⋅q^k(X).
The prover then proves the following:
deg(ζx)≤d∗+1: This proves that deg(Q^)≤d∗+1, which implies that deg(q^k)≤dk.
ζx(x)=0: This proves that the commitment to Q^ is consistent with the commitments to the q^k.
At this point, the claim f(u0,…,un−1)=v has been reduced to the following checks:
the identity check Zx(x)=?0;
the evaluation and degree checks ζx(x)=?0 and deg(ζx)≤d∗+1.
In the final Zeromorph opening protocol, we choose d∗=2n−2 so that ζx and Zx have the same degree bound, 2n−1. The verifier then samples a random challenge z∈F and uses it to combine the two polynomials:
H^x(X)=ζx(X)+z⋅Zx(X).
Finally, the prover and verifier run the degree-bounded KZG opening protocol to prove that H^x(x)=0 and deg(H^x)≤2n−1. With high probability over z, 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.
The end-to-end opening protocol proceeds as follows:
P computes the univariate encoding of f,
f^(X)=Un(f)(X)
and sends the commitment C=[f^(τ)]1 to V.
V samples (u0,…,un−1)$Fn and sends it to P.
P computes the multilinear quotient polynomials q0,…,qn−1 and their univariate encodings
q^k(X)=Un(qk)<2k(X).
It sends the commitments
Ck=[q^k(τ)]1,k∈{0,…,n−1},
and the evaluation v to V.
V samples a random challenge y$F (used to batch degree checks) and sends it to P.
P computes the shifted random linear combination
Q^(X)=k=0∑n−1ykX2n−dk−1q^k(X)
and sends its commitment
CQ^=[Q^(τ)]1
to V.
V samples x$F∗ (a nonzero opening point) and z$F (used to batch Zx and ζx), and sends both challenges to P. Using the homomorphic property of KZG commitments, V computes the commitments to Zx and ζx as follows:
For an n-variate multilinear polynomial with 2n coefficients, the complexity of the opening protocol is explained as follows.
Proof Size: The prover sends the n quotient commitments C0,…,Cn−1, the commitment CQ^ and the final opening proof π. Therefore, the proof contains n+2 elements in G1. Assuming each G1 element is encoded by two field elements, the proof size is 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) requires O(2n) field operations. Committing to f requires an MSM of size 2n, while committing to all the quotient polynomials requires MSMs with a combined size of 2n−1. The same bounds apply to the univariate encodings f^ and q^k because they contain the same number of coefficients.
Compute the batched polynomials: The quotient encodings contain 2n−1 coefficients in total, and each batching or division step makes a linear pass over at most 2n coefficients. Therefore, computing Q^, Zx, ζx, H^x, and the final opening quotient requires O(2n) field operations.
Commit to Q^: Every shifted term X2n−dk−1q^k(X) ends at degree at most 2n−1. Thus, computing CQ^ requires at most 2n−1 group scalar multiplications.
Compute quotient commitment in degree-bound KZG: The polynomial H^x has degree at most 2n−1, so its opening quotient has at most 2n−1 coefficients. Computing the shifted commitment π therefore requires an MSM of size at most 2n−1.
Verifier Cost: The verifier receives the quotient commitments C0,…,Cn−1 from the prover. It computes the field values needed to form CZx and Cζx, including the required powers of x and y and the evaluations of the Φi. This requires O(n) field operations. The verifier then forms CZx and Cζx as linear combinations of the received commitments, requiring O(n) group scalar multiplications. Additionally, the final check has two pairing terms.
Equivalently, excluding the cost of the original commitment C, the opening costs can be summarized as follows:
Component
Cost
Proof size
O(n) field elements
Prover work
O(2n) field operations, O(2n) group scalar mults
Verifier work
O(n) field operations, O(n) group scalar mults, two pairing terms
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.