ZKForge compiles a high-level DSL into zero-knowledge proof circuits — entirely in Rust. No circom toolchain, no snarkjs, no Node.js dependency. Generate Groth16 or PLONK proofs in under a second, get an EIP-197 Solidity verifier, and deploy with Foundry — all from a single binary.
| ZKForge | circom + snarkjs | |
|---|---|---|
| Language | Pure Rust 🦀 | Rust DSL + JavaScript runtime |
| Install | cargo install zkforge |
Node.js + npm + circom + snarkjs |
| Prove time (simple) | <0.1s ⚡ | ~0.3s (with Node.js) |
| Proof size | 128 B | ~128 B |
| Verifier | Solidity (EIP-197) + Foundry deploy | Solidity (manual deploy) |
| Proof systems | Groth16 + PLONK | Groth16 + PLONK |
| zkML | ✅ Built-in | ❌ |
| Auto-shielding | ✅ Automatic | ❌ |
| Recursive proofs | ✅ Native | ❌ |
# Install from crates.io
cargo install zkforge
# Or from GitHub
cargo install --git https://github.com/zkarchitect/zkforge.git
# Write a circuit
cat > prove_age.zkf << 'EOF'
prove {
input age: Private<u8>;
input min_age: Public<u8>;
assert age >= min_age;
output valid<bool>;
}
EOF
# Generate a proof
zkforge prove-native prove_age.zkf -w witness.json
# Deploy verifier to any EVM chain
zkforge deploy prove_age.zkf --chain-id 11155111| Circuit | Constraints | R1CS Vars | Prove Time | Proof Size | Gas (verify) |
|---|---|---|---|---|---|
| Age Verify | 13 | 15 | <0.1s | 128 B | ~170K |
| Credit Score | 36 | 38 | <0.1s | 128 B | ~170K |
| Token Balance | 74 | 76 | <0.1s | 128 B | ~170K |
| NFT Ownership | 5 | 7 | <0.1s | 128 B | ~170K |
| Merkle Proof | 18 | 23 | <0.1s | 128 B | ~170K |
| ECDSA Verify | 3,041 | 3,045 | <0.8s | 128 B | ~290K |
.zkf DSL → Parser (~770 LoC)
→ Constraint Synthesizer (~1,380 LoC)
→ R1CS (BigUint, BN254 field, ~630 LoC)
→ Native Groth16 (arkworks, BN254, ~630 LoC)
→ PLONK (KZG, 3-gate, ~500 LoC)
→ Solidity Verifier (EIP-197, ~320 LoC)
→ Foundry Deploy Package
Zero circom. Zero snarkjs. Zero Node.js in the core path.
- Groth16 Proving — Native arkworks backend, BN254 curve, EIP-197 compatible
- PLONK Proving — KZG polynomial commitments, 3-gate universal circuit, Fiat-Shamir
- Recursive Proofs — Fold multiple proofs into one for batch verification
- zkML — Zero-knowledge neural network inference (ReLU, softmax, field-aware)
- Solidity Verifier — Auto-generated, EIP-197, compilable with solc 0.8.x
- Foundry Deploy — One command: verifier + deployment script + test
- Auto-Shielding — Wrap any Solidity contract with ZK privacy
- ECDSA Verification — Signature checks via k256, committed in-circuit via Poseidon
- Merkle Proofs — Tree membership via 73-round Poseidon hash chain
- Crypto Primitives — Poseidon hashing, field arithmetic
zkforge/
├── compiler/ # Core compiler (17 Rust modules, ~10,200 LoC)
├── cli/ # CLI binary
├── examples/ # 6 .zkf example circuits (all passing e2e)
├── assets/ # Logo and assets
└── .github/ # CI workflows, templates, security review
Internal security review completed. 3 critical bugs found and fixed:
- Comparison constraints —
assert age >= 18was silently passing forage = 3 - Plonk witness bypass — prover used domain elements instead of real witness values
- Inequality inversion —
!=check used-1instead of1for the witness
All fixes verified with adversarial tests (131/131 passing). Full audit report →
131 tests passing — parser, AST, constraint synthesis, R1CS, Groth16,
PLONK, crypto primitives, recursive prover, auto-shield, zkML, deployment.
Many tests include adversarial counterexamples: wrong inputs produce rejected proofs.
Cause: Upstream incompatibility between ark-ff 0.6.0 and Rust ≥1.95.
Workaround: Install from GitHub source directly:
cargo install --git https://github.com/zkarchitect/zkforge.gitThis builds the latest commit and avoids the crates.io pre-built dependency lock.
- 📣 Introducing ZKForge: A Pure Rust ZK Compiler — start here!
- 🐛 Bug Reports
- 💡 Feature Requests
- 🔬 Technical Paper — Architecture, protocols, security review
Apache 2.0 — see LICENSE
ZKForge is open source and welcomes contributions. See CONTRIBUTING.md for guidelines.