Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · Finance · The Plumbing That Moves Money · with code: Go · about 15 min to read

Watch: Double-entry ledgers: how a payments company never loses a cent
▶ VideoPlay it as a journeyTutor comes with a plan

The Ledger That Cannot Lie, build a small money ledger in Go and hold it to four promises

The Double-Entry Ledger
The Double-Entry Ledger · Open board

The double-entry ledger as one picture: events in, balanced entries, balances read off. This lesson builds a small one in Go, stage by stage, and then tries to break it.

Education, not financial advice.

Before you start. From Every Litre Leaves One Tank and Enters Another, double-entry, normal balances and the trial balance: a ledger is accounts and entries, every transaction sums to zero, and the trial balance is the alarm. From A Book You Never Erase, the append-only ledger, reversals and derived balances: entries are only added, a mistake is fixed by a reversal, and a balance is derived from the entries. From Half a Point a Day, Gone, integer minor units, rounding and currency exponents: money is whole minor units, never floats. From The Hold That Is Not Money Yet: authorisation, capture, clearing, settlement and chargebacks: a card payment passes through a clearing account before it is cash. You need Go 1.22 or newer to run the code. You can read the lesson without it.

Lesson 54 of 58 in Finance

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 16 February 2024: five billion events a day, and a promise
  • The four promises
  • Stages 1 and 2: whole units, and a transaction that must balance
  • Stages 3 and 4: a retry changes nothing, and nothing is edited
  • Stages 5 and 6: two writers, and the bank’s opinion
  • Stage 7 and the test that makes it a promise
  • Ten posting exercises

Review Finance