Interactive proofs are complete and (statistically) sound, while interactive arguments are sound w.r.t computationally bounded prover (computational soundness).
Definition (SNARK). A succinct (preprocessing) non-interactive argument of knowledge (SNARK) is a triple of algorithms (S,P,V):
SetupS(C;r)=(pp,vp): Generates public parameters (pp,vp) for the prover and verifier respectively, given a circuit C.
ProveP(pp,x,w)=π: Produces a short proof π, where len(π)=sublinear(∣w∣)
VerifyV(vp,x,π): Fast to verify, with verification time: time(V)=Oλ(∣x∣,sublinear(∣C∣)),
that satisfy:
Completeness: For all x,w such that C(x,w)=0,Pr[π←P(pp,x,w):V(vp,x,π)=1]=1.
Knowledge Soundness: If V accepts, then P “knows” a witness w such that C(x,w)=0.
If the algorithms satisfy:
Zero-Knowledge: The (C,pp,vp,x,π) “reveals nothing new” about the witness w.
then the scheme is called a zk-SNARK.
Strong SNARK: all sublinear terms are log(∣C∣).
So in SNARK, prover can not simply send a w, for w might be long (∣w∣≤∣C∣) and it may be hard to verify C(x,w)=0.
Observe that S is randomized for setup phase. If r is revealed to P, it can prove false statements. This is because while vp is visible from P, it can hide some key structures invisible from P without knowing the random r.
The pre-processing has different types:
transparent setup: S(C) uses no random bit.
trusted but universal setup: S=(Sinit,Sindex), Sinit(r)=gp generates global parameters with secret r, Sindex(gp,C)=(pp,vp) is deterministic.
trusted setup per circuit: S(C;r) uses random bits for every circuit C.
Argument of Knowledge
Here we use trusted but universal setup.
Definition (Adaptive Knowledge Soundness). A preprocessing NARK (S,P,V) is (adaptively) knowledge sound for a circuit C if for every polynomial-time adversary A=(A0,A1) such that:
there exists an efficient extractor E (that uses A) such that:
gp←Sinit(1λ;r),(C,x,st)←A0(gp),w←EA(gp,C,x)
and
Pr[C(x,w)=0]>1/106−ϵ(for a negligible ε w.r.t. λ).
Adversary chooses (C,x) after seeing gp (adaptive), then produces a proof π. If A produces an accepting proof with non-negligible probability, then E can extract a valid witness w with essentially the same probability (up to negligible ε).
After intro, we proceed to constructing a SNARK, which uses 2 building blocks, one is functional commitment scheme, and the other is interactive oracle proof. The former is a cryptographic object and the latter is an information-theoretical object.
Building Blocks 1: functional commitment scheme
Definition (Commitment Scheme). A commitment scheme consists of
setup(1λ)→gp, outputs public parameters gp
commit(gp,f,r)→com, commitment to f∈F with r∈R randomly chosen
open(com,f,r): if com=commit(gp,f,r), then open(com,f,r)=1; otherwise open(com,f,r)=0
also defined as computational indistinguishability.
Note: the r in the open algorithm is the same as that in the commit algorithm.
After sender’s commitment, the sender should also send (x,r) for the receiver to verify. For example, if I want to play paper-scissors-rock with a friend remotely: first we determine our choices; then we send the commitments to each other; finally we send the choice and the random bits used and verify the commitments sent by one another.
To hide the message along the interaction (also, to make the proof short instead of (x,r)), we define functional commitment scheme.
Definition (Functional Commitment Scheme). A functional commitment scheme for F={f:X↦Y}:
setup(1λ)→gp, outputs public parameters gp
commit(gp,f,r)→comf , commitment to f∈F with r∈R, which is a binding (and hiding for zk-SNARK) commitment scheme for F
eval(P,V): for a given comf and all x∈X:
open(gp,f,x,r)→short proof π and value y∈Y
verify(gp,comf,x,y,π)→accept/reject
satisfying
Completeness: If f∈F and x∈X with f(x)=y, then Pr[V(gp,comf,x,y,π)=accept]=1.
Knowledge Soundness: (setup∥commit,open,verify) is knowledge sound.
The interaction within eval(P,V) is actually a SNARK for the relation (circuit)
whose witness is essentially (f,r). The proof π actually proves that f∈F, f(x)=y and comf is a commitment to f.
The definition above essentially illustrates an interactive process. It is like the verifier “queries” the oracle f at x with an additional cost of verifying.
IOP is a proof system that proves the prover knows w such that C(x,w)=0. The verifier uses oracles of f∈F, which is later replaced by functional commitments to construct a SNARK; here we use oracles.
Definition (F-IOP): An F-IOP is a proof system that proves ∃w,C(x,w)=0 and consists of
setup(1λ)→pp,vp=(Oraclef−s,…,Oraclef0)
At round i∈[t], prover P sends Oraclefi where fi is based on the interaction history from view of P; verifier sends ri$R unless i=t.
verifyOraclef−s,…,Oracleft(vp,x,r1,…,rt−1) uses (fi)i=−st as oracles and output the result.
which satisfies
Completeness: If∃w,C(x,w)=0, then the verifier is bound to accept
Knowledge Soundness: if we use comf’s for Oraclef’s, the extractor can use (fi)i=−st to compute w because the functional commitment scheme is knowledge sound (functional commitment scheme is actually a SNARK).