Skip to article
Miomir Labs ← Our work
Engineering note · Briclair · 2026-11

Inside Briclair’s ledger design

For Briclair, our work covers identity, accounts, and compliance infrastructure for developers in Nigeria. This note describes the ledger design and the database tests we wrote around it.

A ledger needs to preserve the history of a payment through a correction. We chose accounts and transfers as its core entities. A transfer joins a debit account to a credit account on the same ledger.

Represent the smallest unit

We represent naira amounts as integers in kobo, with a fixed scale of two decimal places. An amount of ₦125.50 is 12,550 kobo. The ledger stores the integer; the interface formats it for the reader.

Each account belongs to a ledger with a defined currency and scale. The schema constrains a transfer to two accounts on that same ledger. Currency conversion needs a separate design.

Preserve the original posting

We record a correction as a new transfer in the opposite direction. The original transfer remains in the history. An auditor can reconstruct the posting and its correction.

We separate pending transfers from their resolution. Posting or voiding a pending transfer creates another record. The database must refuse a second resolution of that same pending transfer.

Test the operations we must refuse

The database test suite attempts invalid operations and expects rejection. It covers:

  • A transfer between accounts on different ledgers.
  • A transfer to the same account, or an amount of zero or less.
  • A second resolution of a pending transfer.
  • An update or deletion of a transfer through the ledger role.

These tests exercise the schema and database permissions. They establish a narrower claim than a production reliability record. They do not establish bank integration behaviour, throughput, or uptime.

This note draws on Briclair’s ledger decision record, schema, and database invariant tests. The public project site contains API examples and an issuer-routing simulation.

Visit Briclair