Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

binary-jolt

binary-jolt implements the Magnetar protocol (ePrint 2026/2423) adapted for Jolt-compatible RV64IMAC executions.

binary-jolt: A Binary-Field Proof System for RISC-V Executions (companion technical report, PDF)

Warning

binary-jolt is a research prototype under heavy development. It has not been audited, its security analysis is incomplete, and it must not be used in production or to protect anything of value.

  • Proofs are not zero knowledge: inputs, advice and memory contents are not hidden.
  • The verifier is not hardened against malicious inputs or denial of service.
  • Interfaces, proof formats and parameters change without notice.

binary-jolt is a prover and verifier for RISC-V programs, built as a research fork of Jolt. It proves executions of Jolt-compatible RV64IMAC guest ELFs, written with Jolt's SDK, with a polynomial interactive oracle proof (PIOP) over binary fields instead of Jolt's large prime field. The witness is bit-sliced over GF(2), and the verifier's challenges live in GF(2^128). The execution argument ends in one evaluation claim per committed multilinear bit polynomial: the trace, plus the program and the trusted advice when these are committed. A pluggable polynomial commitment scheme (PCS) then opens those claims.

The implementation lives in crates/binary-jolt. Cargo imports Jolt’s tracer, runtime, RISC-V types and inline registry at the execution-semantics pin 44a878f0, and Jolt's field algebra at the fork base 92688c2d, unmodified. The guest corpus is built from the execution pin using the third-party/jolt submodule. The one forked Jolt crate is the transcript (crates/jolt-transcript), shared with Akita. Local changes

Techniques

The protocol is specified in specs/binary-jolt. In outline:

  • Execution argument over binary fields. A one-cycle RV64 executor driven by a micro-ROM. The per-cycle witness is bit-sliced into 0/1 columns. It has these parts:
    • Spartan-style sumcheck phases for the constraint system over GF(2^128);
    • Twist and Shout memory checking for registers, RAM and the micro-ROM;
    • product-tree grand products;
    • "router" sumchecks for shifts, loads and stores.
  • Mosaic packing. All of a proof's committed components are packed into one bit polynomial G, and every claim of the execution argument is reduced to one evaluation claim G̃(r) = v. A committed program or trusted advice gets its own slot and claim, so the PCS opens one claim per slot.
  • ISA. RV64I with M, C (Zca) and A (Zaamo, Zalrsc) (spec). Other extensions are out of scope.
  • Jolt compatibility (spec and its parts):
    • Jolt's guest execution environment and memory layout;
    • trusted and untrusted advice;
    • traps;
    • the program in the statement (full-program mode) or committed;
    • precommitted slots;
    • Jolt's inlines;
    • the Fiat–Shamir transcript;
    • a table of every parameter with its range and how it is bound.
  • PCS seam. One interface behind which every backend sits, with per-slot commitments and precommitments (slots and the PCS identity).

PCS backends

The default build has all three backends; each is a Cargo feature (pcs-akita, pcs-whir, pcs-flock), so a build may leave any out, and --no-default-features builds the frontend alone (no Akita, Plonky3 or Flock dependency). Which built backend proves is chosen at run time by BINARY_JOLT_PCS (whir, akita or flock; binary WHIR when unset and built, else the first built one); naming a backend the build leaves out is an error. A proof names its backend in the statement. Binary WHIR's rate set is BINARY_JOLT_WHIR_RATES: quarter (rate 1/4 for every slot, the default) or per-role (the committed program and trusted advice at rate 1/16, the trace at rate 1/4: smaller proofs when a slot is precommitted). Prover and verifier must use the same set.

Backend Kind Notes
Binary WHIR (default) hash-based (Keccak-256 Merkle), Reed–Solomon proximity over binary fields Plonky3's binary WHIR, vendored with local changes; rate 1/4 by default; optional per-role rates (the precommitted program and trusted-advice slots at rate 1/16, the trace at rate 1/4; BINARY_JOLT_WHIR_RATES=per-role, pcs::hash::PerRoleHash). Rate 1/16 for every slot is not selectable with BINARY_JOLT_WHIR_RATES: only the Rust type pcs::hash::whir::BinaryWhir<Sixteenth> and e2e_bench --pcs whir16 use it (note)
Akita / LaBinius lattice-based (Module-SIS), binary-source opening Akita with its LaBinius binary-source route, built from a pinned branch of the public Akita repository (experimental)
flock hash-based (SHA-256 Merkle), binary Ligerito a vendored fork of flock; profiles slim, fast and P-UD

Security status

There is no end-to-end concrete soundness claim for any backend, and no backend is admitted for production. What the analysis states today:

  • Fiat–Shamir. The analysis is in the classical random-oracle model.
    • Each challenge of the execution argument (the frontend) has a per-query error of at most 2^-128, grinding included. So does each challenge of every backend's opening on its pinned rows.
    • There is no aggregate 2^-128 claim and no QROM claim. The reduction from the transcript's duplex to an ideal permutation, and the extractor's loss, are not priced.
    • The single-proof interactive error (a union bound over all of a proof's challenges, without grinding) is reported, not gated: about 2^-96.8 for the worst admitted layout (the largest M table and pair table at 2^30 cycles, two BitZ projections; about 2^-97.8 with one) under WHIR or Akita.
  • Binary WHIR and flock (hash-based).
    • Status: not admitted.
    • Model: the classical ROM for the Keccak-f[1600] duplex (the transcript); the Merkle hash (Keccak-256 for WHIR, SHA-256 for flock, fixed-length inputs) modeled as a random oracle, the BCS16 compilation: a root fixes the word its query log determines when the root is first absorbed, failing only on a collision or an inversion, about (Q² + Q)/2^256 (collision resistance alone does not fix the word before the challenges the bounds are taken over; the compilation's reduction is not priced); SHA3-256 statement digests. WHIR's extraction, with the queries of whoever produced a precommitment in the log and a hash term charged once over the trees' life, is stated in the backend note, §3.2.
    • WHIR: every Fiat–Shamir run of an opening on its certified rows (2^15 … 2^32 carriers) is at most 2^-128 per query.
    • flock: every Fiat–Shamir squeeze run of an opening on its certified rows (2^15 … 2^31 carriers; profiles slim, fast and P-UD) is at most 2^-128 per query, grinding counted (worst 2^-129.0, under P-UD). Slim and fast bind precommitted slots with an out-of-domain site of at most 2^-235.8 per query.
    • flock is an experimental backend, with rows up to 2^31 carriers and known prover robustness issues at the largest sizes.
    • The soundness analysis of the binary-WHIR adaptation is in docs/notes/binary-whir-adaptation.md; flock's soundness write-up is not part of this release.
    • No post-quantum claim is made for WHIR or flock.
  • Akita / LaBinius (lattice).
    • Every induced Module-SIS instance is estimated at 169 modeled quantum bits or more, the lowest at 169.3 for rows from 2^27 to 2^31. The estimator treats the ring as unstructured; the structured-ring caveat is in the report.
    • The PCS's binary-source extraction and binary-root composition are proved for commitments of up to 2^26 carriers; the theorem composing them with the frontend (thm:pcs) covers N = 2^(n+1) for 17 ≤ n ≤ 24, up to 2^25 carriers. Larger admitted layouts (2^26 composed, and the rows from 2^27 to 2^32, which carry estimator and Fiat–Shamir evidence) have a draft composition argument. No proof has been produced at 2^31 or 2^32 carriers yet.
    • Upstream Akita makes no security claim for this route.
  • Not claimed: zero knowledge or hiding, recursion, end-to-end or aggregate soundness, QROM security, post-quantum security of the hash backends, production admission.
  • Not admitted. The public verify entry refuses proofs. Tests and the corpus driver use verify_unadmitted.

Details are in the security statement and the security report.

What is proved, and what is refused

A proof shows that the guest program, with the public inputs, outputs and panic flag in the statement (and its committed advice, if any), runs for T = 2^n cycles under Jolt's execution environment and reaches its halt, with n in the admitted range (17 … 30 today, depending on the backend's pinned PCS rows). The program is bound either in full (the verifier rebuilds its table) or through a commitment.

One deliberate difference from Jolt's tracer: advice-checked inlines. For GRUMPKIN_DIVQ_ADV, GRUMPKIN_DIVR_ADV, GRUMPKIN_GLVR_ADV and P256_FAKE_GLV_ADV, the stored advice words are the prover's:

  • a proof accepts any words that the guest SDK's checks after the call accept;
  • if the guest calls the inline without those checks, a proof accepts any words at all.

With a divisor whose raw representation is a nonzero multiple of the field modulus, Jolt's tracer does not terminate, while binary-jolt can prove past the call; that case is unreachable through the SDK's own constructors. With an off-curve P-256 point the tracer aborts while the rows are satisfiable; the SDK's ecdsa_verify checks the point first. SECP256K1_GLVR_ADV is pinned to the tracer's values exactly.

Everything outside the admitted ranges is handled before any proof is produced (parameter table):

  • Refused with a typed error, before the transcript. This covers:
    • malformed or unsupported ELF images, including ELFs that use a tohost symbol;
    • programs above the full-program-mode size bounds, which need committed-program mode;
    • memory configurations, inputs or outputs out of range;
    • trace lengths above the largest pinned PCS row (2^31 carriers under flock).
  • Not supported: batched multi-slot openings. Every committed slot is opened on its own.
  • Unsatisfiable: no proof exists. This covers runs that fault or access memory outside their window.
  • Prover error. A run longer than the largest admitted trace.

Building and running

Requirements: Rust 1.95 (pinned by rust-toolchain.toml), and for building guests the riscv64imac-unknown-none-elf target. The Python tools under tools/ and docs/security/artifacts need Python 3.10 or newer (int.bit_count); third-party/plonky3-0d803737/vendor.py needs 3.11 (tomllib). The CPU needs carry-less multiplication: x86-64 with VPCLMULQDQ and AVX2 (or AVX-512F), or aarch64 with AES. crates/binary-jolt/.cargo/config.toml sets -C target-cpu=native for x86-64, so Cargo run from crates/binary-jolt builds for the host CPU (a RUSTFLAGS environment variable replaces it). crates/binary-jolt is the repository's only Cargo workspace. A few file paths and file contents are fixed inputs to the protocol identity (they are hashed into the parameter set), so they keep their historical names; changing them would change every proof.

cd crates/binary-jolt
cargo build --release          # all three backends, binary WHIR as the default
cargo build --release --no-default-features --features pcs-whir   # binary WHIR only
cargo test  --release --lib    # unit and protocol tests

The Akita backend's crates come from the public Akita repository, branch experimental, pinned in crates/binary-jolt/Cargo.toml. Switching the default backend is the environment variable BINARY_JOLT_PCS, for example BINARY_JOLT_PCS=akita; the benchmarks also take --pcs akita|whir|flock.

Proving a Jolt guest end to end. The prover accepts guest ELFs. From crates/binary-jolt, the benchmark below assembles the checked-in Fibonacci guest, proves it, and replays the research verifier.

cargo run --locked --profile build-fast --bin e2e_bench -- --guest ../../tests/fixtures/jolt-guests/fibonacci --reps 1
  • For a quick local run of a guest with binary WHIR, use cargo test --locked --profile build-fast --test corpus -- --exact a_small_guest_proves_and_verifies.
  • The corpus driver proves and verifies a small in-tree guest: cargo test --release --test corpus a_small_guest_proves_and_verifies.
  • It also proves any guest directory that holds program.elf and program.json, with an optional fixture directory for inputs and advice. Give it a manifest with one name<TAB>guest-dir<TAB>fixture-dir line per guest (- for no fixture):
CORPUS_MANIFEST=manifest.tsv CORPUS_OUT=results.jsonl \
  cargo test --release --test corpus -- --ignored --exact corpus

Each entry yields one JSON line: proved, refused (with the parameter row) or failed.

Jolt's examples. Built at the Jolt pin, they are committed as such guest directories in tests/fixtures/jolt-guests. Without CORPUS_MANIFEST the driver proves all of them:

CORPUS_OUT=results.jsonl cargo test --release --test corpus -- --ignored --exact corpus

tools/jolt-examples/generate.sh rebuilds them from the third-party/jolt submodule and checks them against the corpus's MANIFEST; the corpus's README says how to update them or move the pin. The Fibonacci end-to-end tests use the committed corpus by default. Set BINARY_JOLT_EXTERNAL_GUESTS to an absolute corpus directory to override it. Other external-guest tests opt in through that same variable.

Coverage. 158 public programs were run under each of the three backends (binary WHIR, Akita and flock), as a correctness check only, with identical results under all three. These runs were recorded for the initial release (4f90ff1), with binary WHIR at rate 1/4 for every slot, its default. WHIR's opt-in per-role set (then the feature whir-per-role; now BINARY_JOLT_WHIR_RATES=per-role at run time, pcs::hash::PerRoleHash in Rust) changes only the entries with a precommitted slot, so those were also run under it: the 19 entries in committed-program mode or with trusted advice (the 12 Jolt examples named below, 2 synthetic edge programs, and 5 entries with trusted advice besides merkle-tree, which has both). 17 proved, including merkle-tree with all three slots, and 2 are refused by design (S1), as in the initial runs; none failed. Of the other 139 entries, the 86 proved have the trace slot alone, whose proof is byte-identical under the per-role set by construction (the backend's tests pin it), and the 53 refused are refused before any slot layout or proof is built, by checks the per-role set does not change; so their results are unchanged. None fails unexpectedly. "Proved" means the proof verifies, and its outputs and panic flag equal those of a reference execution. The step count and the trace digest were recorded next to the verdict and compared with the reference's, without gating it; in the per-role runs, all 17 proved entries matched both. The corpus driver now records only the step count against Jolt's tracer (steps_match_tracer), still without gating the verdict; it no longer records a trace digest. To reproduce Jolt's example rows, run the corpus driver on the committed corpus tests/fixtures/jolt-guests (see Building and running). The test-guest rows were produced with guest programs and generators that are not part of this release; tests/fixtures/ ships a subset of them as prebuilt ELFs, which the crate's tests use.

  • Jolt's examples (at the compatibility pin 44a878f0): 32 of 35 proved, 3 refused. field-limbs and field-ops use field-inline instructions, which are not supported. overflow-stack overflows its stack, so it has no valid trace.
  • Test guests (123): 71 proved. The other 52 are deliberately invalid or unsupported programs (traps, unsupported features, negative tests) and are refused as designed:
    • 43 have no valid trace (S1);
    • 6 are ELFs Jolt itself refuses (Π1);
    • 3 have an entry point that is not a valid instruction start (P_entry).
group programs proved refused by design
Jolt's examples (at the compatibility pin 44a878f0) 35 32 3
one guest per registered Jolt inline (SHA-2, SHA-3/Keccak, BLAKE2/3, BigInt, secp256k1, P-256, grumpkin, NTT) 40 35 5
ELF-loader and decoder guests (section layouts, inline sites) 15 8 7
execution-environment guests (faults, traps, advice, I/O, atomics) 41 7 34
synthetic edge programs (entries, tables, windows, advice sizes) 19 13 6
guests written without the SDK 7 7 0
generated trap guest (ECALL, MRET, CSRs) 1 1 0
all 158 103 55

12 of the 32 proved Jolt examples are too large for full-program mode and prove in committed-program mode: advice-demo, backtrace-std, hash-bench, both large-alloc variants, merkle-tree, modinv, p256-ecdsa-verify, recover-ecdsa and the three stdlib examples. Under binary WHIR their program slot was opened at rate 1/4 in the initial runs and at rate 1/16 in the per-role runs; the backend's per-role tests (specs/binary-jolt/jolt/J10-slots.md, J10.6) cover those openings too.

Repository layout

Path Contents
crates/binary-jolt binary-jolt: executor, execution argument, Mosaic, the PCS seam and backends, the Jolt-compatibility layer
specs/binary-jolt the protocol specification
docs/ design notes and the security report
third-party/ vendored Plonky3 (binary WHIR) and flock, with their licences (provenance); Jolt at the pin as a git submodule (third-party/jolt), used only to rebuild the guest corpus
crates/jolt-field, crates/jolt-transcript the Jolt crates Akita's Jolt pin is redirected to: a re-export of Jolt's jolt-algebra, and the transcript fork (changes)

Licence and attribution

Copyright (c) 2026 LayerZero Labs, for the changes and additions in this repository.

binary-jolt is licensed under the MIT License (LICENSE-MIT) or the Apache License, Version 2.0 (LICENSE-APACHE), at your option.

  • Jolt. binary-jolt is a fork of a16z's Jolt (MIT OR Apache-2.0; Copyright (c) a16z, Copyright (c) Microsoft Corporation). Jolt's own notices and code headers for ported third-party code are kept. The files changed from Jolt are listed in MODIFICATIONS.md.
  • Third-party code keeps its own licence. This covers:
    • flock (third-party/flock, with Binius64-derived portions and one file derived from bolt-rs, crates/flock-core/src/pcs/ligerito.rs); its changes are listed in third-party/flock/MODIFICATIONS.md;
    • Plonky3 (third-party/plonky3-0d803737); its changes are listed in third-party/plonky3-0d803737/MODIFICATIONS.md;
    • files adapted from Binius64 and BitZ-pcs inside binary-jolt's own sources, each carrying its upstream notice;
    • three files adapted from Akita's binary-source example (crates/binary-jolt/src/pcs/akita/catalog/, MIT OR Apache-2.0, Copyright (c) 2025 a16z);
    • the guest programs in tests/fixtures/jolt-guests, built from Jolt's examples at the pin (MIT OR Apache-2.0) and the crates and C code they link, which keep their own licences. Jolt itself (third-party/jolt) is a git submodule, not part of this repository's tree.
  • Cargo dependencies, among them Akita and arkworks, are not part of this repository and keep their own licences (apart from the four Akita example files above).

The full attribution, with every upstream's copyright, licence and commit, is in NOTICE; see also the third-party provenance.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages