Coder Social home page Coder Social logo

giza's Introduction

Overview

Giza leverages the Winterfell library to prove and verify the execution of programs running on the Cairo VM.

Usage instructions

Giza offers two modes of usage. In the first mode, an execution trace created by an external Cairo runner is supplied to the CLI to output a proof. The provided trace consists of binary files containing the record of register and memory states visited during the run of a Cairo program. To prove execution, additional auxiliary trace values must be reconstructed, and the built-in Rust runner is used to re-execute the trace in order to compute these values.

The second usage mode accepts only a Cairo program and initial register state, and uses the runner to construct all necessary trace information (including trace and memory values). Unlike the first mode, Python hint support and program input are not yet fully supported. This is not the preferred mode of interacting with Giza, and is not currently exposed through the CLI.

Mode 1: Supply a trace to the CLI

Assuming a compiled Cairo program program.json, the following steps can be taken to construct a proof:

  1. Install the Giza CLI using nightly Rust: cargo install --path cli
  2. Generate the partial trace using an external runner, for example: cairo-run --program=program.json --layout=all --memory_file=memory.bin --trace_file=trace.bin. Note that the Starkware runner may only be used for purposes that fall within its license.
  3. Construct the proof: giza prove --trace=trace.bin --memory=memory.bin --program=program.json --output=output.bin
  4. Verify the proof: giza verify --proof=output.bin

Mode 2: Supply a program

To prove and verify the execution of the program found in examples/src/main.rs, one can run the following after completing step 1 from the previous section.

cargo run --release --bin giza-examples

Acknowledgments

  • The Cairo virtual machine and programming language is developed by Starkware.
  • The STARK prover and verifier is built using the Winterfell project.
  • The current Rust runner is a fork of the implementation written by Anaïs Querol of O(1) Labs.

giza's People

Contributors

maxgillett avatar liamzebedee avatar tdelabro avatar lgiussan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.