Just One Lookup Table.
Jolt is a zkVM (zero-knowledge virtual machine) for RISC-V, built to be the simplest, fastest, and most extensible general-purpose of its kind. This repository currently contains an implementation of Jolt for the RISC-V 32-bit Base Integer Instruction Set + M Standard Extension for Integer Multiplication and Division (RV32IM). Contributors are welcome!
- 🚧 currently undergoing updates 🚧
Jolt: SNARKs for Virtual Machines via Lookups
Arasu Arun, Srinath Setty, Justin Thaler
Twist and Shout: Faster memory checking arguments via one-hot addressing and increments
Srinath Setty, Justin Thaler
Unlocking the lookup singularity with Lasso
Srinath Setty, Justin Thaler, Riad Wahby
Initial launch:
Updates:
Note
Jolt is in alpha and is not suitable for production use at this time.
For developers looking to build using Jolt, check out the Quickstart guide.
For developers looking to contribute to Jolt, follow the instructions below.
You will need Rust nightly.
If you have rustup
installed, you do not need to do anything as it will
automatically install the correct toolchain and any additional targets on the
first cargo
invocation.
Clone this repo:
git clone [email protected]:a16z/jolt.git
To check if rustup
has picked the right version of Rust run rustup show
inside the cloned repository.
cd jolt; rustup show
.
This repository uses workspaces, and each workspace can be built individually, e.g.
cargo build -p jolt-core
For faster incremental builds, use the build-fast
profile:
cargo build --profile build-fast -p jolt-core
Unit and end-to-end tests for jolt-core
can be run using the following command:
cargo test -p jolt-core
Examples in the examples
directory can be run using e.g.
cargo run --release -p sha2-chain
Jolt is instrumented using tokio-rs/tracing for execution profiling.
To generate a trace, run e.g.
cargo run --release -p jolt-core profile --name sha3 --format chrome
Where --name
can be sha2
, sha3
, sha2-chain
, fibonacci
, or btreemap
. The corresponding guest programs can be found in the examples
directory. The benchmark inputs are provided in bench.rs
.
The above command will output a JSON file in the workspace rootwith a name trace-<timestamp>.json
, which can be viewed in Perfetto.
Jolt uses allocative for memory profiling.
Allocative allows you to (recursively) measure the total heap space occupied by a data structure implementing the Allocative
trait, and optionally generate a flamegraph.
In Jolt, most sumcheck data structures implement the Allocative
trait, and we generate a flamegraph at the start and end of stages 2-5 (see jolt_dag.rs
).
To generate allocative output, run:
RUST_LOG=debug cargo run --release --features allocative -p jolt-core profile --name sha3 --format chrome
Where, as above, --name
can be sha2
, sha3
, sha2-chain
, fibonacci
, or btreemap
.
The above command will log memory usage info to the command line and output multiple SVG files, e.g. stage3_start_flamechart.svg
, which can be viewed in a web browser of your choosing.
We have enabled benchmarking during CI to track performance changes over time in terms of prover runtime and peak memory usage.
This repository started as a fork of https://github.com/arkworks-rs/spartan. Original Spartan code by Srinath Setty.
Jolt is dual licensed under the following two licenses at your discretion: the MIT License (see LICENSE-MIT), and the Apache License (see LICENSE-APACHE).
Jolt is Copyright (c) a16z 2023. However, certain portions of the Jolt codebase are modifications or ports of third party code, as indicated in the applicable code headers for such code or in the copyright attribution notices we have included in the directories for such code.
This code is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the code. It has not been audited and as such there can be no assurance it will work as intended, and users may experience delays, failures, errors, omissions or loss of transmitted information. Nothing in this repo should be construed as investment advice or legal advice for any particular facts or circumstances and is not meant to replace competent counsel. It is strongly advised for you to contact a reputable attorney in your jurisdiction for any questions or concerns with respect thereto. a16z is not liable for any use of the foregoing, and users should proceed with caution and use at their own risk. See a16z.com/disclosures for more info.