Consensus cleanup soft fork
Also covering BIP54
Consensus cleanup soft fork is a proposal to address several issues in Bitcoin’s consensus rules that date back to the original version of Bitcoin released in 2009.
After a prior draft in 2019 was deferred, renewed efforts since 2023 substantiated into a concrete proposal, BIP54: Consensus Cleanup. The soft fork proposal advocates for fixing the following four issues.
-
● Time warp bug: an off-by-one error in the difficulty adjustment algorithm permits a majority hashrate attacker to arbitrarily increase block cadence. This is mitigated by limiting the permitted timestamps for the first block in difficulty periods and requiring that an entire difficulty period has a non-negative duration.
-
● Slow-to-validate blocks: attackers may use uncommon script patterns to compose blocks that are prohibitively expensive to process. These forms of malicious transactions are prevented by introducing limits on signature operations that curb this malicious use but far exceed organic uses.
-
● Merkle tree weakness: the construction of the merkle tree on a block’s transactions treats transactions with witness-stripped sizes of 64 bytes indistinguishably from inner nodes. Forbidding such transactions prevents two ways of misrepresenting the content of a valid block.
-
● Duplicate transaction vector: Some early coinbase transactions exhibit patterns that would allow them to be replayed in future blocks. Requiring that the locktime of coinbase transactions is set to a specific value based on the block height enforces that future coinbase transactions are unique without needing to enforce BIP30 checks for those blocks.
Primary code and documentation
Optech newsletter and website mentions
2026
- Bitcoin Inquisition adds an implementation of the BIP54 consensus cleanup soft fork rules
- Addressing remaining points on BIP54
- Discussion of BIP54’s timewarp fix and its impact on the 2106 block timestamp overflow issue
2025
- BIP54 implementation and test vectors
- Bitcoin Core #32521 makes legacy transactions with more than 2500 sigops non-standard
- BIPs #1760 merges BIP53, which specifies a consensus change to forbid 64 byte transactions
- Bitcoin Core #32155 updates the internal miner to comply with consensus cleanup requirements
- BIPs #1800 merges BIP54, which specifies the consensus cleanup soft fork proposal
- Draft BIP published for consensus cleanup
- Announcement of updates to the consensus cleanup soft fork proposal
2024
- Discussion about fixing Murch-Zawy time warp and duplicate transactions in consensus cleanup
- Discussion about mitigating merkle tree vulnerabilities in the proposed consensus cleanup soft fork
- Notes from Bitcoin developer discussion about consensus cleanup
- Question: where exactly is the ‘off-by-one’ difficulty bug and how does it relate to time warp?
- Renewed discussion of consensus cleanup soft fork
2020
2019
- 2019 year-in-review: consensus cleanup soft fork proposal
- CoreDev.tech discussion: cleanup soft fork
- Consensus cleanup discussion: codeseparator & sighash types
- Consensus cleanup background
- Cleanup soft fork proposal
See also
Previous Topic:
Compact block relay
Next Topic:
Countersign