Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

1sixtech/gc-stark-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gc-stark-verifier

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.

Project goals

  • 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.

CLI usage

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.proof

Proof text format

Proofs 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 (explicit exposes random coins; tx derives 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.

Repository layout

  • src/garbled_circuit.rs, src/circuit.rs, and src/evaluation.rs implement the generic garbling engine and boolean circuit primitives.
  • src/fri.rs and src/verifier.rs build circuit templates for multi-round FRI and composition polynomial checks.
  • src/proof.rs handles parsing/serialization of the proof text format.
  • examples/ contains small state dumps useful for integration experiments.

Development

  • cargo test runs parser/unit coverage for core components.
  • cargo run -- verify-proof <file> provides a fast sanity check of parser + circuit execution.

License

This project is distributed under the MIT License. See LICENSE.

About

Rust implementation of a verifier for garbled-circuit STARK proofs

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages