https://github.com/arkworks-rs/marlin

A Rust library for the Marlin preprocessing zkSNARK

https://github.com/arkworks-rs/marlin

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 17 committers (17.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

cryptography marlin r1cs rust zksnark

Keywords from Contributors

elliptic-curves finite-fields pairings polynomials poseidon sponge
Last synced: 5 months ago · JSON representation

Repository

A Rust library for the Marlin preprocessing zkSNARK

Basic Info
  • Host: GitHub
  • Owner: arkworks-rs
  • License: apache-2.0
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 1.68 MB
Statistics
  • Stars: 323
  • Watchers: 21
  • Forks: 87
  • Open Issues: 13
  • Releases: 1
Topics
cryptography marlin r1cs rust zksnark
Created over 6 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog License Authors

README.md

Marlin

marlin is a Rust library that implements a

preprocessing zkSNARK for R1CS
with
universal and updatable SRS

This library was initially developed as part of the Marlin paper, and is released under the MIT License and the Apache v2 License (see License).

WARNING: This is an academic prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.

Overview

A zkSNARK with preprocessing achieves succinct verification for arbitrary computations, as opposed to only for structured computations. Informally, in an offline phase, one can preprocess the desired computation to produce a short summary of it; subsequently, in an online phase, this summary can be used to check any number of arguments relative to this computation.

The preprocessing zkSNARKs in this library rely on a structured reference string (SRS), which contains system parameters required by the argument system to produce/validate arguments. The SRS in this library is universal, which means that it supports (deterministically) preprocessing any computation up to a given size bound. The SRS is also updatable, which means that anyone can contribute a fresh share of randomness to it, which facilitates deployments in the real world.

The construction in this library follows the methodology introduced in the Marlin paper, which obtains preprocessing zkSNARKs with universal and updatable SRS by combining two ingredients:

  • an algebraic holographic proof
  • a polynomial commitment scheme

The first ingredient is provided as part of this library, and is an efficient algebraic holographic proof for R1CS (a generalization of arithmetic circuit satisfiability supported by many argument systems). The second ingredient is imported from poly-commit. See below for evaluation details.

Build guide

The library compiles on the stable toolchain of the Rust compiler. To install the latest version of Rust, first install rustup by following the instructions here, or via your platform's package manager. Once rustup is installed, install the Rust toolchain by invoking: bash rustup install stable

After that, use cargo (the standard Rust build tool) to build the library: bash git clone https://github.com/arkworks-rs/marlin.git cd marlin cargo build --release

This library comes with some unit and integration tests. Run these tests with: bash cargo test

Lastly, this library is instrumented with profiling infrastructure that prints detailed traces of execution time. To enable this, compile with cargo build --features print-trace.

Benchmarks

All benchmarks below are performed over the BLS12-381 curve implemented in the ark-bls12-381 library, with the asm feature activated. Benchmarks were run on a machine with an Intel Xeon 6136 CPU running at 3.0 GHz.

Running time compared to Groth16

The graphs below compare the running time, in single-thread execution, of Marlin's indexer, prover, and verifier algorithms with the corresponding algorithms of Groth16 (the state of the art in preprocessing zkSNARKs for R1CS with circuit-specific SRS) as implemented in groth16. We evaluate Marlin's algorithms when instantiated with the PC scheme from [CHMMVW20] (denoted "M-AHP w/ PC of [CHMMVW20]"), and the PC scheme from [MBKM19] (denoted "M-AHP w/ PC of [MBKM19]").

Indexer Prover

Verifier

Multi-threaded performance

The following graphs compare the running time of Marlin's prover when instantiated with the PC scheme from [CHMMVW20] (left) and the PC scheme from [MBKM19] (right) when executed with a different number of threads.

Multi-threaded scaling of Marlin AHP with the PC scheme from [CHMMVW20] Multi-threaded scaling of Marlin AHP with the PC scheme from [MBKM19]

Proof size

We compare the proof size of Marlin with that of Groth16. We instantiate the Marlin SNARK with the PC scheme from [CHMMVW20], and the PC scheme from [MBKM19].

| Scheme | Proof size in bytes | |:------------------------------------------:|:---------------------:| | Marlin AHP with PC of [CHMMVW20] | 880 | | Marlin AHP with PC of [MBKM19] | 784 | | [Groth16] | 192 |

License

This library is licensed under either of the following licenses, at your discretion.

Unless you explicitly state otherwise, any contribution that you submit to this library shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.

Reference paper

Marlin: Preprocessing zkSNARKs with Universal and Updatable SRS
Alessandro Chiesa, Yuncong Hu, Mary Maller, Pratyush Mishra, Psi Vesely, Nicholas Ward
EUROCRYPT 2020

Acknowledgements

This work was supported by: an Engineering and Physical Sciences Research Council grant; a Google Faculty Award; the RISELab at UC Berkeley; and donations from the Ethereum Foundation and the Interchain Foundation.

Owner

  • Name: arkworks
  • Login: arkworks-rs
  • Kind: organization

An ecosystem for developing and programming with zkSNARKs

GitHub Events

Total
  • Watch event: 10
  • Issue comment event: 1
  • Pull request event: 6
  • Fork event: 6
Last Year
  • Watch event: 10
  • Issue comment event: 1
  • Pull request event: 6
  • Fork event: 6

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 90
  • Total Committers: 17
  • Avg Commits per committer: 5.294
  • Development Distribution Score (DDS): 0.5
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Pratyush Mishra p****a@b****u 45
Weikeng Chen w****k@b****u 17
Ryan Lehmkuhl r****b@g****m 5
Nicholas Ward n****d@b****u 4
Psi Vesely p****v@r****t 3
Jeff Burdges b****s@g****g 2
Dev Ojha V****n@u****m 2
jon-chuang 9****g@u****m 2
Noah Vesely f****s@r****t 2
Andrija Novakovic a****k@g****m 1
Dimitris Apostolou d****u@i****m 1
Kobi Gurkan k****k@g****m 1
Michele Orrù m****r@p****t 1
Thibaut Schaeffer s****t@g****m 1
ValarDragon d****2@g****m 1
Nirvan Tyagi n****i@u****m 1
dependabot-preview[bot] 2****]@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 22
  • Total pull requests: 79
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 23 days
  • Total issue authors: 18
  • Total pull request authors: 23
  • Average comments per issue: 2.82
  • Average comments per pull request: 0.85
  • Merged pull requests: 60
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 months
  • Issue authors: 0
  • Pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.13
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • weikengchen (5)
  • 3for (1)
  • judgegrubb (1)
  • vlopes11 (1)
  • sanket1729 (1)
  • alxiong (1)
  • wang12d (1)
  • matteocam (1)
  • jon-chuang (1)
  • Pratyush (1)
  • SilverPoker (1)
  • ssahai (1)
  • Schaeff (1)
  • srinathsetty (1)
  • csc290Spr2018 (1)
Pull Request Authors
  • weikengchen (22)
  • Pratyush (17)
  • zhiqiangxu (4)
  • ryanleh (4)
  • psivesely (4)
  • dependabot-preview[bot] (3)
  • npwardberkeley (3)
  • ValarDragon (3)
  • Schaeff (2)
  • jon-chuang (2)
  • crStiv (2)
  • vlopes11 (2)
  • burdges (1)
  • rex4539 (1)
  • davidjsonn (1)
Top Labels
Issue Labels
D-easy (2) T-documentation (1) P-high (1) T-design (1) P-low (1) T-bug (1) P-medium (1)
Pull Request Labels
dependencies (3)

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 42,316 total
  • Total dependent packages: 9
  • Total dependent repositories: 12
  • Total versions: 2
  • Total maintainers: 1
crates.io: ark-marlin

A library for the Marlin preprocessing zkSNARK

  • Versions: 2
  • Dependent Packages: 9
  • Dependent Repositories: 12
  • Downloads: 42,316 Total
Rankings
Dependent packages count: 3.8%
Dependent repos count: 7.4%
Average: 7.6%
Forks count: 7.9%
Downloads: 9.2%
Stargazers count: 9.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

Cargo.toml cargo
  • ark-ff ^0.3.0
  • ark-poly ^0.3.0
  • ark-poly-commit ^0.3.0
  • ark-relations ^0.3.0
  • ark-serialize ^0.3.0
  • ark-std ^0.3.0
  • derivative 2
  • digest 0.9
  • rayon 1
.github/workflows/ci.yml actions
  • actions-rs/cargo v1 composite
  • actions-rs/toolchain v1 composite
  • actions/checkout v1 composite
  • actions/checkout v2 composite
.github/workflows/linkify_changelog.yml actions
  • actions/checkout v2 composite