A research-oriented Rust implementation of a verifier for garbled-circuit STARK proofs. The project wires together Merkle path checks, low-degree polynomial verification with FRI, and compositional constraints into boolean circuits that can be evaluated with garbled circuit techniques.
- Provide a reference pipeline for ingesting text-encoded STARK proofs and re-expressing their verification as combinational circuits.
- Experiment with circuit garbling for proof verification, including multi-round FRI checks and optional composition polynomial validation.
- Offer deterministic proof generation helpers that make it easy to test the verifier end-to-end without bespoke tooling.
The binary exposes two commands (see src/main.rs:15):
cargo run -- gen-full-proof <depth> <num_paths> <rounds> <pairs> <mode:explicit|tx> <out-file>Generates a deterministic, self-contained proof file that exercises Merkle and FRI verification logic. The helper synthesises Merkle leaves, sibling paths, and FRI round data so you can quickly benchmark or experiment with different circuit sizes.
cargo run -- verify-proof <file>Parses a proof file in the custom text format and evaluates the corresponding garbled circuits. When composition data is included, the verifier constructs the full circuit; otherwise it falls back to separate Merkle and FRI circuits.
Example workflow:
cargo build --release
./target/release/gc-stark-verifier gen-full-proof 16 2 3 4 tx /tmp/example.proof
./target/release/gc-stark-verifier verify-proof /tmp/example.proofProofs are stored in a compact, line-based text format described in src/proof.rs:14. Key sections include:
merkle.*fields describing tree depth, number of paths, root hash, and per-path leaf/sibling data.fri.*fields describing the number of rounds, folding pairs, operating mode (explicitexposes random coins;txderives them from a transcript seed), and per-round evaluations.- Optional composition data (
comp.*) that supplies out-of-domain evaluation points and folded values for the constraint polynomial. When absent, the verifier only executes the Merkle+FRI subcircuits.
Lines beginning with # are treated as comments; blank lines are ignored. All multi-byte values are big-endian hex.
src/garbled_circuit.rs,src/circuit.rs, andsrc/evaluation.rsimplement the generic garbling engine and boolean circuit primitives.src/fri.rsandsrc/verifier.rsbuild circuit templates for multi-round FRI and composition polynomial checks.src/proof.rshandles parsing/serialization of the proof text format.examples/contains small state dumps useful for integration experiments.
cargo testruns parser/unit coverage for core components.cargo run -- verify-proof <file>provides a fast sanity check of parser + circuit execution.
This project is distributed under the MIT License. See LICENSE.