Groth16
Zero-Knowledge Proof system for Quadratic Arithmetic Programs (QAPs) slides
Notation
We denote [A]1=La,[B]2=Ra,[C]1=Oa [A]1∙[B]2 represents the pairing of [A]1 and [B]2
Motivation
Simply providing the verifier with some [A]1,[B]2,[C]1 that satisfy [A]1∙[B]2=[C]1∙[G]2 does not mean the prover satisfied the QAP, as we do not know whether the equation actually represents the QAP.
Preventing Forgery
We add another pairing to the verification equation, s.t. it is now [A]1∙[B]2=[α]1∙[β]2+[C]1∙[G]2 where α,β are random secrets generated by the trusted setup.
Semi-public Witness
For our witness a, we want to be able to publish the first l elements publicly. This way, we directly show we have the first part of a witness, and then issue a ZK proof for the latter part. This is because the verifier may wish to provide some number of the input variables, and have the prover discover the rest, while ensuring the prover used the input variables provided.
However, we need to be careful and ensure that our scheme does not have a weakness which allows a prover to use the public part of the witness to forge a proof for the latter part.
This is avoided by the trusted setup dividing Ψ1...Ψl by γ and Ψl+1...Ψm by δ where γ,δ are some random scalars generated and kept secret by the trusted setup. Since only the trusted setup knows the discrete log of γ,δ, no one else can calculate this division.
The verifier then simply pairs [X]1∙[γ]2 and [C]1∙[δ]2 to cancel out this division.
Enforcing Zero Knowledge
If our input-space for our QAP is small, an attacker can simply keep guessing witnesses until they find one that results in the same proof submitted by the prover. They have then determined the solution the prover has, violating the Zero Knowledge requirement.
To prevent this, the prover salts their proof. They do this by generating two random field elements r,s, and adding them to A and B to make them unguessable.
Trusted Setup
The trusted setup calculates
α,β,τ,γ,δ[τn−1G1, τn−2G1, ..., τG1, G1][τn−1G2, τn−2G2, ..., τG2, G2][δτn−2t(τ), δτn−3t(τ), ..., δτt(τ), δt(τ)][Ψ1]1[Ψ2]1⋮[Ψl]1[Ψl+1]1[Ψl+2]1⋮[Ψm]1←←SRS for G1←SRS for G2←SRS for h(τ)t(τ)Used with public portion of witness=γαv1(τ)+βu1(τ)+w1(τ)G1=γαv2(τ)+βu2(τ)+w2(τ)G1=γαvl(τ)+βul(τ)+wl(τ)G1=δαvl+1(τ)+βul+1(1τ)+wl+1(τ)G1=δαvl+2(τ)+βul+2(τ)+wl+2(τ)G1=δαvm(τ)+βum(τ)+wm(τ)G1random scalarsUsed with private portion of witness The trusted setup then publishes ([α]1, [β]1[β]2, [γ]2, [δ]1[δ]2, SRSG1, SRSG2, [Ψ1]1, [Ψ2]1, ...,[Ψm]1),
Prover
The prover has a witness a and generates random scalars r,s.
[A]1[B]1[B]2[C]1=[α]1+i=1∑maiui(τ)+r[δ]1=[β]1+i=1∑maivi(τ)+s[δ]1=[β]2+i=1∑maivi(τ)+s[δ]2=i=l+1∑mai[Ψi]1+h(τ)t(τ)+[A]1s+[B]1r−rs[δ]1 Publishes ([A]1,[B]2,[C]1,[a1,...,al])
Verification
The verifier calculates
[X]1=i=1∑laiΨi and checks
[A]1∙[B]2=?[α]1∙[β]2+[X]1∙[γ]2+[C]1∙[δ]2 References