Skip to main content

What is ZK-Kit?

ZK-Kit is a comprehensive suite of production-ready zero-knowledge libraries designed to simplify the development of privacy-preserving applications. Built and maintained by the Privacy & Scaling Explorations team, ZK-Kit provides battle-tested implementations of cryptographic primitives across multiple programming languages.

Overview

ZK-Kit is a set of libraries (algorithms or utility functions) that can be reused in different projects and zero-knowledge protocols, making it easier for developers to access user-friendly, tested, and documented code for common tasks.

Key Features:

  • Super lightweight
  • TypeScript type support
  • Comprehensive code documentation
  • Full test coverage
  • Browser and NodeJS compatible
  • Multiple language implementations

Core Components

Merkle Trees

Build privacy-preserving membership systems with three variants:

  • IMT (Incremental Merkle Tree): Standard choice for most applications
  • LeanIMT: Memory-optimized for resource-constrained environments
  • SMT (Sparse Merkle Tree): Key-value storage with non-membership proofs

Cryptographic Primitives

  • EdDSA-Poseidon: Digital signatures optimized for zero-knowledge circuits
  • Poseidon Cipher: Encryption/decryption for ZK-friendly data
  • Baby Jubjub: Elliptic curve operations
  • Poseidon Proof: Generate and verify ZK proofs

Utilities

  • Utils: Field operations, conversions, scalar arithmetic
  • Logical Expressions: Boolean logic in zero-knowledge

Why ZK-Kit?

🔒 Battle-Tested

Used in production by:

  • Semaphore Protocol: Anonymous signaling
  • Worldcoin: Proof of personhood protocol
  • MACI: Anti-collusion voting
  • Privacy Pools: Private transactions
  • Zupass: Privacy-preserving tickets

⚡ Developer-Friendly

// Install
npm i @zk-kit/imt
// + peer dependencies (check npm page)

// Use
import { IMT } from "@zk-kit/imt"
import { poseidon2 } from "poseidon-lite" // peer dependency

const tree = new IMT(poseidon2, 16, 0, 2)
tree.insert(BigInt(1))
const proof = tree.createProof(0)
console.log(tree.verifyProof(proof)) // true ✓

🎯 Modular Design

  • Tree-shakeable builds
  • Minimal dependencies
  • Composable components
  • Language-specific optimizations

🚀 Production-Ready

  • Comprehensive test coverage
  • Security audits
  • Performance benchmarks
  • Real-world usage patterns

Architecture

ZK-Kit follows a modular architecture where each package is independent and composable:

┌─────────────────────────────────────────┐
│ Your Application │
└─────────────────────────────────────────┘

┌───────────────┼───────────────┐
│ │ │
┌───▼────┐ ┌────▼─────┐ ┌────▼─────┐
│ Merkle │ │ Crypto │ │ Utilities│
│ Trees │ │ Primitives│ │ │
└────────┘ └──────────┘ └──────────┘

Language Support

ZK-Kit is available in 5 languages for different use cases:

LanguagePackages/CircuitsRepositoryPrimary Use Case
JavaScript/TypeScript9 packagesprivacy-scaling-explorations/zk-kitWeb apps, Node.js (this documentation)
Circom5+ circuitsprivacy-scaling-explorations/zk-kit.circomzkSNARK circuit development
Noir4 packagesprivacy-scaling-explorations/zk-kit.noirAztec protocol, Noir circuits
Solidity4 contractsprivacy-scaling-explorations/zk-kit.solidityEthereum smart contracts
Rust3 packagesprivacy-scaling-explorations/zk-kit.rustHigh-performance backends

Cross-language compatibility: All implementations use the same algorithms, so proofs generated in TypeScript can be verified in Solidity!

Explore all language implementations

Use Cases

ZK-Kit enables a wide range of privacy-preserving applications:

Identity & Authentication

  • Anonymous credentials
  • Self-sovereign identity
  • Privacy-preserving KYC
  • Reputation systems

Voting & Governance

  • Anonymous voting
  • Anti-collusion mechanisms
  • Delegation systems
  • Quadratic voting

DeFi & Payments

  • Private transactions
  • Compliance proofs
  • Anonymous airdrops
  • Privacy pools

Social & Gaming

  • Anonymous messaging
  • Hidden information games
  • Private leaderboards
  • Fair randomness

Getting Started

Choose your path:

Community & Support

License

ZK-Kit is open source and released under the MIT License.

Next Steps