Implementation of Bolt: Faster SNARKs from Sketched Codes.
This code is for benchmarking and evaluation purposes only and should not be used for production code.
A significant portion of the code in this repository was generated by Claude Code. AI-generated code may not be eligible for copyright protection in all jurisdictions, and its legal status regarding intellectual property remains unsettled. Users should be aware of these potential copyright implications before incorporating any of this code into their own projects.
The main focus of the benchmark is to demonstrate prover performance for large polynomials, and so the benchmark uses polynomials of size
The encoding works as follows:
- The
$2^{30}$ polynomial is interleaved to a matrix of dimensions$2^{23} \times 2^7$ - Each column is encoded using an expander of dimensions
$2^{23} \times 2^{20}$ to get a syndrome - Each syndrome is encoded with Reed-Solomon of rate
$\frac{1}{2}$ - The code is then obtained by concatenating the message with the RS-encoded syndrome, resulting in dimensions
$(2^{23} + 2^{21}) \times 2^7$ - The final interleaved code is committed by hashing each row (sized
$2^7$ ) into a Merkle tree with SHA256
The implementation attempts to optimize the use of L1 and L2 caches, SIMD, GPU acceleration using Metal, low-level instructions for carry-less multiplication, low-level and hardware-accelerated instructions for SHA256.
The following are the results on an M4 Pro Mac mini with 14 CPU cores, 20 GPU cores and 64 GBs of memory, in a variant that hashes on GPU and encodes on CPU, pipeplining the hashing of the systematic part while encoding is taking place.
| Variant | Commit time (ms) |
|---|---|
| bolt-max | 840 |
| bolt-min | 1250 |
You can run the benchmarks using ./run_benchmarks.sh bolt-xor bolt32 for Bolt, and ./run_benchmarks.sh --paper for the systems benchmarked in the paper.
The codebase started as a Rust port of the Julia-based ligerito-impl. From there, it served as the main implementation for the paper. Optimizations, tests and benchmarks were majorly done by Claude Code, prompted by us.
The sumcheck prover incorporates several optimizations learned from binius.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.