Zero-knowledge, made legible

Build circuits you can reason about.

Lof is a compiled, type-safe language for zero-knowledge circuits. Catch visibility mistakes before proving and keep every generated constraint explicit.

$ git clone https://github.com/alk0x1/Lof.git
// Prove a private value is inside a public range
proof RangeProof {
    witness value: field;
    input min: field;
    input max: field;

    assert value >= min;
    assert value <= max;
    1
}
// Keep the account balance private
proof BalanceCheck {
    input amount: field;
    witness balance: field;

    let remaining = balance - amount in
    assert remaining >= 0;
    1
}
// Verify age without revealing birth year
proof AgeProof {
    input current_year: field;
    input minimum_age: field;
    witness birth_year: field;

    let age = current_year - birth_year in
    assert age >= minimum_age;
    1
}
Compiled 12 constraints ยท 0 warnings
TYPE-SAFE R1CS GROTH16 WASM RUST

Designed for assurance

Safety is part of the language.

Lof moves circuit mistakes out of production and into the compiler, where they are cheaper to find and easier to understand.

01

Visibility-aware types

Public inputs and private witnesses are different at the type level, so accidental leaks fail before a proof is generated.

input != witness
02

Explicit constraints

What you write is what reaches R1CS. No hidden control flow, surprise gates, or runtime behavior to audit later.

source -> R1CS
03

Compiler diagnostics

Trace type mismatches, invalid operations, and constraint issues with errors that point back to the source.

errors at compile time
04

Groth16 workflow

Compile circuits, perform setup, generate proofs, and verify them through the Lof and Lofit toolchain.

BN254 + Groth16
05

Web and WASM

Generate witness calculators and browser-ready proving bundles for applications that need proofs at the edge.

--target wasm
06

Rust-native

A predictable toolchain designed for local development, automated testing, and repeatable CI pipelines.

fast + portable

One coherent toolchain

From source to proof.

Write the circuit once, inspect the artifacts, then ship the same workflow to native applications, Node.js, or the browser.

Follow the integration guide ->
  1. 01

    Author

    Describe public inputs, private witnesses, and constraints in a readable .lof file.

    proof BalanceCheck { ... }
  2. 02

    Compile

    Type-check the circuit and emit deterministic IR, R1CS, and input templates.

    lof compile circuit.lof
  3. 03

    Prove

    Generate witnesses and use Lofit to set up, prove, verify, or package for the web.

    lofit prove ...

Start with a small circuit

Make the constraints obvious.

Install Lof, compile your first proof, and inspect every artifact it generates.