Docs/Self-Banking Engine/Wallet and Ledger Architecture

Wallet and Ledger Architecture

Production Track

Compartmentalized balances and journal-backed accounting enforce strict movement semantics across all value paths.

Objective

Guarantee that all wallet mutations are reconcilable, balanced, and scoped by explicit compartment intent.

Compartment Model

Vault handles long-horizon reserves, Operational supports active spending, Escrow tracks pending settlement, and Delegated isolates agent-managed limits.

Each compartment keeps independent balances and policy hooks, enabling safer automation and least-privilege execution.

Double-entry Guarantees

All state transitions produce balanced debit/credit entries. There is no direct balance mutation outside journal pathways.

Fixed-point Amount(i128) with 8-decimal scaling removes floating-point drift and ensures deterministic reconciliation across nodes.

Operational Auditability

Each transaction path includes idempotency metadata to prevent duplicate effects under retry conditions.

Wallet-level history is reconstructible from journal entries and WorldLine references, enabling post-incident replay.

Interfaces

Wallet API

Create wallet, compartment balance lookup, scoped transfer initiation

Ledger API

Journal query, entry reconciliation, idempotency lookup

Production Checkpoints

  • Debit = credit invariant holds in all transfer and settlement flows
  • Compartment-specific restrictions are enforced before commitment
  • Replay from journal + worldline reproduces final balances
  • Idempotency keys suppress duplicate side-effects

Continue exploring

Self-Banking Engine