Bitcoin Consensus Rules vs Node Policy: A Developer Guide
Bitcoin consensus rules determine which blocks and transactions are valid when incorporated into the blockchain. Node policy determines which otherwise potentially valid unconfirmed transactions a node will accept into its mempool and relay. Confusing these layers can produce incorrect wallet and payment behavior.
Consensus: what blocks must satisfy
Consensus rules govern transaction structure, spending authorization, money creation limits, proof of work, block weight, and other conditions for accepting a block. A full node independently validates blocks against its rules. A transaction that violates consensus cannot become valid merely because a miner includes it.
Policy: what a node chooses to relay
Mempool and relay policy includes resource limits, fee-related admission rules, dust-related standardness rules, and replacement criteria. Policy is not identical across all Bitcoin software versions and node configurations. A transaction rejected by one node's mempool policy may still be consensus-valid if included in a valid block.
A practical example
A wallet broadcasts a transaction with an extremely low feerate. A node may refuse to relay it under local policy. That rejection does not by itself establish that the transaction would violate consensus if mined. Conversely, a transaction that is readily relayed is not guaranteed to be mined or to remain valid against future conflicting spends.
Why this distinction matters to API designers
Expose separate outcomes for local mempool acceptance, peer observation when available, and active-chain confirmation. When an RPC returns a policy-related rejection, preserve the rejection reason rather than labeling every failure an invalid signature. Avoid hardcoding one node's current relay policy as an immutable Bitcoin protocol rule.
Upgrades and network differences
Soft forks can tighten consensus rules under specified activation conditions. Relay policies can evolve independently of consensus changes. Mainnet, testnet, and regtest may also use different configuration and activation environments; always label which network your example targets.
References
- Bitcoin developer guide: https://developer.bitcoin.org/devguide/transactions.html
- Bitcoin Core documentation: https://bitcoincore.org/en/doc/
- Bitcoin Improvement Proposals: https://github.com/bitcoin/bips
