banner
social-twittersocial-githubsocial-github

Notes on (Super)spartan

I think that the superspartan paper doesn't lack maths, but a bit of motivation and intuition. Hence, I will sometimes handwave the maths in the benefit of prose. Note that superspartan is a generalization of spartan. The intuition that we lay out also works for spartan.

Superspartan is a polynomial IOP for CCS, described in the same paper. Let's quickly review here the notational definition from the CCS paper, for reading practicality.

A CCS structure S\mathcal{S} consists of:

  • Size bounds m,n,N,l,t,q,dNm, n, N, l, t, q, d \in N where n>Nn \gt N
  • A sequence of matrices M0,,Mt1Fm×nM_0, \dots, M_{t-1} \in F^{m \times n}
  • A sequence of qq multisets [S0,,Sq1S_0, \dots, S_{q-1}] where an element in each multiset is from the domain 0,,t1{0, \dots, t-1} and the cardinality of each multiset is at most dd
  • A sequence of qq constants [c0,,cq1c_0, \dots, c_{q-1}], where each constant is from FF.

Superspartan leverages the sumcheck protocol. Sumcheck is an interactive protocol between a prover PP and a verifier VV. PP uses sumcheck to convince VV that a claimed sum HH is equal to the summation of a polynomial over an hypercube of size kk. That is, PP wants to convince VV that for a given multivariate polynomial g(x0,,xk)g(x_0, \dots, x_k):

Σ{0,1}kg(x0,,xk)=H\Sigma_{\{0, 1\}^{k}} g(x_0, \dots, x_k) = H

where {0,1}k\{0, 1\}^{k} is the hypercube of size kk. Sumcheck requires kk communication rounds and a final oracle query of VV to evaluate g(x0,...,xk)g(x_0, ..., x_k) at a random point rFkr \in F^{k}.

An intuitive explanation for superspartan

Turning the CCS into MLEs

Let z=(1,x,w)z = (1, x, w), where ww is a purported satisfying witness for a CCS structure-instance tuple (S,x)(\mathcal{S}, x). In the context of superspartan, a prover PP wants to convince a verifier VV that a zz vector is a satisfying assignment to a CCS structure S\mathcal{S}.

In the preprocessing phase, turn CCS matrices M0,,Mt1M_0, \dots, M_{t-1} into a set of multilinear extensions (MLEs) in log(m)+log(n)log(m) + log(n) variables: M~0(x,y),,M~t1(x,y)\widetilde{M}_{0}(x, y), \dots, \widetilde{M}_{t-1}(x, y). Do the same for the zz vector, to obtain Z~(y)\widetilde{Z}(y), an MLE in log(n)log(n) variables.

Using the definition of an MLE, observe that for, say M0M_0, turning it into an MLE means that we will get M~0(x,y)=M0[x][y]\widetilde{M}_0(x, y) = M_0[x][y]. MLEs re-interpret matrices as functions in log(m)+log(n)log(m) + log(n) variables. Similarly, for the vector zz, Z~(y)=z[y]\widetilde{Z}(y) = z[y]. This is (roughly) the preprocessing step for superspartan: MLEs are used to turn the original CCS into a set of low-degree polynomials.

Next, using those low-degree polynomials, PP will use the sumcheck protocol to convince VV that the CCS instance-structure tuple (x,S)(x, \mathcal{S}) is satisfied by zz.

Prove the knowledge of a satisfying assignment, with sumcheck

Once the MLE pre-processing is done, the idea is to prove that zz satisfies (S,x)(\mathcal{S}, x) with sumcheck. To do this, PP and VV will perform two invocations of the sumcheck protocol. The first invocation consists into PP showing that when turned into an MLE, say g(x0,,xk)g(x_0, \dots, x_k) where k=log(n)+log(m)k = log(n) + log(m), the CCS is satisfied by zz.

However, VV will need to evaluate g(x0,,xk)g(x_0, \dots, x_k) at a random point to conclude this first sumcheck invocation (the final oracle query mentioned above). Hence, the second sumcheck invocation will consists into PP convincing VV that the evaluation of g(x0,,xk)g(x_0, \dots, x_k) at the first sumcheck invocation's random point rar_a is correct.

Superspartan, commented

I'm commenting here the pseudocode laid out in figure 2 (p.15). I'm not a fiat-shamir expert, so I omitted what should be hashed to obtain random challenges.

  1. PP sends VV the MLE of ww, noted W~\widetilde{W}
  2. VV sends a random challenge τ\tau to PP. PP uses fiat shamir to obtain τ\tau non-interactively
  3. Apply the sum check protocol over the CCS-turned-MLE g(x0,,xk)g(x_0, \dots, x_k) polynomial. Observe that the sum in equation (15)(15) is basically the sum used for checking that a CCS is satisfied by a witness ww, in equation (2)(2). Hence, this first sum check is used to prove that the sum of g(x0,,xk)g(x_0, \dots, x_k), done over the hypercube of size log(m)log(m), is 0. Observe that eq~(τ,a)\widetilde{eq}(\tau, a) enforces this sum to be done a specific row of the CCS; i.e. a row "selected" by the verifier using a random challenge. At the end of this first sumcheck, VV still has to ensure that the final evaluation g(ra)g(r_a) is correct, for raFlog(m)r_a \in F^{log (m)}.
  4. VV sends a random challenge γ\gamma to PP. Using fiat-shamir, PP obtains it non-interactively
  5. PP sends claimed sums over the hypercube of size log(n)log(n) for M~(ra,y)Z~(y)\widetilde{M}(r_a, y) \cdot \widetilde{Z}(y). To check those claimed sum, VV and PP run the sum check protocol to compute the sum over the hypercube of size log(n)log(n) of a random linear combination of γiM~(ra,y)Z~(y)\gamma^{i} \cdot \widetilde{M}_(r_a, y) \cdot \widetilde{Z}(y). The random linear combination is useful to avoid running as many sumcheck invocations as they are matrices and instead run a single one

When all of the above is done, VV performs the three following checks:

  1. The claimed sums for M~(ra,y)Z~(y)\widetilde{M}(r_a, y) \cdot \widetilde{Z}(y) are correct. Simply take their random linear combination and compare the result to the second sumcheck proof.
  2. The final evaluation γiM~(ra,ry)Z~(ry)\gamma^{i} \cdot \widetilde{M}_(r_a, r_y) \cdot \widetilde{Z}(r_y) is correct. VV has access to those MLEs as oracles, the check is straightforward.
  3. Using the above sums for M~(ra,y)Z~(y)\widetilde{M}(r_a, y) \cdot \widetilde{Z}(y), compute the evaluation g(ra)g(r_a) and assert that it is equal to the claimed evaluation in the first sumcheck invocation.