Solidity contracts for verifying STARK proofs on Ethereum.
- Foundry (
forge,cast) - Rust
- direnv (for environment variables)
-
Install direnv:
-
Configure environment:
# Copy example file cp .env.example .env # Edit .env and fill in required values: # - PRIVATE_KEY=your_private_key_here (required) # - SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY (required) # # Optional (defaults to examples/factorial-bootloader/): # - ANNOTATED_PROOF=examples/factorial-bootloader/annotated_proof.json # - INPUT_JSON=examples/factorial-bootloader/input.json # - FACT_TOPOLOGIES=bootloader/fact_topologies.json
-
Allow direnv:
direnv allow .
# Deploy to Sepolia testnet
cargo run --bin deploy sepolia
# Dry run (simulate without broadcasting)
cargo run --bin deploy sepolia --dry
# Deploy to Base Sepolia
cargo run --bin deploy base-sepolia# Test a program example (fibonacci or factorial)
cargo run --bin test example factorial
cargo run --bin test example fibonacci
# Test bootloader version
cargo run --bin test example factorial --bootloader
# Run all Forge tests
cargo run --bin test all
# Run all tests with gas report
cargo run --bin test all --gasVerify large bootloader proofs using the split approach:
# With network selection (uses env vars for RPC URL)
cargo run --bin verify sepolia
cargo run --bin verify base-sepolia
# by default it will verify factorial proof but you can specify to verify fobonnaci.
cargo run --bin verify -- --annotated-proof examples/fibonacci-bootloader/annotated_proof.json --fact-topologies examples/fibonacci-bootloader/fact_topologies.json sepoliaThe verification process:
- Splits the proof into smaller parts (trace decommitments, FRI decommitments, continuous pages)
- Registers each part separately to avoid gas/calldata limits
- Verifies the main proof using
input.jsondirectly
- Pre-generated
input.jsonfiles (fromprepare-proofrepository) deployment-addresses.jsonwith deployed contract addresses (after deployment)
Example input.json files are stored in examples/ directory:
examples/fibonacci/input.json- Fibonacci program proofexamples/factorial/input.json- Factorial program proofexamples/fibonacci-bootloader/input.json- Fibonacci via bootloaderexamples/factorial-bootloader/input.json- Factorial via bootloader
- This is not a production version - a production implementation can be found on Ethereum mainnet
- Compatibility: Only supports proofs generated with
layout=starknet - Proof generation: This repository only handles verification - proof generation must be done separately using
prepare-proofrepository - Proofs must use
keccak256for EVM compatibility
Apache-2.0