# Consensus rules

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.

Canonical page: https://mybitcoinexplorer.com/learn/consensus-rules
Topic: Nodes and the network
Published: 2026-10-29
Updated: 2026-10-30


## 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.

> Diagram: A sample of the consensus checks every node performs — 

## Examples
| Rule | Lesson |
|---|---|
| Inputs must refer to existing, unspent outputs | [UTXOs: how Bitcoin balances really work](https://mybitcoinexplorer.com/learn/understanding-utxos) |
| Outputs can't exceed inputs (except in the coinbase) | [How Bitcoin transaction fees work](https://mybitcoinexplorer.com/learn/bitcoin-transaction-fees) |
| Every signature and script must succeed | [Bitcoin Script](https://mybitcoinexplorer.com/learn/bitcoin-script) |
| Block hash must be below the target | [Proof of work](https://mybitcoinexplorer.com/learn/proof-of-work) |
| Coinbase can't claim more than subsidy + fees | [The block reward](https://mybitcoinexplorer.com/learn/block-reward) |
| Block weight at most 4,000,000 | [Block size and the weight limit](https://mybitcoinexplorer.com/learn/block-size-and-weight-limit) |
| Timestamp above median of last 11 blocks | [Block timestamps](https://mybitcoinexplorer.com/learn/block-timestamps) |
| Coinbase outputs wait 100 blocks | [The coinbase transaction](https://mybitcoinexplorer.com/learn/coinbase-transaction) |

## Consensus vs policy
Consensus rules decide what's **valid in a block**. [Policy](https://mybitcoinexplorer.com/learn/relay-policy-and-standardness) 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](https://mybitcoinexplorer.com/learn/soft-forks-and-hard-forks) and [Bitcoin Improvement Proposals (BIPs)](https://mybitcoinexplorer.com/learn/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.

## Related lessons

- [Relay policy and standardness](https://mybitcoinexplorer.com/learn/relay-policy-and-standardness)
- [Soft forks and hard forks](https://mybitcoinexplorer.com/learn/soft-forks-and-hard-forks)
- [What is a Bitcoin node?](https://mybitcoinexplorer.com/learn/what-is-a-bitcoin-node)
- [What does decentralized mean in Bitcoin?](https://mybitcoinexplorer.com/learn/decentralization)
