ZK/SEC Research notes from zkSecurity
All posts
Variants of KZG · Part 3 of 3

Variants of KZG: Part III, Multilinear Commitments with Zeromorph

KZG-III Header

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 $\mathbb{F}[X_0,\ldots,X_{n-1}]^{\preceq 1}$ for the set of $n$-variate multilinear polynomials and $\mathbb{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 $\hat p(X)=\sum_jp_jX^j$, we write $\hat p^{< d}(X)=\sum_{j=0}^{d-1}p_jX^j$ for its truncation to terms of degree less than $d$.

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

$$ 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 $n$-variate multilinear polynomials to univariate polynomials of degree at most $2^n - 1$ is defined as follows:

$$ \mathcal{U}_n: \mathbb{F}[X_0,\ldots,X_{n-1}]^{\preceq 1} \rightarrow \mathbb{F}[X]^{<2^n}. $$

For a multilinear polynomial $f$, its univariate encoding is defined as

$$ \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 $f$ over the Boolean hypercube become the coefficients of the univariate polynomial. For example, when $n=2$,

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

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

  1. Linearity: For multilinear polynomials $f,g$ and scalars $\alpha,\beta\in\mathbb{F}$,
$$ \mathcal{U}_n(\alpha \cdot f+\beta \cdot g)(X) = \alpha \cdot \mathcal{U}_n(f)(X) + \beta \cdot \mathcal{U}_n(g)(X). $$
  1. One-to-one correspondence: Each evaluation $f(\vec b)$ is stored as a distinct coefficient of $\mathcal{U}_n(f)$. Thus, we can recover all the evaluations of $f$ by reading the coefficients of $\mathcal{U}_n(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 $2^n$ determine the evaluations of exactly one multilinear polynomial over the Boolean hypercube. A map with this property is called bijective.

Therefore, $\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 $\mathcal{U}_n$ to the multilinear quotient identity and get the univariate identity.

Multilinear-to-Univariate Identity

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

$$ \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 $\mathcal{U}_n$,

$$ \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 $\mathcal{U}_n(v)$, $\mathcal{U}_n(q_k)$, and $\mathcal{U}_n(X_k \cdot q_k)$.

Univariatization of $v$

Consider the constant $n$-variate multilinear polynomial defined by

$$ g(X_0, \ldots, X_{n-1}) = v. $$

It is independent of $X_0, \ldots, X_{n-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.

Multilinear Polynomial Univariate Encoding
$X_{n-1}, \ldots, X_2, X_1, X_0$ $g(X_0, X_1, X_2, \ldots, X_{n-1})$ Monomial Coefficient
$0, \ldots, 0, 0, 0$ $v$ $X^0$ $v$
$0, \ldots, 0, 0, 1$ $v$ $X^1$ $v$
$0, \ldots, 0, 1, 0$ $v$ $X^2$ $v$
$0, \ldots, 0, 1, 1$ $v$ $X^3$ $v$
$\vdots$ $\vdots$ $\vdots$ $\vdots$
$1, \ldots, 1, 1, 1$ $v$ $X^{2^n-1}$ $v$

Thus, the univariatization of $v$ is

$$ \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 $\Phi_n(X)=1+X+\cdots+X^{2^n-1}$.

Univariatization of $q_k$

Let us understand this for $k=2$, that is, for $q_2(X_0, X_1)$, which is multilinear in $X_0, X_1$ and independent of the variables $X_2, \ldots, X_{n-1}$.

Suppose the evaluations of $q_2(X_0, X_1)$ are as follows:

$$ 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 Polynomial Univariate Encoding
$X_{n-1}, \ldots, X_2, X_1, X_0$ $q_2(X_0, X_1)$ Monomial Coefficient
$0, \ldots, 0, 0, 0$ $a$ $X^0$ $a$
$0, \ldots, 0, 0, 1$ $b$ $X^1$ $b$
$0, \ldots, 0, 1, 0$ $c$ $X^2$ $c$
$0, \ldots, 0, 1, 1$ $d$ $X^3$ $d$
$0, \ldots, 1, 0, 0$ $a$ $X^4$ $a$
$0, \ldots, 1, 0, 1$ $b$ $X^5$ $b$
$0, \ldots, 1, 1, 0$ $c$ $X^6$ $c$
$0, \ldots, 1, 1, 1$ $d$ $X^7$ $d$
$\vdots$ $\vdots$ $\vdots$ $\vdots$
$1, \ldots, 1, 0, 0$ $a$ $X^{2^n-4}$ $a$
$1, \ldots, 1, 0, 1$ $b$ $X^{2^n-3}$ $b$
$1, \ldots, 1, 1, 0$ $c$ $X^{2^n-2}$ $c$
$1, \ldots, 1, 1, 1$ $d$ $X^{2^n-1}$ $d$

Thus, the univariatization of $q_2$ is

$$ \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, $\hat q_2(X)=\mathcal{U}_n(q_2)^{<4}(X)=a+bX+cX^2+dX^3$ is the truncation of $\mathcal{U}_n(q_2)$ to terms of degree less than $4$.

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

$$ \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 $\Phi_n(X)=1+X+\cdots+X^{2^n-1}$.

Univariatization of $X_k \cdot q_k$

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

Multilinear Polynomial Univariate Encoding
$X_{n-1},\ldots,X_2,X_1,X_0$ $X_2 \cdot q_2(X_0,X_1)$ Monomial Coefficient
$0,\ldots,0,0,0,0$ $0$ $X^0$ $0$
$0,\ldots,0,0,0,1$ $0$ $X^1$ $0$
$0,\ldots,0,0,1,0$ $0$ $X^2$ $0$
$0,\ldots,0,0,1,1$ $0$ $X^3$ $0$
$0,\ldots,0,1,0,0$ $a$ $X^4$ $a$
$0,\ldots,0,1,0,1$ $b$ $X^5$ $b$
$0,\ldots,0,1,1,0$ $c$ $X^6$ $c$
$0,\ldots,0,1,1,1$ $d$ $X^7$ $d$
$\vdots$ $\vdots$ $\vdots$ $\vdots$
$1,\ldots,1,0,0,0$ $0$ $X^{2^n-8}$ $0$
$1,\ldots,1,0,0,1$ $0$ $X^{2^n-7}$ $0$
$1,\ldots,1,0,1,0$ $0$ $X^{2^n-6}$ $0$
$1,\ldots,1,0,1,1$ $0$ $X^{2^n-5}$ $0$
$1,\ldots,1,1,0,0$ $a$ $X^{2^n-4}$ $a$
$1,\ldots,1,1,0,1$ $b$ $X^{2^n-3}$ $b$
$1,\ldots,1,1,1,0$ $c$ $X^{2^n-2}$ $c$
$1,\ldots,1,1,1,1$ $d$ $X^{2^n-1}$ $d$

Thus, the univariatization of $X_2 \cdot q_2$ is

$$ \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\in\{0,\ldots,n-1\}$, multiplication by $X_k$ makes the evaluation zero whenever $X_k=0$. The coefficients of $\hat q_k$ occur when $X_k=1$, starting at degree $2^k$, and repeat every $2^{k+1}$ powers. Therefore,

$$ \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 $\Phi_n(X)=1+X+\cdots+X^{2^n-1}$ and, for $k=n-1$, $\Phi_0(X)=1$.

Univariate Identity

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

$$ \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

$$ \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 $\hat f(X) = \mathcal{U}_n(f)(X)$ and $\hat q_k(X)=\mathcal{U}_n(q_k)^{<2^k}(X)$.

Note

We express the above identity in terms of $\Phi_n(X)=1+X+\cdots+X^{2^n-1}$ because the verifier can efficiently evaluate $\Phi_n(X)$ at a random point. Since $$ (X-1) \cdot \Phi_n(X) = X^{2^n} - 1, $$ the evaluation $\Phi_n(x)=(x^{2^n}-1)/(x-1)$ can be computed using $n+1$ multiplications, $2$ additions and $1$ inversion.

Define the following univariate polynomial:

$$ \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(\tau)=0$ at the randomly sampled secret setup value $\tau$, then, with high probability, $Z(X)$ is the zero polynomial and the univariate identity holds. However, the verifier cannot directly check $Z(\tau) \stackrel{?}{=} 0$ because $\tau$ is secret and the verifier cannot compute the following term for the pairing check:

$$ \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\in\mathbb{F}$ and asks the prover to prove that $Z(x)=0$. To do so, the prover constructs the following polynomial $Z_x(X)$, in which the coefficients multiplying the quotient polynomials are evaluated at $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) = Z_x(x)$. Thus, the prover proves that $Z_x(x)=0$. The verifier can compute the commitment to $Z_x$ using the commitments to $\hat f$ and the $\hat q_k$, since the commitments are additively homomorphic.

However, only checking $Z_x(x) \stackrel{?}{=} 0$ is not enough. The KZG opening will verify that $Z_x(x)=0$, but it does not ensure that each committed polynomial $\hat 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 $2^k-1$. Therefore, the protocol must additionally check that for every $k$, $\deg\left(\hat{q}_k\right)<2^k$.

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

$$ \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 $k$, $\deg\left(\hat{q}_k\right)<2^k$, then each summand on the right has degree at most $(2^n-2^k)+(2^k-1)=2^n-1$. Since $\deg\left(\Phi_n\right) = 2^n - 1$, the identity automatically implies $\deg\left(\hat{f}\right) < 2^n$. Thus, no separate degree check on $\hat{f}$ is required.

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

  • the identity check $Z_x(x)\stackrel{?}{=}0$;
  • the $n$ degree checks $\deg\left(\hat q_k\right)<2^k$ for $k\in\{0,\ldots,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.

Degree-Bounded KZG Opening

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

$$ ck=\left([1]_1,[\tau]_1,[\tau^2]_1,\ldots,[\tau^{N_{\max}-1}]_1\right). $$

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

$$ \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:

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

Multiplying both sides by $X^{N_{\max}-d}$ gives

$$ (\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 $\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:

$$ (\hat f(X)-v) \cdot X^{N_{\max}-d} \stackrel{?}{=} \hat q_{\mathrm{shift}}(X) \cdot (X-u) $$

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

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

  1. $\mathcal{P}$ sends $com_{\hat f}$ to $\mathcal{V}$.

  2. $\mathcal{V}$ samples $u \in \mathbb{F}^*$ and requests an opening at $u$.

  3. $\mathcal{P}$ sends the evaluation $v$ and the commitment $$ cm=[\hat q_{\mathrm{shift}}(\tau)]_1 =\left[\hat q(\tau)\tau^{N_{\max}-d}\right]_1. $$

  4. $\mathcal{V}$ accepts if and only if $$ 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$ and $[\tau]_2$, the verifier key contains the higher power $[\tau^{N_{\max}-d}]_2$.

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

$$ \hat q_{\mathrm{shift}}(X)=(\hat f(X)-v) \cdot X^{N_{\max}-d-1}. $$

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

$$ \hat q_{\mathrm{shift}}(X) \cdot X \stackrel{?}{=} (\hat f(X)-v) \cdot X^{N_{\max}-d} $$

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

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

$$ \deg(\hat q_{\mathrm{shift}}) \geq d+(N_{\max}-d) =N_{\max}. $$

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

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

Batched Degree-Check Protocol

For univariate polynomials $\hat q_0(X),\ldots,\hat q_{n-1}(X)$, the goal is to prove that

$$ \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^*\geq\max_k d_k$ and $y\in\mathbb{F}$ be the random challenge. For $\hat q_k$ with $\deg(\hat q_k)\leq d_k$, the shifted polynomial is

$$ X^{d^*-d_k+1} \cdot \hat q_k(X). $$

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

$$ \hat Q(X) = \sum_{k=0}^{n-1}y^k \cdot X^{d^*-d_k+1} \cdot \hat q_k(X). $$

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

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

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

$$ \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(\zeta_x)\leq d^*+1$: This proves that $\deg(\hat Q)\leq d^*+1$, which implies that $\deg(\hat q_k)\leq d_k$.
  • $\zeta_x(x)=0$: This proves that the commitment to $\hat Q$ is consistent with the commitments to the $\hat q_k$.

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

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

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

$$ \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 $\hat H_x(x)=0$ and $\deg(\hat H_x)\leq2^n-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.

End-to-End Opening Protocol

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

  1. $\mathcal{P}$ computes the univariate encoding of $f$, $$ \hat f(X)=\mathcal U_n(f)(X) $$ and sends the commitment $C=[\hat f(\tau)]_1$ to $\mathcal{V}$.

  2. $\mathcal{V}$ samples $(u_0, \ldots, u_{n-1})\xleftarrow{\$}\mathbb F^n$ and sends it to $\mathcal{P}$.

  3. $\mathcal{P}$ computes the multilinear quotient polynomials $q_0,\ldots,q_{n-1}$ and their univariate encodings $$ \hat q_k(X)=\mathcal U_n(q_k)^{<2^k}(X). $$ It sends the commitments $ C_k=[\hat q_k(\tau)]_1, \; k\in{0,\ldots,n-1}, $ and the evaluation $v$ to $\mathcal V$.

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

  5. $\mathcal P$ computes the shifted random linear combination $$ \hat Q(X) = \sum_{k=0}^{n-1} y^kX^{2^n-d_k-1}\hat q_k(X) $$ and sends its commitment $ C_{\hat Q}=[\hat Q(\tau)]_1 $ to $\mathcal V$.

  6. $\mathcal V$ samples $x\xleftarrow{\$}\mathbb F^*$ (a nonzero opening point) and $z\xleftarrow{\$}\mathbb F$ (used to batch $Z_x$ and $\zeta_x$), and sends both challenges to $\mathcal P$. Using the homomorphic property of KZG commitments, $\mathcal V$ computes the commitments to $Z_x$ and $\zeta_x$ as follows: $$ \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 $\mathcal V$ combines the two commitments as $$ C_{\hat H_x}=C_{\zeta_x}+ z \cdot C_{Z_x}. $$

  7. $\mathcal P$ computes the corresponding polynomials $Z_x$ and $\zeta_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 $\mathcal P$ combines the two polynomials as $$ \hat H_x(X) = \zeta_x(X) + z \cdot Z_x(X). $$

  1. $\mathcal P$ and $\mathcal V$ run the degree-bounded KZG opening protocol on $C_{\hat H_x}$, with opening point $x$, claimed evaluation $0$, and degree bound $2^n-1$. This proves $$ \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 $n$-variate multilinear polynomial with $2^n$ coefficients, the complexity of the opening protocol is explained as follows.

  • Proof Size: The prover sends the $n$ quotient commitments $C_0,\ldots,C_{n-1}$, the commitment $C_{\hat Q}$ and the final opening proof $\pi$. Therefore, the proof contains $n+2$ elements in $\mathbb{G}_1$. Assuming each $\mathbb{G}_1$ 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(\vec u)$ requires $O(2^n)$ field operations. Committing to $f$ requires an MSM of size $2^n$, while committing to all the quotient polynomials requires MSMs with a combined size of $2^n-1$. The same bounds apply to the univariate encodings $\hat f$ and $\hat q_k$ because they contain the same number of coefficients.
    • Compute the batched polynomials: The quotient encodings contain $2^n-1$ coefficients in total, and each batching or division step makes a linear pass over at most $2^n$ coefficients. Therefore, computing $\hat Q$, $Z_x$, $\zeta_x$, $\hat H_x$, and the final opening quotient requires $O(2^n)$ field operations.
    • Commit to $\hat Q$: Every shifted term $X^{2^n-d_k-1}\hat q_k(X)$ ends at degree at most $2^n-1$. Thus, computing $C_{\hat Q}$ requires at most $2^n-1$ group scalar multiplications.
    • Compute quotient commitment in degree-bound KZG: The polynomial $\hat H_x$ has degree at most $2^n-1$, so its opening quotient has at most $2^n-1$ coefficients. Computing the shifted commitment $\pi$ therefore requires an MSM of size at most $2^n-1$.
  • Verifier Cost: The verifier receives the quotient commitments $C_0,\ldots,C_{n-1}$ from the prover. It computes the field values needed to form $C_{Z_x}$ and $C_{\zeta_x}$, including the required powers of $x$ and $y$ and the evaluations of the $\Phi_i$. This requires $O(n)$ field operations. The verifier then forms $C_{Z_x}$ and $C_{\zeta_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(2^n)$ field operations, $O(2^n)$ group scalar mults
Verifier work $O(n)$ field operations, $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.

Keep reading
Recommended

Variants of KZG: Part II, Multilinear Commitments with PST

In this blog post, we extend the ideas behind univariate KZG commitments to multilinear polynomials through the PST commitment scheme. We derive the multilinear quotient identity, explain how PST commits to and opens multilinear polynomials using a specialized multilinear setup and walk through its opening protocol. We conclude by examining the proof size, prover and verifier costs, and the limitations that motivate other multilinear polynomial commitment schemes.

Varun Thakore · July 28, 2026

Variants of KZG: Part I, Univariate

In this blog post, we dive into the world of polynomial commitment schemes (PCS), which are crucial for constructing most practical SNARKs. We cover the basics of how PCS works, focusing on KZG10, known for its efficiency in proof size and verification time. You'll learn about the essential properties of binding and hiding and explore technical concepts like homomorphism, batching, and unconditionally hiding. We break down various methods to achieve these features, offering insight into how PCS maintains the security and privacy of polynomials in cryptographic systems. Get ready to understand these powerful concepts and their applications in modern cryptography!

Varun Thakore · April 28, 2025

KZG vs IPA vs FRI: Picking the Right Polynomial Commitment Scheme

A practical guide to the trade-offs between KZG, IPA/Halo, and FRI, the three major polynomial commitment scheme families powering modern zero-knowledge proof systems. We compare proof sizes, verification costs, trust assumptions, benchmarks, and on-chain gas costs.

ZK/SEC, University of Padua · March 23, 2026
More to explore

Common Circom Pitfalls and How to Dodge Them, Part 2

This post is the second part of our series on Circom pitfalls. While part 1 covered issues with assertions, hints, and aliasing, this one explores unsafe component usage and the subtle fact that Circom’s comparison operators work over signed integers.

Marco Besier · November 10, 2025

Exploring Leo: A Primer on Aleo Program Security

In this blog post, we dive into Aleo, a blockchain platform that leverages zero-knowledge cryptography for creating private and scalable decentralized applications. You'll discover how Leo, its Rust-like programming language, simplifies app development by allowing developers to focus on robust privacy features without delving deep into cryptographic complexities. We also explore Leo's unique design, offering practical tips on avoiding common pitfalls and potential vulnerabilities like underflows and unauthorized access. Whether you're a developer curious about building privacy-focused solutions or just intrigued by blockchain innovation, you'll find valuable insights here.

Suneal Gong · August 07, 2024

Playing with LaBRADOR: Building Compact Lattice-based Proofs with Recursion

In this post, we explore LaBRADOR, a transparent, lattice-based proof system that achieves sublinear proof sizes through recursion. Built on the Module-SIS assumption, LaBRADOR lets a prover efficiently demonstrate knowledge of short vectors satisfying dot product constraints, general enough to express R1CS. The protocol’s key ideas include amortized openings, outer commitments, and a strategy to shrink the witness after each round of recursion. Together, these techniques make LaBRADOR a powerful, scalable framework for post-quantum zero-knowledge proofs.

Georgios Raikos · November 13, 2025