Skip to main content

Jolt zkVM Support

We are excited to announce support for the Jolt zkVM in Sindri! Jolt is a state of the art zero-knowledge virtual machine that leverages the power of Just One Lookup Table to achieve high performance and scalability.

This update expands Sindri's pallet of proving frameworks beyond circuit DSL's, enabling users to generate proofs of correct execution from arbitrary Rust programs. Users can generate proofs one of two polynomial commitment schemes (PCS's) currently supported in Jolt:

The project directory that users upload to Sindri should closely resemble the structure of the guest code directory from the Jolt template, with the addition of a sindri.json manifest file and a utils.rs file.

Jolt Project Directory Structure
📦guest
┣ 📂src
┃ ┣ lib.rs
┃ ┗ utils.rs
┣ 📜Cargo.toml
┗ 📜sindri.json

Here is an example sindri.json file that specifies the required fields for a Jolt project using the HyperKZG commitment scheme.

sindri.json
{
"name": "fibonacci",
"circuitType": "jolt",
"provingScheme": "jolt",
"commitmentScheme": "hyperkzg",
"joltVersion": "0.1.0",
"stdEnabled": false,
"packageName": "fibonacci",
"guestFunction": "fib"
}

Users can also choose to enable the standard library by setting the stdEnabled field to true or false.
If set to true, the guest code and Cargo.toml file should be modified per the instructions in the Jolt documentation.

The utils.rs file will contain definitions for an Input and Output struct. An example of a utils.rs file is shown below:

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct Input {
pub n: u32,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Output {
pub output: u128,
}

The guest code contained in lib.rs will need to import the utils.rs file and format the inputs and outputs for the fib function.

#![cfg_attr(feature = "guest", no_std)]
#![no_main]
pub mod utils;
pub use utils::{Input, Output};

#[jolt::provable]
fn fib(input: Input) -> Output {
let mut a: u128 = 0;
let mut b: u128 = 1;
let mut sum: u128;
for _ in 1..input.n {
sum = a + b;
a = b;
b = sum;
}

let out: Output = Output { output: b };

out
}

Users can explore sample guest code in the sindri-resources repository to get started creating Jolt proofs.