Overview

11 Bitcoin upgrades

This chapter explains how Bitcoin’s rules can change and still preserve a single, shared ledger. It introduces the two kinds of consensus-rule changes—hard forks and soft forks—and emphasizes why safe rollout matters: the network is decentralized, each node chooses its own software, and upgrades must balance technical caution with broad social coordination. A recurring theme is that the “economic majority” of users ultimately defines Bitcoin’s rules by what software they run, while miners are paid to follow those rules, not set them.

Hard forks relax rules and risk permanent chain splits unless deliberately made incompatible with the old rules or protected with mechanisms like wipe-out protection; they also need replay protection so transactions do not unintentionally execute on both branches. Soft forks tighten rules so old nodes still accept new blocks, but if old miners produce blocks violating the tightened rules they can trigger temporary splits that later reorg away as adoption grows. The chapter uses examples such as increasing block size (hard fork), Segregated Witness (soft fork), the dangers of transaction replay, and why explicit replay and wipe-out protections may be needed when branches diverge.

Deployment mechanisms have evolved from ad hoc and miner-activated signaling toward more structured and user-empowering approaches. Early upgrades used coinbase text (BIP16) and then block-version thresholds (BIP34/66/65). Version bits (BIP9) enabled multiple parallel deployments with states like STARTED, LOCKED_IN, and ACTIVE, and worked smoothly for relative locktime (CSV) but stalled for SegWit, revealing that BIP9 grants a miner veto. SegWit ultimately activated via BIP91 and growing user pressure, highlighting that users drive consensus. The chapter concludes with user-activated soft forks (UASF) as a tool to align outcomes with the economic majority, and with hybrid designs that ensure upgrades proceed when broad user support exists even if some miners hesitate.

  Your new message will be accepted by Bitcoin New and ignored by Bitcoin Old.
kill message.png
  Qi gets a transaction twice. First during transaction propagation, second during block propagation.
qi gets the transaction twice.png
  Compact blocks in action. Rashid sends just the necessary data to Qi.
compact blocks.png
  Your node running Bitcoin New is a loser against the Bitcoin Old nodes. Bitcoin Old will discard all your blocks that violate the ≤ 4,000,000 WU rule.
hard fork single new node.png
  A majority of the hash rate runs Bitcoin New. It seems to have caused a permanent chain split.
hard fork majority new node.png
  The New chain is wiped out because the Old chain becomes stronger.
hard fork new chain reorg.png
  Bitcoin Cash protects against wipe-out by requiring the first block after the chain split to be >1MB.
bitcoin cash hard fork.png
  An Old miner regards a segwit output as anyone can spend and adds a transaction that spends it as such to the block.
spend segwit as anyone can spend.png
  The soft fork may cause a chain split if the Old nodes produce a block that New miners don’t accept.
soft fork single new node.png
  As people adopt Bitcoin New, your branch will cause a reorg for Bitcoin Old nodes.
soft fork majority new node.png
  After a chain split you effectively have two versions of your UTXOs.
utxos in chain split before book purchase.png
  Your transaction to the book store is valid on both the Old branch and the New branch.
old new utxo sets.png
  Transaction replay causes you to pay in both currencies
utxos in chain split.png
  With replay protection, a transaction is only valid on one of the branches.
bitcoin cash replay protection.png
16. A miner signals support for pay-to-script-hash by writing "/P2SH/" in the coinbase’s signature script.
17  The block header contains a block version. The first blocks used version 1.
header version 1.png
  BIP34 requires that all blocks contain the block height in the coinbase.
height in coinbase.png
   Miners that run the soft fork signal support for it by increasing their block version.
header version 2.png
relative hash rate 75.png
relative hash rate 95.png
  The Old nodes could cause a chain split, but it probably won’t last for long.
soft fork bip34 chain split.png
  The block version is treated differently. Each of the right 29 bits can signal for different proposals.
version bits.png
  State transitions happens every 2016 blocks.
bip9 states.png
  BIP9 deployment of csv. It went well.
bip9 relative lock time states.png
  The segwit deployment didn’t proceed as anticipated.
bip9 segwit stuck started.png
  BIP91 updates its state every 336 blocks instead of the usual 2016. This went fast.
bip91 states.png
  Segwit finally activates thanks to BIP91.
bip9 segwit active.png
   Users start rejecting big blocks. They see no new valid blocks, but plenty invalid (too big) blocks.
uasf start.png
  One miner decides to go with the users' will and only build small blocks. That miner will be able to pay the bills.
uasf single miner.png
  A few more miners realize that it’s more profitable to work on the users' branch.
uasf more miners.png
  The users' branch is stronger and wipes out the big blocks branch.
uasf wipeout miners.png
 Hard and soft forks compared.
summary hard vs soft fork.png
  . BIP9 states
bip9 states.png
   User-activated soft fork states
uasf states.png
  Some blocks are only valid on Old nodes and some blocks are only valid on New nodes.
ex hard soft fork.png

 Recap

In this chapter you learned that

  • We don’t want a blockchain split when deploying a fork, because that would cause disruption in the Bitcoin economy.
  • A hard fork is a consensus rule change that requires every miner to upgrade. Otherwise the blockchain will split.
  • A soft fork is a consensus rule change that doesn’t require simultaneous upgrade of the whole network.
  • A hard fork will lead to a blockchain split if a majority runs the New software, which will cause confusion among users and miners.
  • During a blockchain split due to a hard fork you want wipe-out protection to make sure the New branch isn’t deleted by old nodes.
  • In a blockchain split, you want replay protection to let you select what branch you want your transactions applied to.
  • A miner-activated soft fork, for example one using BIP9 for deployment, lets miners deploy a non-controversial soft fork.
  • A user-activated soft fork lets users enforce deployment of a soft fork. If a hash-rate majority eventually follows, the soft fork succeeds without a lasting blockchain split.

FAQ

What does “fork” mean in this chapter, and how is it different from a normal open‑source fork?A fork here means a change to Bitcoin’s consensus rules (the rules that define valid blocks and the valid UTXO set). A normal open‑source fork is just copying/modifying software; a Bitcoin consensus fork changes what different nodes consider valid, which can split the chain.
How do hard forks and soft forks differ?A hard fork relaxes rules, so New blocks may be invalid to Old nodes. A soft fork tightens rules, so New blocks remain valid to Old nodes, but some Old blocks become invalid to New nodes. In hard forks, the New branch can be wiped out unless it’s made incompatible (“wipe‑out protection”); in soft forks, the Old branch can be wiped out, and you can’t protect it without turning it into a hard fork.
What is a chain split and when can it happen?A chain split occurs when groups of nodes enforce different consensus rules and therefore extend different valid branches. It can happen in both hard and soft forks if some miners produce blocks that the other side considers invalid and both branches keep getting mined.
Why can transactions be replayed after a split, and what is replay protection?After a split, you generally hold identical UTXOs on both branches. A transaction valid on one branch may also be valid on the other, so it can be “replayed.” Replay protection changes the transaction format or validation rules so a transaction is valid on at most one branch (e.g., BCH’s FORKID), preventing unintended double spends across branches.
What is wipe‑out protection and why is it used in hard forks?Wipe‑out protection ensures the New branch can’t be reorganized back onto the Old branch by making the branches mutually incompatible (e.g., requiring the first post‑split block to violate Old rules or changing PoW). Without it, Old‑compatible New blocks risk being reorged if Old regains hashpower.
How can Bitcoin change without a consensus fork?Non‑consensus upgrades don’t change block validity, so Old and New nodes remain compatible. An example is compact block relay (BIP152), which speeds block propagation by sending short summaries instead of full blocks when peers already have most transactions.
How have soft forks been deployed historically (BIP16, BIP34/66/65)?Early methods used miner signaling: BIP16 used a coinbase text tag “/P2SH/” and a flag day; later soft forks used incremented block versions with thresholds (e.g., 75% then 95%) before enforcement. These are miner‑activated soft forks.
What is BIP9 “version bits” and what are its states?BIP9 reinterprets the block version to carry multiple independent signaling bits (up to 29 features in parallel). Each feature goes through states—DEFINED → STARTED (monitor signaling) → LOCKED_IN (grace period) → ACTIVE (rules enforced) or FAILED (timeout)—with thresholds (typically 95% per 2016‑block period) using median time past for timing.
Why did SegWit’s BIP9 deployment stall, and how did BIP91/BIP148 resolve it?SegWit signaling stalled well below 95%, allowing a de facto miner veto. BIP148 (a user‑activated soft fork) proposed rejecting non‑signaling blocks on a set date. BIP91 (miner‑adopted) required signaling for SegWit at 80% over short periods and began rejecting non‑signaling blocks, forcing rapid SegWit lock‑in and activation without a disruptive split.
What is a user‑activated soft fork (UASF) and who ultimately sets Bitcoin’s rules?A UASF is when users (economic majority running full nodes) enforce new rules from a chosen time/height regardless of miner signaling. Because miners need the market to value their block rewards, they tend to follow the rules users accept. Ultimately, users collectively decide the rules by choosing the software they run; miners are paid to follow those rules, not set them.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Grokking Bitcoin ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Grokking Bitcoin ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Grokking Bitcoin ebook for free