snarkjs  by iden3

zkSNARK implementation in JavaScript & WASM

Created 7 years ago
1,939 stars

Top 22.6% 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)
8
Issues (30d)
1
Star History
18 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
7 more.

dalai by cocktailpeanut

0%
13k
Local LLM inference via CLI tool and Node.js API
Created 2 years ago
Updated 1 year ago
Starred by Sourabh Bajaj Sourabh Bajaj(Cofounder of Uplimit), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
3 more.

NextChat by ChatGPTNextWeb

0.1%
86k
AI assistant for web, iOS, MacOS, Android, Linux, and Windows
Created 2 years ago
Updated 3 days ago
Feedback? Help us improve.