Skip to content

Verification

So now the prover, who has issued the challenge γ, has both c and π. He will use the verification function that takes as parameters c,π,γ and b=f(γ). We are finally ready to use the pairing. We want to check whether the following values are equal.

e(π,S2γQ)=?e(cbP,Q)

The left-hand side is:

e(π,S2γQ)=e(Qc(τ)P,(τγ)Q)

and using bilinearity:

e(Qc(τ)P,(τγ)Q)=e(Qc(τ)(τγ)P,Q)

The right-hand side is:

e(cbP,Q)=e(f(τ)Pf(γ)P,Q)=e((f(τ)f(γ))P,Q)

So essentially what the pairing allows us to do is to check:

f(τ)f(γ)=?Qc(τ)(τγ)

which is expected by the construction of Qc. This is equivalent to checking polynomial equality using the challenge τ. But remember, nobody knows τ directly because we deleted it after setup ("toxic waste")!

Exercise 10

Implement a verification function that takes c,π,γ and f(γ)=b as parameters. It should output true or false, by evaluating:

e(π,S2γQ)=?e(cbP,Q)

Test the function on the previously computed commitment c for a(x) and the proof π computed in the previous exercise.

python
def verification(c,π,γ,b):
    #Solve here!
    
assert verification(c,π,γ,b) == True

𝒫𝔩𝔬𝔫𝒦 Tutorial by zkSecurity