GithubHelp home page GithubHelp logo

isabella232 / plasma_cash_history_snark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matter-labs-archive/plasma_cash_history_snark

0.0 0.0 0.0 22 KB

History compaction zkSNARK circuit for Plasma Cash and Cashflow history compaction

Rust 100.00%

plasma_cash_history_snark's Introduction

Plasma cash history SNARK

Compacts history in Plasma Cashes by hiding Merkle proofs under the private witness. Currently contains only non-inclusion circuit, with inclusion being trivially extended.

Without much optimization is requires 4270718 constraints for 128 block of non-inclusion for 24 tree depth.

Public inputs to the zkSNARK:

  • Start of the interval index (if single coin - just index)
  • Interval length (is single coin - 1)
  • Set of roots for which this coin index is proved to be non-included

Notice

SNARK checks that start of the interval is divisible by the interval length, but in principle such check should be done outside of the snark as range start and length are public inputs.

Run

Requires Rust 1.31 or higher.

Dummy tree and proof are generated for a large set of blocks

cargo run --release --bin benchmark_proof_gen

You can also sent an environment variable BELLMAN_VERBOSE=1 to have some verbose setup and proof generation progress.

Benchmark

    Using test constraint system to check the satisfiability
    Synthsizing a snark for 128 block for 24 tree depth
    Looking for unconstrained variabled:
    Number of constraints = 4263710
    generating setup...
    Has generated 4263684 points
    setup generated in 358.876 s
    creating proof...
    proof created in 39.749 s
    Proof is valid

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

plasma_cash_history_snark's People

Contributors

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