The Additive NTT
The most important code we come across in SNARKs is the Reed–Solomon code. This is a simple—and yet extremely powerful and effective—code, and appears not just in Binius but also in DEEP-ALI-based SNARKs like Plonky3 and Stwo.
As we've suggested, error-correcting codes have two desirable properties—distance and rate—which are at odds with each other in general. Indeed, a mathematical result called the Singleton bound formalizes the precise way in which these desiderata are in tension. Reed–Solomon codes meet the Singleton bound, in the sense that the inequality becomes an equality; they thus negotiate the tension between these attributes as favorably as it is possible to do.
Reed–Solomon codes are not just coding-theoretically nice. They also support an extremely rich set of auxiliary protocols, designed to achieve such ends as proximity testing (determining whether a supplied word is close to a codeword or not, by just reading from it at a few places). The crucial protocol here is FRI (short for fast Reed–Solomon interactive oracle proof of proximity), due to Ben-Sasson, Bentov, Horesh and Riabzev. We will use FRI in our evaluation protocol.
Review of Reed–Solomon Codes
Mathematically, each Reed–Solomon code depends on a field , a message length and a block length . We first need to pick a domain of size (as a side effect, we need for this to make sense).
Our message space will be the set of univariate polynomials of degree less than with coefficients in . The word space will be the set of all -tuples of -elements (here, we can think of associating these with the elements of ). The codewords will be those -tuples which arise as the set of evaluations of some polynomial as above on : that is, those of the form . Here, is an enumeration of 's elements.
The Binary Case
In Binius, Reed–Solomon codes also play a central role. On the other hand, since we work with binary fields, things get significantly trickier. The first question that arises has to do with encoding: the actual algorithm which takes as input a message and outputs its corresponding codeword. As should be clear from the above, this is a problem of polynomial evaluation: how do we take the coefficients of some polynomial, and output the values that that polynomial takes on some domain? We can trivially do this in steps; the goal is to do better than that.
In the classical, prime-field setting, encoding is very standard: the key algorithm is the NTT (number-theoretic transform), a close relative of the fast Fourier transform. The NTT runs in steps. Here, the set is a multiplicative subgroup of power-of-two order (the field needs to be chosen in such a way that this kind of subgroup exists).
In binary fields, primitive multiplicative roots of unity of power-of-two order don't exist, and things get significantly trickier. Indeed, it was not known until 2014—i.e., until the arrival of a key work by Lin, Chung and Han [LCH14]—how one might encode in the binary setting in such a way as to recover the time complexity of the classical algorithm.
Even the Lin–Chung–Han algorithm has a catch. While classical Reed–Solomon encoding algorithms understand their inputs as the coefficients in the standard monomial basis of the polynomial being evaluated, Lin, Chung and Han actually need to introduce a special polynomial basis: the so-called novel polynomial basis. These are specially constructed polynomials unequal to the simple monomials . The polynomial we actually end up evaluating is not , but rather .
Finally, the set we evaluate on is not a multiplicative subgroup, but rather an -subspace of (recall that when the characteristic of is 2, we can view it as a vector space over its own subfield ).
The Algorithm
Here, we sketch in slightly more technically precise terms what Lin, Chung and Han's algorithm [LCH14] achieves. We fix parameters and . Ultimately, the code we spin up is going to be Reed–Solomon, with message length and block length ; we will write for this code. We fix a binary tower field , and write for an -basis of it. From this -basis of , [LCH14] tells us how to construct a further basis of polynomials—called the novel polynomial basis—which we will write as . Each will be a polynomial over of degree . In fact, these polynomials will themselves constitute a -basis of the -dimensional vector space (i.e., of the set of polynomials over of degree less than ).
Finally, we write for the -span of the basis prefix .
The additive NTT is an algorithm that takes as input a list and returns a list defined in the following way. We write for the polynomial whose coefficients in the novel basis are the given input . What we return is the list of 's evaluations on . Here, is again an enumeration of . In practice, we will get this by taking the lexicographically ordered basis combinations of .
We refrain here from describing how the additive NTT actually works (i.e., how it achieves the above task). In short, Lin, Chung and Han [LCH14] rely on a totally new sort of polynomial decomposition, specific to the novel basis polynomials. In [DP24, § 3], we show that Lin–Chung–Han's NTT is can actually be re-characterized in terms more familiarly Fourier-theoretic.