Skip to content

A Rust library for the Marlin preprocessing zkSNARK

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

HorizenLabs/marlin

 
 

Repository files navigation

Coboundary Marlin

marlin is a Rust library that implements Coboundary Marlin, an optimization of the Marlin preprocessing zk-SNARK for rank-one constraint systems (R1CS). The library is based on a fork from arkworks, using the modifications as described in HGB.

On the argument system

Coboundary Marlin is a zk-SNARK for R1CS as used by ginger-lib. It is built on top of any homomorphic polynomial commitment scheme, proving the satisfiability of a given constraint system (subject to some public inputs) by means of an algebraic oracle protocol. The main differences to Marlin are as follows:

  • A cohomological sumcheck argument, which allows a more light-weight zero-knowledge randomization and drops the need for proving individual degree bounds,
  • a different arithmetization of the R1CS matrices, which is directly based on their Lagrange representation.

See HGB for details.

Directory structure

The high-level structure of the repository is as follows:

  • data_structures.rs defines the structs for key material and SNARK proofs.
  • lib.rs contains the public SNARK functions: Parameter generation, producing and verifying proofs. The latter two are obtained by a Fiat-Shamir transform of the interactive oracle proof contained in ahp (and replacing oracles by commitments).
  • ahp contains the algebraic oracle proof, i.e. a pre-compiled version of the interactive protocol, in which polynomials to be sent to the verifier are left uncommitted. The module consists of
    • constraint_systems, which contains extensions of the constraint system trait as supported by the current version of ginger-lib,
    • indexer, which provides structs and functions for the circuit-specific pre-processing stage,
    • prover and verifier, which implements the round functions of prover and verifier of the oracle proof.

Release Note

The current release implements Coboundary Marlin using Marlin's original matrix arithmetization.

Build instructions

The library compiles on the 1.51.0 stable toolchain of the Rust compiler.

git clone https://github.com/HorizenLabs/marlin.git
cd marlin
cargo build --release

Run tests using

cargo test --all-features 

More detailed information can be found in our build guide.

About

A Rust library for the Marlin preprocessing zkSNARK

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 94.8%
  • Shell 5.0%
  • Dockerfile 0.2%