A comprehensive command-line toolkit for building, testing, and deploying zero-knowledge proofs using the Groth16 proving system. zkkit streamlines the entire workflow from circuit compilation to proof generation and verification.
zkkit abstracts the complexity of zero-knowledge proof development by providing a clean, intuitive API and CLI interface. Whether you're building privacy-preserving applications, credentials systems, or cryptographic protocols, zkkit handles the heavy lifting of zk-SNARK operations.
- 🚀 Simple CLI & Programmatic API - Use as command-line tool or import functions in your code
- 🔧 Complete Workflow - From circuit compilation to proof verification
- 🛡️ Secure Setup - Built-in trusted setup ceremony with entropy support
- ⚡ Efficient - Leverages snarkjs and circom for optimal performance
- 📦 Zero Dependencies Hell - Minimal, well-maintained dependencies
- 🔌 Composable - Mix and match functions for custom workflows
Before installing zkkit, you must have the following installed on your system:
Required for running zkkit and npm packages.
macOS:
brew install nodeUbuntu/Debian:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejsVerify installation:
node --version
npm --versionRequired for circom compilation and cryptographic operations.
macOS & Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envVerify installation:
rustc --version
cargo --versionThe circuit compiler for zero-knowledge proofs.
macOS:
brew install circomLinux (from source):
git clone https://github.com/iden3/circom.git
cd circom
cargo build --release
sudo cp target/release/circom /usr/local/bin/Verify installation:
circom --versionThe SNARK toolkit for proof generation and verification.
npm install -g snarkjsVerify installation:
snarkjs --versionOnce all prerequisites are installed:
npm install zkkitgit clone <repository-url>
cd zkkit
npm install
npm linkThen in your project:
npm link zkkit# Initialize a new zkSNARK project
zkkit init
# Compile your circuit
zkkit compile --circuit circuits/schema.circom --out outputs
# Generate witness
zkkit witness --input inputs/inputs.json --name witness.wtns
# Perform trusted setup
zkkit setup:trusted "your-entropy-string"
# Setup Groth16 proving system
zkkit setup:groth
# Generate proof
zkkit proof
# Verify proof
zkkit verifyCLI Commands in Action:
const {
init,
compileCircuit,
generateWitness,
generateTrustedSetup,
generateGrothSetup,
generateProof,
verify
} = require("zkkit");
async function main() {
// Initialize project structure
await init();
// Compile Circom circuit
await compileCircuit({
circuit: "circuits/schema.circom",
out: "outputs"
});
// Generate witness from inputs
await generateWitness({
input: "inputs/inputs.json",
name: "witness.wtns"
});
// Perform trusted setup (Powers of Tau)
await generateTrustedSetup("your-entropy-string");
// Setup Groth16 proving system
await generateGrothSetup();
// Generate zero-knowledge proof
await generateProof();
// Verify the proof
await verify();
console.log("✅ Proof generated and verified successfully!");
}
main().catch(console.error);Successful Workflow Execution:
The above screenshot shows a complete successful run of the entire zero-knowledge proof workflow, from circuit compilation through proof verification.
Initializes a new zkSNARK project with the required directory structure.
Creates:
circuits/- Directory for Circom circuit filesinputs/- Directory for input JSON filesoutputs/- Directory for compiled outputs
Example:
await init();Compiles a Circom circuit to R1CS and WebAssembly formats.
Parameters:
options.circuit(string) - Path to the.circomfileoptions.out(string) - Output directory for compiled files
Output Files:
{out}/schema.r1cs- R1CS constraint system{out}/schema_js/schema.wasm- WebAssembly binary{out}/schema_js/generate_witness.js- Witness generator
Example:
await compileCircuit({
circuit: "circuits/schema.circom",
out: "outputs"
});Generates a witness from circuit inputs.
Parameters:
options.input(string) - Path to input JSON fileoptions.name(string) - Name of the output witness file
Input JSON Format:
{
"a": 3,
"b": 11
}Example:
await generateWitness({
input: "inputs/inputs.json",
name: "witness.wtns"
});Performs the Powers of Tau ceremony - the first phase of the trusted setup. This generates the public parameters needed for the proving system.
Parameters:
entropy(string) - Random entropy string for the ceremony
Generated Files:
pot12_0000.ptau→pot12_0001.ptau- Powers of Tau intermediatepot12_final.ptau- Final Powers of Tau parameters
Example:
await generateTrustedSetup("super-secure-entropy-string-12345");Performs the Phase 2 setup specific to your circuit. Creates the proving and verification keys for the Groth16 protocol.
Prerequisites:
- Circuit must be compiled (R1CS file exists)
- Trusted setup must be completed (pot12_final.ptau exists)
Generated Files:
circuit_0000.zkey- Proving keyverification_key.json- Verification key
Example:
await generateGrothSetup();Generates a zero-knowledge proof using the witness and proving key.
Prerequisites:
- Witness generated
- Groth16 setup completed
Generated Files:
proof.json- The zero-knowledge proofpublic.json- Public inputs/outputs
Example:
await generateProof();Verifies a proof using the verification key.
Prerequisites:
- Proof generated
- Verification key exists
Returns: Console output indicating success or failure
Example:
await verify();your-project/
├── circuits/
│ └── schema.circom # Your circuit definitions
├── inputs/
│ └── inputs.json # Circuit input values
├── outputs/
│ ├── schema.r1cs # Compiled R1CS
│ └── schema_js/
│ ├── schema.wasm # WebAssembly binary
│ └── generate_witness.js
├── proof.json # Generated proof
├── public.json # Public outputs
├── verification_key.json # Verification key
├── circuit_0000.zkey # Proving key
├── pot12_final.ptau # Powers of Tau
└── main.js # Your script
You write constraints in Circom language defining what you want to prove.
The circuit is compiled to R1CS (Rank-1 Constraint System) and WebAssembly.
Powers of Tau ceremony generates common parameters. This is a one-time setup per circuit.
Creates proving and verification keys specific to your circuit.
Evaluates the circuit with your private inputs to generate a witness.
Uses the witness and proving key to create a succinct proof.
Anyone can verify the proof using only public inputs and the verification key.
- Privacy-Preserving Authentication - Prove identity without revealing sensitive data
- Credentials - Issue and verify credentials without shared databases
- Confidential Transactions - Prove transaction validity privately
- Scalability Solutions - Bundle multiple transactions into one proof
- Compliance - Prove regulatory compliance without exposing details
- Node.js >= 14.0.0
- Rust - Latest stable version
- circom >= 2.0 - Circuit compiler
- snarkjs >= 0.4.0 - SNARK toolkit
See Installation Prerequisites section above for detailed installation instructions for each dependency.
If any of these are missing, zkkit will not work. Please complete the prerequisite installation before proceeding.
See the Prerequisites (Required) section above for complete setup instructions for macOS and Linux.
- Entropy - Use cryptographically secure entropy for trusted setup
- Key Management - Keep your proving keys (
circuit_0000.zkey) private - Verification - Always verify proofs before trusting computations
- Audits - Have trusted setup audited before production use
- Circuit Optimization - Keep circuits simple to reduce proving time
- Batch Operations - Generate multiple proofs in parallel
- Incremental Setup - Reuse Powers of Tau across multiple circuits
- Start Small - Begin with simple circuits to understand the workflow
- Test Locally - Run full workflow locally before production
- Version Control - Track your circuits and inputs in git
- Documentation - Document your circuit logic and assumptions
# Ensure npm link is set up correctly
npm link zkkit
# Or reinstall
npm install zkkit# Verify circom is installed
circom --version
# If not, install it
brew install circom # macOS- Check that
proof.jsonandpublic.jsonwere generated correctly - Verify the verification key matches the circuit
- Ensure witness was generated with correct inputs
- Ensure your
package.jsondoes NOT have"type": "module" - Or use ES6 import syntax throughout your project
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
ISC - See LICENSE file for details
- Circom Documentation - https://docs.circom.io/
- snarkjs - https://github.com/iden3/snarkjs
- Zero-Knowledge Proofs - https://zkp.science/
- Groth16 Protocol - https://eprint.iacr.org/2016/260.pdf
For issues and questions:
- Open an issue on GitHub
- Check existing documentation
- Review circuit examples
Happy Proving! 🚀
Built with ❤️ for the zero-knowledge community.


