Bank8:Ledger - the core ledger
The system of record for money positions: accounts, products, double-entry postings, balances, schedules, and the full configuration library (parameters, flags, restrictions, calendars, plans, contracts) that drive them. 91 endpoints, 44 tables, one schema the service owns exclusively.
Use cases
Retail & business banking
- Account opening - an open product factory: any financial product is creatable as data (free-form type + parameters + validation modules); products compose validation modules (limits, overdraft rules, sweeps, tiered rates) and parameters resolve through the hierarchy (global → product → account) so a product change never needs data migration. Read The product factory.
- Transfers - a transfer is one
POST /v1/postingscall with a batch and a single instruction; retries with the sameidempotency_keyare safe by construction. - Scheduled postings - due schedules generate posting batches in one transaction per batch (recurring fees, sweeps, interest).
Finance operations
- Balance truth - live and end-of-day balances per denomination; every posting batch is balance-validated before any row is written (422 on imbalance, never compensating entries after the fact).
- Statement generation - scheduled generation writes documents to platform storage; regeneration is a per-account-period workflow.
- Config library - flags, restrictions, plans, contract modules: the whole product rule set is data, unit-testable without a DB.
API surface (91 endpoints, selected families)
| Family | Endpoints | Scope |
|---|---|---|
| Accounts | GET/POST /v1/accounts, …/{id}, …/balances, …/transactions, …/statements | bank8:ledger:accounts:read/write |
| Products | GET/POST /v1/products, …/{id}/activate, versions | bank8:ledger:products:* |
| Postings | POST /v1/postings, POST /v1/postings/async, GET …/{id}, republish | bank8:ledger:postings:read/write |
| Balances v2 | GET /v2/balances/{live,end,series} | bank8:ledger:balances:read |
| Schedules | GET/POST /v1/schedules, tags, associations | bank8:ledger:schedules:* |
| Customers | GET/POST /v1/customers, link-auth | bank8:ledger:customers:write |
| Parameters | /v1/parameters, viewEffective, derived values | bank8:ledger:parameters:* |
| Product versions (WASM) | POST/GET /v1/products/{id}/versions - per-version WASM registry (wasm_hash, language, hooks); pending → active pointer, no restart | bank8:ledger:products:write |
| Function hooks | POST /v1/contracts/simulate (synthetic-state dry run), POST /v1/internal/func-host (Sentin8:Func proxy-back: get_account, get_balance, set_flag, create_posting) | M2M + hook scopes |
Invariants
- Money is
rust_decimalend-to-end; the JSON wire format is a string. - Postings are idempotent per
(env_id, idempotency_key)- partial unique index + ON CONFLICT. - Audit + outbox inserts propagate errors inside the posting transaction: a posting whose audit/event write fails never commits.
- Product logic is external by construction: hooks compile to WASM and run in Sentin8:Func around the atomic commit - the ledger has no WASM runtime of its own, only the proxy-back handler. Even a hook-initiated posting re-enters the full validation pipeline (unbalanced batches still rejected 422). Read The product factory and Extending Bank8.
Full documentation
The complete detail lives in this product's sub-pages: