Project Configuration
Every Achronyme project can have an achronyme.toml file at its root. This file configures defaults for CLI commands, eliminating the need to pass flags repeatedly.
Quick start
Section titled “Quick start”ach init my-circuitcd my-circuitach run # reads entry from achronyme.tomlConfig resolution
Section titled “Config resolution”The CLI searches for achronyme.toml by walking up from the input file’s directory (or the current working directory if no file is specified). The first match is used.
Values are resolved with this precedence:
CLI flags (explicit) > achronyme.toml > hardcoded defaultsUse --no-config to disable achronyme.toml loading entirely.
Full schema
Section titled “Full schema”[project] — Project metadata
Section titled “[project] — Project metadata”[project]name = "my-circuit" # Required. Must match [a-zA-Z_][a-zA-Z0-9_-]*version = "0.1.0" # Required. Semantic versioning (MAJOR.MINOR.PATCH)description = "A ZK circuit" # Optionallicense = "MIT" # Optional. SPDX identifierentry = "src/main.ach" # Optional. Default entry file for run/compile/circuit/disassembleWhen entry is set, you can omit the file path from CLI commands:
# Instead of:ach run src/main.ach
# Just:ach run[build] — Compilation settings
Section titled “[build] — Compilation settings”[build]backend = "r1cs" # "r1cs" (default) or "plonkish"optimize = true # Enable IR optimization passes (default: true)error_format = "human" # "human" (default), "json", or "short"| Field | CLI equivalent | Default |
|---|---|---|
backend | --backend, --prove-backend | "r1cs" |
optimize | --no-optimize (inverted) | true |
error_format | --error-format | "human" |
[build.output] — Output paths
Section titled “[build.output] — Output paths”[build.output]r1cs = "build/circuit.r1cs" # Default .r1cs output pathwtns = "build/witness.wtns" # Default .wtns output pathbinary = "build/{name}.achb" # Default .achb output path ({name} = project.name)solidity = "" # If non-empty, generate Solidity verifierplonkish_json = "" # If non-empty, export Plonkish JSONThe {name} template variable is replaced with project.name.
[vm] — Virtual machine settings
Section titled “[vm] — Virtual machine settings”[vm]max_heap = "256M" # Maximum heap size (e.g., "256M", "1G", "512K"). Empty = unlimitedstress_gc = false # Force GC on every allocation (default: false)gc_stats = false # Print GC statistics after execution (default: false)| Field | CLI equivalent | Default |
|---|---|---|
max_heap | --max-heap | unlimited |
stress_gc | --stress-gc | false |
gc_stats | --gc-stats | false |
[circuit] — Circuit input declarations
Section titled “[circuit] — Circuit input declarations”[circuit]public = ["x", "y"] # Public input variable nameswitness = ["secret"] # Witness input variable namesThese are equivalent to --public x,y --witness secret on the command line. If --public or --witness are explicitly passed on the CLI, they override these values.
If both the CLI flags and TOML fields are empty, the compiler uses in-source public and witness declarations.
Minimal example
Section titled “Minimal example”[project]name = "multiply"version = "0.1.0"
[build]backend = "r1cs"Full example
Section titled “Full example”[project]name = "merkle-prover"version = "0.2.0"description = "Merkle tree membership proof circuit"license = "MIT"entry = "src/main.ach"
[build]backend = "r1cs"optimize = trueerror_format = "human"
[build.output]r1cs = "build/circuit.r1cs"wtns = "build/witness.wtns"solidity = "build/Verifier.sol"
[vm]max_heap = "512M"Validation
Section titled “Validation”The CLI validates the TOML file on load:
project.namemust match[a-zA-Z_][a-zA-Z0-9_-]*project.versionmust be valid semver (MAJOR.MINOR.PATCH)build.backendmust be"r1cs"or"plonkish"build.error_formatmust be"human","json", or"short"vm.max_heapmust be a valid size string if non-emptycircuit.public/circuit.witnessentries must be valid identifiersproject.entrymust end in.achor.achb- Unknown fields are rejected (forward compatibility via explicit sections)