Docs / Toolchain Overview

Toolchain Overview

Lof separates circuit authoring, witness generation, and proof operations into focused tools. Each stage produces artifacts that can be inspected, cached, and tested independently.

Compiler

The lof compiler parses and type-checks a .lof source file, then emits the intermediate representation and R1CS constraint system used by the proving workflow.

lof compile circuits/balance.lof --output dist/balance

The generated output includes the constraint system, input templates, and optional web assets depending on the selected target.

Witness generator

lof-witness-gen creates witness calculators from compiler artifacts. Native Rust and WASM targets let the same circuit logic run in backend services or browsers.

lof compile circuits/balance.lof --target wasm --output dist/balance

Lofit

lofit handles the Groth16 lifecycle over BN254:

  1. Create proving and verification keys.
  2. Generate a proof from a valid witness.
  3. Verify the proof against its public inputs.
  4. Package the required assets for Node.js or browser use.

See the CLI reference for command options and the web integration tutorial for a complete application flow.

Artifact flow

circuit.lof
    -> lof compile
    -> IR + R1CS + input templates
    -> witness calculator
    -> proving key + verification key
    -> proof + public inputs

Keeping these stages explicit makes it possible to inspect constraint output, reproduce builds, and test the exact artifacts deployed to production.

Edit this page on GitHub