A chapter-by-chapter deep dive into the Bitcoin Core codebase, from data structures to consensus, networking to wallets.
Written by Mohit Bhat15 chapters covering every major subsystem. Read in order for the best learning experience, or jump to any chapter.
What Bitcoin is, why it was created, the double-spend problem, key concepts, and a plain-English walkthrough of how a payment works.
Layered design, core components, data flow between subsystems, and design principles that govern Bitcoin Core.
CTransaction, CTxIn, CTxOut, COutPoint, CBlock, CBlockHeader, the fundamental data structures of Bitcoin.
Private keys, public keys, ECDSA signatures, SHA-256 hashing, secp256k1 curve, and key derivation.
The stack-based scripting language: opcodes, script types (P2PKH, P2SH, P2WPKH, P2TR), and the script interpreter.
Base58Check, Bech32/Bech32m encoding, address types, key I/O, and how human-readable addresses map to scripts.
AcceptToMemoryPool, script verification, fee checks, RBF, CPFP, package relay, and the CTxMemPool data structure.
ProcessNewBlock, ConnectBlock, proof-of-work, difficulty adjustment, the UTXO set, and block template creation.
Cluster mempool, linearization algorithms, TxGraph, TRUC (v3) transactions, ephemeral anchors, and package RBF.
Block storage on disk, FlatFileSeq, the block index, UTXO database, undo data, pruning, and optional indexes (TxIndex, compact block filters).
CWallet, key management, coin selection algorithms, transaction creation & signing, fee estimation, and wallet database.
End-to-end journey: wallet creation → mempool admission → block inclusion → chain confirmation. Ties every chapter together.
Miniscript's composable spending policies, output descriptors, BIP 9 soft fork deployment, test networks, and headers sync anti-DoS.
libbitcoinkernel, multiprocess IPC architecture, peer eviction logic, privacy networks (Tor, I2P, CJDNS), ZMQ, and REST API.