This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue

The Japanese edition of the third edition of Mastering Bitcoin, the world-renowned technical book on Bitcoin, has been published by O'Reilly Japan.

Mastering Bitcoin is a technical book written mainly for engineers. It's ideal for developers who want a deep understanding of how Bitcoin works, engineers building wallet or exchange systems, and anyone interested in the technical side of cryptocurrency. The first few chapters are written so that non-technical readers can follow them too, making the book valuable for anyone who wants to understand Bitcoin's inner workings.

For the third edition, the original author Andreas M. Antonopoulos is joined as co-author by David A. Harding, a lead writer for Bitcoin Optech who has contributed to Bitcoin documentation for many years. Because the second edition was never published in Japan, the jump from the first edition, published by NTT Publishing in 2016, to the third edition is enormous, and the new edition covers every major upgrade introduced to the Bitcoin protocol over the past 10 years.

In this article, I'll go over what has changed since the first edition and highlight what makes the third edition worth reading.

Segregated Witness (SegWit)

SegWit, activated in 2017, is one of the most important upgrades in Bitcoin's history. By introducing the concepts of a witness version and a witness program, it laid the groundwork for extending Bitcoin freely without being bound by traditional Bitcoin Script (in theory, it's possible to introduce verification logic entirely different from traditional Bitcoin Script).

This technology didn't exist at the time of the first edition, and the third edition explains it in detail, focusing on the following:

  • Fixing transaction ID malleability: What is transaction ID malleability, the problem that had to be solved before the Lightning Network could be deployed?
  • How SegWit works: How does SegWit solve the malleability problem?
  • P2WPKH / P2WSH: Explains how the new address formats introduced for using SegWit work
  • bech32 addresses: Explains the new address encoding scheme, replacing base58check, introduced for the new address format starting with bc1
  • Effective increase in block capacity: Why does separating out witness data (such as signature data) allow block capacity to increase?

Taproot and Schnorr signatures

Taproot, activated in 2021, is the biggest upgrade since SegWit. The third edition adds the following new material:

  • Schnorr signatures: A new signature scheme that replaces ECDSA. It enables efficient signature aggregation, improving the privacy and efficiency of multisig. The book walks through the signature scheme concretely and explains in detail how multisig can be constructed using cryptography alone
  • Taproot (P2TR): Lets even transactions with complex script conditions execute in a way that is indistinguishable on-chain from an ordinary payment
  • Tapscript: The new, updated version of Bitcoin Script for Taproot, with a summary of the main changes from the original Script
  • MAST (Merklized Alternative Script Tree): Explains the mechanism for efficiently expressing multiple spending conditions within a script while improving privacy
  • bech32m addresses: Explains the vulnerability in the bech32 encoding introduced with SegWit, and the improved address format created for Taproot to fix it

Transaction fees in depth

Fees, which the first edition only covered briefly, get much more extensive and practical coverage in the third edition:

  • RBF (Replace-By-Fee): A mechanism for replacing an already broadcast transaction by raising its fee
  • CPFP (Child-Pays-For-Parent): A mechanism for indirectly raising a transaction's fee by having a child transaction make up for the parent's fee
  • Transaction pinning: An attack that uses malicious fee manipulation to prevent a transaction from being replaced, and how to counter it
  • CPFP carve-out: A special rule for two-party contract protocols such as the Lightning Network
  • Package relay: A new feature that evaluates the fees of parent and child transactions together

This is essential knowledge for designing, building and operating multiparty protocols such as the Lightning Network, especially protocols where there can be a long gap between creating a transaction and broadcasting it, as with pre-signed transactions.

Layer 2 applications

The book also newly covers Layer 2 applications that make use of the primitives Bitcoin provides as the base layer. In particular, the third edition explains modern protocols as well:

  • Single-use seals: A building block that serves as the foundation for securely transferring new assets such as colored coins
  • P2C (Pay to Contract): A mechanism for binding a Bitcoin transaction to the fact that it is a payment made under an actual contract
  • Client-side validation: An approach to validating transfers of new assets, along with logic in those transfers that goes beyond Bitcoin Script
  • RGB protocol: A modern colored coins protocol that makes use of client-side validation
  • Taproot Assets: A colored coins protocol that leverages Taproot and is designed with Lightning Network integration in mind

The book also covers the building blocks that make off-chain scaling such as the Lightning Network possible.

  • How payment channels work
  • HTLCs (Hash Time-Locked Contracts)
  • Onion routing
  • Opening and closing channels, and security

If you want to dig deeper into the Lightning Network, be sure to check out Mastering the Lightning Network as well.

A major restructuring of the chapters

The third edition reorganizes its chapters to allow for more systematic learning. Most notably, the old edition's chapter on transactions has been split up and expanded into the following four chapters:

  1. Transactions: The structure of transactions (almost completely rewritten)
  2. Authorization and Authentication: How scripts within transactions work, plus an introduction to scripts commonly used in contracts
  3. Digital Signatures: Explains ECDSA and Schnorr signatures, as well as scriptless multisig and threshold signatures
  4. Transaction Fees: How fees work, fee bumping, and the challenges involved

Other updates

  • Keys and Addresses: Reorganized in historical order, from P2PK to P2PKH, P2SH, SegWit and Taproot
  • Signet: A new test network for developers
  • Compact block relay / filters: Explains the protocols introduced to improve network efficiency and light clients
  • BIP8 and Speedy Trial: How soft fork activation methods have evolved
  • Differences from the white paper: A new appendix explaining how Bitcoin's implementation has evolved from Satoshi's white paper

Additions in the Japanese edition

Since some time has passed since the English edition was published, the Japanese edition adds translator's notes on topics that have since been updated, such as the new CMake-based build process and policy changes, so that the book reflects the state of things as of 2025.

Conclusion

The Bitcoin protocol has evolved dramatically since the first edition was published in 2014. The technical progress of the past 10 years has been remarkable: scalability improvements that began with SegWit, greater privacy and flexibility with Taproot, and instant payments made possible by the Lightning Network.

The third edition covers all of these developments and is currently the most comprehensive technical book on Bitcoin. Whether you already own the first edition or are just starting to learn about Bitcoin, I hope you'll pick up a copy.

Mastering Bitcoin, Third Edition (Japanese edition)