LogoLogo
LogoLogo
  • Introduction
    • About Us
    • Notations & Definitions
      • MPC
      • ZK
    • Contribute to this Site!
  • Primitives
    • Multiplication
      • Karatsuba Multiplication
      • Toom-Cook Multiplication
    • NAF (Non-adjacent form)
    • Chinese Remainder Theorem (CRT)
    • Euclidean Algorithm
      • Extended Euclidean Algorithm
      • Binary Euclidean Algorithm
      • Extended Binary Euclidean Algorithm
    • Coding Theory
      • Linear Code
    • Number Theoretic Transform
    • Abstract Algebra
      • Group
        • -Morphisms
        • Batch Inverse
      • Elliptic Curve
        • Weierstrass Curve
          • Coordinate Forms
          • Fast Elliptic Curve Arithmetic and Improved WEIL Pairing Evaluation
        • Edwards Curve
          • Coordinate Forms
          • Twisted Edwards ↔ Short Weierstrass Transformation
        • Batch Inverse for Batch Point Additions
        • Scalar Multiplication
          • Double-and-add
          • GLV Decomposition
        • MSM
          • Pippenger's Algorithm
          • Signed Bucket Index
          • CycloneMSM
          • EdMSM
          • cuZK
        • 2-Chain and 2-Cycle of Elliptic Curves
    • Encryption Scheme
      • ElGamal Encryption
    • Modular Arithmetic
      • Modular Reduction
        • Barrett Reduction
        • Montgomery Reduction
      • Modular Inverse
        • Bernstein-Yang's Inverse
    • Multiset Check
    • Sumcheck
    • Commitment Scheme
      • Fflonk
      • SHPlonk
      • Zeromorph
  • MPC
    • Yao's Garbled Circuits
    • GMW
    • BMR
  • ZK
    • Arithmetization
      • R1CS
      • PLONK
      • AIR
    • Folding
      • LatticeFold
      • Nova
        • Nova over Cycles of Curves
    • Lookup
      • Lasso
      • LogUp-GKR
    • SNARK
      • Groth16
      • HyperPlonk
      • Spartan
        • SPARK
    • STARK
      • Additive NTT
      • Basefold
      • Binius
      • Brakedown
      • CircleSTARK
      • FRI
        • FRI Security Features and Optimizations
      • DEEP FRI
      • STIR
      • WHIR
    • Distributed ZK
      • Ryan's Trick for Distributed Groth16
  • Application
    • zkLogin
    • zkHoldem
    • zkTLS
      • DECO
      • Proxying is enough
  • zkVM
Powered by GitBook
On this page
  • Introduction
  • Background
  • Problem statement
  • Succinct interactive arguments of knowledge
  • The sumcheck protocol
  • Multilinear polynomial extension
  • Polynomial commitment scheme for multilinear polynomials
  • Protocol Explanation
  • R1CS as a multivariate function
  • Functions to polynomials
  • Putting them together for NIZK
  • Computation commitments: zkSNARK from NIZK
  • Experimental Results
  • References
Export as PDF
  1. ZK
  2. SNARK

Spartan

Presentation: https://www.youtube.com/watch?v=adsGo7DvkJ8

PreviousHyperPlonkNextSPARK

Last updated 2 months ago

Introduction

Various constructions for zkSNARKs over R1CS exist—, for instance, achieves O(nlog⁡n)O(n \log n)O(nlogn) proving time and O(1)O(1)O(1) proof size, but requires a per-statement trusted setup with a large common reference string. Recent transparent zkSNARKs, such as Hyrax, STARK, Aurora, Ligero, and Bulletproofs, eliminate the need for trusted setups yet often impose limitations like circuit restrictions or linear verification costs. In Spartan, a new zkSNARK for arbitrary R1CS instances with sub-linear verification cost is introduced.

Background

Problem statement

Prior works are still lacking to achieve truly succinct SNARK without any trusted setup.

  • The computational model of is layered arithmetic circuits, where the verifier’s costs and the proof sizes scale linearly in the depth of the circuit. For a depth-ddd circuit, converting to a layered form increases the circuit size by a factor of O(d)O(d)O(d), so Hyrax is restricted to low-depth circuits. Also, Hyrax achieves sublinear verification costs only for circuits with a uniform structure (e.g., data-parallel circuits).

  • requires circuits with a sequence of identical sub-circuits, otherwise it does not achieve sublinear verification costs. Any circuit can be converted to this form, but the transformation increases circuit sizes by 10–1000×, which translates to a similar factor increase in the prover’s costs ().

  • , , and incur O(n)O(n)O(n) verification costs.

So to summarize, there is two main challenges with achieving succinct verification:

  1. Arbitrary circuits have no structure.

  2. The verifier must know what statement is being proven. Because of these challenges, the verification must have complexity of at least O(∣C∣)O(|C|)O(∣C∣) where ∣C∣|C|∣C∣ implies circuit size.

Spartan solution: Verifier preprocesses the circuits - without secret trapdoors to avoid any form of trusted setup.

  • Verifier retains a commitment to the circuit.

  • Preprocessing incurs O(∣C∣)O(|C|)O(∣C∣) costs but is amortized.

The amortized cost here implies that even though the upfront computational or resource expense might be high, when spread over a large number of operations or over time, the average cost per operation becomes more manageable or efficient.

Succinct interactive arguments of knowledge

The sumcheck protocol

This proof system does not require a trusted setup. It can be made zero-knowledge and non-interactive with existing compilers but still cannot be used as a zkSNARK. The main two reasons for this are:

  1. We need an efficient reduction from R1CS statements to sumcheck instances.

  2. The proof system is not succinct (both proof sizes and verification times).

Multilinear polynomial extension

Polynomial commitment scheme for multilinear polynomials

Protocol Explanation

R1CS as a multivariate function

Functions to polynomials

Observe that:

So let's denote it as the following:

\displaylines{\bar{A}(r_x)=\sum_{y\in\{0,1\}^s}\tilde{A}(r_x,y)\cdot\tilde{Z}(y) \newline \bar{B}(r_x)=\sum_{y\in\{0,1\}^s}\tilde{B}(r_x,y)\cdot\tilde{Z}(y)\newline \bar{C}(r_x)=\sum_{y\in\{0,1\}^s}\tilde{C}(r_x,y)\cdot\tilde{Z}(y)}
  1. Verifier uses sumcheck to verify:

Putting them together for NIZK

Cost Analysis

  • Prover:

  • Verifier:

  • Communication cost:

Computation commitments: zkSNARK from NIZK

Experimental Results

References

From this paper, we adopt the notation ⟨A(za),B(zb)⟩(x)\langle\mathcal{A}(z_a),\mathcal{B}(z_b)\rangle(x)⟨A(za​),B(zb​)⟩(x) to denote the random variable representing the local output of machine B\mathcal{B}B when interacting with the machine A\mathcal{A}A on common input xxx, when the random tapes for each machine are uniformly and independently chosen, and A\mathcal{A}A and B\mathcal{B}B has auxiliary inputs zaz_aza​ and zbz_bzb​, respectively.

Let ⟨P,V⟩\langle\mathcal{P},\mathcal{V}\rangle⟨P,V⟩ denote a pair of algorithms and Setup\mathsf{Setup}Setup denotes an algorithm that outputs public parameters pp\mathsf{pp}pp given as input the security parameter λ\lambdaλ.

from the paper. A protocol between a pair of algorithms ⟨P,V⟩\langle\mathcal{P},\mathcal{V}\rangle⟨P,V⟩ is called a public-coin succinct interactive argument of knowledge for a language L\mathcal{L}L if:

Completeness. For any problem instance x∈L\mathbf{x}\in\mathcal{L}x∈L, there exists a witness www such that for all r∈{0,1}∗r\in\{0, 1\}^{*}r∈{0,1}∗, Pr{⟨P(pp,w),V(pp,r)⟩(x)=1}≥1−negl(λ)\mathsf{Pr}\{\langle\mathcal{P}(\mathsf{pp},w),\mathcal{V}(\mathsf{pp},r)\rangle(\mathbf{x}) = 1\} ≥ 1 − \mathsf{negl}(\lambda)Pr{⟨P(pp,w),V(pp,r)⟩(x)=1}≥1−negl(λ).

Soundness. For any non-satisfiable problem instance x\mathbf{x}x, any PPT prover P∗P^∗P∗ , and for all w,r∈{0,1}∗w,r\in\{0, 1\}^∗w,r∈{0,1}∗, Pr{⟨P∗(pp,w),V(pp,r)⟩(x)=1}≤negl(λ)Pr\{\langle\mathcal{P}^* (\mathsf{pp},w), \mathcal{V}(\mathsf{pp},r)⟩(\mathbf{x}) = 1\} ≤ \mathsf{negl}(\lambda)Pr{⟨P∗(pp,w),V(pp,r)⟩(x)=1}≤negl(λ).

Knowledge soundness. For any PPT adversary A\mathcal{A}A, there exists a PPT extractor E\mathcal{E}E such that for any problem instance x\mathbf{x}x and for all w,r∈{0,1}∗w,r\in\{0, 1\}^∗w,r∈{0,1}∗ , if Pr{⟨A(pp,w),V(pp,r)⟩(x)=1}≥negl(λ)\mathsf{Pr}\{\langle\mathcal{A}(pp, w), \mathcal{V}(\mathsf{pp},r)⟩(\mathbf{x}) = 1\} \geq\mathsf{negl}(\lambda)Pr{⟨A(pp,w),V(pp,r)⟩(x)=1}≥negl(λ), then Pr{SatL(x,w′)=1∣w′←EA(pp,x)}≥negl(λ)\mathsf{Pr}\{\mathsf{Sat}_\mathcal{L}(\mathbf{x},w') = 1|w'\leftarrow\mathcal{E}^{\mathcal{A}}(\mathsf{pp}, \mathbf{x})\} \geq \mathsf{negl}(\lambda)Pr{SatL​(x,w′)=1∣w′←EA(pp,x)}≥negl(λ).

Succinctness. The total communication between P\mathcal{P}P and V\mathcal{V}V is sublinear in the size of the NP statement x∈L\mathbf{x}\in\mathcal{L}x∈L.

Public coin. V\mathcal{V}V's messages are chosen uniformly at random.

Using , a prover can prove statements of the form:

∑x∈{0,1}μG(x)=?T\sum_{\bm{x}\in\{0,1\}^\mu}\mathcal{G}(\bm{x})\stackrel{?}{=}Tx∈{0,1}μ∑​G(x)=?T

We can denote the sumcheck protocol as IsSat←⟨Psc,Vsc(r)⟩(G,μ,l,T)\mathsf{IsSat}\leftarrow\langle\mathcal{P}_{sc},\mathcal{V}_{sc}(\bm{r})\rangle(\mathcal{G},\mu,l,T)IsSat←⟨Psc​,Vsc​(r)⟩(G,μ,l,T) for any μ\muμ-variate polynomial G\mathcal{G}G with degree at most lll in each variable. This is typically reduced to the claim G(r)=?e\mathcal{G}(\bm{r})\stackrel{?}{=}eG(r)=?e and using μ\muμ round interactive protocol which can be denoted as e←⟨Psc(G),Vsc(r)⟩(μ,l,T)e\leftarrow\langle\mathcal{P}_{sc}(\mathcal{G}),\mathcal{V}_{sc}(\bm{r})\rangle(\mu,l,T)e←⟨Psc​(G),Vsc​(r)⟩(μ,l,T)

Generally, the verifier must evaluate G\mathcal{G}G at some random point in its domain r=(r1,…,rμ)\bm{r}=(r_1,\dots,r_\mu)r=(r1​,…,rμ​).

. (Multilinear polynomial) A multivariate polynomial is called a multilinear polynomial if the degree of the polynomial in each variable is at most one.

. (Low-degree polynomial) A multivariate polynomial G\mathcal{G}G over a finite field F\mathbb{F}F is called low-degree polynomial if the degree of G\mathcal{G}G in each variable is exponentially smaller than ∣F∣|\mathbb{F}|∣F∣.

Low-degree extensions (LDEs). Suppose g:{0,1}μ→Fg:\{0,1\}^\mu\rightarrow\mathbb{F}g:{0,1}μ→F is a function that maps μ\muμ-bit elements into an element of F\mathbb{F}F. A polynomial extension of ggg is a low-degree μ\muμ-variate polynomial g~(⋅)\tilde{\mathcal{g}}(\cdot)g~​(⋅) such that g~(x)=g(x)\tilde{\mathcal{g}}(\bm{x})=\mathcal{g}(\bm{x})g~​(x)=g(x) for all x∈{0,1}μ\bm{x}\in\{0,1\}^\mux∈{0,1}μ.

Multilinear extension (MLE) is a LDE where the extension is a multilinear polynomial. Given a function Z:{0,1}μ→FZ:\{0,1\}^\mu\rightarrow\mathbb{F}Z:{0,1}μ→F, the MLE of Z(⋅)Z(\cdot)Z(⋅) is the unique multilinear polynomial Z~:Fμ→F\tilde{Z}:\mathbb{F}^\mu\rightarrow\mathbb{F}Z~:Fμ→F. It can be computed as follows:

Z~(x1,…,xμ)=∑e∈{0,1}mZ(e)⋅∏i=1μ(xi⋅ei+(1−xi)⋅(1−ei)=∑e∈{0,1}μZ(e)⋅eq~(x,e)\widetilde{Z}(x_1,\dots,x_\mu)=\sum_{\bm{e}\in\{0,1\}^m}Z(\bm{e})\cdot \prod_{i=1}^\mu(x_i\cdot e_i + (1-x_i)\cdot (1-e_i) \\ = \sum_{\bm{e}\in\{0,1\}^\mu}Z(\bm{e})\cdot \widetilde{\mathsf{eq}}(\bm{x},\bm{e})Z(x1​,…,xμ​)=e∈{0,1}m∑​Z(e)⋅i=1∏μ​(xi​⋅ei​+(1−xi​)⋅(1−ei​)=e∈{0,1}μ∑​Z(e)⋅eq​(x,e)

Note that eq~(x,e)\widetilde{\mathsf{eq}}(\bm{x},\bm{e})eq​(x,e) is the MLE of the following function:

eq(x,e)={1if x=e0otherwise\mathsf{eq}(\bm{x},\bm{e})= \begin{cases} 1 &\text{if}\ \bm{x}=\bm{e} & \\ 0 & \text{otherwise} \end{cases} eq(x,e)={10​if x=eotherwise​

For any r∈Fμ\bm{r}\in \mathbb{F}^\mur∈Fμ, Z~(r)\tilde{Z}(\bm{r})Z~(r) can be computed in O(2μ)O(2^\mu)O(2μ) operations in F\mathbb{F}F. [, ]

A polynomial commitment scheme for multilinear polynomials is a tuple of four protocols PC=(Setup,Commit,Open,Eval)\mathsf{PC} = (\mathsf{Setup}, \mathsf{Commit}, \mathsf{Open}, \mathsf{Eval})PC=(Setup,Commit,Open,Eval).

pp←Setup(1λ,μ)\mathsf{pp} \leftarrow \mathsf{Setup}(1^λ, \mu)pp←Setup(1λ,μ): takes as input μ\muμ (the number of variables in a multilinear polynomial); produces public parameters pp\mathsf{pp}pp.

(C;S)←Commit(pp;G)(\mathcal{C}; \mathcal{S}) \leftarrow \mathsf{Commit}(\mathsf{pp}; \mathcal{G})(C;S)←Commit(pp;G): takes as input a μ\muμ-variate multilinear polynomial over a finite field G∈F[X1,...,Xμ]\mathcal{G} \in \mathbb{F}[X_1,...,X_\mu]G∈F[X1​,...,Xμ​]; produces a public commitment C\mathcal{C}C and a secret opening hint S\mathcal{S}S.

b←Open(pp,C,G,S)b \leftarrow \mathsf{Open}(\mathsf{pp}, \mathcal{C}, \mathcal{G}, \mathcal{S})b←Open(pp,C,G,S): verifies the opening of commitment C\mathcal{C}C to the μ\muμ-variate multilinear polynomial G∈F[X1,…,Xμ]\mathcal{G} \in \mathbb{F}[X_1,\dots,X_\mu]G∈F[X1​,…,Xμ​] with the opening hint S\mathcal{S}S; outputs a boolean b∈{0,1}b \in \{0, 1\}b∈{0,1}.

b←Eval(pp,C,r,v;G,S)b \leftarrow \mathsf{Eval}(\mathsf{pp}, \mathcal{C}, r, v; \mathcal{G}, \mathcal{S})b←Eval(pp,C,r,v;G,S) is an interactive public-coin protocol between a prover P\mathcal{P}P and verifier V\mathcal{V}V. Both V\mathcal{V}V and P\mathcal{P}P hold a commitment C\mathcal{C}C, a scalar v∈Fv\in\mathbb{F}v∈F , and r∈Fμr\in \mathbb{F}^\mur∈Fμ. P\mathcal{P}P additionally knows a μ\muμ-variate multilinear polynomial G∈F[X1,…,Xμ]\mathcal{G} \in\mathbb{F} [X_1,\dots,X_\mu]G∈F[X1​,…,Xμ​] and its secret opening hint S\mathcal{S}S. P\mathcal{P}P attempts to convince V\mathcal{V}V that G(r)=v\mathcal{G}(r) = vG(r)=v. At the end of the protocol, V\mathcal{V}V outputs b∈{0,1}b \in \{0, 1\}b∈{0,1}.

from the paper. For any R1CS instance x=(F,A,B,C,io,m,n)\mathbf{x}=(\mathbb{F},\bm{A,B,C},\bm{io},m,n)x=(F,A,B,C,io,m,n) there exists a degree-3, log⁡m\log mlogm-variate polynomial G\mathcal{G}G such that ∑x∈{0,1}log⁡mG(x)=0\sum_{\bm{x}\in\{0,1\}^{\log m}}\mathcal{G}(\bm{x})=0∑x∈{0,1}logm​G(x)=0 if and only if there exists a witness www such that Sat(x,w)=1\mathsf{Sat}(\mathbb{x},w)=1Sat(x,w)=1 (except for a soundness error that is negligible in λ\lambdaλ). Here, nnn is the upper bound on the non-zero entries in the A,B,C\bm{A}, \bm{B}, \bm{C}A,B,C matrices.

If we denote log⁡m=s\log m = slogm=s for the sake of simplicity, for a given A,B,C∈Fm×m\bm{A,B,C}\in\mathbb{F}^{m\times m}A,B,C∈Fm×m, we can view them as functions with the following signature: {0,1}s×{0,1}s→F\{0,1\}^s\times\{0,1\}^s\rightarrow \mathbb{F}{0,1}s×{0,1}s→F. Furthermore, given a witness w\bm{w}w to instance x\mathbf{x}x, let Z=(io,1,w)\bm{Z}=(\bm{io},1,\bm{w})Z=(io,1,w). Then we can also view Z\bm{Z}Z as a function mapping {0,1}s→F\{0,1\}^s\rightarrow\mathbb{F}{0,1}s→F.

We define Fio(⋅)F_{\bm{io}}(\cdot)Fio​(⋅) that can be used to encode w\bm{w}w as:

Fio(x)=∑y∈{0,1}sA(x,y)Z(y)⋅∑y∈{0,1}sB(x,y)Z(y)−−∑y∈{0,1}sC(x,y)Z(y)F_{\bm{io}}(\bm{x})=\sum_{\bm{y}\in\{0,1\}^s}A(\bm{x,y})Z(\bm{y})\cdot\sum_{\bm{y}\in\{0,1\}^s}B(\bm{x,y})Z(\bm{y}) -\\ - \sum_{\bm{y}\in\{0,1\}^s}C(\bm{x,y})Z(\bm{y})Fio​(x)=y∈{0,1}s∑​A(x,y)Z(y)⋅y∈{0,1}s∑​B(x,y)Z(y)−−y∈{0,1}s∑​C(x,y)Z(y)

from the paper. ∀x∈{0,1}s,Fio(x)=0\forall \bm{x}\in\{0,1\}^s, F_{io}(x)=0∀x∈{0,1}s,Fio​(x)=0 if and only if Sat(x,w)=1\mathsf{Sat}(\mathbf{x},\bm{w})=1Sat(x,w)=1.

Proof. This follows from the definition of SatR1CS(x,w)\mathsf{Sat}_\mathsf{R1CS}(\mathbf{x}, \bm{w})SatR1CS​(x,w) (Section 2.1) and of Z(⋅)Z(\cdot)Z(⋅). □\square□

Unfortunately, Fio(⋅)F_{io}(\cdot)Fio​(⋅) is a function, not a polynomial, so it cannot be directly used in the sumcheck protocol. But, consider its polynomial extension F~io:Fs→F\tilde{F}_{\bm{io}}:\mathbb{F}^s\rightarrow\mathbb{F}F~io​:Fs→F:

F~io(x)=∑y∈{0,1}sA~(x,y)Z~(y)∑y∈{0,1}sB~(x,y)Z~(y)−−∑y∈{0,1}sC~(x,y)Z~(y)\tilde{F}_{\bm{io}}(\bm{x})=\sum_{\bm{y}\in\{0,1\}^s}\tilde{A}(\bm{x,y})\tilde{Z}(\bm{y})\sum_{\bm{y}\in\{0,1\}^s}\tilde{B}(\bm{x,y})\tilde{Z}(\bm{y}) - \\ - \sum_{\bm{y}\in\{0,1\}^s}\tilde{C}(\bm{x,y})\tilde{Z}(\bm{y})F~io​(x)=y∈{0,1}s∑​A~(x,y)Z~(y)y∈{0,1}s∑​B~(x,y)Z~(y)−−y∈{0,1}s∑​C~(x,y)Z~(y)

from the paper. Then, ∀x∈{0,1}s,F~io(x)=0\forall \bm{x}\in\{0,1\}^s, \tilde{F}_{\bm{io}}(\bm{x})=0∀x∈{0,1}s,F~io​(x)=0 if and only if Sat(x,w)=1\mathsf{Sat}(\mathbf{x},\bm{w})=1Sat(x,w)=1.

Proof. For any x∈{0,1}s\bm{x} \in \{0, 1\}^sx∈{0,1}s, F~io(x)=Fio(x)\tilde{F}_{\bm{io}}(x) = F_{\bm{io}}(x)F~io​(x)=Fio​(x), so the result follows from Lemma 4.1. □\square□

Since F~io(⋅)\tilde{F}_{\bm{io}}(\cdot)F~io​(⋅) is a low-degree multivariate polynomial over F\mathbb{F}F in sss variables, a verifier could check if ∑x∈{0,1}sF~io(x)=0\sum_{\bm{x}\in\{0,1\}^s}\tilde{F}_{\bm{io}}(\bm{x})=0∑x∈{0,1}s​F~io​(x)=0 using the sumcheck protocol. But the sum being 0 doesn't exactly mean that each of them was 0 since some of the terms in the sum may cancel each other out. This is addressed using a prior idea from by taking:

Gio,τ(x)=F~io(x)⋅eq~(τ,x)\mathcal{G}_{\bm{io},\tau}(\bm{x})=\tilde{F}_{\bm{io}}(\bm{x})\cdot\widetilde{\mathsf{eq}}(\bm{\tau},\bm{x})Gio,τ​(x)=F~io​(x)⋅eq​(τ,x)
Qio(τ)=∑x∈{0,1}sGio,τ(x)=∑x∈{0,1}sF~io(x)⋅eq~(τ,x)Q_{\bm{io}}(\bm{\tau})=\sum_{\bm{x}\in\{0,1\}^s}\mathcal{G}_{\bm{io},\bm{\tau}}(\bm{x})=\sum_{\bm{x}\in\{0,1\}^s}\tilde{F}_{\bm{io}}(\bm{x})\cdot\widetilde{\mathsf{eq}}(\bm{\tau},\bm{x})Qio​(τ)=x∈{0,1}s∑​Gio,τ​(x)=x∈{0,1}s∑​F~io​(x)⋅eq​(τ,x)

QioQ_{\bm{io}}Qio​ is same as F~io\tilde{F}_{\bm{io}}F~io​ over the boolean hypercube.

QioQ_{\bm{io}}Qio​ is sss-variate multilinear polynomial

∀t∈{0,1}s\forall\bm{t}\in\{0,1\}^s∀t∈{0,1}s, Qio(t)=0⇔Sat(x,w)=1Q_{\bm{io}}(\bm{t})=0 \Leftrightarrow \mathsf{Sat}(\mathbf{x},\bm{w})=1Qio​(t)=0⇔Sat(x,w)=1 . Therefore, Since it has 2s2^s2s solutions, it has to be a 0 polynomial over the Fs\mathbb{F}^sFs if and only if Sat(x,w)=1\mathsf{Sat(\mathbf{x},\bm{w})}=1Sat(x,w)=1.

This implies that Qio(τ)Q_{\bm{io}}(\bm{\tau})Qio​(τ) is zero-polynomial if and only if Sat(x,w)=1\mathsf{Sat}(\mathbb{x},w)=1Sat(x,w)=1 and to check if Qio(⋅)Q_{\bm{io}}(\cdot)Qio​(⋅) is a zero-polynomial, its enough with a single random challenge Qio(rτ)=?0Q_{\bm{io}}(\bm{r_\tau})\stackrel{?}{=}0Qio​(rτ​)=?0 where rτ∈RFs\bm{r_\tau}\in_R \mathbb{F}^srτ​∈R​Fs (this will introduce soundness error log⁡m∣F∣)\frac{\log m}{|\mathbb{F}|})∣F∣logm​).

Proof of . For a given R1CS instance x=(F,A,B,C,io,m,n)\mathbf{x} = (\mathbb{F} ,\bm{A},\bm{B},\bm{C}, \bm{io}, m, n)x=(F,A,B,C,io,m,n), define, Gio,τ(x)=F~io(x)⋅eq~(τ,x)\mathcal{G}_{\bm{io},\bm{\tau}} (\bm{x}) = \tilde{F}_{\bm{io}}(\bm{x}) \cdot\widetilde{\mathsf{eq}}(\bm{\tau}, \bm{x})Gio,τ​(x)=F~io​(x)⋅eq​(τ,x), so Qio(τ)=∑x∈{0,1}sGio,τ(x)Q_{io}(\bm{\tau}) = \sum_{\bm{x}∈\{0,1\}^s}\mathcal{G}_{\bm{io},\bm{\tau}}(\bm{x})Qio​(τ)=∑x∈{0,1}s​Gio,τ​(x). Observe that Gio,τ(⋅)\mathcal{G}_{\bm{io},\bm{\tau}}(\cdot)Gio,τ​(⋅) is a degree-3 sss-variate polynomial if multilinear extensions of A,B,C\bm{A},\bm{B},\bm{C}A,B,C, and Z\bm{Z}Z are used in F~io(⋅)\tilde{F}_{\bm{io}}(\cdot)F~io​(⋅). In the terminology of the sumcheck protocol, T=0T = 0T=0, μ=s=log⁡m\mu = s = \log mμ=s=logm, and l=3l = 3l=3. Furthermore, if rτ∈RFs\bm{r_\tau}\in_R\mathbb{F}^srτ​∈R​Fs, ∑x∈{0,1}sGio,rτ(x)=0\sum_{\bm{x}\in\{0,1\}^s} \mathcal{G}_{\bm{io},\bm{r_\tau}} (\bm{x}) = 0∑x∈{0,1}s​Gio,rτ​​(x)=0 if and only F~io(x)=0\tilde{F}_{\bm{io}}(\bm{x}) = 0F~io​(x)=0, ∀x∈{0,1}s\forall \bm{x}\in\{0,1\}^s∀x∈{0,1}s—except for soundness error that is negligible in λ\lambdaλ under the assumptions noted above (). This combined with implies the desired result.

from the paper. Given an extractable polynomial commitment scheme for multilinear polynomials, there exists a public-coin succinct interactive argument of knowledge where security holds under the assumptions needed for the polynomial commitment scheme and assuming ∣F∣|\mathbb{F}|∣F∣ is exponential in λ\lambdaλ and the size parameter of R1CS instance n=O(λ)n = O(\lambda)n=O(λ).

established that for V\mathcal{V}V to verify if an R1CS instance x=(F,A,B,C,io,m,n)\mathbf{x}=(\mathbb{F},\bm{A,B,C},\bm{io},m,n)x=(F,A,B,C,io,m,n) is satisfiable, it can check if ∑x∈{0,1}log⁡mGio,τ(x)=0\sum_{\bm{x}\in\{0,1\}^{\log m}}\mathcal{G}_{\bm{io},\bm{\tau}}(\bm{x})=0∑x∈{0,1}logm​Gio,τ​(x)=0. By using the sumcheck protocol, we can reduce the claim about the sum to ex=?Gio,τ(rx)e_x \stackrel{?}{=} \mathcal{G}_{\bm{io},\bm{\tau}}(\bm{r}_x)ex​=?Gio,τ​(rx​) where rx∈Fs\bm{r}_x\in \mathbb{F}^srx​∈Fs, so V\mathcal{V}V needs a mechanism to evaluate Gio,τ(rx)\mathcal{G}_{\bm{io},\bm{\tau}}(\bm{r}_x) Gio,τ​(rx​)—without incurring O(m)O(m)O(m) communication from P\mathcal{P}P to V\mathcal{V}V.

Now, the prover can make three separate claims Aˉ(rx)=vA,Bˉ(rx)=vB,Cˉ(rx)=vC\bar{A}(\bm{r}_x)=v_A, \bar{B}(\bm{r}_x)=v_B, \bar{C}(\bm{r}_x)=v_CAˉ(rx​)=vA​,Bˉ(rx​)=vB​,Cˉ(rx​)=vC​ and verifier can check:

Gio,τ(rx)=(vA⋅vB−vC)⋅eq~(rx,τ)=?ex\mathcal{G}_{io,\tau}(\bm{r}_x)=(v_A\cdot v_B - v_C)\cdot\widetilde{\mathsf{eq}}(r_x,\tau)\stackrel{?}=e_xGio,τ​(rx​)=(vA​⋅vB​−vC​)⋅eq​(rx​,τ)=?ex​

Of course, the verifier still needs verify the vA,vB,vCv_A, v_B, v_CvA​,vB​,vC​ claims and to do so, it can run three independent instances of sumcheck protocol but instead, we can use a to combine these into a single claim:

Verifier samples rA,rB,rC←Fr_A, r_B, r_C \leftarrow \mathbb{F}rA​,rB​,rC​←F and computes c=rA⋅vA+rB⋅vB+rC⋅vCc=r_A\cdot v_A + r_B\cdot v_B + r_C \cdot v_Cc=rA​⋅vA​+rB​⋅vB​+rC​⋅vC​.

Let L(x)=rA⋅Aˉ(x)+rB⋅Bˉ(x)+rC⋅Cˉ(x)L(\bm{x})=r_A\cdot\bar{A}(\bm{x}) + r_B\cdot\bar{B}(\bm{x})+r_C\cdot\bar{C}(\bm{x})L(x)=rA​⋅Aˉ(x)+rB​⋅Bˉ(x)+rC​⋅Cˉ(x). Then:

L(rx)=∑y∈{0,1}srA⋅A~(rx,y)Z~(y)+rB⋅B~(rx,y)Z~(y)+rC⋅C~(rx,y)Z~(y)=∑y∈{0,1}sMrx(y)L(\bm{r}_x)=\sum_{\bm{y}\in\{0,1\}^s}r_A\cdot\tilde{A}(\bm{r}_x,\bm{y})\tilde{Z}(\bm{y})+r_B\cdot\tilde{B}(\bm{r}_x,\bm{y})\tilde{Z}(\bm{y}) +r_C\cdot\tilde{C}(\bm{r}_x,\bm{y})\tilde{Z}(\bm{y}) \\ = \sum_{\bm{y}\in\{0,1\}^s}\bm{M}_{\bm{r}_x}(\bm{y})L(rx​)=y∈{0,1}s∑​rA​⋅A~(rx​,y)Z~(y)+rB​⋅B~(rx​,y)Z~(y)+rC​⋅C~(rx​,y)Z~(y)=y∈{0,1}s∑​Mrx​​(y)
rA⋅Aˉ(rx)+rB⋅Bˉ(rx)+rC⋅Cˉ(rx)=∑y∈{0,1}sMrx(y)=?cr_A\cdot\bar{A}(r_x) + r_B\cdot\bar{B}(r_x)+r_C\cdot\bar{C}(r_x)=\sum_{\bm{y}\in\{0,1\}^s}\bm{M}_{\bm{r}_x}(\bm{y})\stackrel{?}{=}crA​⋅Aˉ(rx​)+rB​⋅Bˉ(rx​)+rC​⋅Cˉ(rx​)=y∈{0,1}s∑​Mrx​​(y)=?c

Still there are some problems left. To verify the last sumcheck ∑y∈{0,1}sMrx(y)=?c\sum_{\bm{y}\in\{0,1\}^s}\bm{M}_{\bm{r}_x}(\bm{y})\stackrel{?}{=}c∑y∈{0,1}s​Mrx​​(y)=?c, the verifier has to evaluate Mrx\bm{M}_{\bm{r}_x}Mrx​​ at some random ry∈RFs\bm{r}_y\in_R \mathbb{F}^sry​∈R​Fs:

Mrx(ry)=rA⋅A~(rx,ry)Z~(ry)+rB⋅B~(rx,ry)Z~(ry)+rC⋅C~(rx,ry)Z~(ry)=(rA⋅A~(rx,ry)+rB⋅B~(rx,ry)+rC⋅C~(rx,ry))⋅Z~(ry)\bm{M}_{\bm{r}_x}(\bm{r}_y)=r_A\cdot\tilde{A}(\bm{r}_x,\bm{r}_y)\tilde{Z}(\bm{r}_y)+r_B\cdot\tilde{B}(\bm{r}_x,\bm{r}_y)\tilde{Z}(\bm{r}_y) +r_C\cdot\tilde{C}(\bm{r}_x,\bm{r}_y)\tilde{Z}(\bm{r}_y) \\ =(r_A\cdot\tilde{A}(\bm{r}_x,\bm{r}_y)+r_B\cdot\tilde{B}(\bm{r}_x,\bm{r}_y) +r_C\cdot\tilde{C}(\bm{r}_x,\bm{r}_y))\cdot\tilde{Z}(\bm{r}_y) Mrx​​(ry​)=rA​⋅A~(rx​,ry​)Z~(ry​)+rB​⋅B~(rx​,ry​)Z~(ry​)+rC​⋅C~(rx​,ry​)Z~(ry​)=(rA​⋅A~(rx​,ry​)+rB​⋅B~(rx​,ry​)+rC​⋅C~(rx​,ry​))⋅Z~(ry​)

Observe that the only term in Mrx(ry)\bm{M}_{\bm{r}_x}(\bm{r}_y)Mrx​​(ry​) that depends on the prover’s witness is Z~(ry)\tilde{Z}(\bm{r}_y)Z~(ry​). This is because all other terms in the above expression can be computed locally by V\mathcal{V}V using x=(F,A,B,C,io,m,n)\mathbf{x}=(\mathbb{F},\bm{A,B,C},\bm{io},m,n)x=(F,A,B,C,io,m,n) in O(n)O(n)O(n) time ( in the paper discusses how to reduce the cost of those evaluations to be sub-linear in nnn).

To evaluate Z~(ry)\tilde{Z}(\bm{r}_y)Z~(ry​), V\mathcal{V}V does the following. WLOG, assume ∣w∣=∣io∣+1|\bm{w}| = |\bm{io}| + 1∣w∣=∣io∣+1. Thus, by the closed form expression of multilinear polynomial evaluations, we have:

Z~(ry)=ry[0]⋅w~(ry[1..])+(1−ry[0])⋅(io,1)~(ry[1..])\tilde{Z}(\bm{r}_y)=\bm{r}_y[0]\cdot\tilde{w}(\bm{r}_y[1..]) + (1-\bm{r}_y[0])\cdot\widetilde{(\bm{io},1)} (\bm{r}_y[1..])Z~(ry​)=ry​[0]⋅w~(ry​[1..])+(1−ry​[0])⋅(io,1)​(ry​[1..])

If you recall that Z=(io,1,w)\bm{Z}=(\bm{io},1,\bm{w})Z=(io,1,w) and eq~(e,x)=∏i=1s(xi⋅ei+(1−xi)(1−ei))\widetilde{\mathsf{eq}}(\bm{e},\bm{x})=\prod_{i=1}^s(x_i\cdot e_i + (1-x_i)(1-e_i))eq​(e,x)=∏i=1s​(xi​⋅ei​+(1−xi​)(1−ei​)):

Z~(x1,…,xs)=∑e∈{0,1}sZ(e)⋅eq~(e,x)=x1⋅∑e′∈{0,1}s−1Z(1,e′)⋅eq~(e′,x[1..])++(1−x1)⋅∑e′∈{0,1}s−1Z(0,e′)⋅eq~(e′,x[1..])=x1⋅w~(x[1..])+(1−x1)⋅(io,1~)(x[1..])\tilde{Z}(x_1,\dots,x_s)=\sum_{\bm{e}\in\{0,1\}^s}Z(\bm{e})\cdot \widetilde{\mathsf{eq}}(\bm{e},\bm{x}) \\=x_1\cdot \sum_{\bm{e'}\in\{0,1\}^{s-1}}Z(1,\bm{e'})\cdot \widetilde{\mathsf{eq}}(\bm{e'},\bm{x}[1..]) + \\ +(1-x_1)\cdot \sum_{\bm{e'}\in\{0,1\}^{s-1}}Z(0,\bm{e'})\cdot \widetilde{\mathsf{eq}}(\bm{e'},\bm{x}[1..])\\ = x_1 \cdot \tilde{w}(\bm{x}[1..])+(1-x_1)\cdot\widetilde{(\bm{io},1})(\bm{x}[1..])Z~(x1​,…,xs​)=e∈{0,1}s∑​Z(e)⋅eq​(e,x)=x1​⋅e′∈{0,1}s−1∑​Z(1,e′)⋅eq​(e′,x[1..])++(1−x1​)⋅e′∈{0,1}s−1∑​Z(0,e′)⋅eq​(e′,x[1..])=x1​⋅w~(x[1..])+(1−x1​)⋅(io,1​)(x[1..])

Similar technique is also used by under the section .

We assume that there exists an extractable polynomial commitment scheme for multilinear polynomials PC=(Setup,Commit,Open,Eval)\mathsf{PC}=(\mathsf{Setup, Commit, Open, Eval)}PC=(Setup,Commit,Open,Eval).

pp←PC.Setup(1λ,s)\mathsf{pp}\leftarrow \mathsf{PC.Setup}(1^\lambda,s)pp←PC.Setup(1λ,s)

IsSat←⟨P(w),V(r)⟩(F,A,B,C,io,m,n):\mathsf{IsSat}\leftarrow\langle\mathcal{P}(\bm{w}),\mathcal{V}(r)\rangle(\mathbb{F},\bm{A},\bm{B},\bm{C},\bm{io},m,n):IsSat←⟨P(w),V(r)⟩(F,A,B,C,io,m,n):

P:(C,S)←PC.Commit(pp,w~)\mathcal{P}:(\mathcal{C},\mathcal{S})\leftarrow \mathsf{PC.Commit}(\mathsf{pp},\tilde{\bm{w}}) P:(C,S)←PC.Commit(pp,w~) and send C\mathcal{C}C to V\mathcal{V}V.

V:τ∈RFs\mathcal{V}:\bm{\tau}\in_R\mathbb{F}^{s}V:τ∈R​Fs and send τ\bm{\tau}τ to P\mathcal{P}P

Let T1=0,μ1=log⁡m,l1=3T_1=0, \mu_1=\log m,l_1=3T1​=0,μ1​=logm,l1​=3.

V:\mathcal{V}:V: Sample rx∈RFμ1\bm{r}_x\in_R\mathbb{F}^{\mu_1}rx​∈R​Fμ1​

Sumcheck #1: ex←⟨Psc(Gio,τ),Vsc(rx)⟩(μ1,l1,T1)e_x\leftarrow\langle\mathcal{P}_{sc}(\mathcal{G}_{\bm{io},\bm{\tau}}),\mathcal{V}_{sc}(\bm{r}_x)\rangle(\mu_1,l_1,T_1)ex​←⟨Psc​(Gio,τ​),Vsc​(rx​)⟩(μ1​,l1​,T1​)

P:\mathcal{P}:P: Compute Aˉ(rx)=vA,Bˉ(rx)=vB,Cˉ(rx)=vC\bar{A}(\bm{r}_x)=v_A, \bar{B}(\bm{r}_x)=v_B, \bar{C}(\bm{r}_x)=v_CAˉ(rx​)=vA​,Bˉ(rx​)=vB​,Cˉ(rx​)=vC​ and send (vA,vB,vC)→V(v_A,v_B,v_C)\rightarrow \mathcal{V}(vA​,vB​,vC​)→V.

V:\mathcal{V}:V: Abort with IsSat=0\mathsf{IsSat}=0IsSat=0 if ex≠(vA⋅vB−vC)⋅eq~(rx,τ).e_x\neq(v_A\cdot v_B - v_C)\cdot\tilde{eq}(\bm{r}_x,\bm{\tau}).ex​=(vA​⋅vB​−vC​)⋅eq~​(rx​,τ).

V:\mathcal{V}:V: Sample rA,rB,rC∈RFr_A,r_B,r_C\in_R\mathbb{F}rA​,rB​,rC​∈R​F and send them to P\mathcal{P}P.

Let T2=rA⋅vA+rB⋅vB+rC⋅vC,μ2=log⁡m,l2=2T_2=r_A\cdot v_A + r_B\cdot v_B + r_C\cdot v_C, \mu_2=\log m, l_2=2T2​=rA​⋅vA​+rB​⋅vB​+rC​⋅vC​,μ2​=logm,l2​=2.

V:\mathcal{V}:V: Sample ry∈RFμ2r_y\in_R \mathbb{F}^{\mu_2}ry​∈R​Fμ2​

Sumcheck #2: ey←⟨Psc(Mrx),Vsc(ry)⟩(μ2,l2,T2)e_y\leftarrow\langle\mathcal{P}_{sc}(\bm{M}_{\bm{r}_x}),\mathcal{V}_{sc}(\bm{r}_y)\rangle(\mu_2,l_2,T_2)ey​←⟨Psc​(Mrx​​),Vsc​(ry​)⟩(μ2​,l2​,T2​)

P:v←w~(ry[1..])\mathcal{P} : v\leftarrow \tilde{w}(r_y[1..])P:v←w~(ry​[1..]) and send vvv to V\mathcal{V}V.

IsSate←⟨PPC.Eval(w~,S),VPC.Eval(r)⟩(pp,C,ry[1..],v,μ2)\mathsf{IsSat}_e \leftarrow \langle\mathcal{P}_\mathsf{PC.Eval}(\tilde{w},\mathcal{S}),\mathcal{V}_\mathsf{PC.Eval}(r)\rangle(\mathsf{pp}, \mathcal{C},r_y[1..],v,\mu_2)IsSate​←⟨PPC.Eval​(w~,S),VPC.Eval​(r)⟩(pp,C,ry​[1..],v,μ2​)

V:\mathcal{V}:V: if IsSate==0\mathsf{IsSat}_e == 0IsSate​==0, abort with IsSat=0\mathsf{IsSat}=0IsSat=0.

V:vZ←ry[0]⋅v+(1−ry[0])⋅(io,1)~(ry[1...])\mathcal{V}: v_Z\leftarrow r_y[0]\cdot v+(1-r_y[0])\cdot\widetilde{(\bm{io},1)}(r_y[1...])V:vZ​←ry​[0]⋅v+(1−ry​[0])⋅(io,1)​(ry​[1...])

V:v1←A~(rx,ry),v2←B~(rx,ry),v3←C~(rx,ry)\mathcal{V}:v_1\leftarrow\tilde{A}(r_x,r_y),v_2\leftarrow\tilde{B}(r_x,r_y),v_3\leftarrow\tilde{C}(r_x,r_y)V:v1​←A~(rx​,ry​),v2​←B~(rx​,ry​),v3​←C~(rx​,ry​)

V:\mathcal{V}:V: Abort with IsSat=0\mathsf{IsSat}=0IsSat=0 if ey≠(rA⋅v1+rB⋅v2+rC⋅v3)⋅vZe_y\neq(r_A\cdot v_1 + r_B\cdot v_2 + r_C\cdot v_3)\cdot v_Zey​=(rA​⋅v1​+rB​⋅v2​+rC​⋅v3​)⋅vZ​

V:\mathcal{V}:V: return IsSat=1 \mathsf{IsSat}=1IsSat=1

O(n)O(n)O(n) for each sumcheck instances

Cost of PC.Commit\mathsf{PC.Commit}PC.Commit and PC.Eval\mathsf{PC.Eval}PC.Eval for log⁡m\log mlogm-variate multilinear polynomial w~(⋅)\tilde{w}(\cdot)w~(⋅).

O(log⁡m)O(\log m)O(logm) for each sumcheck instances

Cost of PC.Eval\mathsf{PC.Eval}PC.Eval for log mlog\ mlog m-variate multilinear polynomial w~(⋅)\tilde{w}(\cdot)w~(⋅)

O(n)O(n)O(n) to evaluate A~,B~,C~\tilde{A}, \tilde{B}, \tilde{C}A~,B~,C~ at (rx,ry)(\bm{r}_x, \bm{r}_y)(rx​,ry​)

O(log⁡m)O(\log m)O(logm) for each sumcheck instances

The size of the commitment to w~(⋅)\tilde{w}(\cdot)w~(⋅) and the communication in PC.Eval\mathsf{PC.Eval}PC.Eval

The protocol described above is not succinct yet since the verifier incurs costs linear in the size of the R1CS instance to evaluate A~,B~,C~\tilde{A}, \tilde{B}, \tilde{C}A~,B~,C~ at (rx,ry)(\bm{r}_x, \bm{r}_y)(rx​,ry​) on step 16. We can get around this by introducing an offline preprocessing step for V\mathcal{V}V. In this offline step, V\mathcal{V}V with access to non-io\bm{io}io portions of an R1CS instance x=(F,A,B,C,io,m,n)\mathbf{x}=(\mathbb{F},\bm{A,B,C},\bm{io},m,n)x=(F,A,B,C,io,m,n) executes the following, where ppcc←PC.Setup(1λ,2log⁡m)\mathsf{pp}_{cc} \leftarrow \mathsf{PC.Setup}(1^λ, 2 \log m)ppcc​←PC.Setup(1λ,2logm) and PC is an extractable polynomial commitment scheme for multilinear polynomials.

Encode(ppcc,(A,B,C)):\mathsf{Encode}(\mathsf{pp}_{cc},(\bm{A},\bm{B},\bm{C})):Encode(ppcc​,(A,B,C)):

(CA,⊥)←PC.Commit(ppcc,A~)(\mathcal{C}_A,\perp)\leftarrow \mathsf{PC.Commit}(\mathsf{pp}_{cc},\tilde{A})(CA​,⊥)←PC.Commit(ppcc​,A~)

(CB,⊥)←PC.Commit(ppcc,B~)(\mathcal{C}_B,\perp)\leftarrow \mathsf{PC.Commit}(\mathsf{pp}_{cc},\tilde{B})(CB​,⊥)←PC.Commit(ppcc​,B~)

(CC,⊥)←PC.Commit(ppcc,C~)(\mathcal{C}_C,\perp)\leftarrow \mathsf{PC.Commit}(\mathsf{pp}_{cc},\tilde{C})(CC​,⊥)←PC.Commit(ppcc​,C~)

After encoding, V\mathcal{V}V retains the commitments and instead of evaluating at step 16, it verifies the opening proof of A~,B~,C~\tilde{A}, \tilde{B}, \tilde{C}A~,B~,C~ at (rx,ry)(\bm{r}_x, \bm{r}_y)(rx​,ry​). Unfortunately, existing polynomial commitment schemes are not efficient enough to be practical. Since, the number of variables in A~,B~,C~\tilde{A}, \tilde{B}, \tilde{C}A~,B~,C~ is 2log⁡m2\log m2logm, existing polynomial commitment schemes incur O(22log⁡m)=O(m2)=O(n2)O(2^{2\log m})=O(m^2)=O(n^2)O(22logm)=O(m2)=O(n2) cost for the prover side. Furthermore, in schemes such as Hyrax-PC, VEval\mathcal{V}_\mathsf{Eval}VEval​ incurs O(n)O(n)O(n) costs. This problem is addressed by introducing a new cryptographic compiler to transform an existing extractable polynomial commitment scheme for dense multilinear polynomials to one that can efficiently handle sparse multilinear polynomials.

According to the table below, which is taken from the paper, among the proof-succinct NIZKs, SpartanNIZK is 100× faster than Hyrax, 113× faster than Aurora, and 22× faster than Ligero at 2202^{20}220 constraints. The commitment scheme used for this benchmark is Hyrax-PC over curve25519 ().

Written by from

sumcheck
Definition 2.8
vSQL
Avoiding Relaying the Inputs
Spartan: Efficient and general-purpose zkSNARKs without trusted setup
GGPR’s approach
Hyrax
STARK
ref
Ligero
Bulletproofs
Aurora
PPT
Definition 2.5
PPT
Definition 2.9
96
99
PPT
Theorem 4.1
Lemma 4.1
Lemma 4.2
LegoSNARK
Theorem 4.1
Lemma 4.3
Lemma 4.2
Theorem 5.1
Theorem 4.1
prior idea
Section 6
ref
A41
BATZORIG ZORIGOO
List of possible PCS schemes that can be used
Total cost of the SpartanNIZK depending on PCS choice
Performance benchmark