Embedded DSL for constructing recursive zero-knowledge circuits in PureScript. Faithfully implements the pickles recursive snark protocol backed by o1-labs proof-systmes
A port of the ocaml snarky DSL to PureScript, backed by arkworks for the finite field arithmetic and cryptography (using napi-rs).
For a practical demonstration, refer to packages/example. This implements a simple Merkle tree-based cryptocurrency ledger with createAccount, getAccount, and transfer circuits. It showcases foundational ZK application development.
- Node.js 23 and a stable Rust toolchain
npm install— install dependencies and build thekimchi-napinative bindingmake fetch-srs— download SRS files (required for the kimchi/pickles tests)make gen-linearization— generate Kimchi linearization code (required to build pickles)
make allmake testpackages/kimchi-napi/- Rust (napi-rs) crate exposing o1Labs proof-systems (Kimchi/arkworks) as thekimchi-napiNode module — the crypto backendpackages/curves/- Prime field and elliptic curve operations (Pallas, Vesta, BN254)packages/snarky/- Circuit DSL for building zero-knowledge circuitspackages/sized-vector/- Type-level sized vectors
packages/snarky-kimchi/- o1Labs Kimchi plonk backend (Pasta curves)packages/pickles/- Pickles recursive proof system (2-cycle recursion over Pasta)
packages/snarky-curves/- Elliptic curve arithmetic circuits using the DSLpackages/poseidon/- Poseidon hash permutationpackages/random-oracle/- Random-oracle / sponge construction and circuitspackages/schnorr/- Schnorr signatures (in-circuit verifier + out-of-circuit signer/verifier)packages/merkle-tree/- Merkle trees and circuits (fixed-depth and unbounded)
packages/snarky-test-utils/- Testing utilities for circuit developmentpackages/union-find/- Union-find data structurepackages/pickles-codegen/- Kimchi linearization PureScript codegen (make gen-linearization)
mina/- OCaml Snarky source (Git submodule) used as translation reference