Try   HackMD

A Simple Range Proof From Polynomial Commitments

Dan Boneh, Ben Fisch, Ariel Gabizon, and Zac Williamson


Let's construct a simple zero knowledge range proof from a hiding polynomial commitment scheme (PCS).

The setup

Let

p be a prime, where
p>2n
for some
n
. We want a commitment scheme for elements in
Fp
that allows a prover to efficiently convince a verifier that a committed quantity
zFp
is in the range
0z<2n
.

We show that for a committed

zFp, the prover can provide an HVZK proof to convince the verifier that
0z<2n
by committing to two polynomials of degree
(n+1)
, and running the polynomial evaluation protocol three times. Therefore:

  • For the pairing-based polynomial commitment scheme of Kate, Zaverucha and Goldberg, this gives a range proof of length
    Oλ(1)
    that can be verified in time
    Oλ(1)
    , with a trusted setup and an updatable SRS of size
    Oλ(n)
    .
  • For the DARK polynomial commitment scheme of Bünz, Fisch, and Szepieniec, this gives a range proof of length
    Oλ(logn)
    that can be verified in time
    Oλ(logn)
    , with no trusted setup.
  • For comparison, recall that Bulletproofs give a range proof with no trusted setup of length
    Oλ(logn)
    that can be verified in time
    Oλ(n)
    .

In what follows we use

Fp(<n)[X] to denote polynomials in
Fp[X]
of degree less than
n
. We assume that
n
divides
p1
so that there is an element
ωFp
of order
n
. Let
H={1,ω,ω2,,ωn1}
.

The commitment scheme

Suppose that we have available a hiding and binding PCS for polynomials in

Fp(<n)[X]. Moreover, we assume that the polynomial evaluation protocol is HVZK.

To commit to an element

zFp, choose an arbitrary polynomial
fFp(<n)[X]
such that
f(1)=z
. Taking
f
as the constant polynomial
f(X)=z
is sufficient. The commitment to
z
is the polynomial commitment
comf
to
f
.

If the PCS is additive, then the commitment scheme is additively homomorphic: given commitments to

z1 and
z2
in
Fp
, anyone can construct a commitment to
z1+z2
.

Range proof for the range
[0,2n)

Let

comf be a commitment to
zFp
so that
f(1)=z
, as above. Let
z0,,zn1{0,1}
be the binary digits of
z
, so that
z=i=0n12izi
.

Now, given

comf, the prover proves that
0z<2n
, by constructing a degree-
(n1)
polynomial
gFp(<n)[X]
such that
g(ωn1)=zn1andg(ωi)=2g(ωi+1)+zi  for all i=n2,,0.
Observe that
g(1)=g(ω0)=i=0n12izi=z
. Now the prover needs to prove three things:

  1.   g(1)=f(1)
    ,
  2.   g(ωn1){0,1}
    ,   and
  3.   g(X)2g(Xω){0,1}
      for all
    xH{ωn1}
    .

Condition (1) proves that

g(1)=z; Conditions (2) and (3) prove that
z0,,zn1
are all in
{0,1}
and are the binary digital of
z
. Together, these conditions prove that
0z<2n
, as required.

To prove Conditions (1)-(3), the prover sends to the verifier a polynomial commitment to

g. It then proves to the verifier that the following polynomials evaluate to zero for all
xH
:
w1(X)=(gf)(Xn1X1),w2(X)=g(1g)(Xn1Xωn1),andw3(X)=[g(X)2g(Xω)][1g(X)+2g(Xω)](Xωn1).
This can be done efficiently using a batch opening technique described in this paper. The verifier sends a radom
τFp
to the prover, and the prover computes the quotient polynomial
q(X)=(w1+τw2+τ2w3)/(Xn1).
The prover sends a polynomial commitment to
q
to the verifier, and then proves that the polynomial
w(X)=w1+τw2+τ2w3q(Xn1)
is the zero polynomial. To do so, the verifier sends a random
ρFp
to the prover, and together they run the evaluation protocol three times: once for
g(ρ)
, once for
g(ρω)
, and once for evaluating
w^(ρ)
, where
w^(X)=f(X)(ρn1ρ1)+q(X)(ρn1)
. This
w^
is a linear combination of
f
and
q
, and therefore the verifier can construct a commitment to
w^
using the additiving property of the PCS. The three evaluations,
g(ρ)
,
w^(ρ)
, and
g(ρω)
, along with
ρ
and
τ
, are sufficient to evaluate
w(ρ)
and confirm that the result is zero. This proves, with high probability, that
w
is the zero polynomial.

There is one remaining issue, which is that revealing

g(ρ),
w^(ρ)
, and
g(ρω)
is not zero-knowledge. The fix is simple: the prover constructs
g
as a degree
n+1
polynomial by interpolating
g
to a random value at two more points
ω,ω
outside
H
. That is,
g
is defined in exactly the same way on all points in
H
, but
g(ω)=α
and
g(ω)=β
for random
α,βFp
and
ω,ωH
. Since
g
has the same values over all points in
H
, this has no effect on the relations checked above. This is zero-knowledge because
g(ρ)
and
g(ρω)
can now be simulated as independent random values in
Fp
. Moreover, the value of
w^(ρ)
is completely determined by the fact that
w(ρ)=0
, and can therefore also be simulated. Note that we need to restrict the choice of
ρ
to
(FpH)
to ensure that the simulation is valid.

This entire process makes two polynomial commitments, to

g and
q
, and uses the polynomial evaluation protocol three times to evaluate
g(ρ)
,
w^(ρ)
, and
g(ρω)
. We note that, if needed, it is possible to reduce the degree of
g
by writing
z
in a base greater than 2.

Other constructions

The Bulletproofs paper (Section 4.1) shows how to implement a range proof using an inner-product argument. The DARK paper shows how to implemement an inner-product argument using a polynomial commitment scheme. Combining the two gives another way to construct a range proof from a polynomial commitment scheme with similar properties as the range proof described above. Interestingly, the resulting protocol is quite different.

Implementation/related work

This scheme initially appeared as a component of Turbo Plonk by Ariel Gabizon and Zac Williamson