← Lessons

quiz vs the machine

Silver1080

System Design

The Double Entry Ledger

Recording every money movement as balanced debits and credits so books always sum to zero.

4 min read · intro · beat Silver to climb

What it is

A double entry ledger records every financial event as at least two entries: a debit to one account and an equal credit to another. The sum of all entries for one transaction is always zero, so money is never created or destroyed, only moved.

Why payments use it

  • It gives a single source of truth for every balance.
  • It makes errors visible because the books must always balance.
  • It supports an immutable append only history that auditors can replay.

How a charge looks

When a customer pays ten dollars, you credit the customer account and debit the merchant account. The two entries belong to one transaction and commit together.

Practical rules

  • Never mutate a posted entry. To fix a mistake, post a reversing entry.
  • Derive balances by summing entries, or keep a running total updated inside the same transaction.
  • Store an amount, a currency, and an account on every entry.

Key idea

A double entry ledger turns every payment into balanced debits and credits, making the books a trustworthy and auditable source of truth.

Check yourself

Answer to earn rating on the learn ladder.

1. What must be true of the entries in one ledger transaction?

2. How do you correct a mistaken posted entry?