snarkjs  by iden3

zkSNARK implementation in JavaScript & WASM

created 7 years ago
1,913 stars

Top 23.3% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides a JavaScript and WebAssembly implementation of zkSNARK and PLONK cryptographic schemes, targeting developers building zero-knowledge applications. It offers a comprehensive toolkit for generating zk-SNARK parameters via multi-party computation (MPC) ceremonies, supporting Groth16, PLONK, and FFLONK protocols.

How It Works

The library leverages the circom compiler to generate circuits and then utilizes WebAssembly for high-performance cryptographic operations. It supports both Node.js and browser environments, with computations parallelized using worker threads. The core functionality includes managing "powers of tau" ceremonies for universal trusted setups and circuit-specific phase 2 ceremonies, enabling the creation of proofs and verification keys.

Quick Start & Requirements

  • Install: npm install -g snarkjs@latest
  • Prerequisites: Node.js LTS (v18+ recommended). Circom compiler must be installed separately.
  • Setup: Detailed guides for trusted setup ceremonies and circuit compilation are provided.
  • Resources: Official documentation and community channels are available for assistance.

Highlighted Details

  • Supports Groth16, PLONK, and FFLONK proving schemes.
  • Enables universal trusted setup ceremonies (Powers of Tau) and circuit-specific phase 2 ceremonies.
  • Generates Solidity verifier contracts for on-chain verification.
  • Offers high-performance WASM implementations comparable to native code.

Maintenance & Community

  • Part of the iden3 project.
  • Community support available via a Telegram group.

Licensing & Compatibility

  • License: GPL-3.
  • Compatibility: The GPL-3 license may impose restrictions on linking with closed-source projects.

Limitations & Caveats

  • Multithreading may not be available in all JavaScript environments (e.g., Bun, browser extensions), requiring a single-threaded fallback.
  • Early versions may contain bugs; using the latest version is advised for security.
Health Check
Last commit

5 days ago

Responsiveness

1+ week

Pull Requests (30d)
3
Issues (30d)
0
Star History
49 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Feedback? Help us improve.