Back to all posts

Circle STARKs: Part IV, Arithmetizing Circles

Recap

Introduction

This final post stitches everything together we built in Parts I–III. Our goal is to show how those ingredients combine into a complete Circle STARK.

We begin by describing the arithmetization over the circle curve. From there we introduce Circle FRI, the low-degree test to ensure polynomials satisfy a degree bound. Finally, we walk through the Circle STARK construction.

Arithmetization

The execution trace is simply the record of the computation: each row captures a step or a clock cycle, each column records the evolution of a register and every entry lives in the Mersenne prime field $\mathbb{F}_p$. If the computation has $N$ cycles and operates on $w$ registers then the trace table is of size $N \times w$. Arithmetization is encoding the local transition rules of this table as polynomial identities that hold over the entire domain, so that reasoning about the computation reduces to checking evaluations of polynomials.

We define our computation in terms of a trace table with $N = 2^n$ rows and $w$ columns. Each cell in this table is an element from $\mathbb{F}_p$. We can define the entire trace using $w$ column vectors:

$$t_1,\ldots,t_w \in \mathbb{F}_p^N$$

Suppose $H$ is a standard position coset of size $N = 2^n$. We will interpolate each trace column $t_i$ over the trace domain $H$ using Circle FFT to obtain bivariate polynomials $p_i$ over the circle curve. The polynomials $p_i$ belong to the space of bivariate polynomials over the circle curve i.e. $$p_i \in L_N(\mathbb{F}_p), \qquad i = 1,\ldots,w$$

The prover commits to the column polynomials $p_i$ by committing to their evaluations over an evaluation domain $D$ which is a factor $2^B$ larger in size than the trace domain $H$ i.e.

$$ \frac{|D|}{|H|} = 2^B, \qquad |D| = 2^{B+n} $$

where $B \geq 1$. The evaluations of $p_i$ over the evaluation domain $D$ are committed using a Merkle tree.

Now we want to add constraints over the trace table. Suppose we add a total of $C$ constraints. For simplicity, we only describe constraints over the neighboring rows as follows:

$$ P_j \big(s_j, p_1,\ldots,p_w, p_1 \circ T_G,\ldots,p_w \circ T_G \big) = 0, \qquad j = 1,\ldots,C $$

Here, $p_i \circ T_G$ denotes translation by the generator $G$ on the column polynomial $p_i$, where $T_G(P) = G \cdot P$. The trace domain is a coset $H = Q\cdot G_n$, where $G_n$ is a subgroup of size $N=2^n$ and $Q$ is an offset. Each column $p_i$ is interpolated over the trace domain $H$ represented as:

$$ H = Q\cdot G_n = \{Q, Q \cdot G, Q \cdot G^2, \ldots, Q \cdot G^{2^n-1}\} $$

Thus $p_i \circ T_G$ pulls in the “next row” of the trace. The constraints $P_j$ are polynomials defined in terms of the column polynomials $p_i$ and a predefined selector polynomial $s_j$ which determines the rows on which the constraint $P_j$ should apply.

Note

What do these selector polynomials $s_j$ look like?

Which polynomial space do they belong to?

Suppose we want to apply the constraint $P_j$ on the subdomain $H_j \subset H$. Then the selector polynomial $s_j$ should evaluate to some non-zero value for points in $H_j$ and zero value for points in $H \setminus H_j$. Another way to describe $s_j$ is that it should vanish outside $H_j$. They are defined as follows: $$ s_j = \frac{v_H}{v_{H_j}} $$ where $v_H$ and $v_{H_j}$ are the vanishing polynomials for $H$ and $H_j$, respectively.

Even though $s_j$ is defined as a rational function, on the circle curve it is a polynomial. The reason is that the global vanishing polynomial $v_H$ vanishes on the smaller domain $v_{H_j}$, so $v_H$ is divisible by $v_{H_j}$. As a result, the ratio $v_H/v_{H_j}$ has no poles. For more details refer Lemma 10, Circle STARKs.

We know that $\deg{(v_H)} = 2^{n-1} = N/2$ and $v_H \in L_N(\mathbb{F}_p)$ (refer to Dimension Gap, Part III). Thus $s_j$ also belongs to the polynomial space $L_N(\mathbb{F}_p)$.

Now rather than proving all the $C$ constraints separately, we batch them into a single one. The verifier chooses a random $\beta$ from the extension field $\mathbb{F}$ of $\mathbb{F}_p$. The prover computes the following:

$$ \sum_{j=1}^{C} \beta^{i-1} P_j\big(s_j,p_1,\ldots,p_w,p_1 \circ T_G,\ldots,p_w \circ T_G\big) = 0 $$

In order to prove validity of the above identity over the entire trace domain $H$, the prover computes the quotient polynomial $q$ as follows:

$$ \sum_{j=1}^{C} \beta^{i-1} P_j\big(s_j,p_1,\ldots,p_w,p_1 \circ T_G,\ldots,p_w \circ T_G\big) = q \cdot v_H $$

Such a quotient $q$ must exist because if all constraints are satisfied throughout $H$, the left-hand side vanishes on $H$ and is therefore divisible by $v_H$.

Note

What is the degree of the quotient polynomial $q$?

Which polynomials space does it belong to?

Let the degree of each $P_j$ be atmost $d$. The polynomials $$s_j, p_i, \ldots, p_w, p_i \circ T, \ldots, p_w \circ T$$ are in the space $L_N(\mathbb{F}_p)$ with maximum degree $N/2$. Thus the maximum degree of the left-hand side of the following expression is $dN/2$. $$\sum_{j=1}^{C} \beta^{i-1} P_j\big(s_j,p_1,\ldots,p_w,p_1 \circ T_G,\ldots,p_w \circ T_G\big) = q \cdot v_H$$ Now the degree of $v_H$ is $N/2$. Thus the degree of $q$ is $(d−1)N/2$ and $q$ is in the polynomial space $q \in L_{(d−1)N}(\mathbb{F})$. Note that $q$ is over the extension field $\mathbb{F}$, since $\beta$ is sampled from $\mathbb{F}$.

Now the prover will have to prove that the columns polynomials $p_i$ are of degree $\leq N/2$ and the quotient polynomial $q$ is of degree $\leq (d−1)N/2$. To make the degree bound uniform (i.e. $\leq N/2$) across all the polynomials, the quotient polynomial $q \in L_{(d−1)N}(\mathbb{F})$ is split into polynomials $q_1, \ldots, q_{d-1} \in L_N(\mathbb{F})$ as follows:

$$ q = \lambda \cdot v_{\bar{H}} + \sum_{k=1}^{d-1} \frac{v_{\bar{H}}}{v_{H_k}} \cdot q_k $$

where $\bar{H} = \bigcup_{k=1}^{d-1} H_k$ is a disjoint union of twin-cosets of size $|H_k| = N$.

Note

Intuition on the decomposition of the quotient polynomial $q$

The quotient polynomial $q$ belongs to the space $L_{(d−1)N}(\mathbb{F})$ which has dimension $(d−1)N + 1$. The decomposition of $q$ follows from the decomposition of polynomial space $L_{(d−1)N}(\mathbb{F})$ which can be decomposed as follows: $$ L_{(d−1)N}(\mathbb{F}) = \langle v_{\bar{H}} \rangle + L'_{(d−1)N}(\mathbb{F}) $$ where the space $L'_{(d−1)N}(\mathbb{F})$ is of dimension $(d−1)N$.

The above decomposition is very similar to the decomposition of $L_N(\mathbb{F})$ in Dimension Gap, Part III. $$ L_{N}(\mathbb{F}) = \langle v_{n} \rangle + L'_{N}(\mathbb{F}) $$

Now we can further decompose polynomials from space $L'_{(d−1)N}(\mathbb{F})$ as $(d-1)$ polynomials from the space $L'_{N}(\mathbb{F})$ combined with some basis of $L'_{(d−1)N}(\mathbb{F})$ over $L'_{N}(\mathbb{F})$ i.e. $q_k$ are the $(d-1)$ polynomials from the space $L'_{N}(\mathbb{F})$ and $\frac{v_{\bar{H}}}{v_{H_k}}$ are the basis of $L'_{(d−1)N}(\mathbb{F})$ over $L'_{N}(\mathbb{F})$.

This gives an intuition on the decomposition of the quotient polynomial $q$. For complete proof, please refer Lemma 12, Circle STARKs.

Thus the prover has to prove the validity of the following equation:

$$ \sum_{j=1}^{C} \beta^{i-1} P_j\big(s_j,p_1,\ldots,p_w,p_1 \circ T_G,\ldots,p_w \circ T_G\big) \stackrel{?}{=} \bigg(\lambda \cdot v_{\bar{H}} + \sum_{k=1}^{d-1} \frac{v_{\bar{H}}}{v_{H_k}} \cdot q_k\bigg) \cdot v_H \tag{1} $$

and prove that the polynomials $p_i$, $q_k$ are of degree $\leq N/2$. We will now describe Circle FRI to prove the latter.

Circle FRI

Circle FRI tests the proximity of a function $f \in \mathbb{F}^D$ over the evaluation domain $D$ of size $|D|=2^{n + B}$ to some polynomial $p(x, y)$ from the polynomial space $L_N(\mathbb{F})$. The function $f \in \mathbb{F}^D$ is represented as a vector of evaluations over the domain $D$.

Here:

$$ L_N(\mathbb{F}) = L'_N(\mathbb{F}) + \langle v_n \rangle $$
Note

Why check proximity to a polynomial?

The prover sends evaluations of a function to the verifier. However, the verifier does not know if this function is a polynomial, or if it satisfies a pre-specified degree bound. FRI allows the verifier to check that the evaluations sent by the prover are indeed "close" to some polynomial of bounded degree. Here, the verifier only checks for proximity; that is, the verifier accepts even if the evaluations sent by the prover are "close enough" to those of a polynomial of bounded degree.

Circle FRI follows a similar divide-and-conquer strategy as the Circle FFT algorithm. The prover recursively decomposes the function and folds the odd and even parts using randomness sent by the verifier. This reduction continues until the proximity test of the folded function to the polynomial space is small enough for the verifier to check directly; in this case, the prover sends the folded function directly to the verifier.

The following figure shows the sequence of domains for the circle FRI algorithm with $r$ folding rounds using a chain of $2$-to-$1$ maps. Circle FRI Domains

As shown in the above diagram, we use two different maps, as in the circle FFT algorithm: the projection map $\pi_x$ and the squaring map $\pi$. The protocol starts with a standard position coset $D_m$ of size $2^m$ where $m = B+n$ and then takes projection onto the $x$-axis using map $\pi_x$ to compute the quotient $D_m/J$. Then subsequently apply the map $\pi$ for $(r-1)$ rounds to get the quotient $D_{m-r+1}/J$ with $2^{m-r}$ elements. To know more about these maps, please refer Sequence of Domains for Circle FFT, Part III. For notational convenience, we have defined the domain and map for the $j$th round as $S_j$ and $\pi_j$, respectively.

At each step of Circle FRI, the prover will decompose and fold functions over the sequence of domains as described above. But before folding, the prover decomposes $f \in L_N(\mathbb{F})$ as:

$$ f = g + \lambda \cdot v_n, $$

where $g$ is from the FFT space $L'_N(\mathbb{F})$, $\lambda \in \mathbb{F}$, and $v_n$ is the vanishing polynomial of the standard position coset of size $N = 2^n$. This reduces the proximity claim of $f$ to $L_N(\mathbb{F})$ to that of $g$ to the FFT space $L'_N(\mathbb{F})$, which is checked through repeated folding of $g$.

We start with the proximity claim of $g = g_0 \in \mathbb{F}^{S_0}$ to the FFT space $L^{(0)} = L'_N(\mathbb{F})$. In each round $j = 1, \ldots, r$, we reduce the previous proximity claim of $g_{j-1} \in \mathbb{F}^{S_{j-1}}$ to $L^{(j-1)}$ to a new proximity claim of $g_{j} \in \mathbb{F}^{S_{j}}$ to the FFT space $L^{(j)}$ where

$$ L^{(j)} = \mathbb{F}[X]^{< N/2^j} $$

We will now explain the complete protocol and the above reduction in detail. The prover has a function $f \in \mathbb{F}^D$ and the verifier is given an oracle to $f$. The protocol consists of a commit phase and a query phase.

Commit Phase

Query Phase

In the query phase, the verifier checks that the prover computed the folding correctly using the oracles sent by the prover. It consists of $s \geq 1$ rounds. In each round:

If all the above checks pass for all rounds $s$ then the verifier accepts, otherwise reject.

Security Analysis

In this section, we give some intuition on the security of the FRI protocol. There are roughly two ways a prover can cheat:

Circle STARKs

In this section, we will combine all the ideas we have covered so far in this series to construct the Circle STARK protocol. Given the trace table as $w$ columns of length $N = 2^n$ i.e.

$$t_1,\ldots,t_w \in \mathbb{F}_p^N$$

The protocol proceeds as follows:

  1. Trace Commitment: The prover interpolates each trace column $t_i$ as a bivariate polynomial $p_i$ over the trace domain $H$ using circle FFT. Then evaluates the polynomials $p_i$ over the evaluation domain $D$ and commits to the evaluation vector using a Merkle tree. The prover sends the Merkle commitment to evaluations of each $p_i$ to the verifier.

  2. Arithmetization: The verifier sends the random $\beta$ to batch all the constraints. The prover computes $q$ and decomposes it to obtain $\lambda$ and $q_k$ polynomials. Each $q_k$ is committed over $D$ like the trace polynomials. The prover sends the Merkle commitment to evaluations of each $q_k$ and $\lambda$ to the verifier. Now the prover has to prove validity of equation $(1)$ i.e.

$$ \sum_{j=1}^{C} \beta^{i-1} P_j\big(s_j,p_1,\ldots,p_w,p_1 \circ T_G,\ldots,p_w \circ T_G\big) \stackrel{?}{=} \bigg(\lambda \cdot v_{\bar{H}} + \sum_{k=1}^{d-1} \frac{v_{\bar{H}}}{v_{H_k}} \cdot q_k\bigg) \cdot v_H $$
  1. Opening: The above identity is checked on an out-of-domain point on the circle over the extension field. The verifier samples $\gamma \in C(\mathbb{F}) \setminus (D \cup H)$ and requests openings of $p_i$ and $q_k$ from the prover. The prover responds with claimed values $v_{i,0}, v_{i,1}$ of $p_i$ at the points $\gamma$ and $T_G(\gamma)$, respectively, for each $i = 1, \dots, w$, as well as the values $v_1, \dots, v_{d-1}$ of $q_1, \dots, q_{d-1}$ at $\gamma$. The verifier checks the identity using these claimed values. Note that other values like evaluations of the vanishing polynomials can be succinctly computed by the verifier.

  2. Low-Degree Test: The prover and verifier engage in a low-degree test on the following quotients using the Circle FRI protocol.

$$ \frac{p_i - v_{i,0}}{v_\gamma},\; \frac{p_i - v_{i,1}}{v_{T_G(\gamma)}}, \; \frac{q_k - v_{k}}{v_\gamma} $$

where $v_\gamma$ and $v_{T_G(\gamma)}$ are the vanishing polynomials over $\gamma$ and $T_G(\gamma)$, respectively. All the above proximity tests can be batched into a single proximity test using randomness from the verifier. If the proximity test passes and if the claimed values satisfy the overall identity, the verifier accepts.

Conclusion

This final post connected all the ideas from arithmetization, quotienting and Circle FRI low-degree test to describe the Circle STARK construction. This concludes the four part series on Circle STARKs.

zkSecurity offers auditing, research, and development services for cryptographic systems including zero-knowledge proofs, MPCs, FHE, and consensus protocols.

Learn more →

Share This Article