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
  • Motivation
  • Circle Group
  • Group Operations
  • Twin-coset and Standard Position Coset
  • Space of Polynomials
  • Vanishing Polynomial
  • Circle FFT
  • Low degree test over the Circle
  • COMMIT phase:
  • QUERY phase: (executed by the Verifier)
  • Batch Circle FRI
  • CircleSTARK
  • IOP for AIR
  • Conclusion
Export as PDF
  1. ZK
  2. STARK

CircleSTARK

PreviousBrakedownNextFRI

Last updated 3 months ago

Motivation

There is a trade-off between selecting finite fields that allow for:

  1. Efficient Arithmetic Implementations: Smaller prime fields, particularly those of special forms like Mersenne primes, enable faster arithmetic operations on standard hardware architectures.

  2. Efficient FFT Support: Fields need to have smooth multiplicative groups with large two-adic subgroups to support efficient FFTs, which are crucial for STARKs' encoding processes.

One of the most efficient fields for arithmetic seem to be Mersenne fields, defined by primes of the form p=2e−1p = 2^e − 1p=2e−1. In particular, the prime p=231−1p = 2^{31} − 1p=231−1 enables very efficient arithmetic on 32-bit architectures. Since 232=2mod  p2^{32} = 2 \mod{p}232=2modp, a widened product encoded as 232⋅xhi+xlo2^{32} \cdot x_{hi} + x_{lo}232⋅xhi​+xlo​ is trivially reduced to a much smaller quantity, 2⋅xhi+xlo2 \cdot x_{hi} + x_{lo}2⋅xhi​+xlo​. However, as p−1=2⋅32⋅7⋅11⋅31⋅151⋅331p − 1 = 2 \cdot 3^2 \cdot 7 \cdot 11 \cdot 31 \cdot 151 \cdot 331p−1=2⋅32⋅7⋅11⋅31⋅151⋅331, the multiplicative group lacks two-adic subgroups, which are useful for efficient Cooley-Tukey Fast Fourier Transforms (FFTs).

Circle Group

For p=3mod  4p=3\mod{4}p=3mod4 , a complex extension field Fp/(X2+1)\mathbb{F}_p/(X^2+1)Fp​/(X2+1) can be defined as:

C(Fp)={x+i⋅y:x,y∈Fp}\mathbb{C}(\mathbb{F}_p)=\{x + i\cdot y:x,y\in \mathbb{F}_p\}C(Fp​)={x+i⋅y:x,y∈Fp​}

For p=1mod  4p = 1 \mod{4}p=1mod4, X2+1=0X^2 + 1=0X2+1=0 has a solution since by : −1p=(−1)p−12=1\frac{-1}{p}=(-1)^{\frac{p-1}{2}}=1p−1​=(−1)2p−1​=1. This means that −1-1−1 is a and X2+1X^2+1X2+1 can be written as (X−a)(X+a)(X-a)(X+a)(X−a)(X+a) making Fp/(X2+1)\mathbb{F}_p/(X^2+1)Fp​/(X2+1) not a field.

The unit circle over Fp\mathbb{F}_pFp​ is the algebraic set C(Fp)={(x,y)∈Fp2:x2+y2=1}C(\mathbb{F}_p)=\{(x,y)\in \mathbb{F}_p^2 : x^2 + y^2 = 1\}C(Fp​)={(x,y)∈Fp2​:x2+y2=1}, or in complex representation:

C(Fp)={z∈C(Fp)×:z⋅zˉ=1}C(\mathbb{F}_p)=\{z\in \mathbb{C}(\mathbb{F}_p)^\times:z\cdot\bar{z}=1\}C(Fp​)={z∈C(Fp​)×:z⋅zˉ=1}

where zˉ\bar{z}zˉ denotes the conjugate x−iyx-iyx−iy of z=x+iyz=x+iyz=x+iy.

Lemma 1 (Unit circle group). Let Fp\mathbb{F}_pFp​ be a prime field with p=3mod  4p = 3\mod{4}p=3mod4. Then the unit circle group C(Fp)C(\mathbb{F}_p)C(Fp​) equals the group of (p+1)(p + 1)(p+1)-th roots of unity in C(Fp)×\mathbb{C}(\mathbb{F}_p)^\timesC(Fp​)×, and has order p+1p + 1p+1.

Proof: Notice that zp=(x+iy)p=xp+(iy)p=x+(ip)y=x−iy=zˉz^p=(x+iy)^p=x^p+(iy)^p=x + (i^p)y=x-iy=\bar{z}zp=(x+iy)p=xp+(iy)p=x+(ip)y=x−iy=zˉ so x2+y2=z⋅zˉ=zp+1x^2+ y^2=z\cdot\bar{z}=z^{p+1}x2+y2=z⋅zˉ=zp+1. Therefore, C(Fp)={z∈C(Fp)×:zp+1=1}C(\mathbb{F}_p)=\{z\in C(\mathbb{F}_p)^\times:z^{p+1}=1\}C(Fp​)={z∈C(Fp​)×:zp+1=1} which means C(Fp)C(\mathbb{F}_p)C(Fp​) is set of all (p+1)(p+1)(p+1)-th roots of unity. Since ∣C(Fp)×∣=p2−1|\mathbb{C}(\mathbb{F}_p)^\times|=p^2-1∣C(Fp​)×∣=p2−1 is divisible by p+1p+1p+1, the unit circle group must be the unique subgroup of order p+1p + 1p+1.

Group Operations

The p+1p + 1p+1 points of C(Fp)C(\mathbb{F}_p)C(Fp​) form a group with the group operation:

(x0,y0)⋅(x1,y1):=(x0⋅x1−y0⋅y1,x0⋅y1+y0⋅x1)(x_0, y_0) \cdot (x_1, y_1) := (x_0 \cdot x_1 − y_0 \cdot y_1, x_0 \cdot y_1 + y_0 \cdot x_1)(x0​,y0​)⋅(x1​,y1​):=(x0​⋅x1​−y0​⋅y1​,x0​⋅y1​+y0​⋅x1​)

The group has (1,0)(1, 0)(1,0) as its identity element, and for any P=(Px,Py)∈C(Fp)P = (P_x, P_y) \in C(\mathbb{F}_p)P=(Px​,Py​)∈C(Fp​), we shall call

TP(x,y):=P⋅(x,y)=(Px⋅x−Py⋅y,Px⋅y+Py⋅x)T_P(x, y) := P \cdot (x, y) = (P_x \cdot x − P_y \cdot y, P_x \cdot y + P_y \cdot x)TP​(x,y):=P⋅(x,y)=(Px​⋅x−Py​⋅y,Px​⋅y+Py​⋅x)

the translation(rotation) by PPP.

The squaring map with respect to the group operation is the quadratic map

π(x,y):=(x,y)⋅(x,y)=(x2−y2,2⋅x⋅y)=(2⋅x2−1,2⋅x⋅y)\pi(x, y) := (x, y) \cdot (x, y) = (x^2 − y^2, 2 \cdot x \cdot y) = (2 · x^2 − 1, 2 \cdot x \cdot y)π(x,y):=(x,y)⋅(x,y)=(x2−y2,2⋅x⋅y)=(2⋅x2−1,2⋅x⋅y)

and group inverses are given by the degree-one map J(x,y):=(x,−y)J(x, y) := (x, −y)J(x,y):=(x,−y)

So you can think of π\piπ as doubling the angle it forms with the xxx-axis and JJJ as a reflection by the xxx-axis.

Twin-coset and Standard Position Coset

First, Figure 2 shows how the subgroups would look like in the circle group.

Taking a coset of a subgroup means that each point in the subgroup will be rotated by the same amount.

Definition Let Gn−1G_{n-1}Gn−1​ be a cyclic subgroup of C(Fp)C(\mathbb{F}_p)C(Fp​) of size ∣Gn−1=2n−1∣|G_{n-1}=2^{n-1}|∣Gn−1​=2n−1∣ for n≥1n\geq1n≥1. Any disjoint union D=Q⋅Gn−1∪Q−1⋅Gn−1D=Q\cdot G_{n-1}\cup Q^{-1}\cdot G_{n-1}D=Q⋅Gn−1​∪Q−1⋅Gn−1​ with Q⋅Gn−1∩Q−1⋅Gn−1=∅Q\cdot G_{n-1}\cap Q^{-1}\cdot G_{n-1}=\varnothingQ⋅Gn−1​∩Q−1⋅Gn−1​=∅ is called twin-coset of size N=2nN=2^nN=2n.

Remark Twin-coset maps to itself under inverse, since

J(D)=J(Q⋅Gn−1)∪J(Q−1⋅Gn−1)=Q−1⋅Gn−1∪Q⋅Gn−1J(D)=J(Q\cdot G_{n-1})\cup J(Q^{-1}\cdot G_{n-1})=Q^{-1}\cdot G_{n-1}\cup Q\cdot G_{n-1}J(D)=J(Q⋅Gn−1​)∪J(Q−1⋅Gn−1​)=Q−1⋅Gn−1​∪Q⋅Gn−1​

Definition In the exceptional case that a twin-coset DDD of subgroup Gn−1G_{n-1}Gn−1​ is again a coset of the subgroup GnG_nGn​, we call DDD a standard position coset. Lemma 3 If DDD is a twin-coset of size 2n,n≥22^n, n\geq22n,n≥2 then its image π(D)\pi(D)π(D) is a twin-coset of size 2n−12^{n-1}2n−1. In addition, if DDD is a standard position coset, so is π(D)\pi(D)π(D).

Lemma 3 from the paper. If DDD is a twin-coset of size 2n,n≥22^n, n\geq22n,n≥2 then its image π(D)\pi(D)π(D) is a twin-coset of size 2n−12^{n-1}2n−1. In addition, if DDD is a standard position coset, so is π(D)\pi(D)π(D).

Proof: π(D)=π(Q⋅Gn−1∪Q−1⋅Gn−1)=π(Q)⋅Gn−2∪π(Q−1)Gn−2\pi(D)=\pi(Q\cdot G_{n-1}\cup Q^{-1}\cdot G_{n-1})=\pi(Q)\cdot G_{n-2}\cup\pi(Q^{-1})G_{n-2}π(D)=π(Q⋅Gn−1​∪Q−1⋅Gn−1​)=π(Q)⋅Gn−2​∪π(Q−1)Gn−2​ and if D=Q⋅GnD=Q\cdot G_{n}D=Q⋅Gn​ is a standard position coset, then π(Q⋅Gn)=π(Q)⋅Gn−1\pi(Q\cdot G_{n})=\pi(Q)\cdot G_{n-1}π(Q⋅Gn​)=π(Q)⋅Gn−1​, which means π(D)\pi(D)π(D) is also a standard position coset.

Space of Polynomials

Definition Let FFF be an extension field of Fp\mathbb{F}_pFp​. Over the circle curve, for any even integer n≥0n\geq0n≥0 we define LN(F)\mathcal{L}_N(F)LN​(F) as the space of all bi-variate polynomials with coefficients in FFF, and of total degree at most N/2N/2N/2,

LN(F)={p(X,Y)∈F[X,Y]/(X2+Y2−1):deg p≤N/2}\mathcal{L}_N(F)=\{p(X,Y)\in F[X,Y]/(X^2 + Y^2 -1) : deg\ p \leq N/2 \}LN​(F)={p(X,Y)∈F[X,Y]/(X2+Y2−1):deg p≤N/2}

For a circle STARK the bi-variate polynomials from LN(F)\mathcal{L}_N(F)LN​(F) are what low-degree extensions are for classical univariate proofs. The crucial properties of LN(F)\mathcal{L}_N(F)LN​(F) are:

  1. rotation invariance, which is needed for the next-neighbour relation and efficient encoding

  2. good separability, leading to maximum distance separable codes.

Vanishing Polynomial

Definition Let DDD be a subset of C(Fp)C(\mathbb{F}_p)C(Fp​) of even size NNN, where 2≤N<p+12\leq N < p + 12≤N<p+1. We call any non-zero polynomial from LN=LN(Fp)\mathcal{L}_N=\mathcal{L}_N(\mathbb{F}_p)LN​=LN​(Fp​), which evaluates to zero over DDD a vanishing polynomial of the set DDD. Decomposing DDD into pairs of points Pk,Qk,1≤k≤N/2{P_k, Q_k},1\leq k\leq N/2Pk​,Qk​,1≤k≤N/2 and taking the product of linear functions going through these pairs,

vD(x,y)=∏k((x−Pkx)⋅(Qky−Pky)−(y−Pky)(Qkx−Pkx))v_D(x,y)=\prod_k{((x-P_{kx})\cdot(Q_{ky}-P_{ky})-(y-P_{ky})(Q_{kx}-P_{kx}))}vD​(x,y)=k∏​((x−Pkx​)⋅(Qky​−Pky​)−(y−Pky​)(Qkx​−Pkx​))

vD(x,y)=∏k((x−Pkx)⋅(Qky−Pky)−(y−Pky)(Qkx−Pkx))v_D(x,y)=\prod_k{((x-P_{kx})\cdot(Q_{ky}-P_{ky})-(y-P_{ky})(Q_{kx}-P_{kx}))}vD​(x,y)=∏k​((x−Pkx​)⋅(Qky​−Pky​)−(y−Pky​)(Qkx​−Pkx​))shows that vanishing polynomials do exist.

Given a twin-coset D=Q⋅Gn−1∪Q−1⋅Gn−1D=Q\cdot G_{n-1}\cup Q^{-1}\cdot G_{n-1}D=Q⋅Gn−1​∪Q−1⋅Gn−1​, using Lemma 3, we can see πn−1(D)\pi^{n-1}(D)πn−1(D) will result in a twin-coset of size 2. In other words, it is in the form of πn−1(D)={(xD,yD),(xD,−yD)}\pi^{n-1}(D)=\{(x_D, y_D),(x_D,-y_D)\}πn−1(D)={(xD​,yD​),(xD​,−yD​)} for some xD,yD∈Dx_D, y_D\in DxD​,yD​∈D. We therefore may take

vD(x,y):=vn(x,y)−xDv_D(x,y):=v_n(x,y)-x_DvD​(x,y):=vn​(x,y)−xD​

with vn(x,y):=πx∘πn−1(x,y)v_n(x,y):=\pi_x\circ\pi^{n-1}(x,y)vn​(x,y):=πx​∘πn−1(x,y) where πx\pi_xπx​ is the projection onto the x-axis.

And when DDD is a standard position coset, its image πn−1(D)\pi^{n-1}(D)πn−1(D) is again a standard position coset and thus xD=0x_D=0xD​=0 (see Figure 4, rightmost image). In this case vD(x,y):=vn(x,y)v_D(x,y):=v_n(x,y)vD​(x,y):=vn​(x,y) and vDv_DvD​ can be evaluated by only O(n)O(n)O(n) field operations (2 addition and 1 multiplication in each step).

v1(x)=πx∘π0(x,y)=πx∘(x,y)=xv2(x)=2x2−1v3(x)=2(2x2−1)2−1=8x4−8x2+1…v_1(x)=\pi_x\circ \pi^0(x,y)=\pi_x\circ(x,y)=x \\ v_2(x)=2x^2 - 1\newline v_3(x)=2(2x^2-1)^2-1=8x^4-8x^2+1\\ \dotsv1​(x)=πx​∘π0(x,y)=πx​∘(x,y)=xv2​(x)=2x2−1v3​(x)=2(2x2−1)2−1=8x4−8x2+1…

Definition The circle code with values in FFF and evaluation domain DDD, is linear code with code words from the space:

CN(F,D)={f(P)∣P∈D:f∈LN(F)}\mathcal{C}_N(F,D)=\{f(P)|_{P\in D}: f\in\mathcal{L}_N(F)\}CN​(F,D)={f(P)∣P∈D​:f∈LN​(F)}

Circle FFT

Definition 1 from the paper. (CFFT-friendly prime). Any prime ppp for which (p+1)(p + 1)(p+1) is divisible by 2n+12^{n+1}2n+1 for sufficiently large n≥1n \geq 1n≥1, will be called CFFT-friendly, and any such nnn is a supported order, and N=2nN = 2^nN=2n a supported domain size.

Definition 4 from the paper. For any integer jjj from the interval 0≤j≤2n−10 \leq j \leq 2^n − 10≤j≤2n−1, let (j0,...,jn−1)∈{0,1}n(j_0, . . . , j_{n−1}) \in\{0, 1\}^n(j0​,...,jn−1​)∈{0,1}n denote its bit representation. The FFT-basis of order nnn is the family Bn\mathcal{B}_nBn​ of polynomials:

bj(n)(x,y):=yj0⋅v1(x)j1⋅...vn−1jn−1(x), 0≤j≤2n−1b^{(n)}_j (x, y) := y^{j_0} · v_1(x)^{j_1} · . . . v^{j_{n−1}}_{n−1}(x),\ 0 ≤ j ≤ 2n − 1bj(n)​(x,y):=yj0​⋅v1​(x)j1​⋅...vn−1jn−1​​(x), 0≤j≤2n−1

Consider bi-variate polynomials modulo x2+y2−1x^2 + y^2 -1x2+y2−1: F[X,Y]/(x2+y2−1)F[X,Y]/(x^2 + y^2 - 1)F[X,Y]/(x2+y2−1). Here y2≡1−x2y^2\equiv 1-x^2y2≡1−x2 so we can replace all y2y^2y2 by 1−x21-x^21−x2 and hence, all polynomials in F[X,Y]/(x2+y2−1)F[X,Y]/(x^2 + y^2 - 1)F[X,Y]/(x2+y2−1) can be represented with polynomials with deg(y)≤1deg(y) \leq 1deg(y)≤1.

This means f(X,Y)∈F[X,Y]/(x2+y2−1)f(X,Y)\in F[X,Y]/(x^2 + y^2 - 1)f(X,Y)∈F[X,Y]/(x2+y2−1) can be represented as canonical form:

f(X,Y)=f0(X)+Yf1(X)f(X,Y)=f_0(X) + Yf_1(X)f(X,Y)=f0​(X)+Yf1​(X)

And we can calculate f0(X)f_0(X)f0​(X) and f1(X)f_1(X)f1​(X) by:

f0(X)=f(X,Y)+f(X,−Y)2f1(X)=f(X,Y)−f(X,−Y)2Yf_{0}(X) = \frac{f(X,Y) + f(X,-Y)}{2}\\f_{1}(X)=\frac{f(X,Y)-f(X,-Y)}{2Y}f0​(X)=2f(X,Y)+f(X,−Y)​f1​(X)=2Yf(X,Y)−f(X,−Y)​

(JJJ-folding) First step ϕJ\phi_JϕJ​ aka πx\pi_xπx​:

f0(x)=f(x,y)+f(x,−y)2f1(x)=f(x,y)−f(x,−y)2yf0(x)+y⋅f1(x)=f(x,y)f_0(x) = \frac{f(x,y) + f(x,-y)}{2}\\f_1(x)=\frac{f(x,y)-f(x,-y)}{2y}\\f_0(x) + y\cdot f_1(x)=f(x,y)f0​(x)=2f(x,y)+f(x,−y)​f1​(x)=2yf(x,y)−f(x,−y)​f0​(x)+y⋅f1​(x)=f(x,y)

More intuitively, f0f_0f0​ is taking the average of fff and f∘Jf\circ Jf∘J while f1f_1f1​ is the difference between them divided by 2y2y2y.

(π\piπ-folding) Next step:

fk00(2⋅x2−1)=fk0(x)+fk0(−x)2fk01(2⋅x2−1)=fk0(x)−fk0(−x)2xfk00(2x2−1)+xfk01(2x2−1)=fk0(x)f_{k_00}(2\cdot x^2 - 1)=\frac{f_{k_0}(x) + f_{k_0}(-x)}{2}\\f_{k_01}(2\cdot x^2 - 1)=\frac{f_{k_0}(x) - f_{k_0}(-x)}{2x}\\f_{k_00}(2x^2 - 1) + xf_{k_01}(2x^2-1)=f_{k_0}(x)fk0​0​(2⋅x2−1)=2fk0​​(x)+fk0​​(−x)​fk0​1​(2⋅x2−1)=2xfk0​​(x)−fk0​​(−x)​fk0​0​(2x2−1)+xfk0​1​(2x2−1)=fk0​​(x)

This step is repeated recursively until we get constant functions of the form:

fk0k1k2…kn−1f_{k_0k_1k_2\dots k_{n-1}}fk0​k1​k2​…kn−1​​

These make up a constant ck=fk0,...,kn−1∈Fc_k = f_{k_0,...,k_{n−1}} \in Fck​=fk0​,...,kn−1​​∈F, for each kkk in the interval 0≤k≤2n−10 \leq k \leq 2^{n} −10≤k≤2n−1, where k=k0+k12+...+kn−12n−1k = k_0 + k_1 2+. . .+k_{n−1}2^{n−1}k=k0​+k1​2+...+kn−1​2n−1.

In Figure 6, f0(x)f_0(x)f0​(x) suddenly has only 4 points. This is because f0(x)f_0(x)f0​(x) actually has only 4 evaluation points (−A,−B,B,A)(-A, -B, B, A)(−A,−B,B,A) and is only parametrized by xxx. It is visualized on a circle for easier group operation visualization. To elaborate:

  1. f00(C)f_{00}(C)f00​(C) is the average of f0(A)f_0(A)f0​(A) and f0(−A)f_0(-A)f0​(−A).

  2. f00(−C)f_{00}(-C)f00​(−C) is the average of f0(B)f_0(B)f0​(B) and f0(−B)f_0(-B)f0​(−B).

But where did CCC come from? It denotes 2A2−12A^2-12A2−1, while −C-C−C is 2B2−12B^2-12B2−1 since A2+B2=1A^2 + B^2=1A2+B2=1 because they are from a standard position coset.

Theorem 2 Let ppp be a CFFT-friendly prime supporting the order n≥1n\geq 1n≥1, take D⊂C(Fp)D \subset C(\mathbb{F}_p)D⊂C(Fp​) a twin-coset of size ∣D∣=2n|D| = 2^n∣D∣=2n. Given f∈FDf \in F^Df∈FD a function over DDD with values in an extension field FFF of Fp\mathbb{F}_pFp​ , the above described algorithm outputs the coefficients ck∈Fc_k \in Fck​∈F, 0≤k≤2n−10 \leq k \leq 2^n-10≤k≤2n−1, with respect to the FFT basis Bn\mathcal{B_n}Bn​, so that ∑2n−1k=0ck⋅bk\sum^{2^n−1}{k=0}c_k \cdot b_k∑2n−1k=0ck​⋅bk​ evaluates to fff over DDD.

Low degree test over the Circle

Protocol 1 (Circle FRI). Let DDD be a standard position coset of size ∣D∣=2B+n|D| = 2^{B+n}∣D∣=2B+n, where B≥1B \geq 1B≥1 and n≥1n \geq 1n≥1, and let C=CN(F,D)\mathcal{C} = \mathcal{C}_N(F, D)C=CN​(F,D) be the circle code with rate ho=N+1∣D∣ho = \frac{N+1}{|D|}ho=∣D∣N+1​, where N=2nN = 2^nN=2n. For given proximity parameter θ∈(0,1−ρ)\theta \in (0, 1 − \sqrt{ρ})θ∈(0,1−ρ​), the interactive oracle proof of a function f∈FDf \in F^Df∈FD being θ\thetaθ-close to the circle code C\mathcal{C}C, consists of a commit phase and a subsequent query phase, which are as follows.

COMMIT phase:

  1. (Decomposition) The prover compute the decomposition of f∈LN(F)f\in\mathcal{L}_N(F)f∈LN​(F) into f=f(0)+λ⋅vnf=f^{(0)} +\lambda\cdot v_nf=f(0)+λ⋅vn​ with f(0)∈L(0):=LN′(F)f^{(0)}\in \mathcal{L}^{(0)}:=\mathcal{L}'_N(F)f(0)∈L(0):=LN′​(F) and λ∈F\lambda\in Fλ∈F. It sends λ\lambdaλ and commitment to f(0)f^{(0)}f(0) to the verifier.

  2. (JJJ-folding) For i=1i = 1i=1:

    1. The verifier picks uniformly random βi∈F\beta_i \in Fβi​∈F and sends it to the prover.

    2. The prover commits to a function f(i)∈L(i)f^{(i)}\in \mathcal{L}^{(i)}f(i)∈L(i) (In the case of an honest prover, f(i)=f0(i−1)+βif1(i−1)f^{(i)} = f^{(i-1)}_{0} + \beta_i f^{(i-1)}_{1}f(i)=f0(i−1)​+βi​f1(i−1)​ where f0(i−1)∘πx=f(i−1)+f(i−1)∘J2f1(i−1)∘πx=f(i−1)−f(i−1)∘J2yf^{(i-1)}_0\circ\pi_x=\frac{f^{(i-1)}+f^{(i-1)}\circ J}{2}\\f^{(i-1)}_1\circ\pi_x=\frac{f^{(i-1)}-f^{(i-1)}\circ J}{2y}f0(i−1)​∘πx​=2f(i−1)+f(i−1)∘J​f1(i−1)​∘πx​=2yf(i−1)−f(i−1)∘J​

  3. (π\piπ-folding) For i=2i = 2i=2 to rrr:

    1. The verifier picks uniformly random βi∈F\beta_i \in Fβi​∈F and sends it to the prover.

    2. The prover commits to a function f(i):L(i)→Ff^{(i)} : L^{(i)} \rightarrow Ff(i):L(i)→F. (In the case of an honest prover, f(i)=f0(i−1)+βif1(i−1)f^{(i)} = f^{(i-1)}_{0} + \beta_i f^{(i-1)}_{1}f(i)=f0(i−1)​+βi​f1(i−1)​ where

      f0(i−1)∘π=f(i−1)+f(i−1)∘T2f0(i−1)∘π=f(i−1)−f(i−1)∘T2xf^{(i-1)}_0\circ\pi=\frac{f^{(i-1)}+f^{(i-1)}\circ T}{2}\\f^{(i-1)}_0\circ\pi=\frac{f^{(i-1)}-f^{(i-1)}\circ T}{2x}f0(i−1)​∘π=2f(i−1)+f(i−1)∘T​f0(i−1)​∘π=2xf(i−1)−f(i−1)∘T​

      where T(x)=−xT(x)=-xT(x)=−x.

  4. The prover sends a value f(r)∈L(r)f^{(r)} \in \mathcal{L}^{(r)}f(r)∈L(r) in plain.

QUERY phase: (executed by the Verifier)

  1. Repeat lll times where lll is the number of times you want to query to achieve target soundness:

    1. Pick x0∈L(0)x_0 \in L^{(0)}x0​∈L(0) uniformly at random.

    2. (JJJ-folding) For i=1i = 1i=1:

      1. Query fff at x0x_0x0​ and J(x0)J(x_0)J(x0​). Compute f(0)(x0)=f(x0)−λ⋅vn(x0)f(0)(J(x0))=f(J(x0))−λ⋅vn(J(x0))f^{(0)}(x_0)=f(x_0)-\lambda\cdot v_n(x_0)\\f^{(0)}(J(x_0))=f(J(x_0)) - \lambda\cdot v_n(J(x_0))f(0)(x0​)=f(x0​)−λ⋅vn​(x0​)f(0)(J(x0​))=f(J(x0​))−λ⋅vn​(J(x0​))

      2. Compute f0(0)(πx(x0))=f(0)(x0)+f(0)(J(x0))2f1(0)(πx(x0))=f(0)(x0)+f(0)(J(x0))2yf^{(0)}_0(\pi_x(x_0)) = \frac{f^{(0)}(x_0) + f^{(0)}(J(x_0))}{2}\\f^{(0)}_1(\pi_x(x_0)) = \frac{f^{(0)}(x_0) + f^{(0)}(J(x_0))}{2y}f0(0)​(πx​(x0​))=2f(0)(x0​)+f(0)(J(x0​))​f1(0)​(πx​(x0​))=2yf(0)(x0​)+f(0)(J(x0​))​

      3. Query f(1)f^{(1)}f(1) at x1=πx(x0)x_1=\pi_x(x_0)x1​=πx​(x0​) and check if f(1)(πx(x0))=f0(0)(πx(x0))+β1f1(0)(πx(x0))f^{(1)}(\pi_x(x_0)) = f^{(0)}_{0}(\pi_x(x_0)) + \beta_1 f^{(0)}_{1}(\pi_x(x_0))f(1)(πx​(x0​))=f0(0)​(πx​(x0​))+β1​f1(0)​(πx​(x0​))

    3. (π\piπ-folding) For i=2…ri = 2\dots ri=2…r:

      1. Calculate xi=π(xi−1)=2xi−12−1x_i=\pi(x_{i-1})=2x^2_{i-1}-1xi​=π(xi−1​)=2xi−12​−1

      2. Query f(i−1)f^{(i-1)}f(i−1) at −xi−1-x_{i-1}−xi−1​. (the value at xi−1x_{i-1}xi−1​ is queried in the previous round)

      3. Compute f0(i−1)(xi)=f(i−1)(xi−1)+f(i−1)(−xi−1)2f1(i−1)(xi)=f(i−1)(xi−1)−f(i−1)(−xi−1))2xi−1f^{(i-1)}_0(x_i) = \frac{f^{(i-1)}(x_{i-1}) + f^{(i-1)}(-x_{i-1})}{2}\\f^{(i-1)}_1(x_i) = \frac{f^{(i-1)}(x_{i-1}) - f^{(i-1)}(-x_{i-1}))}{2x_{i-1}}f0(i−1)​(xi​)=2f(i−1)(xi−1​)+f(i−1)(−xi−1​)​f1(i−1)​(xi​)=2xi−1​f(i−1)(xi−1​)−f(i−1)(−xi−1​))​

      4. Query f(i)f^{(i)}f(i) at xix_ixi​ and check if f(i)(xi)=f0(i−1)(xi)+βif1(i−1)(xi)f^{(i)}(x_i) = f^{(i-1)}_{0}(x_i) + \beta_i f^{(i-1)}_{1}(x_i)f(i)(xi​)=f0(i−1)​(xi​)+βi​f1(i−1)​(xi​)

  2. ACCEPT if all checks passed. REJECT otherwise

Batch Circle FRI

Protocol 2 (batch Circle FRI). Under the same assumptions as Protocol 1, the interactive oracle proof for a batch of functions f1,…,fL∈FDf_1,\dots,f_L \in F^Df1​,…,fL​∈FD having correlated (1−θ)(1 − \theta)(1−θ)-agreement to a codeword from CN(F,D)C_N(F, D)CN​(F,D), is as follows. In the first step, given a random challenge λb←F\lambda_b \leftarrow Fλb​←F from the verifier, the prover computes the values of the linear combination:

f=∑i=1Lλbk−1⋅fif=\sum^L_{i=1}\lambda_b^{k-1}\cdot f_if=i=1∑L​λbk−1​⋅fi​

over DDD. Now, both prover and verifier run Protocol 1 on fff , with its query phase extended by a check of the batching at each of the queries.

CircleSTARK

In circle STARK, the trace domain is the standard position coset H⊂C(Fp)H\subset C(\mathbb{F}_p)H⊂C(Fp​) of a cyclic and proper subgroup G=GnG = G_nG=Gn​ of the circle curve C(Fp)C(\mathbb{F}_p)C(Fp​), of size N=2nN = 2^nN=2n, with n≥1n \geq 1n≥1, and the trace is organised column-wise t1,…,tw∈FpNt_1, \dots, t_w \in \mathbb{F}_p^Nt1​,…,tw​∈FpN​, each placed over the domain HHH in the usual manner, using the group translation TTT by a generator of GGG for the timeline. The trace columns are interpolated by polynomials

p1,…,pw∈Fp[x,y]/(x2+y2−1)p_1,\dots,p_w\in\mathbb{F}_p[x,y]/(x^2+y^2 -1)p1​,…,pw​∈Fp​[x,y]/(x2+y2−1)

of total degree at most N/2N/2N/2, meaning that pi∈LN(Fp)p_i\in\mathcal{L}_N(\mathbb{F}_p)pi​∈LN​(Fp​) (actually, they are from the FFT-space LN′(Fp))\mathcal{L}'_N(\mathbb{F}_p))LN′​(Fp​)), and these polynomials are subject to set of constraints, say

Pi(si,p1,…,pw,p1∘T,…,pw∘T)=0P_i(s_i,p_1,\dots,p_w,p_1\circ T,\dots,p_w\circ T)=0Pi​(si​,p1​,…,pw​,p1​∘T,…,pw​∘T)=0

for i=1,…,Ci=1,\dots,Ci=1,…,C, holding over the entire domain HHH, where si∈LN(Fp)s_i\in \mathcal{L}_N(\mathbb{F}_p)si​∈LN​(Fp​) is a predefined selector polynomial.

Each constraint is a polynomial

Pi∈Fp[S,X1,…,Xw,Y1,…,Yw]P_i\in\mathbb{F}_p[S,X_1,\dots,X_w,Y_1,\dots,Y_w]Pi​∈Fp​[S,X1​,…,Xw​,Y1​,…,Yw​]

Pi∈Fp[S,X1,…,Xw,Y1,…,Yw]P_i\in\mathbb{F}_p[S,X_1,\dots,X_w,Y_1,\dots,Y_w]Pi​∈Fp​[S,X1​,…,Xw​,Y1​,…,Yw​]of total degree at most the maximum number of twin-coset of size NNN, degPi≤p2+1N−1\mathsf{deg} P_i\leq\frac{p^2+1}{N} - 1degPi​≤Np2+1​−1 and the degree in the selector variable SSS is at most degSPi≤1\mathsf{deg}_S P_i \leq 1degS​Pi​≤1.

Definition. The evaluation domain is a standard position coset D⊆C(Fp)D\subseteq C(\mathbb{F}_p)D⊆C(Fp​), of at least double the size of trace domain HHH. The polynomials in the circle STARK will be generally committed by their values over this domain.

Lemma 2 from the paper. Let ppp be a CFFT-friendly prime supporting the order m≥1m \geq 1m≥1, and GkG_kGk​ denote the subgroup of order 2k2^k2k for k≤mk \leq mk≤m. Then any subset of D⊆C(Fp)/GmD\subseteq C(\mathbb{F}_p) / G_mD⊆C(Fp​)/Gm​ which is invariant under and JJJ can be decomposed into twin-cosets of size N=2nN = 2^nN=2n, for any n≤mn \leq mn≤m. In particular for a standard position coset DDD of size M=2mM = 2^mM=2m,

D=Q⋅Gm=⋃k=0M/N−1(Q4k+1⋅Gn−1∪Q−4k−1⋅Gn−1)D = Q \cdot G_m = \bigcup^{M/N-1}_{k=0}(Q^{4k+1}\cdot G_{n−1} \cup Q^{−4k−1}\cdot G_{n−1})D=Q⋅Gm​=k=0⋃M/N−1​(Q4k+1⋅Gn−1​∪Q−4k−1⋅Gn−1​)

where QQQ is an element from C(Fp)C(\mathbb{F}_p)C(Fp​) of order 2m+12^{m+1}2m+1.

IOP for AIR

Now, once we have all these, the interactive oracle proof for the satisfiability of the AIR can be constructed as follows:

In the first round, the prover computes the values of its trace polynomials p1,…,pw∈LN(Fp)p_1,\dots,p_w\in\mathcal{L}_N(\mathbb{F}_p)p1​,…,pw​∈LN​(Fp​) over the evaluation domain DDD using its decomposition into twin-cosets and shares their oracles denoted by

[p1],…,[pw][p_1],\dots,[p_w][p1​],…,[pw​]

with their verifier.

In the second round, the verifier sends random challenge β←F\beta \leftarrow Fβ←F, drawn uniformly from a suitably large extension field FFF of Fp\mathbb{F}_pFp​, which is used to reduce the constraint polynomials into a single one:

∑i=1Cβi−1⋅Pi(si,p1,…,pw,p1∘T,…,pw∘T)=0\sum^C_{i=1}\beta^{i-1}\cdot P_i(s_i,p_1,\dots,p_w,p_1\circ T,\dots,p_w\circ T)=0i=1∑C​βi−1⋅Pi​(si​,p1​,…,pw​,p1​∘T,…,pw​∘T)=0

which should hold over trace domain HHH. To prove this, the vanishing polynomial over HHH, vHv_HvH​, is computed so the composite constraint polynomial can now be written as:

∑i=1Cβi−1⋅Pi(si,p1,…,pw,p1∘T,…,pw∘T)=q⋅vH\sum^C_{i=1}\beta^{i-1}\cdot P_i(s_i,p_1,\dots,p_w,p_1\circ T,\dots,p_w\circ T)=q\cdot v_Hi=1∑C​βi−1⋅Pi​(si​,p1​,…,pw​,p1​∘T,…,pw​∘T)=q⋅vH​

To keep with the degree bound imposed by the size of HHH, the quotient q∈L(d−1)N(F)q\in\mathcal{L}_{(d-1)N}(F)q∈L(d−1)N​(F) needs to be split into polynomials q1,…,qd−1∈LN(F)q_1,\dots,q_{d-1}\in\mathcal{L}_N(F)q1​,…,qd−1​∈LN​(F):

q=λ⋅vHˉ+∑k=1d−1vHˉvHk⋅qkq=\lambda\cdot v_{\bar H} + \sum^{d-1}_{k=1}\frac{v_{\bar H}}{v_{H_k}}\cdot q_kq=λ⋅vHˉ​+k=1∑d−1​vHk​​vHˉ​​⋅qk​

Recall that L(d−1)NL_{(d-1)N}L(d−1)N​ has (d−1)N+1(d-1)N + 1(d−1)N+1 dimension. On the other hand, the quotient q∈L(d−1)N(F)q\in\mathcal{L}_{(d-1)N}(F)q∈L(d−1)N​(F) is computed by value from those of f1,…,fwf_1,\dots,f_wf1​,…,fw​ over a union of twin-cosets HkH_kHk​ of size NNN. Thus the union Hˉ=⋃k=1d−1Hk\bar{H}=\bigcup^{d-1}_{k=1}H_kHˉ=⋃k=1d−1​Hk​ is one point too small to uniquely determine a polynomial from L(d−1)N\mathcal{L}_{(d-1)N}L(d−1)N​. In our decomposition, this missing point is characterized by an additional scalar multiple of the vanishing polynomial of Hˉ\bar{H}Hˉ.

Then, the prover sets up the oracles

[q1],…,[qd−1][q_1],\dots,[q_{d-1}][q1​],…,[qd−1​]

for their values over the evaluation domain DDD, and sends them, together with λ\lambdaλ, to the verifier.

Having all oracles in place, the next step is DEEP ALI, which reduces satisfiability of the constraints to a low-degree test on single-point quotients. (In lose terms, this step turns low-degree test into a polynomial commitment scheme.)

In this step, the verifier responds with a random point γ→C(F)∖(D∪H)\gamma\rightarrow C(F)\setminus (D\cup H)γ→C(F)∖(D∪H). In return, the prover opens the values vi,0=pi(γ),vi,1=pi(T(γ))v_{i,0}=p_i(\gamma), v_{i,1}=p_i(T(\gamma))vi,0​=pi​(γ),vi,1​=pi​(T(γ)) for each i=1,…,wi=1,\dots,wi=1,…,w as well as v1,…,vd−1v_1,\dots,v_{d-1}v1​,…,vd−1​ of q1,…,qd−1q_1,\dots,q_{d-1}q1​,…,qd−1​ at γ\gammaγ. Eventually, both prover and verifier engage in a low-degree test for the real and imaginary parts of the DEEP quotients:

Re/Im(pi−vi,0vγ),Re/Im(pi−vi,1vT(γ))Re/Im(qi−vivγ)\mathsf{Re/Im}(\frac{p_i-v_{i,0}}{v_\gamma}),\mathsf{Re/Im}(\frac{p_i-v_{i,1}}{v_{T(\gamma)}})\\\mathsf{Re/Im}(\frac{q_i-v_i}{v_\gamma})Re/Im(vγ​pi​−vi,0​​),Re/Im(vT(γ)​pi​−vi,1​​)Re/Im(vγ​qi​−vi​​)

Conclusion

The initial implementation of CircleFFT demonstrated a performance improvement by a factor of 1.4 in a single-threaded setup. Building on this foundation, Starknet’s next-generation prover, Stwo (“STARK Two”), is designed to enhance and eventually replace the current prover, Stone (“STARK One”).

Notice that this equation resembles the cos(α+β)cos(\alpha + \beta)cos(α+β) and sin(α+β)sin(\alpha+\beta)sin(α+β) and is equivalent to rotation over the unit circle.

Written by from

Legendre Symbol
quadratic residue
formulas
A41
Batzorig Zorigoo
Figure 1. Blue points under the square operation (left) and inverse operation (right) result in red points.
Figure 2. Subgroups of size 4, 2, 1 (left to right)
Figure 3. Twin cosets of subgroups 4,2,1 (left to right). Q⋅Gn−1Q\cdot G_{n-1}Q⋅Gn−1​ is blue and Q−1⋅Gn−1Q^{-1}\cdot G_{n-1}Q−1⋅Gn−1​ is red. If we take the union, it is a twin coset.
Figure 4. Notice that they are twin-cosets of subgroup 4, 2, 1 (left to right), but are also a coset of subgroup size 8, 4, 2 respectively.
Figure 5. Given the evaluations (left), the result of JJJ-folding is shown. Notice that f0f_0f0​ and f1f_1f1​ can be actually parametrized by only the x-axis.
Figure 6. Result of π\piπ-folding on f0f_0f0​. We do the same for f1f_1f1​ to get f10f_{10}f10​ and f11f_{11}f11​
Figure 7. Initial benchmark result of CFFT