Blockchain Books
Programming Bitcoin
Learn How to Program Bitcoin from Scratch
Jimmy Song's hands-on engineering text — build Bitcoin from first principles in Python.
Jimmy Song's Programming Bitcoin is the closest thing the ecosystem has to a "build your own Bitcoin from scratch" textbook. Over fourteen chapters you implement elliptic curve cryptography, ECDSA signatures, transaction parsing, Script, the block header and proof-of-work, SPV proofs, and a Bitcoin network client — all in pure Python, with no third-party Bitcoin libraries. Each chapter ends with exercises that build directly into the next chapter's code.
Who it's for
Working programmers who already speak Python and want to truly understand Bitcoin at the byte level. You don't need a deep math background — the cryptography chapters start from the definition of a finite field — but you do need patience and a willingness to debug your own implementations. This is not a casual read; it's a course in book form, and skipping the exercises defeats the point.
What it does well
The pedagogy is genuinely excellent. Song builds your understanding the same way he built Bitcoin in code: finite fields, then elliptic curves, then secp256k1, then signatures, then transactions, then blocks, then the network. By the time you reach the proof-of-work chapter you've already typed out every primitive yourself, and the "aha" moments land hard. The exercises are well-scoped — small enough to finish in a sitting, demanding enough that you actually learn something. The accompanying Jupyter notebooks make it easy to verify your work against test cases.
Where it falls short
It's a 2019 book and it shows. Taproot, Schnorr signatures, MuSig2, and modern Lightning are absent. Segwit gets one chapter near the end and feels rushed compared to the careful build-up of legacy transactions. The Python is sometimes idiosyncratic — Song wrote his own helpers rather than using libraries you'd reach for in production — which is pedagogically correct but means the code you ship at the end isn't reusable for anything real.
The book also has Song's distinctive voice, which leans Bitcoin-maximalist and occasionally moralizes about altcoins in asides that don't add anything to the technical content. Skip those paragraphs; the code itself is worth the price of admission. If you finish the exercises you will understand Bitcoin better than 99% of people who claim to.