The Bitcoin Testnet3 Epoch 724 Blockstorm

Brandon Curtis
Feb 18 · 5 min read
The 1999 Leonid meteor shower. (via NASA/Ames Research Center/ISAS/Shinsuke Abe and Hajime Yano)

The Testnet3 20 Minute Rule

Bitcoin Testnet3 has a feature that ensures the testnet is still able to mine blocks if its largest miners suddenly abandon it. From Bitcoin Wiki: Testnet,

Normal Operation

A quick inspection of some recent blocks from the Testnet3 blockchain using the python-bitcoinlib library shows this feature in action:

import bitcoin
import bitcoin.rpc
from datetime import datetime as DT
bitcoin.SelectParams(‘testnet’)
proxy = bitcoin.rpc.Proxy()
for blocknum in range(1457000,1457010,1):
block = proxy.getblock(proxy.getblockhash(blocknum))
ntime = DT.utcfromtimestamp(block.nTime).isoformat()
print(f'block #{blocknum}:{ntime}, diff {block.difficulty}')
block #1457000: 2019–02–13T12:28:50, diff 14570951.397598663
block #1457001: 2019–02–13T12:46:41, diff 14570951.397598663
block #1457002: 2019–02–13T12:57:45, diff 14570951.397598663
block #1457003: 2019–02–13T13:01:01, diff 14570951.397598663
block #1457004: 2019–02–13T13:21:02, diff 1.0
block #1457005: 2019–02–13T13:28:02, diff 14570951.397598663
block #1457006: 2019–02–13T13:48:03, diff 1.0
block #1457007: 2019–02–13T14:08:06, diff 1.0
block #1457008: 2019–02–13T14:27:08, diff 14570951.397598663
block #1457009: 2019–02–13T14:43:44, diff 14570951.397598663

Blockstorm!

But something different happens in a blockstorm:

import bitcoin
import bitcoin.rpc
from datetime import datetime as DT
bitcoin.SelectParams(‘testnet’)
proxy = bitcoin.rpc.Proxy()
for blocknum in range(1457563,1457573,1):
block = proxy.getblock(proxy.getblockhash(blocknum))
ntime = DT.utcfromtimestamp(block.nTime).isoformat()
print(f'block #{blocknum}:{ntime}, diff {block.difficulty}')
block #1457563: 2019-02-18T05:43:26, diff 14570951.397598663
block #1457564: 2019-02-18T05:47:15, diff 14570951.397598663
block #1457565: 2019-02-18T05:57:25, diff 14570951.397598663
block #1457566: 2019-02-18T06:08:26, diff 14570951.397598663
block #1457567: 2019-02-18T06:28:33, diff 1.0
block #1457568: 2019-02-18T06:28:32, diff 1.015794531589063
block #1457569: 2019-02-18T06:28:32, diff 1.015794531589063
block #1457570: 2019-02-18T06:28:32, diff 1.015794531589063
block #1457571: 2019-02-18T06:28:34, diff 1.015794531589063
block #1457572: 2019-02-18T06:28:34, diff 1.015794531589063

A Quirk in Difficulty Adjustment

Bitcoin is designed to keep blocks coming at a regular pace, even as miners change the amount of hashpower that they apply to the chain. This is accomplished by adjusting the difficulty parameter every 2016 blocks.

The Blockstorm of October 2018!

How Often Does This Happen?

Quite often:

Tonight’s blockstorm was the first in 2019; there were 7 in 2017 and 6 in 2018.

What Are The Implications?

A few times a year, we get 3 to 8 days of unusually fast blocks. In the moments right after a blockstorm begins, several blocks may be mined per second.

Testnet3 hashrate is usually split between several different miners (via SoChain)
Tonight, a single fast miner dominates! (via SoChain)

How Do We Fix It?

A fix would require a hard fork. Testnet3 miners and users—wallets, block explorers, faucets, testnet demo apps—would need to switch to a version of the Bitcoin software that fixes this quirk in the difficulty calculation. If some miners and users continue to use the old software, they would continue off on a different fork of the Testnet3 chain. This would require lots of coordination!

RADAR

Building products for our next financial system

Brandon Curtis

Written by

drinker of coffee

RADAR

RADAR

Building products for our next financial system