Consensus rules decide what makes a Bitcoin block or transaction valid. Every node enforces them, and a block that breaks one is rejected. See examples.
The rules everyone must agree on
Consensus rules are the checks that decide whether a block, and every transaction in it, is valid. If your node and mine disagree on one of them, we end up on different chains. That's why they change very carefully.
Examples
| Rule | Lesson |
|---|---|
| Inputs must refer to existing, unspent outputs | UTXOs: how Bitcoin balances really work |
| Outputs can't exceed inputs (except in the coinbase) | How Bitcoin transaction fees work |
| Every signature and script must succeed | Bitcoin Script |
| Block hash must be below the target | Proof of work |
| Coinbase can't claim more than subsidy + fees | The block reward |
| Block weight at most 4,000,000 | Block size and the weight limit |
| Timestamp above median of last 11 blocks | Block timestamps |
| Coinbase outputs wait 100 blocks | The coinbase transaction |
Consensus vs policy
Consensus rules decide what's valid in a block. Policy decides what a node will relay or keep in its mempool. A transaction can be non-standard (not relayed) yet valid if a miner includes it.
Who decides?
Nobody can force a change. New rules need users, businesses and miners to choose to run software that enforces them. See Soft forks and hard forks and Bitcoin Improvement Proposals (BIPs).
Bugs in consensus history
- 2010 value overflow: a bug allowed a transaction creating 184 billion BTC. It was fixed within hours and the chain was rolled back.
- 2018 inflation bug (CVE-2018-17144): found and fixed before it was exploited.
Both show why consensus code is changed with extreme care, and why many independent reviewers matter.
Key takeaways
- Consensus rules define valid blocks and transactions.
- Every full node enforces them independently.
- Policy rules affect relay, not validity.
Common questions
Where are the rules written down?
Effectively in the code of Bitcoin Core and other compatible implementations, plus BIPs describing changes.
Can miners change the rules?
No. Miners producing blocks that break the rules are ignored by nodes.
Who writes Bitcoin's consensus rules?
They're defined by the software nodes run, mainly Bitcoin Core, and changed only through broadly adopted soft forks.
What happens if my node disagrees with the network?
It follows only blocks it considers valid, so it may end up on a different chain until the disagreement is fixed.