# The longest chain (most work) rule

Bitcoin nodes follow the valid chain with the most accumulated proof of work, not simply the most blocks. Learn why and how this creates agreement.

Canonical page: https://mybitcoinexplorer.com/learn/longest-chain-most-work
Topic: Blocks and the blockchain
Published: 2026-10-29
Updated: 2026-10-30


## Most work, not most blocks
People say "the longest chain wins", but the real rule is: **nodes follow the valid chain with the most total proof of work** (called "chainwork"). Normally that's the same thing, but a chain of many easy blocks can't beat a shorter chain of much harder blocks.

> Diagram: When chains compete, nodes follow the one with the most accumulated work — 

## Only valid chains count
Work alone isn't enough. A chain containing even one invalid block, such as one that creates too much bitcoin, is ignored no matter how much work it has. Every [node](https://mybitcoinexplorer.com/learn/what-is-a-bitcoin-node) checks every block itself. See [Consensus rules](https://mybitcoinexplorer.com/learn/consensus-rules).

## Why this creates agreement
- Honest miners build on the best chain they know.
- Any split resolves as soon as one side gets ahead. See [Stale blocks and chain reorganizations](https://mybitcoinexplorer.com/learn/stale-blocks-and-reorgs).
- An attacker wanting to rewrite history must out-work everyone else combined. See [The 51% attack](https://mybitcoinexplorer.com/learn/51-percent-attack).

> This mix of proof of work and "follow the most work" is often called **Nakamoto consensus**.


## A thought experiment
Imagine an attacker builds 1,000 easy blocks at a low difficulty while the real chain adds 10 hard ones. The attacker's chain has more blocks but far less total work, so every node ignores it. Comparing work, not length, closes that loophole.

## Where is chainwork shown?
Bitcoin Core reports `chainwork` for every block header: a running total of expected hashes. It only ever increases along the best chain.


## Key takeaways

- Nodes follow the valid chain with the most cumulative proof of work.
- Invalid blocks are rejected regardless of work.
- This rule lets thousands of nodes agree without a coordinator.

## Common questions

### What is chainwork?

The total expected number of hashes needed to produce every block in the chain.

### Could a longer chain with less work win?

No. Nodes compare total work, not block count.

### Why is it called the longest chain rule?

In normal conditions the chain with the most work is also the longest, so the shorthand stuck.

### Can a chain with more work but invalid blocks win?

No. Nodes reject invalid blocks, whatever work they carry.

## Related lessons

- [Proof of work](https://mybitcoinexplorer.com/learn/proof-of-work)
- [Stale blocks and chain reorganizations](https://mybitcoinexplorer.com/learn/stale-blocks-and-reorgs)
- [The 51% attack](https://mybitcoinexplorer.com/learn/51-percent-attack)
- [Consensus rules](https://mybitcoinexplorer.com/learn/consensus-rules)
