Digital wallet on a double-entry ledger
A wallet where every balance is a materialized view over an append-only double-entry journal — money moves effectively-once, and the books always balance.
What this design does
The mistake most wallet MVPs make is storing balances as mutable numbers — then one crash between 'debit A' and 'credit B' invents or destroys money. Here the journal is the only writer: every transfer is one atomic double-entry posting, balances are just a projection that can be rebuilt from scratch, and a nightly trial balance asserts the invariant that debits equal credits. Import it and try to construct a crash that loses money — the design won't let you.
The patterns it composes
- Double-entry ledger — every movement debits one account and credits another, atomically
- Append-only journal — postings are immutable facts — corrections are new postings, never edits
- Balance as materialized view — balances are a rebuildable projection, not the source of truth
- Effectively-once movement — idempotency keys + posting ids make retries harmless
- Reconciliation (trial balance) — a scheduled job proves Σdebits = Σcredits, every day
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.