Skip to content

navasvarela/zksnarky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zksnarky

A comprehensive zero-knowledge SNARK library implemented in Rust, providing efficient and secure implementations of various zk-SNARK proving systems and circuit representations.

Features

  • Multiple proving system support (Groth16, PLONK, Marlin)
  • Various circuit representations (R1CS, Plonk, AIR)
  • Efficient finite field arithmetic
  • Support for common elliptic curve groups (BN254, BLS12-381)
  • User-friendly circuit definition API
  • Comprehensive testing and benchmarking
  • WebAssembly support
  • GPU acceleration (optional)

Getting Started

Add this to your Cargo.toml:

[dependencies]
zksnarky = "0.1.0"

Example

use zksnarky::{
    circuit::{Circuit, R1CS},
    proving_system::Groth16,
    field::Field,
};

// Define a simple circuit
let circuit = R1CS::new()
    .add_constraint(|w| w[0] * w[1] == w[2])?;

// Generate proving and verification keys
let (pk, vk) = Groth16::setup(circuit)?;

// Generate a proof
let witness = vec![2, 3, 6];
let proof = Groth16::prove(&pk, &witness)?;

// Verify the proof
let public_inputs = vec![6];
let is_valid = Groth16::verify(&vk, &proof, &public_inputs)?;

Documentation

For detailed documentation, visit docs.rs/zksnarky.

Security

This library is in early development and has not been audited. Use at your own risk.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under either of

at your option.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages