Circle Stark: from a new Starker

  • 白菜
  • 发布于 2024-08-16 13:51
  • 阅读 1141

circle stark: perspective from a new stark

Originates from my hackmd note

Domain

Firstly we need to look into domain DD, which the polynomial p(x)p(x) defines over.


Traditional Domain

Usually the domain DD is a cyclic multiplicative sub-group HH defined over finite prime field FpF_p, say F13F_{13}, then F13×=6=12|F_{13}^{\times}| = |\langle 6 \rangle| = 12, there is a order-44 subgroup:

H=63H = \langle 6^3 \rangle

generally speaking:

D=H=gm=gmD = H = \langle g^m \rangle = \langle g_m \rangle

where gg is generator of multiplicative group Fp×F_{p}^{\times}, and gmg_m is the generator of DD or HH.


Therefore we have the belowing evaluation table Y=p(X)Y = p(X), where XDX \in D:

X1gmgm2...gmn1Ye0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} X & 1 & g_m & g_m^2 & ... & g_m^{n - 1} \\ \hline Y & e_0 & e_1 & e_2 & ... & e_{n - 1} \end{array}

Obviousely p(X)p(X) is a univariate polynomial, as XX is one-diamentional coordinate, and evaluation domain DD is a multiplicative group.


Circle Domain

While in circle domain, XX is not one-diamentional coordinate anymore, it's two-diamentional coordinates, it's a bivariate polynomial p(x,y)p(x, y), and its domain DD is a additive group rather a multiplicative group.


Assuming there's a additive cyclic group GG:

G={(x,y);x2+y2=1,x,yFp}G = \{(x, y); x^2 + y^2 = 1, x, y \in F_p \}

where G=g=64|G| = |\langle g \rangle| = 64. There is subgroup:

D=H={g+[i]g2,i<32}D = H = \{ g + [i]g_2, i < 32 \}

where g2=[2]gg_2 = [2] g, we must have D=32|D| = 32.


Therefore we have the following evaluation table Y=p(X)Y = p(X), where XHX \in H:

Xg=(x0,y0)[3]g=[3](x0,y0)[5]g=[5](x0,y0)...[63]g=[63](x0,y0)Ye0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} X & g = (x_0, y_0) & [3]g = [3](x_0, y_0) & [5]g = [5](x_0, y_0) & ... & [63]g = [63](x_0, y_0) \\ \hline Y & e_0 & e_1 & e_2 & ... & e_{n - 1} \end{array}

Everthing looks well? actually it's not.


If you take a close look at its domain DD:

D=H={g+[i]g2,i<32}D = H = \{ g + [i]g_2, i < 32 \}

you'll notice that, it's not a additive cyclic group, as it does not even have a generator! So we must correct it, we can not call DD as a group anymore, maybe domain is more accurate.


FFT

Secondly, given a vector of evaluations:

e=[e0,e1,e2,e3,...,e31]e = [e_0, e_1, e_2, e_3, ..., e_{31}]

we want to get its coefficient represented polynomial p(x)p(x), aka polynomial coefficient vector, through a interpolation algorithm, say:

c=[c0,c1,c2,c3,...,c31]c = [c_0, c_1, c_2, c_3, ..., c_{31}]

This is what FFT does.


Traditional FFT

First Round

Given univairate polynomial evaluation table Y=p(X),XD={gmi,i<n}Y = p(X), X \in D = \{ g_m^i, i < n \}:

X1gmgm2...gmn1Ye0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} X & 1 & g_m & g_m^2 & ... & g_m^{n - 1} \\ \hline Y & e_0 & e_1 & e_2 & ... & e_{n - 1} \end{array}

we need to solve the coefficients of polynomial p(X)p(X) through FFTFFT interpolation.


Divide p(X)p(X) into two sub-polynomials f0(X)f_0(X) and f1(X)f_1(X):

X21gm2gm4...gmn2f0(X2)e0+en12e1+en22e2+en32...en/21+en/22f1(X2)e0en121e1en22gme2en32gm2...en/21en/22gmn/21\def\arraystretch{1.5} \begin{array}{c:c:c} X^2 & 1 & g_m^2 & g_m^4 & ... & g_m^{n - 2} \\ \hline f_0(X^2) & \frac{e_0 + e_{n - 1}}{2} & \frac{e_1 + e_{n - 2}}{2} & \frac{e_2 + e_{n - 3}}{2} & ... & \frac{e_{n / 2 - 1} + e_{n / 2}}{2} \\ \hdashline f_1(X^2) & \frac{e_0 - e_{n - 1}}{2 \cdot 1} & \frac{e_1 - e_{n - 2}}{2 \cdot g_m} & \frac{e_2 - e_{n - 3}}{2 \cdot g_m^2} & ... & \frac{e_{n / 2 - 1} - e_{n / 2}}{2 \cdot g_m^{n / 2 - 1}} \\ \end{array}

where :

p(X)=f0(X2)+Xf1(X2){f0(X2)=p(X)+p(X)2f1(X2)=p(X)p(X)2X\begin{aligned} p(X) = f_0(X^2) + X \cdot f_1(X^2) \\ \Longrightarrow \begin{cases} f_0(X^2) = \frac{p(X) + p(-X)}{2} \\ f_1(X^2) = \frac{p(X) - p(-X)}{2 \cdot X} \\ \end{cases} \end{aligned}

.


The coefficient vector of polynomial p(X)p(X) is reduced into coefficient vectors of f0(X2)f_0(X^2) and f1(X2)f_1(X^2) with halved domain size.


Evaluation vector becomes:

p(X)={e0,e1,e2,e3,...,e31}{f0(X2)={e0+e312,e1+e302,...}f1(X2)={e0e3121,e1+e302g2,...}\begin{aligned} p(X) = \{ e_0, e_1, e_2, e_3, ..., e_{31} \} \\ \Longrightarrow \begin{cases} f_0(X^2) = \{ \frac{e_0 + e_{31}}{2}, \frac{e_1 + e_{30}}{2}, ... \} \\ f_1(X^2) = \{ \frac{e_0 - e_{31}}{2 \cdot 1}, \frac{e_1 + e_{30}}{2 \cdot g_2}, ... \} \\ \end{cases} \end{aligned}

Domain becomes:

D={1,g2,g4,g6,...,g62}D1={1,g4,g8,g12,...,g60}\begin{aligned} D = \{ 1, g_2, g_4, g_6, ..., g_{62} \} \\ \Longrightarrow D_1 = \{ 1, g_4, g_8, g_{12}, ..., g_{60} \} \\ \end{aligned}

Second and The Rest Rounds

Given the evaluation table of f0(X)f_0(X):

X1g4g8...g60Ye0+e312e1+e302e2+e292...e15+e162\def\arraystretch{1.5} \begin{array}{c:c:c} X & 1 & g_4 & g_8 & ... & g_{60} \\ \hline Y & \frac{e_0 + e_{31}}{2} & \frac{e_1 + e_{30}}{2} & \frac{e_2 + e_{29}}{2} & ... & \frac{e_{15} + e_{16}}{2} \end{array}

Then coefficient vector of f0(X)f_0(X) is reduced into f00(X2)f_{00}(X^2) and f01(X2)f_{01}(X^2) with halved domain size again after applying FFT algorithm, similarily works for f1(X)f_1(X):

X1g4g8...g60Ye0e3121e1e302g2e2e292g4...e15e162g30\def\arraystretch{1.5} \begin{array}{c:c:c} X & 1 & g_4 & g_8 & ... & g_{60} \\ \hline Y & \frac{e_0 - e_{31}}{2 \cdot 1} & \frac{e_1 - e_{30}}{2 \cdot g_2} & \frac{e_2 - e_{29}}{2 \cdot g_4} & ... & \frac{e_{15} - e_{16}}{2 \cdot g_{30}} \end{array}

apply FFT algorithm recursively on f0(X)f_0(X) and f1(X)f_1(X) lognlog{n} times, we'll get the final coefficients of univaritate polynomial p(X)p(X).


Circle FFT

First Round

Given bivairate polynomial evaluation table Y=p(X),XD={g+[i]g2,i<n}Y = p(X), X \in D = \{ g + [i]g_2, i < n \}:

Xg=(x0,y0)[3]g=[3](x0,y0)[5]g=[5](x0,y0)...[2n1]g=[2n1](x0,y0)Ye0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} X & g = (x_0, y_0) & [3]g = [3](x_0, y_0) & [5]g = [5](x_0, y_0) & ... & [2n - 1]g = [2n - 1](x_0, y_0) \\ \hline Y & e_0 & e_1 & e_2 & ... & e_{n - 1} \end{array}

similarily we need to solve the coefficients of polynomial p(X)p(X) through interpolation.


But the problem in front of us is that XX is a two-diamentional coordinates, say X=(x,y)X = (x, y), so the polynomial would be more complex than the one with one-diamentional coordinates. say:

p(X)=p(x,y)=3x+2x2+y5x2+y24+y34x3p(X) = p(x, y)= 3x + 2x^2 + y \cdot 5x^2 + y^2 \cdot 4 + y^3 \cdot 4x^3

Luckly any p(x,y)p(x, y) can also be converted into two sub-polynomials f0(x)f_0(x) and f1(x)f_1(x) as traditional FFT does:

p(x,y)=f0(x)+yf1(x)p(x, y) = f_0(x) + y \cdot f_1(x)

since (x,y)(x, y) is circle points satisfying:

x2+y2=1x^2 + y^2 = 1

we must have y2=1x2y^2 = 1 - x^2. so the above toy polynomial case can be divided into:

f0(x)=3x+2x2+(1x2)4f1(x)=5x2+(1x2)4x3\begin{aligned} f_0(x) &= 3x + 2x^2 + (1 - x^2) \cdot 4\\ f_1(x) &= 5x^2 + (1 - x^2) \cdot 4x^3 \\ \end{aligned}

It's a amazing property for circle domain, isn't it?


The bivariate polynomial p(x,y)p(x, y) can also be splitted into two univariate polynomials f0(x)f_0(x) and f1(x)f_1(x):

f0(x)=p(x,y)+p(x,y)2f1(x)=p(x,y)p(x,y)2y\begin{aligned} f_0(x) = \frac{p(x, y) + p(x, -y)}{2} \\ f_1(x) = \frac{p(x, y) - p(x, -y)}{2 \cdot y} \\ \end{aligned}

the evaluation table of them would be like below:

Xgg3=[3]gg5=[5]g...gn1=[n1]gf0(x)=f0(X.x)e0+e312e1+e302e2+e292...e15+e162f1(x)=f1(X.x)e0e312g.ye1e302g3.ye2e292g5.y...e15e162gn1.y\def\arraystretch{1.5} \begin{array}{c:c:c} X & g & g_3 = [3]g & g_5 = [5]g & ... & g_{n - 1} = [n - 1]g \\ \hline f_0(x) = f_0(X.x) & \frac{e_0 + e_{31}}{2} & \frac{e_1 + e_{30}}{2} & \frac{e_2 + e_{29}}{2} & ... & \frac{e_{15} + e_{16}}{2} \\ \hdashline f_1(x) = f_1(X.x) & \frac{e_0 - e_{31}}{2 \cdot g.y} & \frac{e_1 - e_{30}}{2 \cdot g_3.y} & \frac{e_2 - e_{29}}{2 \cdot g_5.y} & ... & \frac{e_{15} - e_{16}}{2 \cdot g_{n - 1}.y} \\ \end{array}

and the domain XX has already been halved.


Second and The Rest Rounds

Given evaluation table of polynomial f0(x)f_0(x) (not bivariate polynomial anymore):

xg.xg3.xg5.x...gn1.xf0(x)e0+e312e1+e302e2+e292...e15+e162\def\arraystretch{1.5} \begin{array}{c:c:c} x & g.x & g_3.x & g_5.x & ... & g_{n - 1}.x \\ \hline f_0(x) & \frac{e_0 + e_{31}}{2} & \frac{e_1 + e_{30}}{2} & \frac{e_2 + e_{29}}{2} & ... & \frac{e_{15} + e_{16}}{2} \\ \end{array}

we need to resolve the coefficients of univariate polynomial f0(x)f_0(x) through FFT algorithm:

x2g2.xg6.xg10.x...gn2.xf00(x2)((e0+e31)/2)+((e15+e16)/2)2((e1+e30)/2)+((e14+e17)/2)2......((e7+e24)/2)+((e8+e23)/2)2f01(x2)((e0+e31)/2)((e15+e16)/2)2g.x............\def\arraystretch{1.5} \begin{array}{c:c:c} x^2 & g_2.x & g_6.x & g_{10}.x & ... & g_{n - 2}.x \\ \hline f_{00}(x^2) & \frac{((e_0 + e_{31}) / 2) + ((e_{15} + e_{16}) / 2)}{2} & \frac{((e_1 + e_{30}) / 2) + ((e_{14} + e_{17}) / 2)}{2} & ... & ... & \frac{((e_7 + e_{24}) / 2) + ((e_8 + e_{23}) / 2)}{2} \\ \hline f_{01}(x^2) & \frac{((e_0 + e_{31}) / 2) - ((e_{15} + e_{16}) / 2)}{2 \cdot g.x} & ... & ... & ... & ... \\ \end{array}

similarly it works for f1(x)f_1(x). Then apply FFT algorithm recursively logn\log{n} times, we will finally get the coefficients of bivariate polynomial p(x,y)p(x, y).


Circle iFFT

First Round

Givent coefficients of bivariate polynomials:

Cp(x,y)c0c1c2...cn1\def\arraystretch{1.5} \begin{array}{c:c:c} C_{p(x, y)} & c_0 & c_1 & c_2 & ... & c_{n - 1} \\ \hdashline \end{array}

we want to get the evaluations on the entire circle domain:

p(x,y)e0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} p(x, y) & e_0 & e_1 & e_2 & ... & e_{n - 1} \\ \hline \end{array}

The original polynomial is composed of two sub-polynomials:

p(x,y)=f0(x)+yf1(x),(x,y){g+[i]g2,i<n}p(x, y) = f_0(x) + y \cdot f_1(x), (x, y) \in \{ g + [i]g_2, i < n \}

thanks to its symmetry property, we can divide it into two parts:

pL(x,y)=f0(x)+yf1(x),(x,y){g+[i]g2,i<n/2}pR(x,y)=f0(x)yf1(x),(x,y){g+[i]g2,i<n/2}\begin{aligned} p_L(x, y) = f_0(x) + y \cdot f_1(x), (x, y) \in \{ g + [i]g_2, i < n / 2 \} \\ p_R(x, y) = f_0(x) - y \cdot f_1(x), (x, y) \in \{ g + [i]g_2, i < n / 2 \} \\ \end{aligned}

where pL(x,y)p_L(x, y) is the left (above xx-coordinate) part, pR(x,y)p_R(x, y) is the right (below xx-coordinate) part.


Therefore solving the evaluations of original bivariate polynomial is reduced into the evaluations of univariate sub-polynomials f0(x)f_0(x) and f1(x)f_1(x).



Second and The Rest Rounds

Given coefficients of univariate polynomial f0(x)f_0(x):

Cf0(x)c0c2...cn2\def\arraystretch{1.5} \begin{array}{c:c:c} C_{f_0(x)} & c_0 & c_2 & ... & c_{n - 2} \\ \hdashline \end{array}

similarly the univariate polynomial f0(x)f_0(x) consists two parts:

f0L(x)=f00(x)+xf01(x),x=t.x,t{g2+[i]g4,i<n/2}f0R(x)=f00(x)xf01(x),x=t.x,t{g2+[i]g4,i<n/2}\begin{aligned} {f_0}_L(x) = f_{00}(x) + x \cdot f_{01}(x), x = t.x, t \in \{ g_2 + [i] g_4, i < n / 2 \} \\ {f_0}_R(x) = f_{00}(x) - x \cdot f_{01}(x), x = t.x, t \in \{ g_2 + [i] g_4, i < n / 2 \} \\ \end{aligned}

apply iFFT algorithm recursively we will finally get the evaluations over entire circle domain DD:

p(x,y)e0e1e2...en1\def\arraystretch{1.5} \begin{array}{c:c:c} p(x, y) & e_0 & e_1 & e_2 & ... & e_{n - 1} \\ \hdashline \end{array}

FRI

How FRI Works

Originally, FRI prover needs to prove that p0(x,y)p_0(x, y) (evaluation vector) is close to a low-degree (trace) polynomial t(x)t(x) with certain degree-bound dd, where the evaluation domain size D|D| is blow-up factor ss times of dd, say D=sd|D| = s \cdot d.


For the purpose of hidden for witness, say p0(x,y)p_0(x, y), prover compress this evaluation vector into ONE field element through merkle commitment, say C0C_0. Concequently, prover prove that C0C_0 is close to a low-degree (trace) polynomial t(x)t(x) with degree-bound dd. Accordingly, verifier need to check consistency of commitment C0C_0 as well.


Unfortunately, degree dd is too big, low degree testing on this would be much too costy, so FRI operator comes. FRI operator reduce evaluation vector p0(x,y)p_0(x, y) into half-sized p1(x,y)p_1(x, y), then prover need to prove p1(x,y)p_1(x, y) is close to low-degree polynomial t1(x)t_1(x) with degree-bound d/2d/2. Recursively apply FRI operator more times until the final degree-bound d/2kd / 2^{k} is small enough, prover only need to prove that pk(x,y)p_k(x, y) is close to low-degree polynomial tk(x)t_k(x) with degree-bound d/2kd / 2^k .


Actually the folding process of FRI operator is non-succinct, prover need to prove the folding is correctly executed. And the verifier need to check ths consistency of folding as well, besides lower-degree testing.


Sum up, prover needs to finish three tasks:

  • commit evaluation vector pi(x,y)p_i(x, y) into CkC_k with merkle hash, and provide merkle proofs for openings (merkle tree path)

  • FRI operator, fold original evaluation vector p0(x,y)p_0(x, y) into pk(x,y)p_k(x, y), and provide folding proofs for openings (leaves of folding tree), and also need to provide merkle proof for these folding proofs (leaves of folding tree)

  • low degree testing, check whether the final evaluation vector pk(x,y)p_k(x, y) is close to polynomial tk(x)t_k(x) with low degree-bound d/2kd / 2^k.


Verifier needs to finish three tasks:

  • check consistency of merkle commititment CkC_k, with provided merkle proof

  • check consistency of FRI folding, through pre-defined query times' folding non-succinctly with provided folding proofs

  • check consistency of low degree testing on pk(x,y)p_k(x, y), through one time FFT interpolation


Circle FRI

Circle FRI is a FRI protocol based on circle domain (satisfying x2+y2=1x^2 + y^2 = 1), not single prime field based domain anymore.


Merkle Commitment and FRI Operator

Mainly consists two parts, preparaion of folding and fold:

  • prepare domain/evaluation vector to be folded

    assuming there's a evaluation domain with cardinality-3232:

    D={g+[i]g2,i<32}={g,g3,g5,...,g63}D = \{ g + [i] g_2, i < 32 \} = \{ g, g_3, g_5, ..., g_{63} \}

    • half-sized circle domain

      DL={g,g5,g9,...,g61}D_L = \{ g, g_5, g_9,..., g_{61} \}

      Due to symmetry of circle domain, there's no need to store all elements of domain, half-sized circle domain is enough.

      The remaining part is reversed of circle domain DLD_L, say DR=DL={g63,g59,g55,...,g3}D_R = -D_L = \{ g_{63}, g_{59}, g_{55}, ..., g_3 \}


    • bit-reverse ordered circle domain

    DL={g,g33,g17,...,g61}DR={g63,g31,g47,...,g3}\begin{aligned} D_L' &= \{ g, g_{33}, g_{17}, ..., g_{61} \} \\ D_R' &= \{ g_{63}, g_{31}, g_{47}, ..., g_3 \} \\ \end{aligned}
    • combine the bit-reverse ordered circle domain
    D0={g,g63,g33,g31,g17,g47,...,g61,g3}D_0 = \{g, g_{63}, g_{33}, g_{31}, g_{17}, g_{47}, ..., g_{61}, g_3 \}
    • similarily works for evaluations
    E0={e0,e31,e16,e15,e8,e23,...,e30,e1}E_0 = \{ e_0, e_{31}, e_{16}, e_{15}, e_8, e_{23}, ..., e_{30}, e_1 \}

  • fold evaluation vector round-by-round

    • Merkle commit with concat and hashes

    • Squeeze a folding factor α\alpha after pushing the merkle root

    • FRI operator, fold evaluation vector constant times per-round


      First fold 👎
      given evaluation table of bivariate polynomial p0(X)=p0(x,y)p_0(X) = p_0(x, y):

      Xgg63g33g31...g61g3p0(X)e0e31e16e15...e30e1\def\arraystretch{1.5} \begin{array}{c:c:c} X & g & g_{63} & g_{33} & g_{31} & ...& g_{61} & g_3 \\ \hline p_0(X) & e_0 & e_{31} & e_{16} & e_{15} & ...& e_{30} & e_1 \\ \end{array}

      where gg is defined in circle domain.


      In first layer, since:

      p0L(X)=f0(X.x)+yf1(X.x),X{g+[i]g2,i<n/2}p0R(X)=f0(X.x)yf1(X.x),X{g+[i]g2,i<n/2}\begin{aligned} {p_0}_L(X) = f_0(X.x) + y \cdot f_1(X.x), X \in \{g + [i]g_2, i < n / 2 \} \\ {p_0}_R(X) = f_0(X.x) - y \cdot f_1(X.x), X \in \{ g + [i]g_2, i < n / 2 \} \\ \end{aligned}

      the bivariate polynomial p0(X)p_0(X) can be splitted into two univariate polynomials f0(X.x)f_0(X.x) and f1(X.x)f_1(X.x):

      Xgg33...g3f0(X.x)e0+e312e16+e152...e30+e12f1(X.x)e0e312g.ye16e152g33.y...e30e12g3.yp1(X.x)e0+e312+αe0e312g.ye16+e152+αe16e152g33.y...e30+e12+αe30e12g3.y\def\arraystretch{1.5} \begin{array}{c:c:c} X & g & g_{33} & ... & g_3 \\ \hline f_0(X.x) & \frac{e_0 + e_{31}}{2} & \frac{e_{16} + e_{15}}{2} & ... & \frac{e_{30} + e_1}{2} \\ \hdashline f_1(X.x) & \frac{e_0 - e_{31}}{2 \cdot g.y} & \frac{e_{16} - e_{15}}{2 \cdot g_{33}.y} & ... & \frac{e_{30} - e_1}{2 \cdot g_3.y} \\ \hdashline p_1(X.x) & \frac{e_0 + e_{31}}{2} + \alpha \cdot \frac{e_0 - e_{31}}{2 \cdot g.y} & \frac{e_{16} + e_{15}}{2} + \alpha \cdot \frac{e_{16} - e_{15}}{2 \cdot g_{33}.y} & ... & \frac{e_{30} + e_1}{2} + \alpha \cdot \frac{e_{30} - e_1}{2 \cdot g_3.y} \\ \end{array}

      Second and the rest folds 👎

      Given (pre-folded) evaluation table of univariate polynomial p1(X.x)p_1(X.x):

      Xgg33...g3p1(X.x)e0+e312+αe0e312g.ye16+e152+αe16e152g33.y...e30+e12+αe30e12g3.y\def\arraystretch{1.5} \begin{array}{c:c:c} X & g & g_{33} & ... & g_3 \\ \hline p_1(X.x) & \frac{e_0 + e_{31}}{2} + \alpha \cdot \frac{e_0 - e_{31}}{2 \cdot g.y} & \frac{e_{16} + e_{15}}{2} + \alpha \cdot \frac{e_{16} - e_{15}}{2 \cdot g_{33}.y} & ... & \frac{e_{30} + e_1}{2} + \alpha \cdot \frac{e_{30} - e_1}{2 \cdot g_3.y} \\ \end{array}

      In second layer, since:

      p1L(X.x)=f0(X2.x)+X.xf1(X2.x)p1R(X.x)=f0(X2.x)X.xf1(X2.x)\begin{aligned} {p_1}_L(X.x) = f_0(X^2.x) + X.x \cdot f_1(X^2.x) \\ {p_1}_R(X.x) = f_0(X^2.x) - X.x \cdot f_1(X^2.x) \\ \end{aligned}

      the univariate polynomial p1(X.x)p_1(X.x) can be splitted into two univariate polynomials f0(X2.x)f_0(X^2.x) and f1(X2.x)f_1(X^2.x) where X2X^2 is the doubled of XX in circle domain. Similarily we do the linear folding as well, obtain a new half-sized univariate polynomial p2(X.x)p_2(X.x).


Decommitment

fri_folding_proof.drawio

Verifier sample mm points q={q0,q1,...,qm1}q = \{ q_0, q_1, ..., q_{m - 1} \} within evaluation domain and send them to prover, prover provide two kinds of proofs for these points, and proof of low-degree test:

  • folding proof for consistency check of sample values

    If FRI operator continues until low-degree bound reaches the bottom, say d/2k=1d / 2^k = 1, then the maximum number of folding would be N=logdN = \log{d}. We get the exact number of folding proof, say 2N12 N - 1.


    The total size of folding proof of mm-queries would be m(2N1)m \cdot (2N - 1).


  • merkle proof for authentication of sample values and their folding proof (consistency of merkle commitment)

    If we also take the ultimate folding, we need to provide merkle proof for each folding proof, including the sample values themselves. Therefore we can also get the exact number of merkle proof for this, say N+(N1)+(N2)+...+1=(1+N)N2N + (N - 1) + (N - 2) + ... + 1 = \frac{(1 + N)N}{2} .


    The total size of merkle proof of mm-queries would be m(1+N)N2m \cdot \frac{(1 + N)N}{2} .


  • low-degree test proof, that's the final folded evaluation vector pk(x,y)p_k(x, y)

    If we take the ultimate folding as well, we can get the exact number of low-degree test proof, that is what we called blow-up factor .


In summary, the time complexity of single query is O(N2)=O(log2d)O(N^2) = O(\log^2{d}). Actually there's no need to do the ultimate folding, it's all fine as long as the low-degree bound d/2kd / 2^k is small enough.


Quotient Polynomial

Recall that, there's a polynomial f(x)f(x) (xx is defined over some evaluation domain DD), prover want to prove f(u)=vf(u) = v. Then the quotient polynomial comes:

q(x)=f(x)vxu;u,vDq(x) = \frac{f(x) - v}{x - u}; u, v \in D

where xFx \in F, and DFD \subset F. Prover need to prove existence of the quotient polynomial.


If polynomial f(x)f(x) is not a univariate-based domain anymore, how about f(X)f(X) and XX is a bivariate-based domain, say circle domain?


Circle Quotient

Let's take a toy example, say:

f(X)=f(x,y)=3x+4y,XD={g+[i]g2,i<n}f(X) = f(x, y) = 3 x + 4 y, X \in D = \{ g + [i]g_2, i < n \}

evaluate on one point PP, we get f(P)=vf(P) = v, namely:

3P.x+4P.yv=03 P.x + 4 P.y - v = 0

Similarily the quotient polynomial comes:

q(X)=f(X)vXP;PDq(X) = \frac{f(X) - v}{X - P}; P \in D

where XFX \in F, and FF is the entire circle domain.


The problem is how to represent this quotient polynomial, which is a line through one point PP? It seems impossible, since there are uncountable lines through one point. Indeed it is true in univariate coordinate space. But it also holds in bivariate coordinate, what we need is a trick.


Let's fix the xx-part of f(x,y)f(x, y), say:

f(y)=4y=v3xf(y) = 4 y = v - 3 x

this is what'd love to see, as f(y)f(y) is a univariate polynomial, not a bivariate one anymore. So, evaluation on P.yP.y, it would be like:

f(P.y)=4P.y=v0f(P.y) = 4 P.y = v_0

But it is not enough to determine f(P)=vf(P) = v, since there are two solutions P.xP.x and P.x-P.x for P.yP.y in circle domain, satisfying x2+y2=1x^2 + y^2 = 1. So we need another point PP' (Vitalik call it dummy point), who's relevant to PP, to make this line uniqueness.


Actually there're many solutions to this, in Stwo implementation, they provide a extreme cheap method Conjugation, namely to say:

P=Pˉ=(P.xˉ,P.yˉ)P' = \bar{P} = (P.\bar{x}, P.\bar{y})

as P.x,P.yP.x, P.y are QM31 field elements, conjugation of P.yˉP.\bar{y} is just a negation of CM31 field, cheaper enough! So, we can interpolate the polynomial f(X)f(X) with these points PP and Pˉ\bar{P}:

f(X)X1f(P)P1f(Pˉ)Pˉ1\begin{vmatrix} f(X) & X & 1 \\ f(P) & P & 1 \\ f(\bar{P}) & \bar{P} & 1 \\ \end{vmatrix}

Theoretically [2]P[2]P, [3]P[3]P, ..., [k]P[k]P all are fine, let's take [2]P[2]P as a example:

[2]P=(2P.x21,2P.xP.y)[2]P = (2 \cdot P.x^2 - 1, 2 \cdot P.x \cdot P.y)

it requires one multiplication of QM31 field, much more expensive than conjugation, so we choose conjugation method instead.


The circle quotient is formalized as:

q(X)=f(X)f(P)VP(X)q(X) = \frac{f(X) - f(P)}{V_{P}(X)}

but how to compute this it anyway? Let's split it into two parts, nominator part f(X)f(P)f(X) - f(P), and denominator part VP(X)V_P(X).


Nominator of Circle Quotient

f(X)f(P)f(X) - f(P) is a bivariate polynomial who vanishes at single point PP, f(X)f(X) can be converted into a univariate line through (P.y,v)(P.y, v) and (Pˉ.y,vˉ)(\bar{P}.y, \bar{v}) as what we've already illustrated above:

f(X)=f(X)X.y1vP.y1vˉPˉ.y1=v+(vˉv)X.yP.yPˉ.yP.yf(X) = \begin{vmatrix} f(X) & X.y & 1 \\ v & P.y & 1 \\ \bar{v} & \bar{P}.y & 1 \\ \end{vmatrix} = v + (\bar{v} - v) \cdot \frac{X.y - P.y}{\bar{P}.y - P.y}

Denominator of Circle Quotient

Vanishing polynomial can be represented as:

VP(X)=(PX).y1+(PX).xV_P(X) = \frac{(P - X).y}{1 + (P - X).x}

where PXP - X is arithemtic on additive circle group.


Put it all together, we have the final circle quotient polynomial:

q(X)=f(X)f(P)VP(X)=(v+(vˉv)X.yP.yPˉ.yP.y)1+(PX).x(PX).yq(X) = \frac{f(X) - f(P)}{V_P(X)} = (v + (\bar{v} - v) \cdot \frac{X.y - P.y}{\bar{P}.y - P.y}) \cdot \frac{1 + (P - X).x}{(P - X).y}

where XFX \in F.


Folding Paradigm

fri_fold.drawio

In folding paradigm, we often see one word non-succinct. Yes, the folding helps prover compress a big proof into a much smaller proof, so verifier can verify it efficiently. But what we must not ignore is the overhead folding induces. And folding is not always succinct, in FRI, verifier need to do the same folding as prover did, fortunately verifier only need to do few times' folding depending on the number of queries.


If the cost of verifying original proof π0\pi_0 is t0t_0, verifying the final compressed proof π2\pi_2 is t2t_2, and cost of folding on query points is tkt_k. Then we must have:

t0t2+tkt_0 \ll t_2 + t_k

Thanks

Special thanks to weikengchen for his input on circle quotients, and learns a lot from his work on Bitcoin Wildlife Sanctuary, finally give great thanks to victor from starkware for his inputs during implementing stwo with bitcoin scripts.


References

[1] Circle Stark

[2] Stwo

[3] Stark 101

[4] Bitcoin Circle Stark

[5] Vitalik Circle Stark Blog

点赞 0
收藏 0
分享
本文参与登链社区写作激励计划 ,好文好收益,欢迎正在阅读的你也加入。

0 条评论

请先 登录 后评论