Loading the ledger engine (Go → WebAssembly)…
A double-entry payments ledger that proves itself: exactly-once requests, holds and captures, refunds, payouts, tamper-evident history and mada settlement reconciliation. This page runs the same Go engine as the server, compiled to WebAssembly.
Whatever goes wrong, the client retries with the same idempotency key, and the ledger applies the request exactly once.
The auditor ignores cached balances and rebuilds the ledger line by line from its append-only history. In PostgreSQL a trigger also refuses any UPDATE or DELETE on history.
Rewrite one line of history directly in storage, bypassing the engine, then run the audit.
Each line's hash covers the previous line's hash, so changing any line breaks the chain from that point on, even if the attacker rehashes it.
Each block is one line: a balance change on this account. Arrows are hash links, and they turn red where the chain no longer verifies.
The simulated card scheme settles every unsettled card payment and refund, then injects the faults below. Daftar matches each line to the ledger, posts what matches, and sends every discrepancy to a suspense account with a reason.
Each seed is a complete, deterministic simulation: 6 clients running payment flows through a network that drops, duplicates and reorders messages, a server that crashes mid-transaction, hold expiry, and a card scheme sending faulty settlement files. After each run, five independent checks must pass.
The full campaign (1,000 seeds × 400 ops) runs natively in 5.8 s. In your browser, 100 seeds take a few seconds.
A checker that never fails proves nothing. Each mutant plants one real bug in the engine; the campaign must catch every one.
Stateless Go. Each request locks its idempotency key, then its transfers, then its accounts, always in sorted order. It checks every rule on locked copies, then writes everything in one transaction, or nothing.
PostgreSQL in production (row locks under READ COMMITTED, CHECK constraints on balances, an append-only trigger on history). In memory for the simulator and this page. Both implement one interface.
A deterministic simulator with a reference model, Go fuzzing (364k runs), mutation testing, and a PostgreSQL load test that kills connections, sends duplicate requests at once, and then audits the result.
| Run | Payments/s | p50 | p99 | Result |
|---|---|---|---|---|
| 16 clients, hot platform accounts not sharded | 2,462 | 1.8 ms | 32 ms | audit clean |
| 16 clients, fee and receivable accounts sharded ×8 | 4,246 | 2.5 ms | 23 ms | audit clean |
| Every payment to one merchant (a single hot row) | 1,682 | 9.3 ms | 34 ms | audit clean |
| Chaos: a connection killed every 20 ms, 20% of requests sent twice at once | 3,397 | 3.2 ms | 26 ms | 0 inconsistencies |