↑ ↓ navigate↵ open

What is proven

Audited theorems by module, axiom policy, the trusted base and the tests that cover it.

On this page · 6
  1. 01How proofs are checked
  2. 02Consensus
  3. 03Transactions
  4. 04Base fee
  5. 05FFI boundary
  6. 06Trusted base and its tests

How proofs are checked

Theorems
59 in core/
Checked by
Lean kernel, on every lake build
Triggered by
cargo build (core-ffi build.rs)
Allowed axioms
propext · Quot.sound · Classical.choice
Audit file
core/Audit.lean
Warnings
errors (warningAsError = true)

Audit.lean runs #print axioms on each main theorem inside #guard_msgs, so the expected axiom list is part of the source. A theorem that picks up sorryAx or a compiler-trusting tactic (native_decide, bv_decide, which add Lean.ofReduceBool) changes its axiom list and fails the build.

Audit.lean
/-- info: 'LeanSvmCore.Ledger.applyTx_supply' depends on axioms: [propext, Classical.choice, Quot.sound] -/
#guard_msgs in #print axioms Ledger.applyTx_supply

Proofs use kernel-checked tactics such as simp and omega. Std and Lean tactic modules are not imported into the linked library, since every imported module becomes a link-time dependency of the node.

Consensus

Quantified over every event sequence from genesis, including forged, duplicated and reordered events (Proof/Consensus.lean):

run_no_equivocation
The core never emits two different votes of the same kind for the same slot.
run_finalized_increasing
Finalized slots strictly increase.
run_finalized_chain
Finalized blocks form a single chain from genesis.
step_valid
If the state is valid, the state step returns is valid (FFI/Consensus.lean).

Transactions

For every successful applyTx (Proof/Ledger.lean). A failed transaction returns an error and no account changes.

applyTx_ok
Exact characterization of a successful application; the theorems below follow from it.
applyTx_authorized
The ML-DSA-44 signature verified under the key bound to the sender’s address.
applyTx_supply
Sender + recipient decrease by exactly the fee; the recipient gains exactly the amount; base_fee × size ≤ fee ≤ max_fee × size.
applyTx_nonce
The sender’s nonce increases by exactly one.
applyTx_no_replay
The same transaction cannot be applied again to the resulting account state.
applyTx_key_stable
A key is bound only when the account has none; a bound key never changes.
applyTx_canonical
An applied transaction carried a public key iff the account had none, so its size and fee are fixed by the signed fields.

Base fee

For nextBaseFee p c used, with c the current base fee (Proof/Fee.lean):

nextBaseFee_le_max
result ≤ maxBaseFee (2^48).
floor_le_nextBaseFee
floor ≤ result, when floor ≤ maxBaseFee.
nextBaseFee_le_increase
result ≤ c + (c / 8 + 1), when floor ≤ c.
nextBaseFee_ge_decrease
result ≥ c − (c / 8 + 1), when c ≤ maxBaseFee.
nextBaseFee_increases
used > target and c < maxBaseFee ⇒ result > c.
nextBaseFee_decreases
used < target, c > floor and c ≤ maxBaseFee ⇒ result < c.

FFI boundary

*.decode?_encode
decode? (encode x) = some x for every message type crossing the boundary.
stepFFI_encode
The consensus export, on encoded input, returns the encoding of step.
applyTxFFI_encode
The ledger export, on encoded input, returns the encoding of applyTx.
nextBaseFeeFFI_encode
The fee export, on encoded input, returns the encoding of nextBaseFee.

Trusted base and its tests

ComponentNot proven becauseCovered by
Lean compiler, runtime, C compilerLean → C is not verifiedRuntime re-checks of the ledger and fee theorems through the FFI
mldsa-native (ML-DSA-44)External C library (CBMC memory-safety proofs upstream)NIST ACVP sigVer vectors incl. invalid signatures; byte-for-byte vs RustCrypto ml-dsa
RustCrypto sha3External crateFIPS 202 examples
core-ffi (shim.c, unsafe Rust)Outside LeanFuzzing of every export with random and mutated input
Mempool pre-checkRust re-implementation of the admission checksDifferential test: accepts exactly what Lean applyTx accepts
Node: disk, clock, networkI/Okill -9 crash tests, damaged-log tests, load tests with restarts, verify

Outside the scope of the proofs: whether the spec states the intended rule, economic attacks (ordering, fee levels), and liveness. The consensus safety theorem for many validators (no two finalized blocks in one slot while malicious stake is below 1/3) is scheduled before v2.