Skip to content
stratum+tcp://stratum.testnet5.com:3333· user: your tb1 address · pass: xSetup guide →
Testnet5.com
Testnet5.com › BIP 54

BIP 54 explained: the Consensus Cleanup on Testnet5

BIP 54, by Antoine Poinsot and Matt Corallo, is a soft fork that fixes several long-standing weaknesses in Bitcoin's consensus rules [BIP 54]. Testnet5 enforces it from block 1 [BIP 95].

The four fixes

1. Timewarp

The timewarp bug lets a majority-hashrate attacker push the difficulty down and speed up blocks. BIP 54 says that in the worst case an attacker could bring difficulty to its minimum within 38 days [BIP 54]. The fix limits timestamps at difficulty-period boundaries:

  • At a height where N % 2016 == 0, the block's timestamp must be no more than 7,200 seconds (two hours) earlier than the previous block's.
  • At a height where N % 2016 == 2015, the block's timestamp must be at least the timestamp of the block 2,015 blocks earlier.

Testnet4 already used a timewarp fix with a 10-minute grace period. BIP 54 uses a two-hour grace period out of caution [BIP 54].

2. Slow-to-validate blocks

Specially crafted blocks can take minutes to validate on high-end machines and hours on low-end ones [BIP 54]. BIP 54 makes any non-coinbase transaction invalid if its inputs count more than 2,500 signature operations, which BIP 54 says cuts worst-case validation time by a factor of 40 [BIP 54].

3. 64-byte transactions

A transaction with exactly 64 bytes of non-witness data can be confused with an inner node of the Merkle tree, which can fool SPV proofs [BIP 54]. BIP 54 makes transactions whose witness-stripped size is exactly 64 bytes invalid. BIP 54 notes such transactions have been non-standard since 2019 and unused since 2016 [BIP 54].

4. Duplicate coinbase transactions

The coinbase transaction's nLockTime must equal the block height minus 1, and its nSequence must not be 0xffffffff [BIP 54]. This guarantees new coinbase transactions differ from old ones, so the old BIP 30 duplicate check is no longer needed, and it lets software read the block height straight from nLockTime [BIP 54].

What it means for miners and pools

Pool software builds the coinbase transaction, so it is the pool, not your ASIC, that must set the coinbase nLockTime and nSequence correctly and respect the boundary timestamp rules. A pool that gets this wrong produces invalid blocks. BIP 95 points out that Signet already enforces BIP 54 through Bitcoin Inquisition, but Signet does not let miners test their own software, which is one reason Testnet5 exists [BIP 95].

Status

BIP 54 is marked Complete in the bips repository [BIP 54]. Its Bitcoin Core implementation is pull request #35793, which implements BIP 54 without mainnet activation and is still open as of November 16, 2026 [PR #35793]. The Testnet5 pull request builds on it [PR #35861].

Mined some test coins? See the testnet markets on AltQuick.

AltQuick lists Bitcoin Testnet4 (TBTC4) and Bitcoin Signet (SBTC).

Open AltQuick

Sources