•
7 min read

Shorten the window

Table of Contents

The short version: shorten the retarget window from 2,016 blocks to 144, and remove the four-times cap. On the chain’s own data that cuts what a week-long raid pays by 92 percent. The rule then ends the raid in a day instead of not at all. The price is a difficulty that wobbles more, and a timestamp trick worth a few percent.

What a hash renter wants

A hash renter looks for a chain whose difficulty is far below the hash about to arrive. It points everything it has at that chain at once. It mines until the difficulty catches up, sells, and moves on. The rule that catches up is the retarget rule. This post is about how fast it should be.

The rule today

This chain pays 3.125 XBT a block and aims at one block every ten minutes. Every 2,016 blocks it measures how long the last 2,016 took and sets a new difficulty. One change can move difficulty at most four times up or four times down. That is bitcoin’s rule, unchanged here (pow.cpp, lines 84 to 88). It has reset seven times since August 30. Three resets in a row hit the cap in September. The last two moved 1.35 and 1.10 times.

The window is counted in blocks, not days. When four times the hash arrives, 2,016 blocks take three and a half days instead of fourteen. When that hash leaves, the next 2,016 blocks take 56 days. The rule is fast on the way up and slow on the way down. Both halves pay the renter.

What we ran

We took the hashrate our node saw from August 30 to October 16, block 977,607. We replayed it under forty versions of the rule: eight window lengths, from 2,016 blocks down to 24. At each window the step at each reset was limited to four times (today’s rule), to two, one and a half or one and a quarter times, or not limited at all. The tighter limits are there to test the argument that a tight cap blunts a timestamp trick. They lose on every other number. Then one raid under each version. The chain sits at today’s difficulty. Four times the hash arrives, stays seven days, and leaves. Then a hundred days of constant hash with luck, twenty times over, to measure wobble. Then one miner with a quarter of the hash playing the two timestamp tricks the rules allow. Then selfish mining, where a miner hides the blocks it finds and releases them later to knock everyone else’s off the chain. The September posts priced it.

The table

A raid of four times the hash for seven days, no cap on the step. Coins are XBT above the 144-a-day schedule. The last column is how often a reset moves difficulty more than a quarter with no change in hash. Luck alone.

Window, blocksThe raid week paysDays to recover after it leavesResets moved a quarter by luck
2,0165,906600 in 100
1,0083,122310 in 100
5041,559160 in 100
28889191 in 200
14444454 in 100
72222315 in 100
36109231 in 100
2475239 in 100

Recover means difficulty is back down and the miners who stayed are back to full pay. The first two columns fall with the window. The third rises. At 144 blocks the raid pays a thirteenth of what it pays today. The chain is back to pace in five days. One reset in 26 moves a quarter by luck. At 72 blocks the raid pays half of that, and one reset in seven moves a quarter by luck. We stop at 144.

The cap

A reset can only move difficulty as far as the hash moved during the window it measured. Over a fourteen-day window a renter can pile in far more than four times the hash. That is why three resets in September pinned at the cap. Over a one-day window the hash would have to quadruple in a single day for the cap to bind. A 4x raid landing all at once asks for exactly a 4x step, and the cap allows it. So at 144 blocks the four-times cap never touches a raid of four times or less. Shortening the window makes the cap almost moot.

Where the cap still matters it hurts. On an 8x raid, or a sudden drop to a tenth of the hash, no cap beats a cap of four. Every tighter cap is worse in every table, on the way up and on the way down. It holds the window open for the renter and holds the stayers down after it leaves. A cap of 1.25 on today’s window would have paid four times what the chain paid since August 30. The one job a tight cap does, blunting a timestamp trick, matters only at windows of 36 blocks or less. The luck column already rules those out. Remove it.

The cost

A faster rule believes a lie faster. Two lies are on the table. Luck: at 144 blocks, difficulty moves 12 percent a step from luck alone, against 3 percent today. Timestamps: a miner with a quarter of the hash dates the last block of each window two hours ahead. It dates the first block of the next window as early as the rules allow. That adds about 3 percent to the chain’s emission. With 40 percent of the hash, 5 percent. Today’s rule runs 13 percent over schedule by itself, from its own lag. That is 163 blocks a day since September 23. zawy’s 60-second limit on future timestamps, his recommendation on issue 89, would cut the trick to nothing. And the block-hider’s wait falls from 33 days to 2.6. That is how long a selfish miner with a third of the hash must hide blocks before the trick pays. That is the bill for the fix. The raid is the bigger bill.

Changing the window is a hard fork, as a moving average would be. It needs a flag day, like the change already set for September 1, 2027. The rule names nobody. It changes what a raid pays, not who may mine.

The full tables and the code are in the repo. Ask and we will send them. Corrections welcome.

Discuss this post on X

Saved you an hour? Tip the node and the clankers.