All Projects → arkworks-rs → marlin

arkworks-rs / marlin

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
A Rust library for the Marlin preprocessing zkSNARK

Programming Languages

rust
11053 projects
TeX
3793 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to marlin

liveprinter
Livecoding for 3D printers
Stars: ✭ 30 (-86.05%)
Mutual labels:  marlin
r1cs-std
R1CS constraints for bits, fields, and elliptic curves
Stars: ✭ 53 (-75.35%)
Mutual labels:  r1cs
crypto-primitives
Interfaces and implementations of cryptographic primitives, along with R1CS constraints for them
Stars: ✭ 76 (-64.65%)
Mutual labels:  r1cs
Marlin-2.0.X-MKS-Robin-Nano
Marlin 2.0.X for the MKS Robin Nano 1.1/1.2
Stars: ✭ 100 (-53.49%)
Mutual labels:  marlin
BCN3DSigma-Firmware
Custom Marlin version for the brand new BCN3D Sigma from BCN3D Technologies
Stars: ✭ 81 (-62.33%)
Mutual labels:  marlin
r1cs-workshop
Notes for the R1CS programming workshop at ZK0x04
Stars: ✭ 19 (-91.16%)
Mutual labels:  r1cs
FlashForge Marlin
🦈 Marlin firmware for FlashForge Dreamer/Dreamer NX/Inventor, Bosch Dremel 3D20 3D, PowerSpec Ultra 3D and Monoprice Inventor 1
Stars: ✭ 50 (-76.74%)
Mutual labels:  marlin
bulletproofs-r1cs-gadgets
Arithmatic circuits convertible to R1CS based on Bulletproofs
Stars: ✭ 65 (-69.77%)
Mutual labels:  r1cs
Cncjs
A web-based interface for CNC milling controller running Grbl, Marlin, Smoothieware, or TinyG.
Stars: ✭ 1,657 (+670.7%)
Mutual labels:  marlin
DGUS-reloaded
DWIN T5UID1 touchscreen firmware for 3D printers running Marlin.
Stars: ✭ 71 (-66.98%)
Mutual labels:  marlin
FABlin
The FABtotum Personal Fabricator Firmware, a Marlin derivate made to support hybrid manufacturing and digital acquisition
Stars: ✭ 19 (-91.16%)
Mutual labels:  marlin
OctoPrint-EEPROM-Marlin
A plugin for editing the EEPROM data of Marlin Firmware, from within OctoPrint.
Stars: ✭ 21 (-90.23%)
Mutual labels:  marlin
ThermistorLibrary
Marlyn based thermistor library for read temperature.
Stars: ✭ 45 (-79.07%)
Mutual labels:  marlin
Marlin
Optimized firmware for RepRap 3D printers based on the Arduino platform. Modified with a new DWIN T5UID1 touchscreen implementation.
Stars: ✭ 33 (-84.65%)
Mutual labels:  marlin
r1cs
A Rust library for building R1CS gadgets
Stars: ✭ 75 (-65.12%)
Mutual labels:  r1cs
Sand-Table
An open-source platform for building DIY sand tables (like the Sisyphus or ZenXY)
Stars: ✭ 99 (-53.95%)
Mutual labels:  marlin
r1cs-tutorial
Tutorial for writing constraints in the `arkworks` framework
Stars: ✭ 74 (-65.58%)
Mutual labels:  r1cs
poly-commit
A Rust library for polynomial commitments
Stars: ✭ 170 (-20.93%)
Mutual labels:  marlin
bellman
Bellman zkSNARK library for community with Ethereum's BN256 support
Stars: ✭ 121 (-43.72%)
Mutual labels:  zksnark
PrntrBoardV2
32-bit 3D Printer controller board using STM32F407 and replaceable TMC2660/2209 stepper drivers.
Stars: ✭ 31 (-85.58%)
Mutual labels:  marlin

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:

rustup install stable

After that, use cargo (the standard Rust build tool) to build the library:

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:

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].