THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Does Bitcoin Choose the Chain With the Most Blocks?

permalink THAMER
#bitcoin#chainwork#consensus#longest-chain#proof-of-work

Not necessarily. The phrase "longest chain" is often used informally, but Bitcoin's fork-choice rule selects the fully valid chain with the greatest accumulated proof of work, also called chainwork.

Different blocks can represent different amounts of work because difficulty targets can vary. Counting blocks alone is therefore not a complete measure of the proof of work behind a branch. A node must also validate consensus rules: a branch with enormous claimed work cannot become active if its blocks or transactions are invalid.

When two valid branches have equal accumulated work, nodes may temporarily disagree about their active tips based on the order in which blocks arrived and their local state. Later valid work can resolve the competition.

This distinction matters for wallets: block height alone does not prove that a transaction remains confirmed. A wallet should associate confirmation with the actual block hash and verify that the block belongs to the current active chain.

Primary references

Bitcoin whitepaper — Section 5: https://bitcoin.org/bitcoin.pdf

Bitcoin Developer Guide — Block Chain: https://developer.bitcoin.org/devguide/block_chain.html

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects