Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 3.39 KB

README.md

File metadata and controls

50 lines (37 loc) · 3.39 KB

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.