Skip to content

A work in progress: A comprehensive Rust implementation for creating Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge (zk-SNARKs). This project encompasses modules for circuit construction, Rank-1 Constraint Systems (R1CS), polynomial operations, and storage management, crucial for building and verifying zk-SNARK proofs.

Notifications You must be signed in to change notification settings

bendrummond389/zk-snarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust zk-SNARKs Project

Overview

This project is a Rust implementation of a system for creating zk-SNARKs. It includes various components like circuits, Rank-1 Constraint Systems (R1CS), and polynomial operations, which are central to the construction of zk-SNARKs.

Project Structure

The project is organized into several modules, each with a specific focus:

  • circuits: Defines the structure and operations of circuits used in zk-SNARKs.
    • circuit.rs: Contains the Circuit struct and related functionalities.
    • errors.rs: Error handling specific to circuit operations.
    • indexed_map.rs: Provides an indexed map utility used within circuits.
    • sample_circuits: Sample JSON files representing predefined circuits.
    • utils.rs: Utilities for circuit operations.
  • r1cs: Implements the Rank-1 Constraint System (R1CS) crucial for zk-SNARKs.
    • r1cs.rs: Contains the R1CS struct and methods for managing constraints.
  • utils: Common utilities used across the project.
    • polynomial.rs: Defines polynomial operations essential in zk-SNARK constructions.
  • zk_proofs: Contains the implementation for generating zk-SNARK proofs.
    • qap.rs: Quadratic Arithmetic Program (QAP) related implementations.

Getting Started

To get started with this project:

  1. Ensure you have Rust installed on your machine.
  2. Clone the repository to your local machine.
  3. Navigate to the project directory and build the project using Cargo:
cargo build

Usage

  • Circuits: Import and utilize the Circuit struct to create and manipulate circuits.
  • R1CS: Use the R1CS struct to generate and manage R1CS constraints.
  • Polynomials: Leverage polynomial operations for various cryptographic computations.

Testing

Run the tests provided in the respective modules to ensure everything is working as expected:

cargo test

Contributing

Contributions to this project are welcome. Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature.
  3. Commit your changes.
  4. Push to the branch.
  5. Submit a pull request.

License

[Specify the license under which this project is made available]

About

A work in progress: A comprehensive Rust implementation for creating Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge (zk-SNARKs). This project encompasses modules for circuit construction, Rank-1 Constraint Systems (R1CS), polynomial operations, and storage management, crucial for building and verifying zk-SNARK proofs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages