Range Proof

A range proof in the context of inner product arguments is a proof that the scalar vv has been committed to VV and vv is less than 2n2^n for some non-negative integer nn.

This article shows how the Bulletproofs paper constructs such a proof. The high level idea is that if we can prove that a vector aL\mathbf{a}_L consists only of ones and zeros and that aL\mathbf{a}_L is the binary representation of vv, then vv must be less than 2n2^n. This is analogous to saying that a number that fits in an 8 bit unsigned integer must be less than 256.

The advantage of using Bulletproofs for range proofs is that the range proof can be directly constructed without the need of an arithmetic circuit.

Monero uses Bulletproof Range Proofs (the algorithm presented here) to ensure that the sum of transactions is not negative (in a finite field, the negative numbers are the elements greater than p/2p/2 as they are additive inverses of the elements less than or equal p/2p/2 where pp is the field order).

This article is part of a series on ZK Bulletproofs.

Notation

0n\mathbf{0}^n is an nn dimensional vector of all zeros.

1n\mathbf{1}^n is an nn dimensional vector of all ones.

2n\mathbf{2}^n is an nn dimensional vector [1,2,4,8,...,2n1][1,2,4,8,...,2^{n-1}]

yn\mathbf{y}^n is an nn dimensional vector [1,y,y2,y3,...,yn1][1, y, y^2, y^3, ..., y^{n-1}]

yn\mathbf{y}^{-n} is an nn dimensional vector [1,y1,y2,...,y(n1)][1, y^{-1}, y^{-2}, ..., y^{-(n-1)}]

Note that ynyn=1n\mathbf{y}^n\circ\mathbf{y}^{-n}=\mathbf{1}^n.

Range proof overview

Proving that VV is a commitment to a scalar with a value less than 2n2^n requires proving the following:

  1. aL\mathbf{a}_L is binary (only holds values 00 and 11).
  2. The inner product aL,2n=v\langle \mathbf{a}_L,\mathbf{2}^n\rangle=v.

The second point is easy to prove, we do a normal inner product proof then reveal 2n\mathbf{2}^n is one of the vectors in the commitment – or have the verifier construct the commitment of 2n\mathbf{2}^n themselves. However, proving that aL\mathbf{a}_L is binary without an arithmetic circuit requires a couple algebraic tricks.

Four useful tricks

The bulletproofs paper implicitly uses four algebraic tricks that are best taught explicitly before looking at the range proof algorithm directly.

1. Proving aL\mathbf{a}_L is binary

The statement aL\mathbf{a}_L is binary is equivalent to the following two assertions:

  • aR=aL1n\mathbf{a}_R = \mathbf{a}_L-\mathbf{1}^n
  • aLaR=0n\mathbf{a}_L \circ \mathbf{a}_R = \mathbf{0}^n

For example, if aL=[1,0,0,1]\mathbf{a}_L = [1,0,0,1] then aR=[0,1,1,0]\mathbf{a}_R=[0,-1,-1,0].

In this case, aLaR=0n\mathbf{a}_L \circ\mathbf{a}_R=\mathbf{0}^n because

[1,0,0,1][0,1,1,0]=[0,0,0,0]=0n[1,0,0,1] \circ [0,-1,-1,0] = [0,0,0,0] = \mathbf{0}^n

Now consider a case where aL\mathbf{a}_L is not binary, for example [2,1,0,0][2, 1, 0, 0]. aR\mathbf{a}_R will be [1,0,1,1][1,0,-1,-1] The Hadamard product of aL\mathbf{a}_L and aR\mathbf{a}_R will be [2,0,0,0]0n[2,0,0,0] \neq \mathbf{0}^n.

More generally, if aL\mathbf{a}_L has a non-binary entry, that entry will be subtracted by 11, and the resulting entry in aR\mathbf{a}_R will be non-zero. When the Hadamard product is computed, then at that particular index, aL\mathbf{a}_L and aR\mathbf{a}_R will both be non-zero and the product will be non-zero, meaning aLaR0n\mathbf{a}_L \circ \mathbf{a}_R \neq \mathbf{0}^n.

However, if a particular entry in aL\mathbf{a}_L is 11, then aR\mathbf{a}_R will be 00 at that index so that the Hadamard product at that index will be zero, too.

Finally, if a particular entry in aL\mathbf{a}_L is 00, then aR\mathbf{a}_R will be 1-1 at that index and their element-wise product will still be zero at that index.

Therefore, if aL\mathbf{a}_L is binary and aR\mathbf{a}_R is computed as aR=aL1\mathbf{a}_R = \mathbf{a}_L-\mathbf{1}, then aLaR=0n\mathbf{a}_L \circ \mathbf{a}_R = \mathbf{0}^n.

2. Proving a vector is all zero

Suppose we wish to prove that the Pedersen commitment AA holds a zero vector. We create the Pedersen commitment A=a,G+αBA = \langle\mathbf{a},\mathbf{G}\rangle + \alpha B and wish to prove to a verifier that a=0n\mathbf{a}=\mathbf{0}^n.

It might seem sufficient to simply send the blinding term α\alpha, but to make our solution more composable, we do not want to reveal the blinding term because that might affect other commitments we have created.

Instead, the prover sends AA to the verifier, and the verifier responds a vector full of random values r\mathbf{r}. The prover must now prove that

a,r=0\langle\mathbf{a},\mathbf{r}\rangle = 0

Note that this is a probabilistic test. It is possible, with negligible probability, that a,r=0\langle\mathbf{a},\mathbf{r}\rangle=0 for a0n\mathbf{a}\neq\mathbf{0}^n, but it is not possible for the prover to forge such an a\mathbf{a} because they do not know in advance what r\mathbf{r} will be.

However, transmitting r\mathbf{r} requires O(n)\mathcal{O}(n) communication overhead, so the verifier instead only sends a single random element yy and the prover computes yn\mathbf{y}^n and uses yn\mathbf{y}^n as a the random vector.

Then, the prover proves that a,yn=0\langle\mathbf{a},\mathbf{y}^n\rangle=0.

3. Proving an inner product is of the form aL,aRyn\langle\mathbf{a}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle where yy is chosen by the verifier and the prover computes yn\mathbf{y}^n

We don’t yet have a mechanism to prove that aLaR=0n\mathbf{a}_L\circ\mathbf{a}_R=\mathbf{0}^n, as that is a Hadamard product, not an inner product. However, stating the vector aLaR\mathbf{a}_L\circ\mathbf{a}_R is identically 0n\mathbf{0}^n is the same as stating that aLaR,yn=0\langle\mathbf{a}_L\circ\mathbf{a}_R,\mathbf{y}^n\rangle=0. By the inner product rules, we can move aR\mathbf{a}_R to the other side of the inner product and we now have aL,aRyn=0\langle\mathbf{a}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle=0.

The verifier will receive commitments to aL\mathbf{a}_L and aR\mathbf{a}_R, not aRyn\mathbf{a}_R\circ\mathbf{y}^n. It will be up to the verifier to construct a commitment to aRyn\mathbf{a}_R\circ\mathbf{y}^n so they are convinced the prover used aRyn\mathbf{a}_R\circ\mathbf{y}^n as the second vector in the inner product.

The key trick we rely on is that the prover uses the basis vectors G\mathbf{G} and H\mathbf{H} to commit their vectors, but the verifier uses G\mathbf{G} and Hyn\mathbf{H}\circ\mathbf{y}^{-n}.

When the prover sends the evaluation ru\mathbf{r}_u, the prover must ensure that yn\mathbf{y}^n terms will cancel with the yn\mathbf{y}^{-n} in the verifier’s basis vector ynH\mathbf{y}^{-n}\circ\mathbf{H}.

Specifically, the prover constructs the commitments

A=aL,G+aR,H+αBS=sL,G+sR,H+βB\begin{align*} A &= \langle\mathbf{a}_L,\mathbf{G}\rangle+\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B\\ S &= \langle\mathbf{s}_L,\mathbf{G}\rangle+\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B \end{align*}

And sends (A,S)(A, S) to the verifier. There is no need to commit and send VV because it is zero in this case.

The prover’s polynomials will be

l(x)=aL+sLxr(x)=aRyn+sRynx\begin{align*} \mathbf{l}(x)&=\mathbf{a}_L + \mathbf{s}_Lx\\ \mathbf{r}(x)&=\mathbf{a}_R\circ\mathbf{y}^n + \boxed{\mathbf{s}_R\circ\mathbf{y}^n}x \end{align*}

Crucially, the prover has Hadamard multiplied sR\mathbf{s}_R by yn\mathbf{y}^n. Previously, r(x)\mathbf{r}(x) was computed as r(x)=aRyn+sRx\mathbf{r}(x)=\mathbf{a}_R\circ\mathbf{y}^n + \mathbf{s}_Rx (without the ynsR\mathbf{y}^n\circ\mathbf{s}_R. This will later allow all of the yn\mathbf{y}^n terms to be canceled when the verifier computes the commitment ru,ynH\langle\mathbf{r}_u,\mathbf{y}^{-n}\circ\mathbf{H}\rangle. Under the hood, ru\mathbf{r}_u is (aR+sRu)yn(\mathbf{a}_R+\mathbf{s}_Ru)\circ\mathbf{y}^n so the yn\mathbf{y}^n will cancel when the verifier computes (aR+sRu)yn,ynH\langle(\mathbf{a}_R+\mathbf{s}_Ru)\circ\mathbf{y}^n,\mathbf{y}^{-n}\circ\mathbf{H}\rangle, i.e.

(aR+sRu)yn,ynH=(aR+sRu),ynynH=(aR+sRu),1nH=(aR+sRu),H\begin{align*} &\langle(\mathbf{a}_R+\mathbf{s}_Ru)\circ\mathbf{y}^n,\mathbf{y}^{-n}\circ\mathbf{H}\rangle\\ &=\langle(\mathbf{a}_R+\mathbf{s}_Ru),\mathbf{y}^n\circ\mathbf{y}^{-n}\circ\mathbf{H}\rangle\\ &=\langle(\mathbf{a}_R+\mathbf{s}_Ru),\mathbf{1}^n\circ\mathbf{H}\rangle\\ &=\langle(\mathbf{a}_R+\mathbf{s}_Ru),\mathbf{H}\rangle \end{align*}

However, the prover cannot compute l(x)\mathbf{l}(x) or r(x)\mathbf{r}(x) yet because the verifier hasn’t sent yy yet. Therefore, after receiving (A,S)(A, S) the verifier sends yy and the prover computes yn\mathbf{y}^n and computes the polynomial t(x)t(x):

t(x)=l(x),r(x)=aL,aRyn+t1x+t2x2t(x)=\langle\mathbf{l}(x),\mathbf{r}(x)\rangle=\langle\mathbf{a}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle+t_1x+t_2x^2

where

t1=aL,sRyn+sL,aRynt2=sL,sRyn\begin{align*} t_1&=\langle\mathbf{a}_L,\mathbf{s}_R\circ\mathbf{y}^n\rangle + \langle\mathbf{s}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle\\ t_2&=\langle\mathbf{s}_L,\mathbf{s}_R\circ\mathbf{y} ^n\rangle \end{align*}

The prover commits to the coefficients t1t_1 and t2t_2 as

T1=t1G+τ1BT2=t2G+τ2B\begin{align*} T_1&=t_1G+\tau_1B\\ T_2&=t_2G+\tau_2B \end{align*}

and sends (T1,T2)(T_1, T_2) to the verifier. The verifier responds with uu and the prover evaluates the vector polynomials l(x)\mathbf{l}(x) and r(x)\mathbf{r}(x):

lu=aL+sLuru=aRyn+(sRyn)utu=lu,ruπlr=α+βuπt=τ1u+τ2u2\begin{align*} \mathbf{l}_u&= \mathbf{a}_L+\mathbf{s}_Lu\\ \mathbf{r}_u&= \mathbf{a}_R\circ\mathbf{y}^n+(\mathbf{s}_R\circ\mathbf{y}^n)u\\ t_u&=\langle\mathbf{l}_u,\mathbf{r}_u\rangle\\ \pi_{lr}&=\alpha + \beta u\\ \pi_t&=\tau_1u+\tau_2u^2 \end{align*}

Note that πt\pi_t only includes the blinding terms for t1t_1 and t2t_2. In the previous implementation, πt\pi_t was computed as γ+τ1u+τ2u2\gamma + \tau_1u+\tau_2u^2, where γ\gamma is the blinding term for VV, which is also the constant coefficient of the polynomial t(x)t(x).

There is no blinding term γ\gamma because there is no commitment to VV, i.e. vv is not secret – it is 00. The prover sends (lu,ru,tu,πlr,πt)(\mathbf{l}_u, \mathbf{r}_u, t_u, \pi_{lr}, \pi_t) and the verifier checks that:

tu=?lu,ruA+Su=?lu,G+ru,ynH+πlrBtuG=?T1u+T2u2πtB\begin{align*} t_u&\stackrel{?}=\langle\mathbf{l}_u,\mathbf{r}_u\rangle\\ A+Su&\stackrel{?}=\langle\mathbf{l}_u,\mathbf{G}\rangle+\langle\mathbf{r}_u,\mathbf{y}^{-n}\circ\mathbf{H}\rangle+\pi_{lr}B\\ t_uG&\stackrel{?}{=} T_1 u + T_2 u^2 - \pi_t B\\ \end{align*}

The first crucial difference is that the commitment to ru\mathbf{r}_u is done with respect to the basis vector ynH\mathbf{y}^{-n}\circ\mathbf{H} instead of H\mathbf{H} for the reasons discussed earlier.

Second, tuG=?T1u+T2u2πtBt_uG\stackrel{?}{=} T_1 u + T_2 u^2 - \pi_t B has no constant commitment. Normally, the equation is tuG=?V+T1u+T2u2πtBt_uG\stackrel{?}{=} \boxed{V}+T_1 u + T_2 u^2 - \pi_t B, but VV is a commitment to 00 in this case.

In general, if VV contains values known to the verifier, the verifier can construct the commitment to VV as we show in the next section.

4. Proving an inner product when an additive public constant is involved

As alluded in the section above, the verifier can reconstruct commitments if the verifier knows the underlying vector.

For example, suppose we are proving that

aL+j,aRyn+k=vz\langle\mathbf{a}_L + \mathbf{j},\mathbf{a}_R\circ\mathbf{y}^n + \mathbf{k}\rangle=vz

where j\mathbf{j} and k\mathbf{k} are a vectors known to the verifier and zz is a scalar known to the verifier in advance. Unlike yn\mathbf{y}^n, these vectors and scalar are known before the proof begins. Note that k\mathbf{k} is not Hadamard multiplied by yn\mathbf{y}^n in this example.

The prover still only commits to the secret values aL\mathbf{a}_L, aR\mathbf{a}_R and vv as usual:

A=aL,G+aR,H+αBS=sL,G+sR,H+βBV=vG+γB\begin{align*} A &= \langle\mathbf{a}_L,\mathbf{G}\rangle+\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B\\ S &= \langle\mathbf{s}_L,\mathbf{G}\rangle+\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B\\ V &= vG + \gamma B \end{align*}

As usual, the polynomials l(x)\mathbf{l}(x) and r(x)\mathbf{r}(x) are such that the constant term is the vector from the original inner product and the linear terms are sL\mathbf{s}_L and sR\mathbf{s}_R. Upon receiving yy from the verifier, the prover computes yn\mathbf{y}^n and crafts but does not evaluate l(x)\mathbf{l}(x) and r(x)\mathbf{r}(x):

l(x)=aL+jleft vector+sLxr(x)=aRyn+kright vector+sRynx\begin{align*} \mathbf{l}(x)&=\underbrace{\mathbf{a}_L + \mathbf{j}}_\text{left vector} + \mathbf{s}_Lx\\ \mathbf{r}(x)&=\underbrace{\mathbf{a}_R\circ\mathbf{y}^n + \mathbf{k}}_\text{right vector} + \boxed{\mathbf{s}_R\circ\mathbf{y}^n}x \end{align*}

Note that k\mathbf{k} is not Hadamard multiplied with yn\mathbf{y}^n, but the linear term sR\mathbf{s}_R still is. We will show how the verifier handles this later.

For now, we compute t(x)t(x) as

t(x)=vz+t1x+t2x2t(x)=vz+t_1x+t_2x^2

where

t1=aL+j,sRyn+sL,aRyn+kt2=sL,sRyn\begin{align*} t_1&=\langle\mathbf{a}_L+\mathbf{j},\mathbf{s}_R\circ\mathbf{y}^n\rangle + \langle\mathbf{s}_L,\mathbf{a}_R\circ\mathbf{y}^n+\mathbf{k}\rangle\\ t_2&=\langle\mathbf{s}_L,\mathbf{s}_R\circ\mathbf{y} ^n\rangle \end{align*}

Note that the constant term in t(x)t(x) is vzvz and not vv. The commitments are computed as

T1=t1G+τ1BT2=t2G+τ2B\begin{align*} T_1 &= t_1G+\tau_1B\\ T_2 &= t_2G+\tau_2B\\ \end{align*}

and sent to the verifier who then sends the random value uu.

The prover computes:

lu=aLyn+j+(sLyn)uru=aRyn+k+sRutu=lu,ruπlr=α+βuπt=vz+τ1u+τ2u2\begin{align*} \mathbf{l}_u&= \mathbf{a}_L\circ\mathbf{y}^n+\mathbf{j}+(\mathbf{s}_L\circ\mathbf{y}^n)u\\ \mathbf{r}_u&= \mathbf{a}_R\circ\mathbf{y}^n+\mathbf{k}+\mathbf{s}_Ru\\ t_u&=\langle\mathbf{l}_u,\mathbf{r}_u\rangle\\ \pi_{lr}&=\alpha + \beta u\\ \pi_t&=vz+\tau_1u+\tau_2u^2 \end{align*}

Note that the constant term in πt\pi_t is γz\gamma z. The prover sends (lu,ru,tu,πlr,πt)(\mathbf{l}_u,\mathbf{r}_u,t_u,\pi_{lr},\pi_t). Finally, the verifier computes:

tu=?lu,ruA+Su+j,Gcommitment to j in l(x)+k,ynHcommitment to k in r(x)=?lu,G+ru,ynH+πlrBtuG=?Vz+T1u+T2u2πtB\begin{align*} t_u&\stackrel{?}=\langle\mathbf{l}_u,\mathbf{r}_u\rangle\\ A+Su+\underbrace{\langle\mathbf{j,\mathbf{G}}\rangle}_{\text{commitment to } \mathbf{j} \text{ in } \mathbf{l}(x)}+\underbrace{\langle\mathbf{k},\mathbf{y}^{-n}\circ\mathbf{H}\rangle}_{\text{commitment to } \mathbf{k} \text{ in } \mathbf{r}(x)}&\stackrel{?}=\langle\mathbf{l}_u,\mathbf{G}\rangle+\langle\mathbf{r}_u,\mathbf{y}^{-n}\circ\mathbf{H}\rangle+\pi_{lr}B\\ t_uG&\stackrel{?}{=} Vz+ T_1 u + T_2 u^2 - \pi_t B\\ \end{align*}

lu\mathbf{l}_u and ru\mathbf{r}_u contain j\mathbf{j} and k\mathbf{k} respectively, but AA and SS do not. Hence, the verifier computes commitments to those vectors and adds them to the commitments AA and SS. In the case of k\mathbf{k}, the basis vector ynH\mathbf{y}^{-n}\circ\mathbf{H} will cause k\mathbf{k} to become kyn\mathbf{k}\circ\mathbf{y}^{-n}, so the commitment must be computed with respect to ynH\mathbf{y}^{-n}\circ\mathbf{H}. Finally, the blinding term πt\pi_t contains vzvz but VV does not contain zz. Therefore, the prover must multiply VV by zz.

By computing j,G\langle\mathbf{j},\mathbf{G}\rangle, k,ynH\langle\mathbf{k},\mathbf{y}^n\circ\mathbf{H}\rangle and VzVz, the verifier can be sure the inner product computation actually included those terms.

Range proof

To prove that VV is a value less than 2n2^n we have three things to prove:

  • the inner product aL,2n=V\langle \mathbf{a}_L,\mathbf{2}^n\rangle = V, i.e. aL\mathbf{a}_L is the binary representation of vv
  • aR=aL1\mathbf{a}_R=\mathbf{a}_L-\mathbf{1}
  • aLaR=0\mathbf{a}_L \circ \mathbf{a}_R = \mathbf{0}

The last two claims are not directly in the form of an inner product. However, we can modify them slightly to accomplish this. What we are really saying is that the vectors

  • aRaL+1\mathbf{a}_R - \mathbf{a}_L+\mathbf{1}
  • aLaR\mathbf{a}_L\circ\mathbf{a}_R

are both 0n\mathbf{0}^n. We can use the trick from a previous section to prove that they are zero. That is, the the prover needs to establish that

aLaR,yn=0\langle\mathbf{a}_L\circ\mathbf{a}_R,\mathbf{y}^n\rangle=\mathbf{0}

and

aRaL+1,yn=0\langle \mathbf{a}_R - \mathbf{a}_L+\mathbf{1},\mathbf{y}^n\rangle=\mathbf{0}

where yn\mathbf{y}^n is the random vector derived from the yy value sent from the verifier.

The original bulletproofs paper slightly modifies the first claim as follows so that we can use the third trick in the previous section:

aL,aRyn=0\langle\mathbf{a}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle=\mathbf{0}

Therefore, the prover has three inner products to establish:

  1. aL,2n=v\langle \mathbf{a}_L,\mathbf{2}^n\rangle = v
  2. aL,aRyn=0n\langle\mathbf{a}_L,\mathbf{a}_R\circ\mathbf{y}^n\rangle=\mathbf{0}^n
  3. aL1naR,yn=0n\langle\mathbf{a}_L -\mathbf{1}^n- \mathbf{a}_R,\mathbf{y}^n\rangle=\mathbf{0}^n

Combining three inner products into one

The three inner products can be combined into a single one using a random linear combination with randomness zz provided from the verifier.

z2aL,2n+z1aL1naR,yn+z0aL,aRyn=z2v+z10n+z00nz^2 \cdot \langle \mathbf{a_L}, 2^n \rangle + z^1 \cdot \langle \mathbf{a_L} - \mathbf{1}^n - \mathbf{a_R}, \mathbf{y}^n \rangle + z^0\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle = z^2 \cdot v + z^1\cdot\mathbf{0}^n+z^0\cdot\mathbf{0}^n
z2aL,2n+zaL1naR,yn+aL,aRyn=z2vz^2 \cdot \langle \mathbf{a_L}, 2^n \rangle + z \cdot \langle \mathbf{a_L} - \mathbf{1}^n - \mathbf{a_R}, \mathbf{y}^n \rangle + \langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle = z^2 \cdot v

With some very hefty inner product algebra, we can combine all the inner products as follows. We show the derivation in the appendix.

aLz1n,ynaR+ynz+z22n=z2v+(zz2)1n,ynz31n,2n\left\langle \mathbf{a_L} - z \cdot \mathbf{1}^n, \mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n \right\rangle = z^2 \cdot v + (z - z^2) \cdot \langle \mathbf{1}^n, y^n \rangle - z^3 \langle \mathbf{1}^n, 2^n \rangle

The terms in boxes below contain values known to the verifier, so we will construct our verification algorithm to explicitly check for those values. That is, the verifier will compute commitments to the values in the boxed terms, not the prover:

aLz1n,ynaR+ynz+z22n=z2v+(zz2)1n,ynz31n,2n\left\langle \mathbf{a_L} - \boxed{z \cdot \mathbf{1}^n}, \mathbf{y}^n \circ \mathbf{a_R} + \boxed{\mathbf{y}^n\cdot z + z^2 \cdot 2^n }\right\rangle = \boxed{z^2} \cdot v + \boxed{(z - z^2) \cdot \langle \mathbf{1}^n, y^n \rangle - z^3 \langle \mathbf{1}^n, 2^n \rangle}

To save space, the Bulletproofs paper refers to the term (zz2)1n,ynz31n,2n(z - z^2) \cdot \langle \mathbf{1}^n, y^n \rangle - z^3 \langle \mathbf{1}^n, 2^n \rangle as δ(y,z)\delta(y,z), so the inner product can be written as

aLz1n,ynaR+ynz+z22n=z2v+δ(y,z)\left\langle \mathbf{a_L} - z \cdot \mathbf{1}^n, \mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n \right\rangle = z^2 \cdot v + \delta(y,z)

Note that δ(y,z)\delta(y,z) is a value the verifier can compute.

Range Proof Algorithm

The prover chooses vv and it’s binary representation aL\mathbf{a}_L and computes aR=aL1\mathbf{a}_R = \mathbf{a}_L - \mathbf{1}.

The prover then randomly chooses the blinding term α\alpha and computes the combined commitment of aL\mathbf{a}_L and aR\mathbf{a}_R using basis vectors G\mathbf{G} and H\mathbf{H} as

A=aL,G+aR,H+αBA = \langle\mathbf{a}_L,\mathbf{G}\rangle+\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B

The prover then chooses the linear terms of the soon-to-be-created vector polynomials l(x)\mathbf{l}(x) and r(x)\mathbf{r}(x) as sL\mathbf{s}_L and sR\mathbf{s}_R and commits to them

S=sL,G+sR,H+βBS = \langle\mathbf{s}_L,\mathbf{G}\rangle+\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B

The prover commits the inner product to VV as with respect to GG of an unknown discrete log (unrelated to G\mathbf{G}):

V=vG+γBV = vG+\gamma B

The prover sends (A,S,V)(A, S, V) to the verifier.

The verifier responds with random values (y,z)(y, z) which the prover will use to combine the three inner products into a single one.

aLz1n,ynaR+ynz+z22n=z2v+δ(y,z)\left\langle \mathbf{a_L} - z \cdot \mathbf{1}^n, \mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n \right\rangle = z^2 \cdot v + \delta(y,z)

The left part of the inner product aLz1\mathbf{a}_L-z\cdot\mathbf{1} will be the constant term of l(x)\mathbf{l}(x) and ynaR+ynz+z22n\mathbf{y}^n \circ\mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n will be the constant term of r(x)\mathbf{r}(x).

Thus, we construct l(x)\mathbf{l}(x) as

l(x)=aLz1constant term+sLx\mathbf{l}(x)=\underbrace{\mathbf{a}_L-z\cdot\mathbf{1}}_\text{constant term}+\mathbf{s}_Lx

and we construct r(x)\mathbf{r}(x) as

r(x)=yn(aR+z1)+z22nconstant term+ynsRx\mathbf{r}(x)=\underbrace{\mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n}_\text{constant term}+\mathbf{y}^n\circ\mathbf{s}_Rx

Note that we element-wise multiplied sRx\mathbf{s}_Rx with yn\mathbf{y}^n for the reasons we discussed in part 3 of the prerequisites section above.

The prover can now construct t(x)=l(x),r(x)t(x) = \langle\mathbf{l}(x),\mathbf{r}(x)\rangle with constant coefficient t0t_0, linear coefficient t1t_1 and quadratic coefficient t2t_2 as:

t0=aLz1n,ynaR+ynz+z22nt1=(aLz1),ynsR+yn(aR+z1)+z22n,sLt2=sL,ynsR\begin{align*} t_0 &= \left\langle \mathbf{a_L} - z \cdot \mathbf{1}^n, \mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n \right\rangle\\ t_1 &= \langle(\mathbf{a}_L-z\cdot\mathbf{1}),\mathbf{y}^n\circ\mathbf{s}_R\rangle+\langle\mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n,\mathbf{s_L}\rangle\\ t_2 &= \langle\mathbf{s}_L,\mathbf{y}^n\circ\mathbf{s}_R\rangle \end{align*}

where t(x)=t0+t1x+t2x2t(x) = t_0 + t_1x + t_2x^2

The prover sends commitments to t1t_1 and t2t_2 as

T1=t1G+τ1BT2=t2G+τ2B\begin{align*} T_1 &= t_1G+\tau_1B\\ T_2 &= t_2G+\tau_2B \end{align*}

There is no need to commit to t0t_0 – observe that it is exactly the inner product we are trying to prove, so the verifier already has the commitment as VV.

The verifier sends randomness uu and the prover computes

lu=l(u)ru=r(u)tu=t(u)πlr=α+βuπt=z2γ+τ1u+τ2u2\begin{align*} \mathbf{l}_u &= \mathbf{l}(u) \\ \mathbf{r}_u &= \mathbf{r}(u) \\ t_u &= \mathbf{t}(u)\\ \pi_{lr} &=\alpha+\beta u\\ \pi_t &= z^2\gamma + \tau_1u + \tau_2u^2\\ \end{align*}

Note that the constant term of πt\pi_t is multiplied by z2z^2 to reflect the z2vz^2\cdot v term of the original inner product.

The verifier then computes a new basis vector Hy1=ynH\mathbf{H}_{\mathbf{y}^{-1}}=\mathbf{y}^{-n}\circ\mathbf{H} and runs the following checks:

tu=?lu,rut_u \stackrel{?}{=} \langle \mathbf{l}_u, \mathbf{r}_u \rangle

A+Su+z1n,G+zyn+z22n,Hy1=?lu,G+ru,Hy1+πlrBA + Su + \boxed{\langle -z\cdot\mathbf{1}^n,\mathbf{G}\rangle} + \boxed{\langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle}\stackrel{?}{=} \langle \mathbf{l}_u, \mathbf{G} \rangle + \langle \mathbf{r}_u, \mathbf{H}_{y^{-1}} \rangle + \pi_{lr} B

tuG+πtB=Vz2+δ(y,z)G+T1u+T2u2t_uG+\pi_tB=V\boxed{z^2}+\boxed{\delta(y,z)}\cdot G+T_1u+T_2u^2

Recall that the prover did not commit the entire vectors they used for the left and right side of the inner product, but only aL\mathbf{a}_L and bL\mathbf{b}_L. The rest of the vectors were additive public vectors known to the verifier, so the verifier reconstructed the commitments to the vectors by constructing commitments to the constant terms and adding them to the commitment of the secret vectors supplied by the prover.

By way of reminder, here is the original inner product with the values known to the verifier boxed:

aL+z1n,ynaR+ynz+z22n=z2v+δ(y,z)\left\langle \mathbf{a_L} + \boxed{-z \cdot \mathbf{1}^n}, \mathbf{y}^n \circ \mathbf{a_R} + \boxed{\mathbf{y}^n\cdot z + z^2 \cdot 2^n }\right\rangle = \boxed{z^2} \cdot v + \boxed{\delta(y,z)}

The reader is encouraged to verify that the boxed terms (values known to the verifier) in the original product were reconstructed by the verifier in the boxed terms in the set of equality checks above.

By replicating a portion of the prover’s computation, the verifier asserts that the prover actually carried out the computation as claimed.

Correctness of the verification algorithm

We now show that the final verification checks are identically correct if the prover was honest.

Below we show the exact algebra, but intuitively the verifier is “reconstructing” the left vector in the inner product aLz1n\mathbf{a_L} - z \cdot \mathbf{1}^n, the right vector in the inner product ynaR+ynz+z22n\mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n and the output z2v+δ(y,z)z^2v+\delta(y,z).

The verifier is not given commitments to aLz1n\mathbf{a_L} - z \cdot \mathbf{1}^n and ynaR+ynz+z22n\mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n but to aL\mathbf{a}_L and aR\mathbf{a}_R. Similarly, the verifier is not given a commitment to the output z2v+δ(y,z)z^2v + \delta(y,z) but only to vv.

The additive terms and the terms element-wise multiplied by yn\mathbf{y}^n must be reconstructed by the verifier.

Correctness of tu=t(u)t_u = \mathbf{t}(u)

For the tu=?lu,rut_u\stackrel{?} =\langle\mathbf{l}_u,\mathbf{r}_u\rangle check, this is true by definition, as that is how the prover computed tut_u.

Correctness of the committed l(x)\mathbf{l}(x) and r(x)\mathbf{r}(x) with respect to AA and SS

For
A+Su+z1n,G+zyn+z22n,Hy1=?lu,G+ru,Hy1+πlrBA + Su + \langle -z\cdot\mathbf{1}^n,\mathbf{G}\rangle + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle\stackrel{?}{=} \langle \mathbf{l}_u, \mathbf{G} \rangle + \langle \mathbf{r}_u, \mathbf{H}_{y^{-1}} \rangle + \pi_{lr} B

we make the following substitution:

aL,G+aR,H+αBA+(sL,G+sR,H+βB)Su+z1n,G+zyn+z22n,Hy1=?aLz1+sLulu,G+yn(aR+z1)+z22n+ynsRxru,Hy1+(α+βu)πlrB\underbrace{\langle\mathbf{a}_L,\mathbf{G}\rangle+\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B}_A + \underbrace{(\langle\mathbf{s}_L,\mathbf{G}\rangle+\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B)}_Su + \langle -z\cdot\mathbf{1}^n,\mathbf{G}\rangle + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle\stackrel{?}{=} \langle \underbrace{\mathbf{a}_L-z\cdot\mathbf{1}+\mathbf{s}_Lu}_{\mathbf{l}_u}, \mathbf{G} \rangle + \langle \underbrace{\mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n+\mathbf{y}^n\circ\mathbf{s}_Rx}_{\mathbf{r}_u}, \mathbf{H}_{y^{-1}} \rangle + \underbrace{(\alpha+\beta u)}_{\pi_{lr}} B

All the G\mathbf{G} terms cancel as follows:

aL,G+aR,H+αB+(sL,G+sR,H+βB)u+z1n,G+zyn+z22n,Hy1=?aLz1+sLu,G+yn(aR+z1)+z22n+ynsRx,Hy1+(α+βu)B\cancel{\langle\mathbf{a}_L,\mathbf{G}\rangle}+\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B + (\cancel{\langle\mathbf{s}_L,\mathbf{G}\rangle}+\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B)u + \cancel{\langle -z\cdot\mathbf{1}^n,\mathbf{G}\rangle} + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \cancel{\langle \mathbf{a}_L-z\cdot\mathbf{1}+\mathbf{s}_L u, \mathbf{G} \rangle} + \langle \mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n+\mathbf{y}^n\circ\mathbf{s}_R x, \mathbf{H}_{y^{-1}} \rangle + (\alpha+\beta u) B

aR,H+αB+(sR,H+βB)u+zyn+z22n,Hy1=?yn(aR+z1)+z22n+ynsRx,Hy1+(α+βu)B\langle\mathbf{a}_R,\mathbf{H}\rangle+\alpha B + (\langle\mathbf{s}_R,\mathbf{H}\rangle+\beta B)u + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \langle \mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n+\mathbf{y}^n\circ\mathbf{s}_R x, \mathbf{H}_{y^{-1}} \rangle + (\alpha+\beta u) B

The blinding terms related to BB cancel as follows:

aR,H+αB+(sR,H+βB)u+zyn+z22n,Hy1=?yn(aR+z1)+z22n+ynsRx,Hy1+(α+βu)B\langle\mathbf{a}_R,\mathbf{H}\rangle+\cancel{\alpha B} + (\langle\mathbf{s}_R,\mathbf{H}\rangle+\cancel{\beta B)u} + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \langle \mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n+\mathbf{y}^n\circ\mathbf{s}_R x, \mathbf{H}_{y^{-1}} \rangle + \cancel{(\alpha+\beta u) B}

aR,H+(sR,Hu)+zyn+z22n,Hy1=?yn(aR+z1)+z22n+ynsRu,Hy1\langle\mathbf{a}_R,\mathbf{H}\rangle + (\langle\mathbf{s}_R,\mathbf{H}\rangle u) + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \langle \mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n+\mathbf{y}^n\circ\mathbf{s}_R u, \mathbf{H}_{y^{-1}} \rangle

The Hy1\mathbf{H}_{y^{-1}} cancels with the yn\mathbf{y}^n terms:

aR,H+(sR,Hu)+zyn+z22n,Hy1=?aR+z1,H+z22n,Hy1+sRu,H\langle\mathbf{a}_R,\mathbf{H}\rangle + (\langle\mathbf{s}_R,\mathbf{H}\rangle u) + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \langle \mathbf{a}_R+z\cdot\mathbf{1},\mathbf{H}\rangle+\langle z^2\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle\mathbf{s}_R u, \mathbf{H} \rangle

Split the inner products:

aR,H+(sR,Hu)+zyn,Hy1+z22n,Hy1=?aR,H+z1,H+z22n,Hy1+sRu,H\langle\mathbf{a}_R,\mathbf{H}\rangle + (\langle\mathbf{s}_R,\mathbf{H}\rangle u) + \langle z\cdot\mathbf{y}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \langle \mathbf{a}_R,\mathbf{H}\rangle+\langle z\cdot\mathbf{1},\mathbf{H}\rangle+\langle z^2\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle\mathbf{s}_R u, \mathbf{H} \rangle

Cancel terms that appear on both sides of the equation:

aR,H+(sR,Hu)+zyn,Hy1+z22n,Hy1=?aR,H+z1,H+z22n,Hy1+sRu,H\cancel{\langle\mathbf{a}_R,\mathbf{H}\rangle} + (\langle\mathbf{s}_R,\mathbf{H}\rangle u) + \langle z\cdot\mathbf{y}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=} \cancel{\langle \mathbf{a}_R,\mathbf{H}\rangle}+\langle z\cdot\mathbf{1},\mathbf{H}\rangle+\langle z^2\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle\mathbf{s}_R u, \mathbf{H} \rangle
(sR,Hu)+zyn,Hy1+z22n,Hy1=?z1,H+z22n,Hy1+sRu,H\cancel{(\langle\mathbf{s}_R,\mathbf{H}\rangle u)} + \langle z\cdot\mathbf{y}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\langle z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=}\langle z\cdot\mathbf{1},\mathbf{H}\rangle+\langle z^2\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\cancel{\langle\mathbf{s}_R u, \mathbf{H} \rangle}
zyn,Hy1+z22n,Hy1=?z1,H+z22n,Hy1\langle z\cdot\mathbf{y}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle+\cancel{\langle z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle} \stackrel{?}{=}\langle z\cdot\mathbf{1},\mathbf{H}\rangle+\cancel{\langle z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle}
zyn,Hy1=?z1,H\langle z\cdot\mathbf{y}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle \stackrel{?}{=}\langle z\cdot\mathbf{1},\mathbf{H}\rangle

Move yn\mathbf{y}^n to the other side:

z1,H=?z1,H\langle z\cdot\mathbf{1},\mathbf{H}\rangle \stackrel{?}{=}\langle z\cdot\mathbf{1},\mathbf{H}\rangle
z1,H=?z1,H\cancel{\langle z\cdot\mathbf{1},\mathbf{H}\rangle} \stackrel{?}{=}\cancel{\langle z\cdot\mathbf{1},\mathbf{H}\rangle}

Correctness of the evaluation of t(u)t(u)

To see that

tuG+πtB=Vz2+δ(y,z)G+T1u+T2u2t_uG+\pi_tB=Vz^2+\delta(y,z)G+T_1u+T_2u^2

is correct, we could substitute the terms as follows:

lu,rutuG+(z2γ+τ1u+τ2u2)πtB=(vG+γB)Vz2+δ(y,z)G+(t1G+τ1BT1)u+(t2G+τ2B)T2u2\underbrace{\langle \mathbf{l}_u, \mathbf{r}_u \rangle}_{t_u}G+\underbrace{(z^2\gamma + \tau_1u + \tau_2u^2)}_{\pi_t}B=\underbrace{(vG+\gamma B)}_{V}z^2+\delta(y,z)G+\underbrace{(t_1G+\tau_1B}_{T_1})u+\underbrace{(t_2G+\tau_2B)}_{T_2}u^2

with lu\mathbf{l}_u, ru\mathbf{r}_u, t1t_1, t2t_2:

lu=aLz1nru=ynaR+ynz+z22nt1=(aLz1),ynsR+yn(aR+z1)+z22n,sLt2=sL,ynsR\begin{align*} \mathbf{l}_u &= \mathbf{a_L} - z \cdot \mathbf{1}^n\\ \mathbf{r}_u &= \mathbf{y}^n \circ \mathbf{a_R} + \mathbf{y}^n\cdot z + z^2 \cdot 2^n\\ t_1 &= \langle(\mathbf{a}_L-z\cdot\mathbf{1}),\mathbf{y}^n\circ\mathbf{s}_R\rangle+\langle\mathbf{y}^n\circ(\mathbf{a}_R+z\cdot\mathbf{1})+z^2\mathbf{2}^n,\mathbf{s_L}\rangle\\ t_2 &= \langle\mathbf{s}_L,\mathbf{y}^n\circ\mathbf{s}_R\rangle \end{align*}

However, such algebra would be extremely messy. Instead, we observe that z2v+δ(y,z)Gz^2v+\delta(y,z)G is the constant term of the vector polynomial inner product of of l(x),r(x)\langle\mathbf{l}(x),\mathbf{r}(x)\rangle. To cancel out the blinding term in γB\gamma B in VV, observe that πt\pi_t contains z2γz^2\gamma, so this will cancel with the gamma term in Vz2=(vG+γB)z2Vz^2 = (vG + \gamma B)z^2.

Since Pedersen commitments are additively homomorphic, the verifier can simply compute and add δ(y,z)G\delta(y,z)G to Vz2Vz^2 to compute the commitment to the constant term of the polynomial t(x)t(x).

Logarithmic-sized range proof

We can reduce the size of the data transmission by sending a commitment CC to lu\mathbf{l}_u and ru\mathbf{r}_u and proving that the committed vectors have inner product tut_u using the logarithmic-sized proof, and then verifying that

A+Su+z1n,G+zyn+z22n,Hy1πlrB=?CA + Su + \langle -z\cdot\mathbf{1}^n,\mathbf{G}\rangle + \langle z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n,\mathbf{H}_{\mathbf{y}^{-1}}\rangle-\pi_{lr}B\stackrel{?}{=} C

and

tu=?lu,rut_u \stackrel{?}{=} \langle \mathbf{l}_u, \mathbf{r}_u \rangle

with respect to the basis vectors G\mathbf{G} and Hy1\mathbf{H}_{\mathbf{y}^{-1}}.

Using the range proof algorithm for the subset sum

The subset sum problem asks, "given a set of numbers, does a subset (possibly including the entire set) sum up to kk? For example if k=16k = 16 and the set is {3,5,7,11}\set{3,5,7,11} the answer is yes because 5+11=165 + 11 = 16. However if k=13k=13, then the answer is no.

The subset sum problem is NP-Complete, meaning that, similar to a Boolean circuit or arithmetic circuit, it can represent any problem in NP. That is, any problem in NP can be rewritten (the technical word is “reduced”) to a subset sum instance.

By replacing 2n\mathbf{2}^n with [3,5,7,11][3,5,7,11], we can prove we know a solution to a subset sum without revealing the answer. Specifically, the prover would know that aL=[0,1,0,1]\mathbf{a}_L= [0,1,0,1] if k=16k=16. In general, a one entry in aL\mathbf{a}_L means we include that element in the subset and a zero means it is not included in the subset.

Therefore, Bulletproofs are capable of proving knowledge of any witness for any problem in NP.

Appendix: Derivation of combining three inner products into one

Starting with the three inner products

z2aL,2n+zaL1naR,yn+aL,aRyn=z2vz^2 \cdot \langle \mathbf{a_L}, \mathbf{2}^n \rangle + z \cdot \langle \mathbf{a_L} - \mathbf{1}^n - \mathbf{a_R}, \mathbf{y}^n \rangle + \langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle = z^2 \cdot v

we show how to derive the final result

aLz1n,aRyn+zyn+z22n=z2v+(zz2)1n,ynz31n,2n\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v+(z-z^2)\cdot\langle\mathbf{1}^n,\mathbf{y}^n\rangle-z^3\langle\cdot\mathbf{1}^n,\mathbf{2}^n\rangle

using the inner product algebra we learned previously.

  1. The middle term can be split into separate inner products:
z2aL,2n+zaL1naR,yn+aL,aRyn=z2vz^2 \cdot \langle \mathbf{a_L}, \mathbf{2}^n \rangle + \boxed{z \cdot \langle \mathbf{a_L} - \mathbf{1}^n - \mathbf{a_R}, \mathbf{y}^n \rangle} + \langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle = z^2 \cdot v
z2aL,2n+zaL,yn+z1n,yn+zaR,yn+aL,aRyn=z2vz^2 \cdot \langle \mathbf{a_L}, \mathbf{2}^n \rangle+\boxed{z\cdot\langle\mathbf{a}_L,\mathbf{y}^n\rangle+z\cdot\langle-\mathbf{1}^n,\mathbf{y}^n\rangle+z\cdot\langle-\mathbf{a}_R,\mathbf{y}^n\rangle}+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle=z^2\cdot v
  1. We can move the constant zz terms inside the inner products:

    aL,z22n+aL,zyn+z1n,yn+aR,zyn+aL,aRyn=z2v\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle+\langle-\mathbf{a}_R,z\cdot\mathbf{y}^n\rangle+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle= z^2 \cdot v

  2. Move the values known to the verifier to the right:

    aL,z22n+aL,zyn+z1n,yn+aR,zyn+aL,aRyn=z2v\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\boxed{\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle}+\langle-\mathbf{a}_R,z\cdot\mathbf{y}^n\rangle+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle= z^2 \cdot v

aL,z22n+aL,zyn+aR,zyn+aL,aRyn=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\langle-\mathbf{a}_R,z\cdot\mathbf{y}^n\rangle+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle= z^2 \cdot v-\boxed{\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle}
  1. Convert the aR\mathbf{a}_R terms to both be aRyn\mathbf{a}_R\circ\mathbf{y}^n:
aL,z22n+aL,zyn+aRyn,z1n+aL,aRyn=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\boxed{\langle-\mathbf{a}_R\circ\mathbf{y}^n,z\cdot\mathbf{1}^n\rangle}+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,z22n+aL,zyn+aRyn,z1n+aL,aRyn=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\boxed{\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle}+\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,z22n+aL,zyn+aRyn,z1n+aL,aRyn=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+{\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle}+\boxed{\langle \mathbf{a_L}, \mathbf{a_R} \circ \mathbf{y}^n \rangle}= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,z22n+aL,zyn+aRyn,z1n+aRyn,aL=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle+\langle \mathbf{a_R} \circ \mathbf{y}^n,\mathbf{a_L} \rangle = z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
  1. Combine the aRyn\mathbf{a}_R\circ\mathbf{y}^n terms into one:
aL,z22n+aL,zyn+aRyn,z1n+aRyn,aL=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\underbrace{\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle+\langle \mathbf{a_R} \circ \mathbf{y}^n,\mathbf{a_L} \rangle} = z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,z22n+aL,zyn+aRyn,aLz1n=z2vz1n,yn\langle \mathbf{a_L}, z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_L,z\cdot\mathbf{y}^n\rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,\mathbf{a}_L-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
  1. Combine the two aL\mathbf{a}_L terms on the left:
aL,z22n+aL,zyn+aRyn,aLz1n=z2vz1n,yn\langle \boxed{\mathbf{a_L}}, z^2\cdot\mathbf{2}^n \rangle+\langle\boxed{\mathbf{a}_L},z\cdot\mathbf{y}^n\rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,\mathbf{a}_L-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,zyn+z22n+aRyn,aLz1n=z2vz1n,yn\langle \mathbf{a_L}, z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,\mathbf{a}_L-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
  1. Split the last left-hand side term into two inner products:
    aL,zyn+z22n+aRyn,aLz1n=z2vz1n,yn\langle \mathbf{a_L}, z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle+\boxed{\langle\mathbf{a}_R\circ\mathbf{y}^n,\mathbf{a}_L-z\cdot\mathbf{1}^n\rangle}= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,zyn+z22n+aRyn,aL+aRyn,z1n=z2vz1n,yn\langle \mathbf{a_L}, z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,\mathbf{a}_L\rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
  1. Combine the aL\mathbf{a}_L terms:
    aL,zyn+z22n+aRyn,aL+aRyn,z1n=z2vz1n,yn\langle \boxed{\mathbf{a_L}}, z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n, \boxed{\mathbf{a}_L}\rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
aL,aRyn+zyn+z22n+aRyn,z1n=z2vz1n,yn\langle \mathbf{a_L}, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle+\langle\mathbf{a}_R\circ\mathbf{y}^n,-z\cdot\mathbf{1}^n\rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle
  1. We can use the rule x,b+c+b,y=vx+y,b+c=v+y,c\langle \mathbf{x}, \mathbf{b} + \mathbf{c}\rangle + \langle \mathbf{b}, \mathbf{y}\rangle = v \rightarrow \langle \mathbf{x} + \mathbf{y}, \mathbf{b} + \mathbf{c}\rangle = v + \langle\mathbf{y},\mathbf{c}\rangle to combine the terms that contain aRyn\mathbf{a}_R\circ\mathbf{y}^n. Here b\mathbf{b} is aRyn\mathbf{a}_R\circ\mathbf{y}^n, c\mathbf{c} is zyn+z22nz\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n, and y\mathbf{y} is z1n-z\cdot\mathbf{1}^n.
aLx,aRynb+zyn+z22nc+aRynb,z1ny=z2vz1n,ynv\langle \underbrace{\mathbf{a_L}}_\mathbf{x}, \underbrace{\mathbf{a}_R\circ\mathbf{y}^n}_\mathbf{b}+\underbrace{z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n}_\mathbf{c} \rangle+\langle\underbrace{\mathbf{a}_R\circ\mathbf{y}^n}_\mathbf{b},\underbrace{-z\cdot\mathbf{1}^n}_\mathbf{y}\rangle= \underbrace{z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle}_v
aLxz1ny,aRynb+zyn+z22nc=z2vz1n,ynv+z1ny,zyn+z22nc\langle \underbrace{\mathbf{a_L}}_\mathbf{x}-\underbrace{z\cdot\mathbf{1}^n}_\mathbf{y}, \underbrace{\mathbf{a}_R\circ\mathbf{y}^n}_\mathbf{b}+\underbrace{z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n}_\mathbf{c} \rangle= \underbrace{z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle}_v+\langle\underbrace{-z\cdot\mathbf{1}^n}_\mathbf{y},\underbrace{z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n}_\mathbf{c}\rangle
aLz1n,aRyn+zyn+z22n=z2vz1n,yn+z1n,zyn+z22n\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle+\langle-z\cdot\mathbf{1}^n,z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n\rangle
  1. We now break up the terms on the right-hand side:
aLz1n,aRyn+zyn+z22n=z2vz1n,yn+z1n,zyn+z1n,z22n\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v-\langle-z\cdot\mathbf{1}^n,\mathbf{y}^n\rangle+\langle-z\cdot\mathbf{1}^n,z\cdot\mathbf{y}^n\rangle+\langle-z\cdot\mathbf{1}^n,z^2\cdot\mathbf{2}^n\rangle
  1. Take the scalars out of the inner products on the right:
aLz1n,aRyn+zyn+z22n=z2v+z1n,ynz21n,ynz31n,2n\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v+z\cdot\langle\mathbf{1}^n,\mathbf{y}^n\rangle-z^2\cdot\langle\mathbf{1}^n,\mathbf{y}^n\rangle-z^3\langle\cdot\mathbf{1}^n,\mathbf{2}^n\rangle
  1. Factor out 1n,yn\langle\mathbf{1}^n,\mathbf{y}^n\rangle:
aLz1n,aRyn+zyn+z22n=z2v+(zz2)1n,ynz31n,2n\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v+(z-z^2)\cdot\langle\mathbf{1}^n,\mathbf{y}^n\rangle-z^3\langle\cdot\mathbf{1}^n,\mathbf{2}^n\rangle

Since δ(y,z)=(zz2)1n,ynz31n,2n\delta(y,z)=(z-z^2)\cdot\langle\mathbf{1}^n,\mathbf{y}^n\rangle-z^3\langle\cdot\mathbf{1}^n,\mathbf{2}^n\rangle, we have:

aLz1n,aRyn+zyn+z22n=z2v+δ(y,z)\langle \mathbf{a_L}-z\cdot\mathbf{1}^n, \mathbf{a}_R\circ\mathbf{y}^n+z\cdot\mathbf{y}^n+z^2\cdot\mathbf{2}^n \rangle= z^2 \cdot v+\delta(y,z)

This completes the derivation. \blacksquare

Ready to Get Started?Join Thousands of Users Today

Start your free trial now and experience the difference. No credit card required.

© 2025 Better-Start. All rights reserved.