03. Ledger and accounts: the book of record
Purpose and scope
A customer's displayed balance, for example EUR 1,240.00, is an obligation of the bank. Payments, cards, risk and reporting require a single source stating what each account holds and why.
An auditor may request a balance as at a specific time, for example 3 March at 14:00. A table of overwritten balances cannot provide this, whereas the ledger, an unmodifiable record of every movement, can.
Components
The diagram shows the ledger's writers and data destinations.
ledgermaintains the chart of accounts (the list of the bank's books), every entry and hold, and each balance. It also records the accounting day to which each entry belongs and a tamper-evident chain over all entries. It holds no customer data or account identifiers such as IBANs; a ledger account is an identifier with a currency, a type and a few flags.accountsmaintains the products, the holders of each account, the account lifecycle from opening to closing, and its restrictions, account identifiers, pots, interest, fees and statement data. It also builds the depositor view required for deposit insurance. It calls the ledger like any other service, over gRPC, a typed remote procedure call (system map).
Only these callers may write to the ledger, each only its own entry kinds (allow-list in security).
| Caller | Permitted bookings |
|---|---|
payments, the payments hub | Transfer holds and captures, incoming credits, clearing settlement, forced debits for late settlement |
cards, the card service | Card holds, captures, refunds, forced holds and debits |
accounts | Interest, fees, pot transfers, seizure and estate holds, payouts |
treasury, the bank's liquidity and funds management | Transfers between the bank's own accounts, keyed treasury:<funding order id>/transfer |
compliance, the compliance service | aml_suspension holds and their release |
backoffice-api, the staff console's backend | Manual adjustments, approved by a second person |
lending (Phase 2) | Loan and overdraft entries |
How it works
Double-entry bookkeeping
No booking creates or removes funds. A business event is an entry; each line within it is a posting to one account.
For the bank, a customer balance is a liability (money owed) and its central bank funds are an asset. A customer payment reduces both: the customer account is debited, reducing the amount owed, and the asset account is credited.
Debits are stored as positive cents and credits as negative cents, so the postings of every entry must sum to zero per currency; the ledger rejects any entry that does not.
Worked example 1: an outgoing instant credit transfer of EUR 650.00
Example: a customer pays EUR 650.00 rent by SEPA Instant Credit Transfer (SCT Inst), the Single Euro Payments Area instant transfer, which by law completes within 10 seconds. Amounts are shown in euro; under the UK profile the same example applies in sterling. The sequence shows what the ledger sees.
The diagram shows the Lithuanian profile; under the UK profile fps-gateway and Faster Payments take the places of sepa-gateway and CENTROlink.
| Step | Account | Debit | Credit |
|---|---|---|---|
| Capture, entry 1 | Customer current account (liability) | 650.00 | |
| Capture, entry 1 | SCT Inst outgoing clearing | 650.00 | |
| Settlement, entry 2 | SCT Inst outgoing clearing | 650.00 | |
| Settlement, entry 2 | Instant prefunded account mirror (asset) | 650.00 |
Entry 1, recording the customer's payment, is booked when the positive pacs.002, the CENTROlink status message, confirms settlement (Settled in payments).
Entry 2 records that funds have left the bank's central bank account. It is booked from the CENTROlink settlement confirmation or the intraday camt.054 movement notice, both available every calendar day; the camt.053 statement, issued on TARGET days only, confirms it. The intermediate clearing account holds transfers in transit and is empty at day end.
If a transfer cannot be completed, the bank must restore the payer's account (Regulation (EU) 2024/886[1]). In the ledger this is a hold release, hence the hold is placed first; the same hold release is used for a rejected Faster Payment under the UK profile. Under the Lithuanian profile payments enforces the 10-second limit; a confirmation arriving after the release is booked as a forced debit (timing in payments). Under the UK profile the hold is kept while the outcome of a Faster Payment is unknown, so no release at a time limit and no forced debit arise (D04.4).
Worked example 2: a card purchase
Example: a customer pays EUR 3.50 by card. The network first requests approval (authorisation); days later the merchant's acquiring bank submits the final amount (clearing).
- Authorisation:
cardsasks the ledger to place a hold of EUR 3.50, keyedcard:<auth_id>/hold. No posting is written. The customer's posted balance is unchanged, and the available balance is reduced by EUR 3.50. - Clearing, two days later:
cardsasks the ledger to capture the hold, keyedcard:<auth_id>/capture/<clearing_line_id>. The entry debits the customer EUR 3.50 and credits card scheme settlement EUR 3.50. - The scheme settles daily, which returns the scheme account to zero.
If the merchant clears EUR 4.20 including a tip, the ledger captures the EUR 3.50 hold and books the excess, EUR 0.70, as a forced_debit with reason over_capture. Without clearing, the hold expires (target 7 or 30 days, depending on the scheme, see cards).
The diagram shows the lifecycle of a card or payment hold.
Every hold has a kind: card_authorisation, payment, aml_suspension, seizure or estate. The last three do not expire and are released only by a named role: compliance releases an aml_suspension; accounts releases an estate hold, and a seizure when the bailiff lifts the order.
A seizure or estate hold ends by release or by a payout capture booked by accounts with a second approver (acct:<order id>/payout). The payout is the only debit permitted while the debit block is in force. The reason for these three holds is never disclosed to the customer (the tipping-off rule, section 06).
The posted balance is the sum of postings, the legal balance on statements. Held is the sum of open holds. Available is posted minus held, plus any overdraft limit (Phase 2); it is the spendable amount. Example: a posted balance of EUR 1,240.00 with an open rent hold of EUR 650.00 gives an available balance of EUR 590.00.
The chart of accounts
The chart of accounts lists every book the bank keeps, including its own accounts as well as customers'. The six below suffice for this document; the remainder follow at the end of this section.
| Account | Description | May go negative | Must return to zero |
|---|---|---|---|
| Customer current account | Amount the bank owes the customer | Overdraft or forced entry only | No |
| Savings pot | Sub-account of a current account | No | No |
| SEPA incoming and outgoing clearing (Faster Payments clearing under the UK profile) | Transfers in transit | Yes | Daily |
| Card scheme settlement | Card spending owed to the scheme | Yes | Each cycle |
| Suspense | Funds not yet allocated | Yes | No unexplained item older than 1 business day (target) |
| Safeguarding accounts, EMI mode | Customer funds held at partner banks | Yes | No |
"EMI mode" denotes operation under an electronic money institution licence. If a must-zero account is non-zero at close, treasury opens an investigation item (treasury).
The data model
This section is intended for engineers. Amounts are signed 64-bit integers of cents, never floating point. Other tables: ledger_account (with allow_negative, must_zero and debit_blocked), posting (partitioned by month) and balance.
create table entry ( -- never updated, never deleted
entry_id uuid primary key,
commit_seq bigint not null unique, -- assigned in the posting transaction
idempotency_key text not null unique,
business_date date not null,
value_date date not null,
kind text not null, -- card_capture, interest, fee_waiver, forced_debit, reversal, ...
reason_code text, -- required for forced_debit and adjustment
reverses uuid references entry,
caller text not null,
content_hash bytea not null -- SHA-256 of the canonical entry
);
create table hold (
hold_id uuid primary key,
account_id uuid not null,
kind text not null, -- card_authorisation, payment, aml_suspension, seizure, estate
amount_minor bigint not null,
captured_minor bigint not null default 0,
state text not null, -- open, partly_captured, captured, released, expired
expires_at timestamptz, -- null only for the last three kinds
reason_ref text not null, -- case or order id, never a name
placed_by text not null,
released_by text
);
Invariants the ledger enforces
- Every entry's postings sum to zero per currency, verified by the service and again by a database trigger at commit.
- An account without
allow_negativemust not have a negative available balance, checked under a lock on its balance row; forced entries are the sole exception. - Append-only storage: the service's database role has no
UPDATEorDELETEprivilege onentryandposting. - Corrections are new entries; a reversal references the original. A manual adjustment is proposed by one staff member and approved by another (maker and checker) within 24 hours (target); otherwise it lapses.
- An idempotency key (
<source>:<external id>/<leg>, as in section 02) books at most once, permanently. A repeatable step carries its own message identifier in the leg, for examplecard:<auth_id>/adjust/<processor_event_id>for each increase, reversal or advice. A retry with identical content receives the stored result; different content is an error. Only booked results are stored under the key, so a retry after a refusal is evaluated afresh, and a standing order refused at 06:00 for insufficient funds may still execute at 18:00. - No entry may be booked on a closed business date.
- A hold of kind
aml_suspension,seizureorestateis never released by a timer.
Forced entries and negative balances
Certain debits must be booked despite insufficient funds, because the bank already owes the amount to a third party:
- a card clearing without a hold
- an over-capture, being the part of a card capture above its hold, such as a tip
- a stand-in advice, being a purchase that the card processor approved on the bank's behalf while the platform was unreachable
- a late settlement of a transfer after its hold was released
cards and payments submit these as a forced_debit (or forced hold) with a reason code. The ledger books it even below zero and raises an alert.
In Phase 1 accounts operates the unarranged negative balance process:
- The customer is notified in the app on the same day.
- Debits from the account are blocked.
- The next incoming funds are applied first to repay the debt.
- A debt unpaid beyond the period in the terms opens a recovery case in the staff console.
- A write-off above a defined amount requires a second approver and transfers the debt to "Fraud and operational loss".
Meanwhile the risk service, risk, reads the total owed; above a threshold it declines card use and lowers stand-in limits until repayment (fraud and risk). In Phase 2 lending assumes responsibility for arrears.
Business date, value date and end of day
The business date is the accounting day to which an entry belongs. The value date is the date from which the funds count for interest. Example: a clearing for Monday that arrives on Wednesday is booked on Wednesday with Monday's value date.
The business date rolls over every calendar day at midnight local time of the profile (Lithuanian time, or UK time under the UK profile) unconditionally, and new entries book on the new date. The ledger then closes the previous date: it snapshots every balance, runs the trial balance, checks every account that must return to zero and emits DayClosed. Under the Lithuanian profile, reconciliations against TARGET statements run on TARGET days and cover all calendar days since the previous reconciliation; the reconciliation calendar under the UK profile is in the same section (treasury).
After a region failover, sealing the previous date (DayClosed, snapshots, trial balance) waits until lost entries are re-booked under their original keys (platform). Late entries for the previous date are booked on the new date with the previous value date.
Tamper evidence
The ledger maintains a hash chain. Every second a sealing process writes a sealed page of newly committed entries in commit_seq order, beginning with the SHA-256 hash of the preceding page, so any change to an earlier entry invalidates every later page.
Entries do not always commit in commit_seq order, so the sealing process takes only entries whose transaction is older than the oldest one in progress (pg_snapshot_xmin), and no late commit is skipped. Rolled-back transactions leave expected gaps; each sealed page records its first sequence number, last sequence number and count.
Every 10 minutes (target) the latest hash, the chain head, is sent to audit and to write-once storage in a separate cloud account that the bank's own administrators cannot modify. A nightly job recomputes the chain. audit maintains a separate chain of its own.
How accounts sits on top
Products as data. A product is a versioned row specifying currency, interest tiers, fee schedule, whether an overdraft is allowed, deposit-insurance eligibility and licence_mode (bank or EMI). A price change is a new version, published as a dated document; comms notifies each affected customer before the effective date. Version approval is defined in Running the bank. E-money may not earn interest (Directive 2009/110/EC, Art 12[2]), and EMI-mode products therefore reject an interest schedule. Under the UK profile an electronic money issuer may likewise not award interest or any other benefit related to the length of time e-money is held (Electronic Money Regulations 2011, regulation 45[13]), and the same product rule applies.
Holders. An account has one or more rows in account_holder, each recording customer id, role (owner, joint_owner, authorised_signatory, guardian, estate_representative), authority and validity dates. Phase 1 creates a single owner row. No service stores a standalone owner, so joint accounts later need no schema change.
Account lifecycle. The diagram shows the customer account lifecycle; every transition is stored with its initiator and reason.
Restrictions are rows in accounts alongside the lifecycle, because one account may carry several at once. While any debit-blocking restriction is open, accounts sets debit_blocked on the ledger account, and the ledger rejects debits. risk reads a copy from accounts events. Credits to a restricted account are still accepted and remain blocked. For a sanctions freeze the sanctions regulations themselves provide for this: a credit institution may credit a frozen account with funds transferred by third parties, provided that the additions are also frozen, and must inform the competent authority of the transaction without delay (for example Regulation (EU) No 269/2014, Art 7[17]). Under the UK profile the corresponding exception permits a relevant institution to credit a frozen account with interest and with funds transferred to it for that account (for example Russia (Sanctions) (EU Exit) Regulations 2019, regulation 58[18]). Each credit to a frozen account raises a compliance event, from which any notification to the authority is made (section 06).
| Restriction | Set by | Lifted by |
|---|---|---|
| Sanctions freeze | screening or compliance, through accounts | False positive: analyst and checker. Confirmed match: only after delisting or with the authorisation of the competent authority, stored with its reference |
| Fraud freeze | Outcome of a fraud case | Fraud analyst and a second fraud analyst or team lead |
| Seizure | Bailiff order; adds a seizure hold | The bailiff's lifting message |
| Deceased | Support agent and a second approver; also stops cards and standing orders | The estate case |
| Negative balance | accounts after a forced entry | Repayment or write-off |
| Customer protective block | Lost-or-stolen line or the customer in the app | The customer in the app after SCA on a bound device, or support with a second approver |
Seizure orders are expected, under the Lithuanian profile, to arrive from bailiffs through the PLAIS system (unconfirmed; see Assumptions and dependencies). Under the UK profile no automated channel is assumed. A third party debt order under Part 72 of the Civil Procedure Rules, the instrument by which a judgment creditor in England and Wales reaches a debtor's account, is served on the bank; the bank must then search for every account of the debtor, must not make a payment that reduces the balance below the amount specified in the order, and must disclose the accounts to the court and the creditor within 7 days of service (Civil Procedure Rules, Part 72[19]). An order served on the bank, of this or any other kind, is entered in the staff console by one staff member and approved by a second, which places the seizure restriction and hold; cost: manual handling of each order, which the 7-day period accommodates. Under both profiles the bank does not lift an order on its own initiative; the hold ends only on the lifting message or decision of the officer or court that issued the order, or by the approved payout. If an order exceeds the balance, the hold takes the available funds and grows with new credits until the order is covered. The bailiff or creditor is paid by the approved payout capture described above.
Death of a customer. Notification places a deceased restriction immediately. Funds are retained under an estate hold with interest accruing, and are paid to the heirs once their documents are verified in an estate case.
Closing stops cards, pays the balance to an account nominated by the customer and closes pots. The ledger account then stays open for a tail of 13 months (target), the period in which a customer may report an unauthorised or incorrectly executed payment (PSD2 Art 71[21]). Under the UK profile the same tail covers the 13 months after the debit date within which a customer may notify an unauthorised or incorrectly executed payment (Payment Services Regulations 2017, regulation 74[14]) and the 13 months from the last payment made as part of the fraud within which an authorised push payment fraud claim may be made (Payment Systems Regulator[12]; fraud and risk). Late clearings, refunds and returns in the tail go to suspense and are paid to that account; funds that cannot be returned move to "Unclaimed customer funds".
A closure by the bank requires compliance approval, a neutral notice and, under the Lithuanian profile, a report to the Bank of Lithuania within 5 calendar days (as reported), which reporting produces (treasury). The notice rules for a closure under the UK profile are in Running the bank. A restricted account may be closed only on a compliance decision.
IBAN issuing. A Lithuanian IBAN has 20 characters: LT, two check digits, a five-digit bank code and an eleven-digit account number, for example LT12 1000 0111 0100 1000 (SEB[4]). The check digits let any system detect a mistyped IBAN; accounts calculates them by the standard algorithm (ISO 13616) from a never-reused number sequence. The bank code is assigned with the licence.
Sort code and account number (UK profile). The account identifier is a 6-digit sort code and an 8-digit account number. A direct participant is allocated a sort code as part of onboarding under rules managed by Pay.UK, whereas an indirect participant receives one from the direct participant that settles for it; sort codes are registered in the Extended Industry Sort Code Directory (Pay.UK[10]). While the bank settles through a sponsor, the design takes the sort code as allocated by the sponsor (payments); accounts holds the sort code as a profile setting, so allocation through Pay.UK onboarding would change no code. accounts draws account numbers under the bank's sort code from a never-reused sequence and validates them against the published modulus-checking rules (Vocalink[11]). It also derives a UK IBAN of 22 characters for cross-border use: GB, two check digits, a four-character bank code formed by the first four characters of the bank's BIC, the sort code and the account number. The IBAN registry fixes this structure (Swift[15]), and the use of the first four characters of the BIC as the bank code is a planning assumption; the formats and their use on the rails are in payments.
Interest (bank mode only). A nightly job multiplies each value-dated balance by the daily rate. Example: at an illustrative rate of 2% a year, one day on EUR 1,240.00 earns 6.79 cents; 6 cents are posted to "interest accrued payable" and the remaining 0.79 cents are carried forward to the following day. Interest is capitalised monthly.
Fees are triggered by and keyed to events, so a replay cannot charge twice. Each fee entry carries its fee type, from which the annual statement of fees is produced. A goodwill refund is an entry of kind fee_waiver, and a refund above a defined amount requires approval by a second person.
Savings pots are separate ledger accounts under the account identifier of the current account. Statements are generated from end-of-day snapshots and rendered by comms. Dormant accounts incur no fees and require re-verification before funds leave. The dormancy period is a profile setting. Under the Lithuanian profile it is 24 months without a transaction initiated by the customer (planning assumption), the inactivity period that the deposit insurer applies to small dormant balances (see Deposit insurance and safeguarding); cost: a customer inactive for that period is verified again before a payment leaves the account. Under the UK profile it is 15 years without a transaction carried out by or on the instructions of the holder, the statutory definition of a dormant account (Dormant Bank and Building Society Accounts Act 2008, section 10[20]; Running the bank).
Deposit insurance and safeguarding
Under the Lithuanian profile in bank mode, deposits are insured up to EUR 100,000 per depositor per institution, aggregated across currencies and including interest, and the insurer pays out within seven working days. E-money is excluded, as are dormant accounts with balances under EUR 10 that have been inactive for 24 months. Certain temporary high balances are covered up to EUR 200,000 or EUR 300,000 (Indėlių ir investicijų draudimas[3]).
accounts therefore rebuilds the depositor view daily. It lists, per depositor, every account and pot, the balance with interest, eligibility and any temporary high balance tag; treasury checks it at close. The default route is a direct bank licence application (licence), so the depositor view is built in Phase 1; on the EMI route it is kept tested for the upgrade. Under the UK profile the same view produces the FSCS Single Customer View file (treasury).
In EMI mode under the Lithuanian profile, funds received in exchange for e-money must be safeguarded no later than five business days after issuance (Directive 2009/110/EC, Art 7[2]); the FCA safeguarding regime that applies under the UK profile is in treasury. treasury would compare total e-money liabilities at close with the safeguarding accounts and fund any shortfall on the same day. This safeguarding reconciliation is designed in Phase 0 and built only if the EMI route is chosen.
Throughput
This section is intended for engineers. The peak target in year three is 200 money-path requests per second in total (payments and card authorisations), approximately 1,000 posting rows per second (derived in the delivery plan). A single PostgreSQL primary can sustain this load.
Every transfer updates the same few settlement and clearing accounts, which a single balance row each would serialise. These accounts need no balance check, so each is split into 16 counters (target) summed on read. Group commit persists many entries per disk write, and the posting table is partitioned by month.
The rest of the chart of accounts
This section is intended for engineers and accountants. TARGET is the Eurosystem's settlement system. Rows marked UK profile exist only in a deployment under that profile, and the two TARGET and CENTROlink rows only under the Lithuanian profile.
| Account | Description | May go negative | Must return to zero |
|---|---|---|---|
| Instant prefunded account mirror | The bank's instant-payment funds in CENTROlink | Yes | No |
| TARGET settlement account mirror | The bank's funds at the Bank of Lithuania | Yes | No |
| Provisional credit receivable | Card refunds paid before settlement by the scheme | Yes | At dispute close |
| Negative balance receivable | Amounts owed by customers after a forced entry | Yes | No |
| Fraud and operational loss | Losses borne by the bank | Yes | No |
| Fee income | Revenue from fees | Yes | No |
| Interest accrued payable | Interest owed to depositors | Yes | At capitalisation |
| Unclaimed customer funds | Amounts owed to former customers that cannot be paid out | Yes | No |
| Sponsor settlement position (UK profile) | Net amount owed to or by the sponsor settlement participant for Faster Payments and Bacs | Yes | At each sponsor settlement |
| Bank of England settlement account mirror (UK profile, Phase 2) | The bank's funds at the Bank of England, including the Pre-Funded Account behind its Faster Payments Net Sender Cap | Yes | No |
| Fraud reimbursement expense (UK profile) | The bank's share of authorised push payment fraud reimbursements | Yes | No |
| Reimbursement due from or to other firms (UK profile) | Amounts claimed from or owed to the other firm in a reimbursed case | Yes | At claim settlement |
| Direct Debit indemnity claims due from other banks (UK profile) | Direct Debit Guarantee refunds paid to customers and claimed from the originator's bank (payments) | Yes | At claim settlement |
United Kingdom profile
| Aspect | Lithuanian profile | UK profile |
|---|---|---|
| Base currency | EUR | GBP |
| Account identifier | Lithuanian IBAN, 20 characters | Sort code and 8-digit account number; a UK IBAN is derived for cross-border use |
| Business date roll-over | Midnight Lithuanian time | Midnight UK time |
| Instant clearing accounts | SCT Inst incoming and outgoing clearing | Faster Payments incoming and outgoing clearing |
| Settlement accounts | Instant prefunded account and TARGET settlement account mirrors | Sponsor settlement position in Phase 1; Bank of England settlement account mirror from Phase 2 |
| Fraud reimbursement | No dedicated accounts | Reimbursement expense; amounts due from or to the other firm |
| Direct Debit refunds | No dedicated accounts in Phase 1 | Indemnity claims due from other banks |
The ledger, its invariants, holds, forced entries, the data model, the hash chain and the account lifecycle are identical in both profiles. The money type binds every amount to its currency, so a sterling ledger runs the same code with pence as minor units. While Faster Payments settles through a sponsor settlement participant, the sponsor settlement position records the net amount owed to or by the sponsor and is reconciled by treasury (treasury). An authorised push payment fraud reimbursement is booked to the reimbursement expense account and to a balance due from or to the other firm, which bears part of the cost (fraud and risk). Deposit protection and safeguarding follow the UK rules described in treasury; the depositor view and the safeguarding reconciliation keep their design.
Key design decisions
D03.1 An in-house ledger on PostgreSQL
Decision: The ledger is built in-house on PostgreSQL behind a narrow gRPC interface: place hold, capture, release, post entry, get balance, close day.
Rationale: The bank must explain the ledger to supervisors and auditors line by line. PostgreSQL is every service's database (Overview, point 7), so one backup method and one recovery drill cover it, and its transactions make balance checks and postings atomic.
Alternatives considered:
| Option | Strengths | Weaknesses for the bank |
|---|---|---|
| TigerBeetle | Designed for double entry and holds; high performance (docs[5]) | An additional database to operate; value dates and hold kinds would be held elsewhere in any case |
| Vendor core, for example Thought Machine Vault or Mambu | Ready-made product engines and a faster start | Per-account licence cost. Holds, value dates and licence modes would still have to be built around it. It would create a supplier dependency from which exit is not feasible |
The instant-payment path requires that holds and balances are decided in the bank's own process within its time budget (payments); a procured core would give least visibility into the component the bank must understand best. A vendor core has not been priced against the money-core squad (delivery plan); that comparison is a Phase 0 task, and this decision is reopened if it shows a proven core with a clearly lower five-year cost that meets the instant-path budget.
Cost: Concurrency and recovery are tested in-house, with property-based tests and a nightly replay rebuilding every balance. TigerBeetle is reassessed at a sustained 5,000 postings per second (target).
D03.2 Balances updated in the same transaction as postings
Decision: The balance row is updated within the transaction that inserts the entry.
Rationale: A stale balance would allow two payments to spend the same funds.
Alternative considered: Summing postings on every read, or updating balances asynchronously. Either approach makes every balance check slow or stale.
Cost: Lock contention on high-volume accounts, mitigated by split counters.
D03.3 Holds as their own records
Decision: Holds are a separate table and API, each with a kind, and are not modelled as postings to a pending account.
Rationale: Cards and instant transfers reserve then settle; seizures and AML suspensions reserve indefinitely. Explicit holds give an accurate available balance and an expiry job limited to card and payment holds.
Alternative considered: Posting to a pending account and reversing later. This adds entries and complicates statements.
Cost: An additional mutable table that must remain consistent with postings.
D03.4 Restrictions beside the lifecycle
Decision: The lifecycle has five states. Freezes, seizures, deaths, negative balances and customer protective blocks are recorded as restriction rows that may overlap.
Rationale: A single state cannot represent a second concurrent event, and lifting the first would silently drop the second.
Alternative considered: Frozen and Seized as lifecycle states. This is simpler to model but does not represent accounts subject to several concurrent restrictions.
Cost: debit_blocked is derived from several rows, and every combination must be tested.
D03.5 Products as versioned data
Decision: Products are versioned rows plus a few schedules written in Rust; most changes are new parameter values.
Alternative considered: A script per product, rejected because it introduces an additional language to secure and explain.
Cost: A new product structure requires a software release.
D03.6 Hash chain with the head kept outside
Decision: Sealed sections are written every second, and the chain head is copied to external storage every 10 minutes.
Rationale: Access permissions do not prevent tampering by an insider with administrator access.
Alternative considered: Chaining each entry within its own transaction. This would serialise every write on a single row.
Cost: Approximately one second of entries is unsealed at any time.
D03.7 The ledger feeds the general ledger
Decision: The ledger holds customer funds and operational accounts, and reporting feeds daily summaries to a procured accounting package that serves as the general ledger.
Rationale: Millions of customer entries are not suited to an accounting package, and items such as salaries are not suited to the core.
Cost: Two sets of books that reporting reconciles daily (treasury).
Failure modes and mitigations
| Failure | Effect | Response |
|---|---|---|
| Caller retries a timed-out post | Possible double debit | The idempotency key returns the first result |
| Clearing account not zero at close | Funds held in transit | treasury opens an item on the same day |
| Lock contention on a high-volume settlement account | Payment latency increases | Split counters; alert on lock wait above 50 ms (target) |
| Region lost | Up to one minute of entries missing | Re-booked under original keys before close |
| Stored balance differs from postings | Incorrect available balance | Detected by the nightly replay; account debit-blocked |
| Chain verification fails | Possible tampering | Security incident (security) |
| Card or payment hold never captured | Funds remain unavailable | Released by the expiry job; other kinds are excluded |
| Card clearing after hold expired | Unreserved debit | forced_debit and the negative balance process |
| Seizure order larger than balance | Order partly unsatisfied | Hold increases with new credits |
| EMI safeguarding shortfall | Breach of safeguarding requirement | Same-day top-up by treasury |
| Sponsor settlement position differs from the sponsor's report (UK profile) | Settlement funds misstated | treasury opens a reconciliation break on the same day; the ledger prevails until explained |
| Reimbursement due from another firm remains unpaid (UK profile) | Receivable ages | Case stays open in the case tool; escalated through the scheme's claims process (fraud and risk) |
Security and privacy considerations
- The ledger stores no personal data, only account identifiers. IBANs, sort codes and account numbers, and holders are held in
accounts, and personal data incustomers(privacy). - Staff never write postings directly. Adjustments follow the maker and checker process, and both identities are stored on the entry.
- Database administrator access is break-glass only and is logged to
audit(security).
Phasing
- Phase 1: Everything in this section, including the depositor view, except the EMI safeguarding reconciliation, which is designed in Phase 0 and built only if the EMI route is chosen. Under the UK profile Phase 1 also includes sort code and account number issuing, the sponsor settlement position, the fraud reimbursement accounts and the account for Direct Debit indemnity claims due from other banks.
- Phase 2: Overdrafts, loans and arrears in
lending, term deposits, multi-currency accounts, business accounts, joint accounts and mandates. Under the UK profile, the Bank of England settlement account mirror when the bank becomes a settling participant. - Phase 3: Per-partner ledger namespaces for banking-as-a-service.
Assumptions and dependencies
The design in this section rests on the following assumptions, each confirmed at the stated point; neither blocks the start of the build.
| Assumption | Confirmed by | When | If it does not hold |
|---|---|---|---|
| Lithuanian profile: seizure orders of bailiffs and of the tax authority reach the bank through PLAIS as structured messages that state the amount to restrict and any amount exempt from recovery, and an order is lifted only by its issuer. | Counsel and the operator of PLAIS | Phase 0 exit | Orders arriving by another channel are entered in the staff console with a second approver, as under the UK profile. If the bank must calculate an exempt amount itself, the seizure hold gains a protected-amount field and accounts a calculation rule; the ledger is unchanged. |
| Funds of a closed or dormant account that cannot be paid out remain a liability of the bank in "Unclaimed customer funds" without limit of time, and no transfer to the state or to a scheme is mandatory under either profile. | Counsel | Before public launch | accounts gains a payout entry from "Unclaimed customer funds" to the designated recipient and a reclaim process for a customer who returns; the ledger and the chart of accounts are unchanged. |
Sources
- Regulation (EU) 2024/886, instant payments
- Directive 2009/110/EC, electronic money
- Indėlių ir investicijų draudimas, deposit insurance
- SEB, what an IBAN is
- TigerBeetle, two-phase transfers
- Modern Treasury, immutability
- Monzo, how balances are calculated
- Thought Machine, Vault Core accounts
- Mambu, platform overview
- Pay.UK, sort code information
- Vocalink, modulus checking
- Payment Systems Regulator, APP fraud reimbursement protections
- Electronic Money Regulations 2011, regulation 45
- Payment Services Regulations 2017, regulation 74
- Swift, IBAN standard and registry
- IBAN.com, United Kingdom IBAN format
- Regulation (EU) No 269/2014, Art 7, crediting of frozen accounts
- Russia (Sanctions) (EU Exit) Regulations 2019, regulation 58
- Civil Procedure Rules, Part 72, third party debt orders
- Dormant Bank and Building Society Accounts Act 2008, section 10
- PSD2 Art 71