PLONK PCS

Polynomial Commitment Scheme (PCS) - allows a prover to commit to a polynomial

f(X) such that a verifer can check claimed evaluations
(z,f(z))
o the polynomial using its commitment.

Batched-PCS (BPCS) - allows a prover to commit to multiple polynomials.

Why Does PLONK Need a PCS?

Constant-Sized - a PLONK witness

u=(u1,,un) can be encoded into a polynomial
f(X)=u1X0++unXn1
for which a single-value commitment can be generated using a PCS.

Non-Revealing - a PCS allows the verifer to query (and verify) additional information about

u without learning any
uiu
; other commitment schemes (e.g. Pedersen [vector] commitments and Merkle trees) require the prover to reveal some/all of their committed data.

Homomorphic - a PCS verifier can perform (limited) polynomial arithmetic without having access to the committed polynomial.

Batchable - PLONK requires a prover to commit to multiple polynomials where some/all are evaluated at different inputs which can be accomplished using a BPCS.

Polynomial Remainder Theorem

If

f(X) is a polynomial containing the point
(a,f(a))
then the polynomial
f(X)f(a)
has a root at
a
.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

If

f(X)f(a) has a root at
a
, then its linear factorization contains the degree-1 polynomial
(Xa)
.

f(X)f(a)=ci(Xri)=(Xa)h(X) (Xa)|f(X)f(a)

The PRT can be used to prove that a polynomial

f(X) contains the point
(a,f(a))
by showing that
(Xa)|f(X)f(a)
without remainder.

Encryption

Here, encryption of an integer

aZ means computing
ga=gg
where
g
is a generator of a prime order multiplicative cyclic group
G=g={g1,,gp}
(which has a hard discrete log).
(G,×)=g={g1,,gp}gaGPr[A(g,ga)=a]=negl

Homomorphic Encryption

Allows arithmetic to be performed on plaintext values without leaving encrypted space.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

HaveWantHowAdd.ga,gbga+bgagbSub.ga,gbgabga/gb,  ga(gb)1SMul.ga, cZg[c]a(ga)cPoly. Eval.f(X)=a0X0++adXd, gs0,,gsdgf(s)i[0,d](gsi)aiMul.ga,gbgabe(g1a,g2b)=gtab

Homomorphic Polynomial Evaluation

If we have homomorphic addition and scalar mulitplication we can homomorphically evaluate a polynomial

f(X) at a point
s
, i.e.
gf(s)
, given encrypted powers of
s
, i.e.
gs0,,gsd
.
f(X)=a0X0+a1X1+a2X2gf(s)=ga0s0+a1s1+a2s2=(ga0s0)(ga1s1)(ga2s2)=(gs0)a0(gs1)a1(gs2)a2=i[0,d](gsi)ai.

Pairings

We cannot perform homomorphic multiplication using cyclic group encryption alone:

(ga,gb)  /  gab but, we can do so using pairings.

A pairing

e is a 2:1 function between groups
(G1,G2)
and
Gt
such that exponents in the inputs (i.e. encrypted integers) are multiplied in the output.
e:G1×G2Gte(g1a,g2b)=gtab

Here,

G1,
G2
, and
Gt
are multiplicative, cyclic, and cryptographic groups of equal prime order
p
.
(G1,×)=g1(G2,×)=g2(Gt,×)=gt

We can homomorphically evaluate a product of polynomials

f(X)h(X) at an input
s
given encrypted powers of
s
in
G1
and
G2
.
f(X)=a0X0++adXd,deg(f)=d,(g1s0=g1, g1s1,,g1sd)h(X)=X+b,deg(h)=1,(g2s0=g2, g2s1)f(s)h(s)=??? g1f(s)=i[0,d](g1si)aig2h(s)=g2s1g2b e(g1f(s),g2h(s))=gtf(s)h(s)

ZKG10 PCS

KZG is parameterized by

(κ,G1,G2,Gt,d):

  • κ
    - the security parameter (in bits) which gives the minimum group size, i.e.
    p2κ
    .
  • G1
    ,
    G2
    , and
    Gt
    - cryptographic groups of equal prime order
    p
    for which a pairing function is defined
    e:G1×G2Gt
    .
  • d
    - the largest polynomial degree that a prover can commit to.
    new(κ)(G1,G2,Gt,d)

KZG requires homomorphically evaluating a degree-

d polynomial in
G1
and a degree-1 polynomial in
G2
at a random input
s
(Schwartz-Zippel). Homomorphic polynomial evaluation requires knowledge of encrypted powers of the polynomial input, thus a trusted-setup is run to generate the random input
s
, known to no party, and outputs encrypted powers of
s
in
G1
and
G2
, i.e. the structured reference string (SRS).
setup()SRS={g1s0,,g1sd, g2s0,g2s1}

The prover commits to a polynomial

f(X)=a0X0++adXd by homomorphically evaluating it at
s
.
commit(f)Com(f)=g1f(s)=i[0,d](g1si)ai

The verifier asks the prover to evaluate

f(X) at a chosen input
zF
. The prover calculates
f(z)
, uses polynomial division to create the PRT cofactor polynomial
h(X)
for
(z,f(z))
, and homomorphically evaluates
h(s)
.
eval(z)(f(z),g1h(s))f(X)f(z)=(Xz)h(X)h(X)=f(X)f(z)(Xz)=b0X0++bd1Xd1g1h(s)=i[0,d1](g1si)bi
g1h(s)
can be thought of as a commitment to
h(X)
in the same way that
g1f(s)
was a commitment to
f(X)
.

The verifier checks the claimed evaluation

f(z) using the PRT equality evaluated at a random input
s
(Schwartz-Zippel). The verification equation is the PRT equality written homomorphically so that the verifier can evaluate the equality at
s
without knowing
s
.
verify(){0,1}e(Com(f)/g1f(z),g2)=?e(g1h(s),g2s1/g2z)e(g1f(s)f(z),g2)=?e(g1h(s),g2sz)  gtf(s)f(z)=?gth(s)(sz)
Which is equivalent to checking the PRT equality at a random input
s
(Schwartz-Zippel).
f(s)f(z)=?h(s)(sz)

Why does this work?

The prover claims that

(z,f(z)) lies on
f(X)
; the PRT equality must hold on all inputs if the claim is true.
f(X)f(z)=(Xz)h(X)
Schwartz-Zippel says that we can evaluate the equality at a single random input. The SRS contains a random integer
s
, known to no party, which we use for the random input.
Pr[f(s)f(z)=h(s)(sz)(z,f(z))f(X)]d|F|
Note that this is the exponents in the KZG verification equation.
f(s)f(z)=h(s)(sz)    v.s.    gtf(s)f(z)=gth(s)(sz)
Rewriting the Schwartz-Zippel-ed PRT equality using homomorphic polynomial evaluation (allows
s
to be unknown) and pairings (allows the verifier to homomorphically multiply evaluated polynomials, i.e.,
h(s)(sz)
) yields an equality which can be checked by a verifier without knowledge of
s
.
h(s)(sz)    e(g1h(s),g2s1/g2z)=gth(s)(sz)f(s)f(z)=h(s)(sz)    e(g1h(s)f(z),g2)=e(g1h(s),g2sz)

Random Linear Combinations

A linear combination is a sum of binary products. The linear combination of two vectors

a and
b
is their dot product.
ab=a1b1++anbn

A random linear combination (RLC) of a vector

a is its dot product with a vector of random values
γ=(γ1,,γn)Fn
.
aγ=a1γ1++anγn

The modular powers of an integer form a psuedorandom sequence, thus for a random

γ we consider
γ=(γ1,,γd)
to be random.

Schwartz-Zippel tells us that for a random

γ, the RLC of a vector
a
with powers of
γ
is (w.h.p.) unique.
f(X)=a0X0++adXdg(X)=b0X0++bdXdabγFPr[aγ=bγ]d|F|

Combining Polynomials via RLC's

Multiple polynomials

f1(X),,ft(X) can be compressed into a single polynomial
F(X)
by taking their random linear combination with randomness
γ
.
γFF(X)=f1(X)γ0++ft(X)γt1
We can compress multiple Schwartz-Zippel evaluations
f1(β),,ft(β)
at a random input
β
into a single value
F(β)
using an RLC with randomness
γ
which is (w.h.p.) unique.
βFF(β)=f1(β)γ0++ft(β)γt1G(β)=g1(β)γ0++gt(β)γt1F(β)=G(β)w.h.p.F(X)=G(X),  i.e. fi(X)=gi(X)

Combining Polynomial Equalities via RLC's

Multiple polynomial equalites

fi(X)=gi(X) can be compressed into a single polynomial equality by taking a RLC of the left-hand sides and a RLC of the right-hand sides using randomness
γ
and equating the two.
f1(X)=g1(X)ft(X)=gt(X)γFF(X)=f1(X)γ0++ft(X)γt1G(X)=g1(X)γ0++gt(X)γt1F(X)=G(X)βFF(β)=G(β)w.h.p.F(X)=G(X), i.e. fi(X)=gi(X)

Batched-KZG Using RLC's

We can combine multiple polynomial equalities into a single equality using an RLC with randomness

γ, thus we can write a batched-PRT equality for proving multiple polynomial evaluations
f1(z)
and
f2(z)
at the same input
z
.
f1(X),f2(X)f1(X)f1(z)=h1(X)(Xz)f2(X)f2(z)=h2(X)(Xz)γF(f1(X)f1(z))γ0+(f2(X)f2(z))γ1=h1(X)(Xz)γ0+h2(X)(Xz)γ1=(h1(X)γ0+h2(X)γ1)(Xz)

Batched-KZG evaluates the batched-PRT equality at a random input

s (Schwartz-Zippel) generated during a trusted-setup. Batched-ZKG allows us to commit to multiple polynomials and verify an evaluation for each using a single equality.
e(g1f1(s)γ0f1(z)γ0+f2(s)γ1f1(z)γ1,g2)=e(g1h1(s)γ0+h2(s)γ1,g2sz)

Multivariate Schwartz-Zippel

Multivariate Schwartz-Zippel:

f(X1,,Xn)g(X1,,Xn)γ=(γ1,,γn)FnPr[f(γ)=g(γ)]d|F| tells us that a RLC of polynomials is (w.h.p.) unique.

TLDR: an

n-variate polynomial is a LC of
(n1)
-variate polynomials. A univariate polynomial evaluated at a random input is (w.h.p.) unique, thus a bivariate polynomial having a partially applied random input
X=β
results in a univariate polynomial which (w.h.p.) has unique coefficients. Partially applying a second random input
Y=γ
yields the standard univariate Schwart-Zippel probability. A RLC of
n
-variate polynomials is equivalent to an
(n+1)
-variate polynomial evaluated at a random input for the introduced indeterminate.

A degree-

d bivariate polynomial
g(X,Y)
is a linear combination of powers of
Y
with univariate polynomials
(f0(X),,fd(X))
.
g(X,Y)=f0(X)Y0++fd(X)Yddeg(fi)=di 

Schwartz-Zippel says us that a univariate polynomial evaluated at a random input

βF is (w.h.p.) unique.
f1(β)f2(β)
Thus, partially applying
X=β
to a bivariate polynomial
g(X,Y)
results in a unique coefficient vector
(f0(β),,fd(β))
.
g(β,Y)=f0(β)Y0++fd(β)Yd
The probability that the coefficient vectors of two different bivariate polynomials
g1(X,Y)g2(X,Y)
are equal after partially applying the random input
X=β
is zero.
g1(X,Y)=f0(X)Y0++fd(X)Ydg2(X,Y)=h0(X)Y0++hd(X)YdPr[g1(β,Y)=g2(β,Y)]=Pr[f0(β)=h0(β)]Pr[fd(β)=hd(β)]=d|F|0|F|=0
Thus, partial application of
X=β
yields a unique univariate polynomial, which Schwartz-Zippel tells us evaluates uniquely on random input
Y=γF
.
g1(X,Y)g2(X,Y)βFg1(β,Y)g2(β,Y)γFPr[g1(β,γ)=g2(β,γ)]=d|F|

[Somewhat surprisingly] the bivariate and univariate Schwartz-Zippel probabilities are equal, which by induction can be generalized into the multivariate Schwartz-Zippel expression.

f(X1,,Xn)=g0(X1,,Xn1)Xn0++gd(X1,,Xn1)Xnd(γ1,,γn)FnPr[f1(γ1,,γn)=f2(γ1,,γn)]=d|F|.

Proof by Induction:

PLONK's BPCS

PLONK's BPCS is a batched-batched-ZKG which allows a prover to commit to mulitple polynomials where each may be evaluated at a distinct input. A prover has

k sets of polynomials where each set is evaluated at the same input and each set's input is distinct. The prover runs batched-KZG for each set producing
k
batched-PRT equalities (one for each distinct input). The prover batches those batched-PRT equalities into a single equality which contains every polynomial's evaluation.

The BPCS is parameterized by

(κ,G1,G2,Gt,d,t) where
t
is the number of polynomials that the prover commits to; all other parameters are the same as those used in KZG10.

PLONK's BPCS uses the same trusted-setup and commitment procedures as KZG10 except that PLONK's BPCS makes

t commitments, one for each polynomial
fi
.
setup()SRS={g1s0,,g1sd,g2s0,g2s1} (f1,,ft)commit(fi)Com(fi)=g1fi(s)(Com(f1),,Com(ft))

The verifier sends the prover each polynomial's evaluation input

(z1,,zt) which may contain duplicated values. For each of the
kt
distinct inputs, the verifier samples a random value
γ
and sends it to the prover
(γ1,,γk)Fk
.

The prover partitions their polynomials according to like input, i.e. splits their polynomials

(f1,,ft) into
k
subarrays where each subarray's polynomials are evaluated at the same input.

For each parition

j[k], the prover performs a batched-PRT using randomness
γj
, i.e. homomorphically computes each
hi(s)
then homomorphically computes the RLC
Hj(s)
of all
hi(s)
. Partition
j[k]
contains
tj
polynomials denoted
(fμ,,fν)
.
i[t]:hi(X)=fi(X)f(zj)(Xzj)=b0X0++bd1Xd1i[t]:g1hi(s)=i[0,d1](g1si)bij[k]:g1Hj(s)=g1hμ(s)γj0++hν(s)γjtj1=i[tj](g1hi(s))γji1(f1(z1),,ft(zt),g1H1(s),,g1Hk(s))

The prover sends the verifier each polynomial's evaluation

fi(zi) and each partition's compressed PRT cofactors
g1Hj(s)
.

The verifier compresses each partition's

j[k] polynomial commitments and polynomial evaluations using randomness
γj
.
g1Fj(s)=g1f1(s)γj0++ftj(s)γjtj1=i[tj]Com(fi)γji1g1Fj(zj)=g1f1(zj)γj0++ftj(zj)γjtj1

The verifier now has three values for each partition: the compressed polynomial commitments, the compressed polynomial evaluations, and the compressed PRT cofactor polynomials.

(g1F1(s),g1F1(z1),g1H1(s)),,(g1Fk(s),g1Fk(zk),g1Hk(s))

The verifier samples a random

βF and computes the random linear combinations of all
Fj(s)
,
Fj(zj)
,
Hj(s)
and
Hj(s)zj
:
A=g1F1(s)β0++Fk(s)βk1=j[k](g1Fj(s))βj1B=g1F1(z1)β0++Fk(zk)βk1C=g1H1(s)β0++Hk(s)βk1=j[k](g1Hj(s))βj1D=g1H1(s)β0z1++Hk(s)βk1zk=j[k](g1Hj(s))βj1zj
then checks the verification equation:
e(AD/B,g2)=?e(C,g2s1)
which homomorphically checks the batched-batched-PRT equality:
(F1(s)F1(z1))β0++(Fk(s)Fk(zk))βk1=H1(s)(sz1)β0++Hk(s)(szk)βk1.

Why Use KZG Over Other Commitment Schemes?

Examples of other commitment schemes are CRHF's, Merkle trees, Pedersen [vector] commitments, accumulators, etc.

KZG10 has constant sized commitments, constant sized openings, opening does not reveal information about the committed polynomial

f(X), i.e.
(a0,,ad)
, and is a natural commitment choice for polynomial-based protocols.


Hiding - the function's output contains no information about its input, e.g.

M={m1=\unicodex201CYes",m2=\unicodex201CNo"}Non-hiding: Com(mi)=H(mi)Hiding: Com(mi,r)=H(mir) committing to
mi
via
H(mi)
is non-hiding because an adversary can brute-force all commitments to find
mi
. Committing to
mi
using a random hiding factor
r
via
H(mir)
is hiding because an adversary cannot brute-force all commitments without without knowing
r
.


Comparison of Commitment Schemes:

Name Commitment Properties
CRHF
Com(m)=H(m)
non-hiding, non-homomorphic
CRHF w/ Blinding
Com(m,r)=H(mr)
hiding, non-homomorphic
Enc.
Com(m)=gm
non-hiding, homomorphic
Pedersen
Com(m,r)=gmhr
hiding, homomorphic
CRHF
Com(f)=H(a0ad)
must reveal all
ai
Enc.
Com(f)=(ga0,,gad)
partially revealing
Pedersen Vector
Com(f,r)=hrg0a0gdad
hiding, homomorphic, must reveal all
ai
Merkle Tree
MerkleTree(a0,,ad).root
partially revealing,
log2(d)
communication
KZG10
Com(f)=g1f(s)
hiding, homomorphic, constant commitment size, non-revealing, constant communication

Recap

PLONK represents witnesses

u=(u1,,uw) using polynomials
f(X)=u1X0++uwXw1
and uses a PCS to commit to those polynomials.

The PRT equality for a polynomial

f(X) evaluated at
z
is:
f(X)f(z)=(Xz)h(X).

Encryption of an integer

aZ using a cyclic group
G=g={g1,,gp}
is:
ga=gg.

Cyclic group encryption gives us homomorphic addition, scalar multiplication, and polynomial evaluation.

gagb=ga+bga/gb=gab(ga)c=gcagf(z)=i[0,d](gzi)ai

Pairings give us homomorphic multiplication.

e(g1a,g2b)=gtabe:G1×G2GtG1=g1G2=g2Gt=gt

KZG10 is a PCS that allows a prover to commit to a polynomial

f(X) and a verifer to check claimed evaluations of that polynomial
f(z)
. KZG is the PRT equality evaluated at a random input
s
(Schwarz-Zippel) generated during a trusted-setup. Because
s
is known to no party, the PRT equality is rewritten homomorphically.
e(g1f(s)f(z),g2)=e(g1h(s),g2sz)  gtf(s)f(z)=gth(s)(sz)