← Back to all products
$15
ZK Circuit Templates
Reusable Circom circuits for common ZK use cases — membership, ordering, range proofs, and more.
TOMLTypeScriptMarkdown
📁 File Structure 20 files
zk-circuit-templates/
├── LICENSE
├── README.md
├── circom/
│ ├── identity/
│ │ └── eddsa_verify.circom
│ ├── merkle/
│ │ └── merkle_proof.circom
│ ├── range/
│ │ └── range_proof.circom
│ ├── token/
│ │ └── private_transfer.circom
│ └── vote/
│ └── anonymous_vote.circom
├── noir/
│ ├── identity/
│ │ ├── Nargo.toml
│ │ └── src/
│ │ └── main.nr
│ ├── merkle/
│ │ ├── Nargo.toml
│ │ └── src/
│ │ └── main.nr
│ ├── range/
│ │ ├── Nargo.toml
│ │ └── src/
│ │ └── main.nr
│ ├── token/
│ │ ├── Nargo.toml
│ │ └── src/
│ │ └── main.nr
│ └── vote/
│ ├── Nargo.toml
│ └── src/
│ └── main.nr
├── security-notes.md
└── ts/
└── src/
├── types.ts
└── witness.ts
📖 Documentation Preview README excerpt
ZK Circuit Templates
CryptoForge Store #10 — Prover Market
Production-ready zero-knowledge circuit templates for Circom and Noir, with TypeScript witness generation helpers. Covers the 5 most common ZK use cases: Merkle proofs, range proofs, signature verification, private transfers, and anonymous voting.
Included Circuits
| Circuit | Circom | Noir | Use Case |
|---|---|---|---|
| Merkle Proof | circom/merkle/ | noir/merkle/ | Prove set membership without revealing the element |
| Range Proof | circom/range/ | noir/range/ | Prove a value is within bounds without revealing it |
| Signature Verify | circom/identity/ | noir/identity/ | Prove EdDSA/ECDSA signature ownership |
| Private Transfer | circom/token/ | noir/token/ | UTXO-based private token transfers |
| Anonymous Vote | circom/vote/ | noir/vote/ | Prove voting eligibility without revealing identity |
Quick Start
Circom
# Compile circuit
circom circom/merkle/merkle_proof.circom --r1cs --wasm --sym
# Generate witness
node circom/merkle/merkle_proof_js/generate_witness.js \
circom/merkle/merkle_proof_js/merkle_proof.wasm \
input.json witness.wtns
Noir
cd noir/merkle
nargo compile
nargo prove
nargo verify
TypeScript Helpers
import { generateMerkleWitness, WitnessInput } from "./ts/src/witness";
const input: WitnessInput = {
leaf: "0xabc...",
pathElements: ["0x123...", "0x456..."],
pathIndices: [0, 1],
root: "0xdef...",
};
const witness = generateMerkleWitness(input);
License
MIT License — See LICENSE file.
📄 Code Sample .ts preview
ts/src/types.ts
// ╔══════════════════════════════════════════════════════════════╗
// ║ CryptoForge — ZK Circuit Template Types ║
// ║ Shared TypeScript types for witness generation & proving ║
// ╚══════════════════════════════════════════════════════════════╝
/** Supported proof systems */
export type ProofSystem = "groth16" | "plonk" | "ultraplonk" | "noir";
/** Supported circuit types */
export type CircuitType =
| "merkle_proof"
| "range_proof"
| "identity_verify"
| "private_transfer"
| "anonymous_vote";
/** Supported circuit languages */
export type CircuitLanguage = "circom" | "noir";
/** Field element — represented as bigint in TypeScript */
export type FieldElement = bigint;
/** A Merkle proof path */
export interface MerkleProof {
/** Leaf value (pre-hashed) */
leaf: FieldElement;
/** Leaf index in the tree */
index: number;
/** Sibling hashes along the path */
siblings: FieldElement[];
/** Actual depth of the tree */
depth: number;
/** Expected Merkle root */
root: FieldElement;
}
/** Range proof inputs */
export interface RangeProofInput {
/** Secret value to prove is in range */
value: FieldElement;
/** Blinding factor for Pedersen commitment */
blinding: FieldElement;
/** Lower bound (inclusive) */
min: FieldElement;
/** Upper bound (inclusive) */
max: FieldElement;
/** Bit width sufficient to represent max-min */
numBits: number;
}
# ... 217 more lines ...