Demo · Bookkeeping
Crypto + Fiat Ledger — derived from events
Hard problem
A ledger that is a pile of hand-posted rows drifts from the truth the moment anything non-trivial happens — a stake that is legally a disposal, a reorg that deletes a transaction already booked — and nothing in the system notices the drift.
Approach
Append an event and regenerate the whole double-entry ledger from those events plus the posting rules, never patching a row in place. The trial balance holds by construction, and every row carries the event and the rule that produced it.
The ledger below is regenerated from the event log by a pure function — never hand-edited. Each event derives balanced double-entry postings; every balance is reproducible and balanced by construction.
✓ Balanced — debits $19,450.00 === credits $19,450.00deterministic checksum: 79e8b773 (unchanged across regenerations)
Event log · input (append-only)
- depositFund account (capital in)$10,000.00
- buyBuy 2 ETH @ $3,000$6,000.00
- sellSell 1 ETH @ $3,400$3,400.00
- feeNetwork fee$50.00
Account balances · derived
| USD | 7,350.00 |
| Capital | (10,000.00) |
| ETH | 3,000.00 |
| Realized Gain | (400.00) |
| Fees | 50.00 |
Journal · derived double-entry postings
| Event | Account | Debit | Credit |
|---|---|---|---|
Fund account (capital in) | USD | 10,000.00 | |
| Capital | 10,000.00 | ||
Buy 2 ETH @ $3,000 | ETH | 6,000.00 | |
| USD | 6,000.00 | ||
Sell 1 ETH @ $3,400cost basis $3,000.00 → proceeds $3,400.00 = gain $400.00 | USD | 3,400.00 | |
| ETH | 3,000.00 | ||
| Realized Gain | 400.00 | ||
Network fee | Fees | 50.00 | |
| USD | 50.00 | ||
| Totals | 19,450.00 | 19,450.00 | |