Commitment Scheme

tags: ingo

What is a commitment?

A cryptographic commitment allows one to commit to a chosen value while keeping it hidden to others, with the ability to reveal the committed value later. It has two important properties:

  1. Hiding: a commitment does not reveal anything about the original value
  2. Binding: once you commit to a value, later you cannot change the committed value

We can think of a commitment scheme as a locker which has two phases:

  1. Commit: lock a certain secret in the locker
  2. Open: the secret is revealed by the sender, then the receiver verifies its authenticity

Kate Commitment Scheme

Lets say I know a polynomial

f(X) of degree
d
. I wish to prove to you that I indeed know the coefficients of
f
without revealing them. Suppose
f(X)=c0+c1X++cdXd
and we have a secret scalar
βFp
. The commit phase of KZG is simply computing the evaluation of
f
at
β
.
com(f):=f(β)=c0+c1β++cdβd

Now, the interesting thing about

β is that it is assumed to be a universal secret, i.e. no one in the world knows what
β
is. Well, in that case, how can I compute the evaluation of
f
on
β
? We will answer this a bit later. For now, lets see what I do in the open phase of KZG. I compute a polynomial
w(X)
such that
w(X):=f(X)f(z)Xz=(f(X)f(z))(Xz)1

where

zFp was sent by the verifier as a challenge. A natural question we can ask: is the polynomial
(f(X)f(z))
even divisible by
(Xz)
? The answer is: yes, it is!
(f(X)f(z))=(c0+c1X++cdXd)(c0+c1z++cdzd)=c1(Xz)+c2(X2z2)++cd(Xdzd)=(Xz)[c1+c2(X+z)++cd(Xd1+zXd2++zd1)]

Therefore,

w(X) is a degree-
(d1)
polynomial with integer coefficients. Let
w(X)=w0+w1X++wd1Xd1
. We commit to
w
as:
com(w):=w(β)=w0+w1β++wd1βd1

As a part of the open phase, I send the verifier a proof
πpc=(com(f),com(w),v)
where
v:=f(z)
.

The verifier will authenticate the proof by checking:

(1)com(w)(βz)=(com(f)v)
In other words, if the above equation holds true, it implies that the verifier checked if the expression of
w
holds at the secret point
β
. The verifier is convinced about my knowledge of
f
because otherwise, it would have been impossible for me to compute
w(X)
.

Structured Reference String (SRS)

In the above discussion, we assumed that the scalar

β is not known to anybody in the world. But still the prover and verifier end up using it some way or other, how is that possible? This is made possible by elliptic curve cryptography! Suppose we have a group
G1
with generator
g
. We embed the secret
β
using powers of the generator
g1G1
.
srs1={g1,g1β,g1β2,,g1βD}G1D

Given

srs1 and the fact that the discrete log relation is unknown in
G1
, there is no way any
adversary could figure out what
β
is. Now, the commitment to
f
can be computed easily (of course only if
d<D
):
com(f):=g1f(β)=g1(c0+c1β+cdβd)=g1c0(g1β)c1(g1β2)c2(g1βd)cd

Given

(com(f),com(w)) and
srs1
, how can we verify equation
(1)
? We essentially wish to check multiplication of evaluations of some polynomials on the secret
β
. Using
srs1
, we can only add up terms in
β
in the exponent of
g1
. To enable multiplication of terms in
β
, we need another fascinating cryptographic primitive: pairings.

A pairing is a map

e:G1×G2GT where we have group generators
g1G1,g2G2
and
gtGT
in the target group
GT
, such that
a,bFp

e(g1a,g2b)=gtab.

Therefore, a pairing allows us to multiply scalars in the exponent of the generators

g1 and
g2
. For verification in
(1)
, we need a second part of our structured reference string:
srs2={g2,g2β}G22.

Now, the verification in equation

(1) boils down to an equality of two pairing computations:
gtw(β)(βz)=?gt(f(β)v)1e(g1w(β),g2(βz))=?e(g1(f(β)v),g2)e(com(w), g2βg2z)=?e(com(f)g1v, g2)

The set

srs=srs1srs2 is called as the structured reference string. This SRS is computed using MPC among several participants of which only one party needs to be honest.

Notation: We will denote the commitment to a polynomial

f as
[f(β)]1
. Further, the SRS can be written as
srs1={[1]1,[β]1,,[βD]1}srs2={[1]2,[β]2}.

Overview of Batched Kate PCS (Optional)

The Kate commitment scheme can be used prove the knowledge of a bunch of polynomials by "opening" all of them at a single scalar. Suppose we have the following polynomials to be opened at respective points (we're considering a fairly general case here):

Polynomials Opening points
f1,1,f1,2,,f1,m
z1
f2,1,f2,2,,f2,m
z2
fn,1,fn,2,,fn,m
zn

Here, we'll have to compute

n opening polynomials
{Wi(X)}i[n]
such that

Wi(X)=Fi(X)Fi(zi)Xzi

where

Fi(X)=j=1mγij1fi,j. The opening proof would be
{[W1]1,[W2]1,,[Wn]1,{[fi,j]1,vi,j}i[n],j[m]}
where
vi,j=fi,j(zi)Fp
. Clearly, the number of opening polynomial commitments needed to be computed by the prover is
n
(i.e. the number of opening points). Finally, the verification needs the pairing check:

e(W,Y)=e(FQ,[1]2)

where

W=i[n]ui1[Wi]1F=i[n]j[m]ui1γij1[fi,j]1Q=[i[n]j[m]ui1γij1vi,j]1Y=[i[n]ui1(Xzi)]2

Marlin PCS

The structure of the SRS is slightly different for the KZG-style PCS used in Marlin.

srs=(GβGβ2GβDGγGγβGγβ2GγβDG)G12D+2

The terms which include

γ are necessary to commit to the hiding polynomials. Hiding polynomials are randomly generated polynomials that are added to the original polynomials to ensure that no information about the original polynomials is not revealed (i.e to make it zero-knowledge).

Commit Phase

Suppose we have polynomials

{pi(X)}i[n] each with a degree bound[1]
{di}i[n]
. In this case, we also need to commit to the polynomial
pi(X)=XDdipi(X)
to prove the correct degree bound
deg(pi)<di
holds. Define
d:=max({di}i[n])
. To commit to these polynomial, we need to trim the SRS to get a committer's key:

srsck=(GβGβ2GβdGβDdGβDd1GβDGγGγβGγβ2GγβdG)G13d+3

Hereafter, the commit phase proceeds as follows:

  1. We are given randomness
    {ri,ri}i[n]
    which is to be added to the polynomials
    pi,pi
    respectively.
  2. Compute polynomials
    p¯i(X)
    and
    p¯i(X)
    from the randomness
    {ri,ri}i[n]
    . Note the degrees of these polynomials should be equal to
    deg(pi)
    .
  3. Compute the commitments as:
    [pi]:=pi(β)G+\colorblueγp¯i(β)G[pi]:=βDdipi(β)G+\colorblueγp¯i(β)G

Open Phase

Given the evaluation point

zFp and the verifier challenge
ξFp
, the opening phase proceeds as:

  1. We compute the opening polynomials as
    w(X)=i[n](ξipi(X)pi(z)Xz+ξn+iXDdipi(X)pi(z)Xz)=i[n]ξi(1+ξnXDdi)(pi(X)pi(z)Xz)w¯(X)=p¯(X)p¯(z)+p¯(X)p¯(z)Xz

    where
    p¯(X)=iξip¯i(X)
    and
    p¯(X)=iξn+ip¯i(X)
    .
  2. Compute commitment to the opening polynomials:
    w=[w(β)]+[γw¯(β)]
  3. Compute the randomness polynomials' evaluation:
    v¯:=p¯(z)+p¯(z).

Thus, the opening proof is

π=(w,v¯).

Verification

The verification involves checking the equality

e(CvGγv¯G,H)=e(w,βHzH)
where
v=iξivi
and
C=iξi[pi]+iξn+i([pi]viβDdiG)
. Note that the verifier now requires the following SRS:
srsvk={H,βH, βDd1G, βDd2G,, βDdnG}G1n×G22.

Also note, the evaluations
vi=pi(z)
and the commitments
{[pi],[pi]}i[n]
are sent to the verifier by the prover.


  1. In the previous sections, we didn't need to prove any degree-bounds on a polynomial

    f(X) other than the obvious bound
    deg(f)<D
    . ↩︎