A STARK Verifier for Cairo programs, written in Rust. For use in the Open Libra Blockchain as a Zero-Knowledge Verification mechanism. Cairo Programs serve as a flexible, robust alternative to manually designing polynomial constraints, which are difficult and can be error-prone.
For a more detailed explanation check out my Medium post.
Based off of STARKWare's Soldity Implementation available at: github/starkware-libs/starkex-contracts/evm-verifier/
Include in your project's cargo.toml:
[dependencies]
cairo-verifier = { git = "https://github.com/patrickbiel01/Cairo_Verifier", branch = "main" }
Call:
use cairo_verifier;
cairo_verifier::verify_proof(
proof_params, proof, task_meta_data, cairo_aux_input, cairo_verifier_id
);
verify_proof Definition:
fn verify_proof(
proof_params: Vec<Uint256>,
proof: Vec<Uint256>,
task_meta_data: Vec<Uint256>,
cairo_aux_input: Vec<Uint256>,
cairo_verifier_id: Uint256,
)
Note: Uint256 is the num256::uint256::Uint256 crate
Currently this verifier only supports Cairo Programs that use Layout 1
- Implement Layout 0, 2 (Example: layout 0)
- Change values in memory_map.rs, oods_check.rs, polynomial_contrainsts.rs, stark_params.rs
- Change all of above to accept multiple layout (Look at 4th element in Cairo Aux Input)
Cairo Whitepaper
Scalable, transparent, and post-quantum secure computational integrity
ethSTARK Documentation
StarkDEX Deep Dive: the STARK Core Engine
STARK Math Series
Using SHARP (Shared Prover)
Cairo for Blockchain Developers
STARKs, Part I: Proofs with Polynomials
STARKs, Part II: Thank Goodness It's FRI-day
STARKs, Part 3: Into the Weeds
A Hands-On Tutorial for Zero-Knowledge Proofs Series
Cryptography Stack Exchange Answer
0x2886D2A190f00aA324Ac5BF5a5b90217121D5756
0xe74999fbc71455462c8143b56797d3bb84c1064b