Glossary

Testnet4

Testnet4 is Bitcoin's newest test network, launched in 2024 to replace the compromised Testnet3 with improved security against spam.

Key Takeaways

  • Testnet4 is Bitcoin's fourth test network, specified in BIP-94 and supported in Bitcoin Core v28.0 and later. It replaces Testnet3, which had become unreliable due to difficulty reset exploits and block storms.
  • The key fix addresses a bug in the difficulty adjustment that allowed the last block of a difficulty period to use minimum difficulty, resetting the next period's target and enabling spam-level block production.
  • Testnet4 remains permissionless and uses proof of work, making it the closest test environment to mainnet conditions. Developers who need predictable block production should consider Signet instead.

What Is Testnet4?

Testnet4 is Bitcoin's newest public test network, designed for developers to experiment with transactions, smart contracts, and protocol features without risking real funds. Specified in BIP-94 by Fabian Jahr and first supported in Bitcoin Core v28.0 (released October 2024), Testnet4 started a fresh blockchain with consensus rule fixes that address the exploits that made its predecessor, Testnet3, increasingly unusable.

Bitcoin's test networks have a long history of degradation. Testnet3, launched in 2012, suffered from a bug in its special minimum-difficulty rule. This bug allowed miners to trigger full difficulty resets, producing thousands of blocks per minute in so-called "block storms." The resulting chaos made Testnet3 coins tradeable for real money and the network unreliable for development work. Testnet4 was created specifically to fix these problems while preserving the permissionless, proof-of-work nature that makes testnets valuable for realistic testing.

How It Works

Testnet4 follows all of Bitcoin's mainnet consensus rules with three targeted exceptions designed to keep the network functional for developers.

The 20-Minute Minimum Difficulty Rule

Like Testnet3, Testnet4 includes a rule that allows a block to use the minimum difficulty target (nBits = 0x1d00ffff) if its timestamp is more than 20 minutes after the previous block. This ensures developers can always mine blocks even without significant hashrate, preventing the network from stalling if miners leave.

The critical fix: in Testnet4, the first block of each difficulty epoch (every 2,016 blocks) must always use the real calculated difficulty. On Testnet3, the last block of a difficulty period could use minimum difficulty, which then skewed the difficulty calculation for the entire next period, resetting it to 1. This was the root cause of block storms.

Block Storm Prevention

Testnet4's difficulty adjustment algorithm uses the first block of the previous period as its reference point rather than the last block. Combined with the restriction on minimum-difficulty blocks at period boundaries, this prevents a single easy block from cascading into a full difficulty collapse. The adjustment factor remains clamped between 1/4x and 4x, the same as mainnet.

Time-Warp Protection

Testnet4 adds a constraint on the first block of each difficulty period: its timestamp cannot be more than 600 seconds before the last block of the preceding period. This prevents the time-warp attack, where miners manipulate block timestamps to artificially lower difficulty. This fix was proposed as part of the Great Consensus Cleanup for mainnet and was first deployed on Testnet4 as a proving ground.

Soft Forks Active from Genesis

All soft forks that were active on mainnet as of May 2024 are enforced from Testnet4's genesis block. This includes SegWit, Taproot, and all prior upgrades. Developers do not need to wait for activation heights or simulate fork transitions: every feature is available immediately.

Network Parameters

Testnet4 uses distinct network parameters to avoid confusion with other networks:

ParameterTestnet3Testnet4
P2P port1833348333
RPC port1833248332
Message start0x0b1109070x1c163f28
Data directorytestnet3/testnet4/
Bitcoin Core flag-testnet (removed in v30.0)-testnet4

Connecting to Testnet4

Bitcoin Core v28.0 or later is required. Start the node with the -testnet4 flag:

# Start Bitcoin Core on Testnet4
bitcoind -testnet4 -daemon

# Or set it in bitcoin.conf
testnet4=1

# Interact via CLI
bitcoin-cli -testnet4 getblockchaininfo

The node stores data in a testnet4/ subdirectory within your Bitcoin data directory. Initial block download must complete before the node is fully usable. Testnet3 data should be discarded: it is not compatible with Testnet4.

Testnet4 vs Signet vs Regtest

Bitcoin developers have three test networks to choose from, each suited to different workflows. Choosing the right one depends on what you are testing. For a detailed comparison, see the Testnet4 vs Signet developer guide.

FeatureTestnet4SignetRegtest
Block productionProof of work (permissionless)Signed blocks (permissioned)On demand (local only)
Block timesVariable (targets 10 min)Consistent (~10 min)Instant
RealismClosest to mainnetControlled environmentIsolated sandbox
Best forIntegration testing, mining softwareCI pipelines, app developmentUnit tests, local development
Coin availabilityFaucets, miningFaucetsSelf-generated

Signet produces blocks at reliable intervals because a trusted signer controls block creation, making it ideal for automated testing. Regtest runs entirely locally with no network peers, perfect for unit testing where you generate blocks on demand. Testnet4's permissionless proof of work is the closest simulation of mainnet conditions, making it the right choice for testing mining software, fee estimation, and mempool behavior under realistic constraints.

Why It Matters

A reliable test network is critical infrastructure for Bitcoin development. When Testnet3 became dominated by block storms and speculative coin trading, developers lost their primary sandbox for safely testing transactions, wallet behavior, and protocol upgrades. Many migrated to Signet, but Signet's permissioned model does not replicate the adversarial conditions developers encounter on mainnet.

Testnet4 restores a permissionless testing environment where anyone can mine blocks, submit transactions, and test applications. This matters for wallet developers building on layer-2 protocols like the Lightning Network, where realistic fee markets and block timing affect channel management and routing decisions. For developers building with the Spark SDK, test networks provide a safe environment to validate transaction flows and integration behavior before deploying to mainnet.

Risks and Considerations

Remaining Minimum-Difficulty Issues

The 20-minute minimum-difficulty exception, while fixed to prevent full period resets, still allows CPU miners to produce blocks when the network is quiet. In practice, miners have exploited this rule to create blocks that skip transactions entirely, reducing network utility during low-activity periods. Discussions on Delving Bitcoin have explored disabling the rule entirely or replacing it with a higher minimum difficulty floor.

Testnet Coins Have No Value

Testnet4 coins (tBTC) are explicitly worthless and should never be bought or sold. One of Testnet3's failures was that its coins acquired market value, distorting network behavior. Testnet4's fresh chain and consensus fixes aim to prevent this, but there is no technical mechanism that can fully stop people from trading test coins.

Ecosystem Migration

Not all tools and services have migrated from Testnet3 to Testnet4. Some block explorers, faucets, and third-party APIs may still default to Testnet3 or lack Testnet4 support. Developers should verify that their entire toolchain supports Testnet4 before relying on it.

Future Testnet Evolution

A draft proposal (BIP-95) for Testnet5 has been discussed in the Bitcoin development community. This proposal would further restrict the minimum-difficulty rule and adjust other parameters to improve long-term network stability. Developers should monitor the Bitcoin Optech testnet topic for updates on test network evolution.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.