How Does S-two work?
Mersenne primes
Proof systems typically rely on finite field operations, where efficient field arithmetic is crucial for optimizing proof generation.
In STARK protocols, there is no direct dependency between the security level of the proof system and the field size.
This allows the use of small fields with highly efficient arithmetic, such as Mersenne prime fields.
A Mersenne prime is defined as a prime number that is one less than a power of two, expressed as .
Consider the Mersenne prime field where .
Our objective is to perform field multiplication , where .
This operation involves a 31-bit integer multiplication, producing a 62-bit intermediate result, which is then reduced modulo .
Let , where are 31-bit values, resulting in a 62-bit product .
We can decompose into two 31-bit values and , such that , as shown in the following figure.

To perform modular reduction, we start with:
Substituting gives:
Since and are both 31-bit values, they can be directly represented as field elements.
Consequently, modular reduction is performed with a single field addition.
This makes arithmetic over Mersenne primes exceptionally fast, making them an ideal choice for our STARK protocol.
However, we instantiate STARK protocols over an FFT-friendly field, meaning a field that contains a multiplicative subgroup of order that is a large power of two (commonly referred to as a smooth subgroup).
As shown above, Mersenne prime fields lack a smooth subgroup of size that is a large power of two because there is no large power of two that divides .
In other words, there does not exist a sufficiently large such that .
To make Mersenne prime fields compatible with STARKs, we use a degree-2 extension of , defined as follows:
This extension forms a field of size , where elements can be represented as or
where and is the root of the polynomial i.e. .
The order of the multiplicative group of this extended field is calculated as follows:
For Mersenne primes of the form , this becomes:
As shown above, i.e. contains a subgroup of size that is a large power of two.
This makes it suitable for instantiating STARKs.
This subgroup is what we refer to as the Circle group (explored further in the next section).