Documentation

Solanalib.Primitives.Lamports

Lamports #

The native unit of value on Solana. Two parallel names, used for different reasoning layers:

The bridge is UInt64.toNat : Lamports → LamportsUnchecked. Theorems about on-chain behaviour are typically stated against Lamports and reduced — via .toNat — to LamportsUnchecked for the arithmetic step.

Main definitions #

The number of lamports in one SOL.

Equations
Instances For

    A lamport count, with the strict on-chain u64 representation.

    Lamports arithmetic is u64-modular (wraps at 2^64); operations that could overflow or underflow carry an explicit precondition. For abstract reasoning that doesn't care about the bound, use LamportsUnchecked instead.

    Equations
    Instances For

      An unbounded lamport count for abstract reasoning.

      A plain Nat, so omega and Mathlib's Nat simp lemmas work without any unfolding ceremony. Use this in conservation theorems and other algebraic results where the u64 bound is a separate concern handled at the encoding layer. Bridge to Lamports via UInt64.toNat / UInt64.ofNat.

      Equations
      Instances For