Basefold
This article aims to provide an intuitive explanation of the goals and processes of the Basefold protocol.
Introduction
BaseFold is a new Polynomial Commitment Scheme that is field-agnostic, with verifier complexity of O(log2n) and prover complexity of O(nlogn). While the RS-code used in FRI-IOPP requires an FFT-friendly field, BaseFold eliminates this constraint by introducing the concept of random foldable code, making it usable with sufficiently large fields.
Background
Constant Polynomial in FRI-IOPP
In FRI, the following polynomial is folded using a random value α0.
After the first round, the polynomial becomes:
If this folding process is repeated k+1 times, the resulting polynomial will eventually reduce to a constant polynomial, which looks like:
This constant polynomial is identical to the evaluation of the multilinear polynomial Q at point (α0,α1,α2,…,αk).
Protocol Explanation
Foldable Code
It is well-known that RS (Reed-Solomon) codes are a type of linear code, and the encoding of linear codes can be represented as a matrix-vector multiplication. For example, the encoding of an [n,k,d]-RS code, when n=16 and k=8, can be represented as follows:

The matrix on the left can be transformed into the matrix on the right by applying a row permutation.

If we divide the matrix on the right into four parts, the red and yellow-colored sections are identical and correspond to the matrix used in RS encoding when n=8 and k=4. The green-colored section is equivalent to multiplying the red matrix by a diagonal matrix T=diag(1,ω,ω2,…,ω7). Similarly, the blue-colored section is equivalent to multiplying the red matrix by another diagonal matrix T′=diag(ω8,ω9,ω10,…,ω15).
If the matrix used in the encoding of a linear code takes the form above, it is referred to as a foldable linear code. Let us define this more formally.
Let c,k0,d∈N, ki=k0⋅2i−1,ni=c⋅ki for every i∈[1,d]. A (c,k0,d)-foldable linear code is a linear code with a generator matrix Gd and rate c1 with the following properties:
the diagonal matrices Ti−1,Ti−1′∈Fni−1×ni−1 satisfies that diag(Ti−1)[j]=diag(Ti−1′)[j] for every j∈[0,ni−1−1].
the matrix Gi∈Fki×ni equals (up to row permutation)\
Random Foldable Code
To design a linear code that is foldable and efficiently encodable regardless of its finite field, BaseFold uses this algorithm:
Set G0←D0, where D0 is a distribution that outputs with 100% probability. Such a Di is referred to as a (c,k0)-foldable distribution.
Sample Ti←$(F×)ni and set Ti′=−Ti.
Generate Gi+1 using Gi,Ti,Ti′.
Repeat steps 2 and 3 until a Gi of the desired size is obtained.
This type of code is called a Random Foldable Code (RFC). The paper demonstrates that this code has good relative minimum distance. For those interested, refer to Section 3.1 of the paper. Additionally, it is noted that this is a special case of punctured Reed-Muller codes. For further details, consult Appendix D of the paper.
Encoding Algorithm
The encoding can be computed recursively as follows:
If i=0, return Enc0(m).
Unpack 1×ki matrix m into a pair of 1×ki/2 matrix (ml,mr).
Set l=Enci−1(ml), t=diag(Ti−1), and then pack a pair of ki×ni/2 matrices (l+t∘r,l−t∘r) to ki×ni matrix.
This approach is valid and can be proven inductively:
If i=0, Enc0(m)=m⋅G0, which holds by definition.
If i>0, Enci(m)=m⋅Gi holds because of the recursive construction of Gi.
BaseFold IOPP
To use this in IOPP, we need to ensure that πi is indeed an encoded random linear combination derived from mi+1. To demonstrate this, let mi represent the message at the i-th layer and πi the oracle (or block) at the i-th layer. Then, the following holds:
Thus, for j∈[0,ni−1], the following conditions are satisfied, where ni is the length of πi:
The values πi+1[j] and πi+1[j+ni] are evaluations of the polynomial f(X)=Enci(mi+1,l)[j]+X⋅Enci(mi+1,r)[j] at diag(Ti)[j] and diag(Ti′)[j], respectively. When using the sampled value αi at each i-th layer, f(αi) can be constructed as follows, ensuring that πi encodes the message mi,l+αi⋅mi,r:
Using this property, an IOPP (Interactive Oracle Proof of Proximity) can be designed. Here, interpolate((x1,y1),(x2,y2)) refers to the computation of a degree-1 polynomial P such that P(x1)=y1,P(x2)=y2.
IOPP.Commit:πd:=Encd(f)∈Fnd→(πd−1,…,π0)∈Fnd−1×⋯×Fn0
Prover witness: the polynomial f∈F[X0,X1,…,Xd−1]
For i from d−1 to 0:
The verifier samples αi←$F and sends it to the prover.
For each index j∈[0,ni−1], the prover
sets f(X):=interpolate((diag(Ti)[j],πi+1[j]),(diag(Ti′)[j],πi+1[j+ni])).
sets πi[j]=f(αi).
The prover outputs oracle πi∈F.
IOPP.Query:(πd,…,π0)→accept or reject
The verifier samples an index μ←$[0,nd−1−1].
For i from d−1 to 0, the verifier
queries oracle entries πi+1[μ],πi+1[μ+ni].
computes p(X):=interpolate((diag(Ti)[μ],πi+1[μ]),(diag(Ti′)[μ],πi+1[μ+ni])).
checks that p(αi)=πi[μ].
if i>0 and μ>ni−1, update μ←μ−ni−1.
If π0 is a valid codeword w.r.t. generator matrix G0, output accept, otherwise output reject.
Multilinear PCS based on interleaving BaseFold IOPP
When performing the sumcheck protocol, the problem is reduced to an evaluation claim. Interestingly, the BaseFold IOPP shares a similar structure: given an input oracle that encodes a polynomial f∈F[X0,X1,…,Xd−1], the final oracle sent by the honest prover in the IOPP protocol is precisely an encoding of a random evaluation f(r), where r=(r0,r1,…,rd−1).
Thus, the sumcheck protocol and the IOPP protocol can be executed interleaved, sharing the same random challenge. At the end, the verifier needs to check whether the evaluation claim f(r)=y, obtained through the sumcheck protocol, matches the final prover message from the IOPP protocol. It performs as follows:
PC.Eval
Public input: oracle πf:=Encd(f)∈Fnd, point r, claimed evaluation y=f(r)∈F
Prover witness: the polynomial f∈F[X0,X1,…,Xd−1]
The prover sends the following to the verifier:
For i from d−1 to 0:
Verifier samples and sends ri←$F to the prover.
For each j∈[0,ni−1], the prover
sets gj(X):=interpolate((diag(Ti)[j],πi+1[j]),(diag(Ti′)[j],πi+1[j+ni])).
sets πi[j]=gj(ri).
The prover outputs oracle πi∈Fni.
if i>0, the prover sends verifier.
The verifier checks that
IOPP.query(πd,…,π0) outputs accept.
hd(0)+hd(1)=?y and for every i∈[1,d−1], hi(0)+hi(1)=?hi+1(ri).
Enc0(h1(r0)/eqz(r0,…,rd−1))=?π0.
Conclusion

In a 256-bit PCS:
BaseFold compared to field-agnostic Brakedown:
Prover time: Slower
Verifier time: Faster
Proof size: Bigger with a small number of variables but smaller with a large number of variables.
BaseFoldFri compared to the non-field-agnostic ZeromorphFri:
Prover time: Faster
Verifier time: Faster
Proof size: Larger

In a 64-bit PCS:
BaseFold compared to field-agnostic Brakedown:
Prover time: Slower
Verifier time: Faster
Proof size: Smaller
BaseFoldFri compared to the non-field-agnostic ZeromorphFri:
Prover time: Faster
Verifier time: Slower
Proof size: Larger

In a 256-bit SNARK:
BaseFold compared to field-agnostic Brakedown:
Prover time: Faster with a small number of variables but similar with a large number of variables.
Verifier time: Faster
Proof size: Smaller
BaseFoldFri compared to the non-field-agnostic ZeromorphFri:
Prover time: Similar
Verifier time: Similar
Proof size: Larger

In a 64-bit SNARK:
Both BaseFold and BaseFoldFri, compared to Zeromorph:
Prover time: Similar
Verifier time: Slower with a small number of variables but faster with a large number of variables.
Proof size: Larger
Written by Ryan Kim of Fractalyze
Last updated