Protocol Invariants and Verification Toolchain
The global invariant registry every Lux LP must preserve, the audit requirements each LP must satisfy, and the toolchain that machine-checks them
LP-0018: Protocol Invariants and Verification Toolchain
Abstract
An auditor reading Lux needs two things this LP provides and no other LP owns: the set of global invariants that hold across every chain and every release, and the toolchain that mechanically checks them. Each protocol component's behaviour is specified in its own LP; what lives here is the cross-cutting contract those LPs are jointly required to preserve.
Invariant registry
These hold network-wide. A change that breaks one is a protocol break, not a feature.
| Invariant | Statement |
|---|---|
| Total supply cap | LUX supply never exceeds 2,000,000,000,000 (2 trillion; genesis SupplyCap) |
| Fee conservation | Every fee is accounted for — burn + treasury + validator, summing to the fee paid |
| Bridge backing | Bridged tokens are always 1:1 backed on the origin chain |
| Consensus safety | No two conflicting blocks are finalized |
| Liveness | If 67% of stake is honest, new blocks are produced |
| Quasar triple soundness | Compromise of any one of {BLS, Pulsar, ML-DSA→Groth16} does not forge a finalized certificate (proved in proofs/lean/Consensus/Quasar.lean) |
| Chain role uniqueness | Each chain owns exactly one role; no role has two owning chains (see lp-0130) |
The Quasar certificate
The triple-soundness invariant rests on the shape of the certificate
itself. A QuasarCert is a 3-tuple binding three independent hardness
assumptions, each contributed by a separate chain:
| Layer | Scheme | Hardness | Source chain | In cert |
|---|---|---|---|---|
| BLS | BLS12-381 aggregate | co-CDH (classical) | network-wide | 48 B |
| Pulsar | Module-LWE threshold | Module-LWE + MSIS (PQ) | Q-Chain | ~3.3 KB |
| MLDSAProof | ML-DSA-65 → Groth16 over BLS12-381 | Module-LWE + MSIS, then Groth16 SNARK | Z-Chain | 192 B |
PQ modes (config/pq_mode.go): BLSOnly, BLSPlusMLDSA,
BLSPlusCorona, BLSPlusGroth16, DoubleLatticePlusClassical. Triple
mode runs all three layers in parallel via TripleSignRound1.
Each layer is independently toggleable; the production mode runs all three. Breaking finality therefore requires breaking a classical assumption and two independent lattice assumptions.
The certificate type is defined in
lp-0110 and implemented in
protocol/quasar/types.go.
Audit requirements
Every LP that specifies protocol behaviour must provide:
- Formal specification of all state transitions.
- The invariants that must hold across all states.
- Security assumptions and threat model.
- Test vectors for implementation verification.
- Reference implementation location.
An LP missing any of the five is not auditable and is not Final.
Verification toolchain
| Tool | Purpose |
|---|---|
| Lean 4 | Consensus / crypto / BFT machine-checked proofs (proofs/lean/) |
| TLA+ | Consensus protocol model checking (proofs/tla/) |
| Tamarin | Protocol verification (proofs/tamarin/) |
| Halmos | Symbolic execution for Solidity (proofs/halmos/) |
| Certora | Smart contract formal verification |
| Echidna | Property-based fuzzing for Solidity |
| Foundry | Unit and integration testing |
Coverage and theorem counts are in lp-0017.
Security Considerations
- The invariant registry is a living document. Each LP update that touches a cross-cutting property revises it here, not locally.
- Auditors receive the specification plus full source access. No security through obscurity.
- Formal verification covers critical paths (consensus, bridge, token transfers). Non-critical paths use property-based fuzzing.
- Audit reports are published publicly after remediation.
References
- lp-0001 — supply and fee policy
- lp-0017 — proofs and coverage
- lp-0110 — Quasar consensus and certificate types
- lp-0130 — canonical chain roster and role assignment
- lp-4450 — Pulsar threshold ML-DSA (Q-Chain lane)
- lp-8000 — Z-Chain ZKVM (Groth16 lane)
- lp-7050 — where the retired T-Chain's duties went
Copyright
Copyright (C) Lux Industries Inc. Licensed under the MIT License.