snarkVM

repository·staging·Indexed 22 days ago

https://github.com/provablehq/snarkvm

A high-performance Rust library suite providing cryptographic primitives, arithmetic circuits, and ledger implementations optimized for the Aleo blockchain ecosystem. It includes support for pairing-friendly elliptic curves (Edwards BLS12 and BLS12-377), univariate polynomial commitment schemes, and the Varuna preprocessing zkSNARK for R1CS. The suite also provides ledger components for authority, block management, and a Narwhal-style memory pool implementation.

Tokens
50.3K
Snippets
150
Records
248
Agent score
76%

What's inside snarkvm

  1. Overview of snarkvm-curves

    staging

    The snarkvm-curves crate provides a tailored set of pairing-friendly elliptic curves used by Aleo for efficient proof generation and verification. It currently supports two main curve types:

    1. Edwards BLS12: A Twisted Edwards curve.
    2. BLS12-377: A Barreto-Lynn-Scott curve.

    Use these curves when building zero-knowledge proofs that require specific field sizes or pairing properties optimized for the Aleo ecosystem.

  2. Overview of snarkvm-ledger-test-helpers

    staging
    The snarkvm-ledger-test-helpers crate is designed to assist in testing ledger-related functionality by providing utilities to produce data structures derived from the ledger. It is intended for developers building or testing components that interact with the snarkVM ledger state.
  3. Overview of the Aleo Mainnet Puzzle

    staging

    The Aleo Mainnet Puzzle is a computational challenge designed to incentivize optimizations in zkSNARK synthesis (witness generation). Unlike previous puzzles that focused on MSM or NTT, this puzzle targets the synthesis phase, which is a significant bottleneck in generating proofs for Aleo programs.

    Core Goals

    • Hardness: Solutions should be non-amortizable (memoryless), meaning winning probability does not increase with time spent computing.
    • System Safety: Prevents DoS, crashes, or code execution via attacker-controlled inputs.
    • Uniquely-Determined Circuits: Ensures opcode circuits have unique valid assignments to prevent 'cheaper' puzzle attempts.
    • Consistency: Aims for Gaussian-like resource consumption distribution to minimize extreme variance.
    • Usefulness: Focuses computation on useful algorithms.
  4. Overview of snarkvm-ledger-narwhal-batch-certificate

    staging
    The snarkvm-ledger-narwhal-batch-certificate crate provides functionality for generating and managing batch certificates specifically designed for a Narwhal-style memory pool. This is used within the context of the snarkVM ledger implementation to handle certificate-based verification for batches of data in the Narwhal mempool architecture.
  5. Overview of snarkVM packages

    staging

    snarkVM is a collection of Rust crates designed for zero-knowledge proof operations and blockchain ledger implementations. Most crates support both std and wasm environments. Key packages include:

    • snarkvm: A meta-package containing all other crates.
    • snarkvm-algorithms: Core algorithms.
    • snarkvm-circuit: Arithmetic circuits for snarkVM.
    • snarkvm-console: Console functionality.
    • snarkvm-curves: Cryptographic curves.
    • snarkvm-fields: Arithmetic fields.
    • snarkvm-ledger: Ledger implementation for the Aleo blockchain.
    • snarkvm-parameters: Parameter management.
    • snarkvm-synthesizer: Program synthesizer.
    • snarkvm-utilities: Helper functions.
    • snarkvm-wasm: WASM bindings.
  6. Overview of the Varuna module

    staging

    The varuna module implements a preprocessing zkSNARK for R1CS (Rank-1 Constraint System) using a universal and updatable Structured Reference String (SRS).

    Key characteristics:

    • Preprocessing: Allows an offline phase to produce a summary of a computation, which can then be used in an online phase to verify any number of arguments relative to that computation.
    • Universal SRS: Supports preprocessing any computation up to a specified size bound.
    • Updatable SRS: Allows participants to contribute fresh randomness, facilitating secure real-world deployments.

    The implementation combines an algebraic holographic proof with a polynomial commitment scheme to achieve these properties.

  7. Overview of Aleo pairing-friendly elliptic curves

    staging

    Aleo utilizes a specific set of pairing-friendly elliptic curves optimized for efficient zero-knowledge proof generation and verification. The two primary curve types used are Edwards BLS12 and BLS12-377.

    Key characteristics include:

    • Edwards BLS12: A Twisted Edwards curve with a 251-bit scalar field and a 253-bit base field. It features a 32-byte compressed G1 size.
    • BLS12-377: A Barreto-Lynn-Scott curve with a 253-bit scalar field and a 377-bit base field. It features a 48-byte compressed G1 size and a 96-byte compressed G2 size.
    |
    |                     |  Edwards BLS12  |     BLS12-377      |
    |:------------------- |:---------------:|:------------------:|
    | Curve Type          | Twisted Edwards | Barreto-Lynn-Scott |
    | Scalar Field Size   |    251 bits     |      253 bits      |
    | Base Field Size     |    253 bits     |      377 bits      |
    | G1 Compressed Size* |    32 bytes     |      48 bytes      |
    | G2 Compressed Size* |       N/A       |      96 bytes      |
    
    * rounded to multiples of 8 bytes.
  8. Overview of snarkvm-algorithms/polycommit

    staging

    The snarkvm-algorithms/polycommit module implements univariate polynomial commitment schemes. These cryptographic primitives allow a party to commit to a univariate polynomial and subsequently reveal specific evaluations of that polynomial accompanied by proofs of correctness.

    Key features of this library include:

    • Support for committing to multiple polynomials with different degree bounds simultaneously.
    • Batching multiple evaluation proofs for the same evaluation point into a single proof.
    • Batch verification of multiple proofs.

    The implementations aim to satisfy the properties of succinctness, extractability, and hiding.