Skip to content

unbalancedparentheses/Cairo_Verifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cairo Verifier

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/

Use

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

Goals:

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)

Resources:

Papers

      Cairo Whitepaper
      Scalable, transparent, and post-quantum secure computational integrity
      ethSTARK Documentation

STARKWare Articles

      StarkDEX Deep Dive: the STARK Core Engine
      STARK Math Series
      Using SHARP (Shared Prover)
      Cairo for Blockchain Developers

Vitalik Buterin Articles

      STARKs, Part I: Proofs with Polynomials
      STARKs, Part II: Thank Goodness It's FRI-day
      STARKs, Part 3: Into the Weeds

Misc. Articles

      A Hands-On Tutorial for Zero-Knowledge Proofs Series
      Cryptography Stack Exchange Answer

Ropsten Addresses

      0x2886D2A190f00aA324Ac5BF5a5b90217121D5756
      0xe74999fbc71455462c8143b56797d3bb84c1064b

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.2%
  • Python 0.8%