LatticeFold
This article aims to intuitively explain the goals and processes of the LatticeFold protocol.
Introduction
LatticeFold is the first lattice-based folding scheme. Folding schemes require a Homomorphic Additive Commitment Scheme, which is why Pedersen commitments are commonly used. These elliptic curve-based commitments are vulnerable to quantum computing attacks, require large-sized fields, and rely on non-native field arithmetic for folding verification. In contrast, LatticeFold uses Ajtai commitments based on the Module SIS problem, which is known to be quantum-resistant, supports small-sized fields, and is cost-efficient to verify.
Background
Folding Schemes: Motivation and Challenges
A circuit is typically expressed as (x;w), where the public input x and witness w represent a certain relation R. For example, a circuit representing w2=x could have relations such as (9;3) and (16;4) satisfying it. While public inputs act as constraints on the relation, since witnesses must be kept hidden, a ZK SNARK proof ensures the relation is held accordingly.
As shown in Fig. 1, some cases require expressing sequences of computations. For example, (216;28),(28;24),(24;22) and (22;2) represent the four steps in computing the square root of 216. Such computational sequences are common, with zkEVMs and zkVMs being other notable examples.
The computational expense of generating a SNARK proof for (x;w) is a major challenge. This inefficiency is compounded when there are multiple instances satisfying the relation, as generating separate proofs for each instance is costly. For example, creating two separate SNARK proofs for (x1;w1) and (x2;w2), both satisfying the same relation R, can be prohibitively expensive.
In comparison, a folding scheme creates a single new pair (x3;w3) from (x1;w1) and (x2;w2) that also satisfies the relation R. Then, the SNARK proof for the folded (x3;w3) not only validates the new relation but also proves the relations for the original pairs (x1;w1) and (x2;w2). Generating and verifying folding proofs is faster and cheaper than doing the same with SNARK proofs. Therefore, instead of recursively generating and verifying SNARK proofs, the process is optimized by using folding proofs for intermediate steps before creating a final SNARK proof. The example shown here demonstrates 2-to-1 folding, but some folding schemes support n-to-1 folding.\
Folding generally employs a technique called Random Linear Combination (RLC) where values are combined together with a random value. To ensure succinctness and to hide the witness, the prover uses commitments of the witness to apply RLC. This means that the commitment must support additive homomorphism.
Since FRI-based STARKs use Merkle Trees as commitments, which do not satisfy the additive homomorphism property, folding schemes cannot be used in FRI-based STARK systems.
Module SIS problem
A lattice refers to a combination of points following a repetitive pattern, defined as:
Here, a set of {b1,b2,…,bn}∈Rd is called the basis, n is the rank, and d is the dimension, satisfying n≤d. The basis vectors must be linearly independent, defined as:
A given lattice can be created with different bases. One notable problem in lattices is the Shortest Vector Problem (SVP), which asks for the shortest vector that can be formed given a basis. For instance:
Using the L2-norm of all the basis vectors, the solution to the SVP for this basis is found to be (1,3,−1) formed by x1=−322,x2=323,x3=−83 (Reference). This problem becomes significantly harder with poorly chosen bases and higher dimensions, posing challenges even for quantum computers.
The Short Integer Solution (SIS) problem was introduced in Ajtai’s 1999 paper, defined as:
Given a uniformly random integer matrix A∈Zqκ×m and B∈Z, find a non-zero integer vector (x∈Zm) such that A⋅x=0∈Zqκ and 0<∥x∥≤B.
Ajtai demonstrated a worst-case-to-average-case reduction, proving that solving SIS implies solving SVP. The key insight here is that the random matrix A allows uniform sampling of bases, retaining the complexity of hard lattice problems and making them practical for cryptographic applications. This was a pivotal step in advancing lattice-based cryptography.
The Module SIS (M-SIS) with B problem, a generalization of SIS, serves as the foundation for LatticeFold. It is defined as:
Given R=Z[X]/(Xd+1) and Rq=R/qR, with a uniformly random matrix A∈Rqκ×m and B∈Rq, find a non-zero vector x∈Rqm such that A⋅x=0∈Rqκ and 0<∥x∥≤B. Here, Xd+1 is a cyclotomic polynomial (Reference), specifically one where d is a power of 2.
Ajtai Commitment
In LatticeFold, the matrix A and witness vector w create a commitment , which is called an Ajtai commitment. For a commitment scheme, the following properties are required:
Hiding: The original message cannot be inferred from the commitment. This is satisfied if A is randomly sampled.
Binding: Each commitment maps to one original message with high probability. If the same commitment is created from two different x1 and x2, it is equivalent to solving the M-SIS with 2B, which is probabilistically very difficult.
Compression: The commitment size is smaller than the original message. This is achieved if κ<m.
Additionally, unlike SIS, M-SIS leverages rings instead of fields, introducing challenges in proving knowledge soundness. Specifically, not all ring elements are invertible, and even if they are, their norms can become excessively large, necessitating solutions to address this.
The Ajtai commitment supports additive homomorphism, making it suitable for folding schemes, which use random linear combinations. To preserve the binding property, the norm of the random linear combination of two witness vectors must stay within a certain boundary B. If performed naively like shown below, the norm may become excessively large, exceeding .
In LatticeFold, the L∞(infinity norm) is used for norm calculations. For a vector v=[v1,v2,…,vn], the infinity norm is defined as:
From this point onward, we use the infinity norm even without an infinity symbol.
Protocol Explanation
LatticeFold is divided into three steps: Expansion, Decomposition, and Fold.
This image above is taken from the LatticeFold paper. As shown above, we first define the multilinear extension (MLE), and then define the following two relations.
This image above is taken from the LatticeFold paper. As shown above, we first define the multilinear extension (MLE), and then define the following two relations.
The difference between the two relations lies with (r,v). For simplicity, the public value x will be omitted.
Expansion
In the Expansion step, RcompB is transformed into RaccB using the zero vector. This transformation is necessary because, in the Fold step, the structure must conform to the format of Racc.
Decomposition
Remember that this takes 2×RaccB as input and produces 2k×Raccb. See Fig 6. above
The Decomposition proceeds through the steps below for each relation:
The prover provides cm0,…,cmk−1,v0,…,vk−1 to the verifier, satisfying the following conditions:
The verifier checks the following conditions
If the conditions above are satisfied, each RaccB is transformed into k instances of Raccb.
By applying this to the 2×RaccB, the number increases from 2×RaccB to 2k×Raccb. This is done to restrict the norm size to b, which should be smaller than B, preventing the norm from growing excessively during the Fold step. However, note that the range check for each wi has not yet been performed.
Fold
To verify that the fi values from the previous step lie within the range (−b,b), the following polynomial will be used.
If a value is sampled within (−b,b) and evaluated with P(X), the result must be 0 for the range check of fi to succeed (This is used in Step 2 below.).
As mentioned earlier, it is also crucial to sample random values effectively. For this purpose, we sample from Csmall, known as a strong sampling set. Even when multiplied by ρ sampled from this set, the norm increases by at most a factor of C, known as the expansion factor. If C⋅b⋅2k<B, the norm of the folded witnesses will remain less than B. It can be formally described as:
This takes 2k×Raccb as input and produces RaccB.
The Fold proceeds through the steps below:
The verifier samples α0,…,α2k−1,μ0,…,μ2k−1,β and sends them to the prover.
The prover performs the sumcheck protocol to prove the following.
At the end of the sumcheck protocol, the following evaluation claim is obtained:
The prover sends θ0,…,θ2k−1 to the verifier, where:
The verifier checks the following condition:
The verifier samples ρ0,…,ρ2k−1 from Csmall and sends them to the prover. Using these, a new relation is created.
Conclusion
Although not covered in detail here, the paper also discusses the use of extension fields to enable smaller field sizes and methods to apply this approach to HyperNova’s CCS. However, some aspects of LatticeFold limit its application to Protostar's, leaving it an open problem. The significance of LatticeFold lies in it being the first to apply lattice-based cryptography to folding schemes, paving the way for incorporating lattice-based folding schemes into STARKs.
Written by Ryan Kim of Fractalyze
Last updated