Overview
zkToolkit (@zkterm/zktoolkit) provides 10 cryptographic modules for building privacy-preserving applications. All primitives are optimized for ZK circuits.
Module Summary
| Module | Operations | Description |
|---|---|---|
| hash | poseidon, pedersen, mimc | ZK-friendly hash functions |
| commit | create, reveal, verify | Pedersen commitments |
| merkle | create, prove | Merkle trees and proofs |
| range | prove | Range proofs |
| sign | keypair, sign, verify | EdDSA signatures |
| nullifier | create, verify | Double-spend prevention |
| field | add, mul, inv, pow | BN254 field arithmetic |
| ec | mulbase, add, isoncurve | Baby JubJub curve |
| shamir | split, combine | Secret sharing |
| proof | generate | Groth16 zkSNARKs |
Terminal Commands
All zkToolkit commands use the format:Show Help
Category Help
Hash Functions
ZK-optimized hash functions with low circuit constraints.| Function | Constraints | Use Case |
|---|---|---|
| Poseidon | ~300 | Most ZK circuits |
| Pedersen | ~1000 | Commitments (homomorphic) |
| MiMC | ~500 | Keyed hashing |
Commitments
Hide values and reveal them later with proof.Merkle Trees
Build trees and generate inclusion proofs.- Fixed depth 32
- Poseidon-based hashing
- Efficient proof generation
Range Proofs
Prove a value lies within a range without revealing it.Signatures
EdDSA signatures on the Baby JubJub curve.Nullifiers
Prevent double-spending in privacy protocols.Field Arithmetic
Finite field operations modulo BN254 prime.Elliptic Curves
Baby JubJub twisted Edwards curve operations.Shamir Secret Sharing
Split secrets into threshold shares.Groth16 Proofs
Generate zkSNARK proofs.API Reference
All zkToolkit endpoints are under/api/zk-toolkit/.
Hash Functions
Commitments
Field Arithmetic
Elliptic Curves
NPM Package
Install for use in your own applications:Usage
Why ZK-Friendly Primitives?
Traditional cryptographic functions are inefficient in ZK circuits:| Function | ZK Constraints |
|---|---|
| SHA-256 | ~25,000 |
| Poseidon | ~300 |
| Pedersen | ~1,000 |
| MiMC | ~500 |