Skip to content
FutureProofsTechPublic

About

Post-quantum confidential transfers on lattice proofs, built from scratch in safe Rust.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

82 Commits

Folders and files

Repository files navigation

0l0

Post-quantum confidential transfers on lattice proofs — built from scratch in safe Rust

CI Release License: GPL-3.0-or-later Rust 1.99.0 unsafe forbidden no_std core zero dependencies tests Kani

No trusted setup. No elliptic curves. Nothing here for a quantum computer to break.


Important

Release v1.0.0 (2026-12-04). This is a code/feature release, not a production-security certification. v9 is the only active protocol; v8 is frozen historical/differential code. The rollup layer is a settlement skeleton: DA, challenge/fraud proofs, bridge, and independent audit remain open. See Security & status.

Contents

What is 0l0?

0l0 is a post-quantum confidential-transfer stack built from first principles in safe Rust. It combines three layers:

  1. sq-pq-core — no_std/no-alloc proof core. The active v9 engine uses 20×20 MLWE commitments over R_q = Z_q[X]/(X⁶⁴+1): R* short-preimage proofs, per-note mixed proofs, and transfer-level balance with Path-A unit/amount range equations. No heap, no unsafe, no third-party dependencies.
  2. sq-pq — std/alloc facade. Mixed-note and transfer aggregation: one transfer proof covers all note equations, the aggregate value balance, and the range checks.
  3. sq-chain — live v9 chain layer. v9 keys, noisy addresses/serials, note commitments, a single-proof transfer wire format, persistent note/spent ledger, wallet rotation, and a compact rollup settlement prototype with an archive blob store. The v8 statement layer is frozen under v8_tx, v8_ledger, v8_wallet, and the v8 support modules.

Design properties

Property Status
Post-quantum MLWE/lattice construction, no elliptic curves
Trusted setup None
Proof core no_std, no heap, forbid(unsafe_code)
Dependencies Zero runtime dependencies
Wire format Fixed, canonical, length-checked, fail-closed
Strict linting all, pedantic, nursery, cargo, no panic/unwrap/expect/indexing/as/casts/inline/exhaustive gaps
Verification Kani, Creusot, AORAI, Z3, Sage, SymPy, Loom, dudect, cargo-fuzz, cargo-mutants
Release profile opt-level=3, LTO, codegen-units=1, panic=abort, strip=true

Architecture

flowchart TB
    subgraph CORE["sq-pq-core · no_std / no_alloc"]
        RING["v9 ring arithmetic<br/>R_q = Z_q[X]/(X^64+1)"]
        COMMIT["20x20 MLWE commitments"]
        RSTAR["R* proof / verify"]
        MIXED["mixed-note proofs"]
        TRANSFER["transfer proof + Path-A range"]
        HASH["BLAKE3 + transcript"]
    end

    subgraph FACADE["sq-pq · std/alloc facade"]
        API["v9 public API"]
        WIRE["wire packing / unpacking"]
    end

    subgraph CHAIN["sq-chain · live v9"]
        TX["tx · single transfer proof"]
        LEDGER["ledger · notes + spent set"]
        WALLET["wallet · fresh-key rotation"]
        ROLLUP["rollup · compact state diffs"]
        ARCHIVE["archive · full-data blobs"]
    end

    subgraph FROZEN["frozen reference"]
        V8["v8_tx · v8_ledger · v8_wallet<br/>keys · commitments · nullifier · proof · real"]
    end

    CORE --> FACADE
    FACADE --> CHAIN
    CHAIN --> ROLLUP
    ROLLUP --> ARCHIVE
    FROZEN -. "differential / historical" .- CHAIN
Loading

The live transfer flow is:

wallet notes
   │
   ├─ prove: one v9 transfer proof
   │
   ├─ wire: leaf, serial, path, output commitments, proof
   │
   └─ ledger lookup: (cv, cm, pk) by leaf
          │
          ├─ membership (Merkle)
          ├─ serial freshness / duplicate check
          ├─ transfer proof (all notes + Path-A range + balance)
          └─ commit spent serials and output notes

Benchmarks

All numbers are measured release builds on the reference host:

Item Value
CPU Intel Core i5-14400F (10 cores / 16 threads)
Rust 1.99.0
Profile opt-level=3, LTO, codegen-units=1, panic=abort
Mode release, p50 unless stated

Full table and methodology: docs/benchmarks-full.md.

v9 proof engine (R*)

Path Proof Prove p50 Verify p50
v9 R* (MLWE, 128-bit target) 8,065 B 897 µs 489 µs
v8 R* (frozen reference) 1,265 B 115 µs 28.5 µs

v9 mixed notes (prepared contexts)

Path Wire Prove p50 Verify p50
input 28,361 B 662 µs 315 µs
output 16,297 B 381 µs 184 µs

v9 transfer with Path-A range (prepared contexts)

Shape Proof wire Live tx wire Prove p50 Verify p50
1-in-2-out 98,819 B ~135.8 KB 2.87 ms 1.48 ms
2-in-2-out 139,779 B ~183.0 KB 4.01 ms 2.04 ms
8-in-8-out 558,915 B ~731.4 KB 15.96 ms 7.56 ms

The proof wire is the benchmarked transfer proof. The live v9 TransferTx wire additionally carries full public note commitments (cv/cm/recipient) and the input serial/path. The chain caches prepared matrix contexts per chain id; proof verification is the dominant verification cost.

Frozen v8 reference

Path Wire Prove Verify
v8 R* / R_bin 1,265 B 115 µs 28.5 µs
v8 mixed input / output 3,385 / 2,841 B ~1.5 / ~1.2 ms ~410 / ~365 µs
v8 1-in-2-out full validate 24,325 B — 433 µs

v8 is not the active target. It remains in-tree for byte-identical differential vectors and historical comparison.

L1 capacity and rollup

Full-proof L1 (current v9 wire)

At 10-second blocks, for 1-in-2-out transfers:

Block size 1×2 TPS 2×2 TPS 8×8 TPS
1 MB 1 1 0
10 MB 7 5 1
100 MB 74 55 14
1 GB 736 547 137

With 8 cores at 70% efficiency, the CPU ceiling is:

Shape 1 core 8 cores @70%
1×2 676 TPS 3,784 TPS
2×2 490 TPS 2,745 TPS
8×8 132 TPS 741 TPS

The current validator is single-threaded; the 8-core column requires a parallel block verifier. At normal block sizes, block capacity — not CPU — is the bottleneck: a 10 MB block holds only ~74 live v9 1×2 transactions.

Rollup settlement

sq-chain::rollup stores only ~96 B of state diff per 1×2 transfer (one spent serial + two created note ids of 32 B each) plus an amortized header:

L1 block / 10 s Settlement TPS
1 MB ~1,000
10 MB ~10,000
100 MB ~100,000

This is a settlement-layer number. Full note bodies/proofs move to a DA layer; at 10k TPS the DA/archive tier must carry roughly 300 MB/s of note data plus proofs (~1.7 GB/s full data) and ~144 TB/day. If all full data must also be posted on L1, the 10 MB block cap returns and throughput collapses to the full-proof table above.

Storage budgets:

TPS Compact L1 diffs Note bodies Full data
10 83 MB/day 26.6 GB/day 144 GB/day
100 829 MB/day 266 GB/day 1.44 TB/day
1,000 8.3 GB/day 2.66 TB/day 14.4 TB/day
10,000 82.9 GB/day 26.6 TB/day 144 TB/day

See docs/tps.md, docs/rollup.md, and docs/storage.md.

What v1.0.0 includes

  • v9-only protocol policy — v8 source retained but frozen.
  • v9 engine — ring, commitments, R*, mixed notes, transfer proof, Path-A range equations.
  • v9 live chain — tx, ledger, wallet are v9-native:
    • one transfer proof per tx;
    • ledger-looked-up (cv, cm, pk) statements;
    • persistent note bodies + spent serial IDs;
    • Merkle membership, duplicate/serial checks, fail-closed parsing;
    • wallet key rotation and receipt verification.
  • Rollup settlement skeleton — compact batch header/state diff, append-only note/spent Merkle roots, DA commitment, wire codec.
  • Archive store — content-addressed full-data blobs, append-only, fsync-on-put, torn-record fail-closed.
  • Strict gates by default — sq-pq-core at crate root, src/v9/mod.rs, and sq-chain/src/v9.rs; zero errors.
  • Formal/tooling gates — Kani, Creusot, AORAI, Z3/Sage/SymPy, Loom, dudect, cargo-fuzz, cargo-mutants, cargo-show-asm.

Verification

Test suites

Suite Tests
Root engine + integration (cargo test) 151
sq-pq-core (cargo test --manifest-path sq-pq-core/Cargo.toml) 36
sq-chain (cargo test --manifest-path sq-chain/Cargo.toml) 91
Total 278

Formal and tooling matrix

Gate Result
Strict clippy (core + v9 facade + v9 chain) 0 errors
no_std core build pass
Kani 14/14 — 7 core, 2 facade, 5 chain (1 frozen v8 predicate)
Creusot 6/6 scalar proofs — add/sub/mul_mod, unit, unit relation, unit square
AORAI + WP range-check call order proved; negative control rejected
Z3 both Path-A quadratic cases unsat
Sage 10.10 sage path-a checks: OK
SymPy exact quadratic/unit/amount checks + 20k random modular trials
Loom 2/2 chain serial-cache models
dudect-style n=10,000, t=-0.322 (threshold 10)
cargo-fuzz 12.68M live tx parse + 33k transfer verify, 0 crashes
cargo-mutants tx 71 caught/0 missed, ledger 35/0, wallet 5/0
Tarpaulin (LLVM) core 97.21%, v9 facade 98.23%, workspace 75.46% (v8 + rollup included)
cargo-show-asm branchless add/mul, challenge, sparse-product probes
Python differentials proof 6/6, bin 1/1, mixed 1/1 byte-identical; mutant agreement 11/11, 8/8, 10/10

Run it yourself

# Core tests
cargo test --locked
cargo test --manifest-path sq-pq-core/Cargo.toml --locked
cargo test --manifest-path sq-chain/Cargo.toml --locked

# Strict gates
./tools/strict_v9.sh

# Formal/tooling suite (Kani, Z3/Sage, AORAI, Loom, dudect, Creusot, asm)
./tools/formal_v9.sh

# Short fuzz smoke
./tools/fuzz_v9.sh 10 5

# Mutation gate
MUTANTS_JOBS=8 ./tools/mutants_v9.sh

tools/formal_v9.sh currently covers Kani, Z3/SymPy, Sage, AORAI, Loom, dudect, Creusot and cargo-show-asm.

Quick start

v9 engine

use sq_pq::v9::commit::derive_matrix;
use sq_pq::v9::prover::{prove, sample_witness_for};
use sq_pq::v9::verifier::verify;

let a = derive_matrix(&[11; 32]).expect("matrix");
let (w, e, y, t) = sample_witness_for(&a, &[22; 32]);
let proof = prove(
    &a, &w, &e, &y, t,
    &[0x33; 32],       // salt (rotate per proof)
    b"ctx",            // context
    &[0x44; 32],       // hedging entropy (non-zero)
).expect("prove");
verify(&a, &y, t, &proof, b"ctx").expect("verify");

v9 live transfer

The complete wallet → ledger → transfer proof → validation path is in sq-chain/tests/v9_live.rs. It covers:

  • note creation and ledger insertion;
  • Merkle path;
  • TransferTx::prove / to_bytes / from_slice;
  • validate against the live ledger;
  • double-spend, stale root, bad path, tampered commitment/serial rejection;
  • ledger reopen and wallet agreement.

Papers

  • Whitepaper — protocol, relations, Path-A range argument, security analysis, rollup design, benchmarks and limitations.
  • Yellow paper — normative v9 constants, wire layouts, algorithms, ledger, transaction, rollup and archive formats.

LaTeX sources and build instructions: paper/.

Repository map

sq-pq-core/   no_std / no-alloc v9 proof core:
              ring · commitments · R* · mixed · transfer · BLAKE3 · transcript

src/          sq-pq facade:
              v9 re-exports · mixed · transfer · params · errors
              v8 modules remain frozen for differential reference

sq-chain/     live v9 chain:
              tx · ledger · wallet · rollup · archive
              v8_tx · v8_ledger · v8_wallet + v8 support modules (frozen)

formal/       Creusot · AORAI · SMT (Z3) · SymPy · Sage
              installation record in formal/INSTALL.md

fuzz/         libFuzzer targets:
              v9_parse · v9_transfer_verify · live tx codec · v8 differential

tools/        strict_v9.sh · kani_v9.sh · fuzz_v9.sh · mutants_v9.sh
              formal_v9.sh · sage_v9.sh · tps_model.py · sbom.py
              Python differential models and estimators

docs/         spec · v9-only policy · code standard · Kani
              benchmarks · Path-A review · constant-time · TPS
              rollup · storage · threat model · negative results

paper/        v1.0.0 whitepaper + yellow paper (LaTeX + PDF, `make -C paper`)

tests/        engine integration: KATs · brutal red-team · canonical rules
              properties · prover fuzz · extractor gates · timing

Security & status

What is verifier-enforced in v9

  • Unit encoding: s_k = 2b_k − 1, with s_k² = 1 via the Path-A quadratic equation.
  • Amount relation: 2a = Σ 2^k s_k + (2^20 − 1).
  • Aggregate value balance and fee.
  • Commitment equations, Merkle membership, serial freshness and duplicate-spend rejection.
  • Canonical 25-bit wire packing and fail-closed parsing.

The internal Path-A extraction review is in docs/path-a-review.md, with Z3/Sage/SymPy checks and a Creusot/AORAI split.

Known limitations

  • No independent audit. This is a prototype code release, not a production-security certification.
  • Rollup is a settlement skeleton. DA, challenge/fraud proofs, bridge, sequencer bond, forced inclusion, and finality are not implemented.
  • Coverage is not 100%. Core 97.21%, v9 facade 98.23%, full workspace 75.46% including frozen v8 and rollup/archive code.
  • Storage is heavy. A live 1×2 tx is ~135.8 KB plus ~30.8 KB of note bodies; at 1,000 TPS full retention is ~14.4 TB/day. Rollup L1 stores compact diffs only; DA/archive is a separate tier.
  • Prover timing is variable. Rejection sampling is data-dependent; dudect measures verifier smoke only, not a hardware side-channel certification.
  • Lattice cryptanalysis is young. MLWE/LaBRADOR-family assumptions still require independent review.
  • No production v9 consensus/network client yet. The live v9 tx/ledger/wallet and rollup settlement are models; mainnet consensus, P2P, economics and audit remain roadmap work.

Warning

Do not use this release for value-bearing assets. The honest status is: working code, measured benchmarks, formal/tooling gates, no external audit, and an unfinished rollup production layer.

Roadmap

  • v1.0.0 (this release) — v9-only code, live v9 tx/ledger/wallet, strict gates, formal/tooling baseline, rollup settlement skeleton.
  • Next — DA layer, challenge/fraud-proof game, bridge/withdrawals, sequencer bond and forced inclusion, transactional Merkle overlay.
  • Then — parallel block verification, batched ledger writes, compression/erasure-coded archive, target-hardware TPS measurements.
  • Before mainnet — independent cryptographic review, external audit, production node/network/economics, 100% reachable-line coverage.

Contributing

Bug reports with an exhibiting reproducer (failing test/script, never prose alone) are welcome. Security-sensitive findings: open an issue with a minimal reproducer against the latest tagged release.

License

GNU General Public License v3.0 or later (GPL-3.0-or-later). See LICENSE.

Copyright (C) 2026 nul0 (FutureProofsTech).


Built proof-by-proof, in the open.

About

Post-quantum confidential transfers on lattice proofs, built from scratch in safe Rust.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages