Brakedown
This document aims to intuitively explain the goals and processes of the Brakedown protocol.
Introduction
Brakedown originates from the question, "How can we generate proofs for R1CS as quickly as possible?" It presents a scheme that achieves proof generation with field operations. To accomplish this, it introduces a method of encoding that operates in linear time. While similar techniques were used in BCG, Brakedown distinguishes itself by being more practical. Additionally, it does not require a trusted setup, may offer quantum resistance, and is field-agnostic, making it more practical.
Background
See LinearCode for more details.
Why use Merkle Tree operations?
When committing to an -length vector, the operations involved generally have the following complexities:
FFT Operations → field operations
Merkle Tree Operations → hash operations
MSM Operations → Using Pippenger's algorithm, group operations
To achieve , FFT operations, which are , cannot be used. Similarly, MSM operations are avoided because group operations are slower than field operations. Instead, Merkle Tree operations are utilized for commitment.
The traditional encoding function used in RS-codes involves FFT operations. However, due to the limitations mentioned earlier, alternative encoding methods must be explored.
Tensor Product
The Tensor Product is an operation that generates all possible combinations of two vectors v and u from different vector spaces. For example, if and , the tensor product between the two is the following matrix:
Additionally, the tensor product can be used to express a Multi Linear Extension (MLE) evaluation like so:
For example, when , the MLE evaluation is calculated as follows:
Protocol Explanation
Brief Overview
The protocol is divided into three phases: Commitment Phase, Testing Phase and Evaluation Phase.
Commitment Phase
This phase commits to the input matrix, with the following steps:
Each matrix is provided as an input, where represents the -th row.
For a given rate , each row of length is encoded into a row of length , producing an matrix . The prover commits this matrix to the verifier using Merkle hash.
Testing Phase
This phase verifies whether the encoding was performed correctly, with the following steps:
The verifier samples a random scalar and sends it to the prover.
The prover computes using the random value and sends it to the verifier:
The verifier tests the following equality by sampling values between and :
This holds because encoding and random linear combination (RLC) are commutative and the codeword is linear code. That is, encoding the rows of the matrix and then performing RLC is equivalent to performing RLC first and then encoding. According to Section 4, "Concrete Optimizations to the Commitment Scheme," the testing phase can be skipped if a Polynomial Commitment Scheme is used.
Evaluation Phase
This phase performs identical checks as in the testing phase but without encoding, with the following steps:
The verifier samples .
The prover computes and sends it to the verifier: (Identical to Testing Phase 2.)
The verifier tests the following equality by sampling : (Identical to Testing Phase 3.) Here, tensor product between and are flattened to the vector.
For example, when and , the equation holds due to the following reasoning:
Analysis
The proof generation time depends on the encoding and commitment operations. Since Merkle Tree is used for commitments, as long as encoding is performed in linear time, the overall execution time is .
The proof structure consists of:
: Fields used in Testing Phase Step 2 and Evaluation Phase Step 3.
: Fields sampled during Testing Phase Step 3 and Evaluation Phase Step 4.
: Opening proof size required for -queries.
Verification time is . While proof generation is fast, the proof size and verification time is directly proportional with .
Linear-time Encoding
The figure above illustrates the linear-time encoding method used in Brakedown. For a given rate , is a function that generates a vector of length from an input vector of length . The output is divided into three parts: . The encoding proceeds as follows:
Vec Enc(Vec x) {
if (x.size() < 900) {
// As mentioned in Section 5 of the paper,
// the threshold is set at 900.
// Quadratic-time operations are acceptable here
// since their time contribution is negligible.
return RSEnc(x);
}
// A is a sparse matrix.
Matrix A = SampleMatrixA();
CHECK_EQ(A.rows(), x.size());
CHECK_EQ(A.cols(), kAlpha * x.size());
Vec y = x * A ;
Vec z = Enc(y);
// B is a sparse matrix.
Matrix B = SampleMatrixB();
CHECK_EQ(B.rows(), z.size());
CHECK_EQ(B.cols(), (kRateInv * - 1 - kAlpha * kRateInv) * x.size());
Vec v = z * B;
return Concatenate(x, z, v);
}
Properties of the Encoded Output
For the encoded result , given the parameter , the zero norm and distance are given by:
The zero norm, also known as Hamming weight, represents the number of non-zero elements in :
The execution time of encoding is proportional to the input vector 's length. Proofs related to this encoding method are detailed in Section 5.1 of the paper.
Linear-time Commitments for Sparse Multilinear Polynomials
Using techniques from Spartan, the input vector can be committed in linear time.
Representing the Vector as a Sparse Matrix
For example, the vector can be converted into a matrix as follows. Here, Rows = 4, Cols = 4, Non-zero Elements (N) = 4, Total Elements (M) = 16:
Simply using a naive polynomial commitment scheme would require a computational complexity of .
Sparse Representation of the Matrix
The sparse representation is defined using , and as the following: 1. Each row of ,, defines a single non-zero entry in the sparse matrix.
2.
Defining Sparse Polynomial D
The sparse polynomial is defined as:
Here is an example calculation of , , and based on the previous example of a sparse matrix.
Therefore, will be calculated as so:
Commitment and Opening Steps
Given and , the prover provides oracles and :
The prover and verifier perform a sumcheck protocol for the equation:
At the final round of sumcheck, the verifier checks the following:
To verify the prover's claims of and , an Offline Memory Checking method is employed (refer to "Detour: offline memory checking" in Section 6 of the paper for details).
Reduction of R1CS to Sumcheck
Brakedown is a proving scheme for R1CS. Since the sumcheck protocol is integral to Brakedown, R1CS must be reduced to a sumcheck format. R1CS is defined as:
This can be converted into a sumcheck format as follows (simplified for illustration; see Section 7 for details):
Conclusion
Brakedown introduces linear-time encoding and linear-time commitment for generating proofs for R1CS, enabling proof generation with field operations. However, as mentioned earlier, the proof size is large, and the verification time is slow. These characteristics are evident in the following results:
The figure above, taken from the paper, benchmarks the performance of Brakedown's Polynomial Commitment Scheme. As shown, while Commit and Open operations are as fast as Ligero, the Verify and Communication stages are the slowest among the compared schemes.
This figure, also taken from the paper, shows that Brakedown achieves the fastest prove time and is among the fastest for encode time. However, it also confirms that verify remains slow, and the proof size is the largest.
Brakedown has since been improved and used in subsequent works, including Orion, Orion+, Vortex, and Binius.
Last updated