venillalemon

January 14, 2026 · Notion export

SNARK Foundations and Functional Commitments


Introduction to SNARK

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)(S, P, V):
  • Setup S(C;r)=(pp,vp)S(C;r)=(pp,vp): Generates public parameters (pp,vp)(pp, vp) for the prover and verifier respectively, given a circuit CC.
  • Prove P(pp,x,w)=πP(pp, x, w)=\pi: Produces a short proof π\pi, where len(π)=sublinear(w)\mathsf{len}(\pi) = \mathsf{sublinear}(|w|)
  • Verify V(vp,x,π)V(vp, x, \pi): Fast to verify, with verification time: time(V)=Oλ(x,sublinear(C))\mathsf{time}(V) = O_{\lambda}(|x|, \mathsf{sublinear}(|C|)),

that satisfy:

  • Completeness: For all x,wx,w such that C(x,w)=0C(x,w)=0,Pr[πP(pp,x,w):V(vp,x,π)=1]=1\mathbf{Pr}\left[\pi \leftarrow P(pp, x, w): V(vp, x, \pi) = 1\right] = 1.
  • Knowledge Soundness: If VV accepts, then PP “knows” a witness ww such that C(x,w)=0C(x,w)=0.

If the algorithms satisfy:

  • Zero-Knowledge: The (C,pp,vp,x,π)(C,pp,vp,x,\pi) “reveals nothing new” about the witness ww.

then the scheme is called a zk-SNARK.

Strong SNARK: all sublinear terms are log(C)\log(|C|).

So in SNARK, prover can not simply send a ww, for ww might be long (wC|w|\leq |C|) and it may be hard to verify C(x,w)=0C(x,w)=0.

Observe that SS is randomized for setup phase. If rr is revealed to PP, it can prove false statements. This is because while vpvp is visible from PP, it can hide some key structures invisible from PP without knowing the random rr.

The pre-processing has different types:

  • transparent setup: S(C)S(C) uses no random bit.
  • trusted but universal setup: S=(Sinit,Sindex)S=(S_{\text{init}}, S_{\text{index}}), Sinit(r)=gpS_{\text{init}}(r)=gp generates global parameters with secret rr, Sindex(gp,C)=(pp,vp)S_{\text{index}}(gp,C)=(pp,vp) is deterministic.
  • trusted setup per circuit: S(C;r)S(C;r) uses random bits for every circuit CC.

Argument of Knowledge

Here we use trusted but universal setup.

Definition (Adaptive Knowledge Soundness). A preprocessing NARK (S,P,V)(S, P, V) is (adaptively) knowledge sound for a circuit CC if for every polynomial-time adversary A=(A0,A1)A = (A_0, A_1) such that:
gpSinit(1λ;r),(C,x,st)A0(gp),(pp,vp)Sindex(C),πA1(pp,x,st)\begin{aligned} & gp \leftarrow S_{\text{init}}(1^\lambda;r), \\ & (C, x, \text{st}) \leftarrow A_0(gp), \\ & (pp, vp) \leftarrow S_{\text{index}}(C), \\ & \pi \leftarrow A_1(pp, x, \text{st}) \end{aligned}

and

Pr[V(vp,x,π)=accept]>1/106(non-negligible w.r.t. λ)\Pr[V(vp, x, \pi) = \text{accept}] > 1/10^6 \quad (\text{non-negligible w.r.t. } \lambda)

there exists an efficient extractor EE (that uses AA) such that:

gpSinit(1λ;r),(C,x,st)A0(gp),wEA(gp,C,x)\begin{aligned} & gp \leftarrow S_{\text{init}}(1^\lambda;r), \\ & (C, x, \text{st}) \leftarrow A_0(gp), \\ & w \leftarrow E^A(gp, C, x) \end{aligned}

and

Pr[C(x,w)=0]>1/106ϵ(for a negligible ε w.r.t. λ).\Pr[C(x, w) = 0] > 1/10^6 - \epsilon \quad (\text{for a negligible } \varepsilon\text{ w.r.t. } \lambda).

Adversary chooses (C,x)(C, x) after seeing gpgp (adaptive), then produces a proof π\pi. If AA produces an accepting proof with non-negligible probability, then EE can extract a valid witness ww with essentially the same probability (up to negligible ε\varepsilon).

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\mathsf{setup}(1^\lambda)\to gp, outputs public parameters gpgp
  • commit(gp,f,r)com\mathsf{commit}(gp, f, r)\to \mathsf{com}, commitment to fFf \in \mathcal{F} with rRr \in \mathcal{R} randomly chosen
  • open(com,f,r)\mathsf{open}(\mathsf{com}, f, r): if com=commit(gp,f,r)\mathsf{com} = \mathsf{commit}(gp, f, r), then open(com,f,r)=1\mathsf{open}(\mathsf{com}, f, r) = 1; otherwise open(com,f,r)=0\mathsf{open}(\mathsf{com}, f, r) = 0

satisfying hiding and binding properties:

  • Binding: for all PPT adversary A\mathcal{A}
Pr[gpsetup(1λ)(comf,f0,r0,f1,r1)A(gp):(f0,r0)(f1,r1)  comf=Commit(gp,f0,r0)  comf=Commit(gp,f1,r1)]negl(λ)\Pr\left[ \begin{array}{l} gp \leftarrow \mathsf{setup}(1^\lambda) \\ (\mathsf{com}_f, f_0, r_0, f_1, r_1) \leftarrow \mathcal{A}(gp) \end{array} : \begin{array}{l} (f_0, r_0) \neq (f_1, r_1) \\ \wedge \; \mathsf{com}_f = \mathsf{Commit}(gp, f_0, r_0) \\ \wedge \; \mathsf{com}_f = \mathsf{Commit}(gp, f_1, r_1) \end{array} \right] \le \mathsf{negl}(\lambda)
  • Hiding: for all PPT adversary A=(A1,A2)\mathcal{A}=(\mathcal{A}_1,\mathcal{A}_2):
Pr[gpSetup(1λ)(f0,f1,st)A1(gp)b{0,1},  rRcomfCommit(gp,fb,r)bA2(st,comf):b=b]12negl(λ)\left| \Pr\left[ \begin{array}{l} gp \leftarrow \mathsf{Setup}(1^\lambda) \\ (f_0, f_1, st) \leftarrow \mathcal{A}_1(gp) \\ b \leftarrow \{0,1\}, \; r \leftarrow \mathcal{R} \\ com_f \leftarrow \mathsf{Commit}(gp, f_b, r) \\ b' \leftarrow \mathcal{A}_2(st, com_f) \end{array} : b' = b \right] - \frac{1}{2} \right| \le \mathsf{negl}(\lambda)

also defined as computational indistinguishability.

Note: the rr in the open algorithm is the same as that in the commit algorithm.

After sender’s commitment, the sender should also send (x,r)(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)(x,r)), we define functional commitment scheme.

Definition (Functional Commitment Scheme). A functional commitment scheme for F={f:XY}\mathcal{F}=\{f:X\mapsto Y\}:
  • setup(1λ)gp\mathsf{setup}(1^\lambda)\to gp, outputs public parameters gpgp
  • commit(gp,f,r)comf\mathsf{commit}(gp, f, r)\to \mathsf{com}_f , commitment to fFf \in \mathcal{F} with rRr \in \mathcal{R}, which is a binding (and hiding for zk-SNARK) commitment scheme for F\mathcal{F}
  • eval(P,V)\mathsf{eval}(P, V): for a given comf\mathsf{com}_f and all xXx \in X:
open(gp,f,x,r)short proof π and value yY\mathsf{open}(gp, f, x, r) \to \text{short proof } \pi\text{ and value }y\in Y
verify(gp,comf,x,y,π)accept/reject\mathsf{verify}(gp, \mathsf{com}_f, x, y, \pi) \to \text{accept/reject}

satisfying

  • Completeness: If fFf \in \mathcal{F} and xXx \in X with f(x)=yf(x)=y, then Pr[V(gp,comf,x,y,π)=accept]=1\Pr[V(gp, \mathsf{com}_f, x, y, \pi) = \mathsf{accept}] = 1.
  • Knowledge Soundness: (setup    commit,open,verify)(\mathsf{setup}\;\|\;\mathsf{commit}, \mathsf{open}, \mathsf{verify}) is knowledge sound.

The interaction within eval(P,V)\mathsf{eval}(P,V) is actually a SNARK for the relation (circuit)

{(gp,comf,x,y):(f,r),f(x)=y,fF,comf=commit(gp,f,r)}\{(gp,\mathsf{com}_f,x,y): \exists (f,r),f(x)=y, f\in\mathcal{F},\mathsf{com}_f=\mathsf{commit}(gp, f, r)\}

whose witness is essentially (f,r)(f,r). The proof π\pi actually proves that fFf\in\mathcal{F}, f(x)=yf(x)=y and comf\mathsf{com}_f is a commitment to ff.

The definition above essentially illustrates an interactive process. It is like the verifier “queries” the oracle ff at xx with an additional cost of verifying.

ProverVerifierr$R,comfcommit(gp,f,r)comfx  x$Xyf(x),πopen(gp,f,x,y,r)y,π  verify(gp,comf,x,y,π)accept/reject\begin{align*} &\text{Prover}&&&\text{Verifier}\\ &r\xleftarrow{\$}R,\mathsf{com}_f\leftarrow\mathsf{commit}(gp, f, r)&\xrightarrow{\mathsf{com}_f}&&\\ &&\xleftarrow{x}&\;&x\xleftarrow{\$} X\\ &y\leftarrow f(x),\pi\leftarrow\mathsf{open}(gp, f, x, y, r)&\xrightarrow{y,\pi}&\;&\mathsf{verify}(gp, \mathsf{com}_f, x, y, \pi) \to \text{accept/reject} \end{align*}

With the scheme above we commit to a function. The F\mathcal{F} vary from many different function classes.

  • Polynomial commitments: F=Fd[X]\mathcal{F} = \mathbb{F}^{\leq d}[X]
  • Multilinear commitments: F=F1[X1,,Xn]\mathcal{F} = \mathbb{F}^{\leq 1}[X_1, \ldots, X_n], where the degree is defined the maximum degree of the polynomial in every variable (1\leq1 means multilinear)
  • Vector commitments: F={fu:[n]F:f(i)=ui,uFn}\mathcal{F} = \{f_u: [n] \to \mathbb{F}:f(i) = u_i,u\in\mathbb{F}^n\}
  • Inner product commitments: F={fu:FnF:fu(v)=u,v,uFn}\mathcal{F} = \{f_{u}: \mathbb{F}^n \to \mathbb{F}:f_{u}(v) = \langle u,v\rangle, u\in\mathbb{F}^n\}

Building Blocks 2: F\mathcal{F}-Interactive Oracle Proof

IOP is a proof system that proves the prover knows ww such that C(x,w)=0C(x,w)=0. The verifier uses oracles of fFf\in\mathcal{F}, which is later replaced by functional commitments to construct a SNARK; here we use oracles.

Definition (F\mathcal{F}-IOP): An F\mathcal{F}-IOP is a proof system that proves w,  C(x,w)=0\exists w,\;C(x,w)=0 and consists of
  • setup(1λ)pp,vp=(Oraclefs,,Oraclef0)\mathsf{setup}(1^\lambda)\to pp,vp=(\mathsf{Oracle}_{f_{-s}},\dots,\mathsf{Oracle}_{f_{0}})
  • At round i[t]i\in[t], prover PP sends Oraclefi\mathsf{Oracle}_{f_i} where fif_i is based on the interaction history from view of PP; verifier sends ri$Rr_i\xleftarrow{\$} R unless i=ti=t.
  • verifyOraclefs,,Oracleft(vp,x,r1,,rt1)\mathsf{verify}^{\mathsf{Oracle}_{f_{-s}},\dots,\mathsf{Oracle}_{f_t}}(vp,x,r_1,\dots,r_{t-1}) uses (fi)i=st(f_i)_{i=-s}^t as oracles and output the result.

which satisfies

  • Completeness: If w,  C(x,w)=0\exists w,\;C(x,w)=0, then the verifier is bound to accept
  • Knowledge Soundness: if we use comf\mathsf{com}_f’s for Oraclef\mathsf{Oracle}_f’s, the extractor can use (fi)i=st(f_{i})_{i=-s}^t to compute ww because the functional commitment scheme is knowledge sound (functional commitment scheme is actually a SNARK).
  • (Optional) Zero-Knowledge