Zinc is a proof-of-concept implementation of a novel SNARK system engineered by Nethermind Research, based on Zinc: Succinct Arguments with Small Arithmetization Overheads from IOPs of Proximity to the Integers by Albert Garreta, Hendrik Waldner, Katerina Hristova and Luca Dall'Ava.
The primary goal of Zinc is to address a significant performance bottleneck in modern zero-knowledge proof systems, specifically the high cost of arithmetization.
The Zinc codebase is organized into several distinct modules, each responsible for a core component of the cryptographic system.
| Path | Description |
|---|---|
| src/zinc/ | Top-Level Protocol Logic. Implements the main ZincProver and ZincVerifier structs. Orchestrates the Spartan protocol by coordinating the sumcheck and PCS layers. |
| src/zip/ | The Zip Polynomial Commitment Scheme (PCS). Contains the commitment (pcs/commit.rs), opening (pcs/open_z.rs), and verification (pcs/verify_z.rs) logic. Implements the underlying RAA linear codes (code_raa.rs) and Merkle tree commitments (pcs/utils.rs). |
| src/ccs/ | Customizable Constraint Systems. Defines the structure for CCS over integers (ccs_z.rs) and their projection to finite fields (ccs_f.rs). Includes utilities for matrix operations (utils.rs). |
| src/sumcheck/ | The Sumcheck Protocol. Provides the core interactive proof (prover.rs, verifier.rs) for verifying polynomial identities, which serves as the engine for the Spartan protocol. |
| src/field/ | Custom Arithmetic Primitives. Defines the core data structures for integer (int.rs) and finite field (field.rs) arithmetic, including the crucial RandomField enum that manages the integer-to-field transition. |
| src/poly/ | Polynomial Utilities. Contains definitions and operations for dense and sparse multilinear polynomial extensions (MLEs), separated for integer (poly_z) and field (poly_f) coefficients. |
| src/traits/ | Core Abstractions. Defines the essential Rust traits like Field, Integer, and FieldMap that enable the library's generic and modular design. |
| benches/ | Performance Benchmarks. Contains the Criterion.rs benchmark suite for evaluating the performance of core components like sumcheck, Spartan, and the Zip PCS. |
Follow these instructions to build, test and benchmark the Zinc library.
Ensure you have the following installed:
- Rust: Install Rust using rustup.
- git: Ensure you have Git installed to clone the repository.
To build the Zinc library, run the following commands:
git clone https://github.com/NethermindEth/zinc
cd zinc
cargo build --releaseFor improved performance on multicore systems, you can enable parallelization by using the parallel feature flag, which uses Rayon for parallel processing.
cargo build --release --features "parallel"cargo test --releaseThe repository includes a suite of benchmarks using Criterion.rs. To run the benchmarks, execute:
cargo benchFor usage example you can refer to the example r1cs.rs file.
Import the library:
[dependencies]
zinc = { git = "https://github.com/NethermindEth/zinc.git" }The crates in this repository are licensed under the following licence.
- MIT license (LICENSE)
see Contributing.