# Intro to Accounting for Software People This project is a curriculum teaching accounting from first principles for software engineers. It treats accounting as a constraint system (conservation of money) rather than simple record-keeping. The content contrasts two implementations to illustrate core invariants: 1. **Beancount**: Text-based double-entry accounting (detective control). 2. **TigerBeetle**: High-performance distributed financial database (preventive control). ## Core Curriculum - [Introduction](md/index.md): Overview of the curriculum and the engineer's framing of accounting. - [Why Accounting Exists](md/0-why-accounting-exists.md): Accounting as a state machine where the sum of all postings is always zero. - [Double-Entry From First Principles](md/1-double-entry-from-first-principles.md): The zero-sum rule, the distinction between postings and transactions, and how TigerBeetle implements this structurally. - [Account Types and the Accounting Equation](md/2-account-types-and-accounting-equation.md): Semantic types (Assets, Liabilities, Equity, Income, Expenses) and the custodial wallet model. - [Transactions, Postings, and the Transfer Primitive](md/3-transactions-postings-transfer.md): The atomic unit of work, decomposing multi-leg transactions, and TigerBeetle's `Transfer` struct. - [TigerBeetle's Data Model](md/4-tigerbeetles-data-model.md): Accounts, ledgers, immutability, and the split between pending and posted balances. - [Consistency, Assertions, and Balance Invariants](md/5-consistency-assertions-balance-invariants.md): Using balance assertions for bisection and database flags for structural enforcement. - [Two-Phase Transfers and Settlement](md/6-two-phase-transfers-and-settlement.md): Managing pending authorizations, holds, and settlement lifecycles. - [Multi-Currency and Commodities](md/7-multi-currency-and-commodities.md): Handling multiple ledgers, exchange rates, and inventory tracking. - [P/L, Realized vs Unrealized, and Corporate Actions](md/8-pnl-realized-unrealized-corporate-actions.md): Calculating profit and loss, handling stock splits, and dividends. - [Fintech Patterns](md/9-fintech-patterns.md): Production patterns including idempotency, correcting entries, rate limiting, and balance-conditional transfers. - [About](md/about.md): About the author, Egemen Göl — personal website and book source repository.