Skip to content

Introduction

Achronyme is a programming language for zero-knowledge circuits.

Write readable code. Decide what gets proven. Same language for general execution and ZK circuit compilation.

let make_counter = fn(init) {
mut n = init
return fn() { n = n + 1; return n }
}
let c = make_counter(0)
print(c()) // 1
print(c()) // 2
circuit merkle_proof(root: Public, leaf: Witness, path: Witness[3], indices: Witness[3]) {
merkle_verify(root, leaf, path, indices)
}
Terminal window
ach circuit merkle.ach --inputs "root=...,leaf=42,path_0=...,path_1=...,path_2=...,indices_0=0,indices_1=1,indices_2=0"
# → circuit.r1cs + witness.wtns (snarkjs-compatible)
let secret = 0p42
let hash = 0p17159... // poseidon(42, 0)
let p = prove(hash: Public) {
assert_eq(poseidon(secret, 0), hash)
}
print(proof_json(p)) // Groth16 proof, verifiable on-chain

Achronyme has two execution modes from the same source:

VM mode (ach run) — Full language: closures, recursion, GC, arrays, maps, strings, I/O. Code runs like any scripting language.

Circuit mode (ach circuit) — Compiles to arithmetic constraints over BN254. No loops at runtime, no I/O — everything is unrolled and flattened into a constraint system for zero-knowledge proofs.

The prove block bridges both: it compiles its body as a circuit via ProveIR at compile time, captures variables from scope, and produces a cryptographic proof at runtime — all in one expression. Witnesses are auto-inferred; only public inputs need to be declared.

Source (.ach)
├─► Parser (PEG) → AST
│ │
│ ├─► Bytecode → VM (run mode)
│ │
│ └─► SSA IR → Optimize
│ │
│ ┌───┴───┐
│ ▼ ▼
│ R1CS Plonkish
│ (Groth16) (KZG-PlonK)
│ │ │
│ ▼ ▼
.r1cs Gates/Lookups
.wtns Copy constraints
│ │ │
│ └───┬───┘
│ ▼
│ Native proof
└─► prove { } → compile + witness + verify + proof (inline)
  • 2,543 unit tests + 162 E2E integration tests
  • Cross-validated against snarkjs (independent constraint verification)
  • 2 ZK backends: R1CS/Groth16 + Plonkish/KZG-PlonK
  • Native in-process proof generation (no external tools)
  • snarkjs-compatible binary export (Groth16 interoperability verified)
  • 6 security audits resolved
  • Poseidon hash compatible with circomlibjs (30% fewer constraints than Circom)