54
BIP54
Consensus Cleanup

Interactive learning

BIP54 problem simulator

Each scenario starts with a short guided lesson, then a playground. Follow the steps, move the knobs, and toggle BIP54 to see the difference.

Loading simulator…

What each scenario shows

The four consensus weaknesses BIP54 closes, and what the labs above demonstrate.

Timewarp attack

Stops miners from manipulating timestamps across difficulty periods to drive difficulty toward the minimum.

Risk:
A majority-hashrate attacker can bring difficulty down to its minimum within 38 days, arbitrarily raising the block rate and stealing subsidy from future miners.
BIP54:
Require a minimum timestamp for the first block of each difficulty period, plus a non-negative period duration.

Slow-to-validate blocks

Legacy scripts can be crafted so a valid block takes several minutes to verify on high-end hardware, and up to a few hours on lower-end devices.

Risk:
Creates DoS pressure, favors large miners, and pushes out node operators on consumer hardware.
BIP54:
Cap legacy signature operations at 2,500 per non-coinbase transaction (~40× better worst-case validation).

Merkle tree weakness

A 64-byte transaction is the same size as an internal Merkle node, enabling forged SPV inclusion proofs.

Risk:
Lightweight wallets and SPV verifiers can be tricked into accepting a payment that never existed on-chain.
BIP54:
Make witness-stripped 64-byte transactions consensus-invalid (also specified in BIP53).

Duplicate coinbase risk

BIP30 prevents duplicate txids, but early BIP34 violations mean explicit BIP30 checks must return at block 1,983,702.

Risk:
Extra validation cost forever, and designs like Utreexo struggle with BIP30-style checks.
BIP54:
Require coinbase nLockTime = height − 1 (and nSequence ≠ 0xffffffff) so uniqueness is built-in.