Skip to content

Commitments

A commitment function takes as parameters the public vector S1 we computed before and the polynomial p(x) we want to commit to. It then computes

i=0laiS1[i]

Note that by construction this is:

a0P+a1τP+a2τ2P++alτlP

which is equivalent to:

p(τ)P

Exercise 8

Implement the commitment function below. Note that the output c will be a point on the curve EK. Test your function over the polynomial a(x) of the Fibonacci example.

python
def commitment(S1,p):
    #Solve here!
    return c

c = commitment(S1,a)

If computed correctly, you should get a commitment:

c=(19772988533509128204934208855583299243034568734268587639600165428945857082832:21198549198844316278609987090510616007059968516882705878791833422348082226388:1)

Now this commitment c can be given to the verifier before any challenge is issued.

In a subsequent step, the prover will receive the challenge γ from the verifier. They will now give back f(γ) but this time also a proof π that indeed this is the evaluation of γ in the very same polynomial that the prover commited to through c.

𝒫𝔩𝔬𝔫𝒦 Tutorial by zkSecurity