Crypto Basics

Time Travelling with Satoshi

The early days of Bitcoin must have been uncertain times for Satoshi, and at 17 seconds past 1:12 am UTC on January 30th, 2009 something strange happened. Block 2298 was mined and then 46 seconds later block 2297 was mined. Less than a month after the Genesis block, Bitcoin had warped time, with a later block appearing before an earlier block. This is not the only incident of time travelling blocks. The timing of 2.6% of the 534,350 blocks mined until July 30th, 2018 are out of order, and 223 blocks have been mined at exactly the same time. What is going on?

Of course, the problem is not that Bitcoin is wreaking havoc with the laws of physics to enable blocks to turn up out of order. Rather, block times are being misreported. It is the block height, the number of blocks since the Genesis block, that is the definitive record of the blockchain’s ordering, not the block time. The Bitcoin source code allows a block time to be up to 2 hours ahead of the median time of the previous 11 blocks. This timestamp window is a grace period to account for differences in computer clocks. Due to this, a block time error can occur if a block at a lower height reports a timestamp that is later than the timestamp of a block at a greater height, or vice-versa.¹ The length of this error is the difference between these two timestamps.

Block time errors may not seem much of an issue. Of the 44 Bitcoin forks occurring until May 2018, there is no ‘Bitcoin Time’ that solves this problem. However, it raises a challenge when trying to compare transactions across blockchains as time is a natural ordering to sync by. (It is also deeply upsetting to a data scientist if their time series is not increasing.)

So are there any patterns to Bitcoin’s block time errors? We used data from btc.com to check whether date, mining pool, block reward, transaction fees, transaction count, block size, mining difficulty, or hash power (where data is from https://www.blockchain.com/) had any influence on block time errors.

Block time errors seem to evolve with trends in mining, although there is no clear overall driver. In 2009, Satoshi and the earliest Bitcoiners mined on their laptops, with an average error rate of 2%. These miners, and others after them, did not report their identities in their blocks, so they are unnamed miners, shown by the light blue area in the chart below.

Between 2010 and 2012, when mining switched to GPUs and later FPGAs, error rates were relatively low except when there were large increases in hash power, which indicates a surge of new mining rigs. From 2012, named mining pools, shown by the dark blue area in the chart below, started to be established and the error rate climbed, possibly reflecting challenges in the setting up of these pools.

By mid-2013, mining pools, some deploying ASICs, came to dominate and unnamed miners declined. This seems to have driven a reduction in time errors. However, unnamed miners were still generating errors. Around mid-2014, nearly half of blocks from unnamed miners had a time error. This contributed to the overall peak in the error rate in April 2014, when 8.5% of all blocks had a time error.

Bitcoin mining has become increasingly professional since 2014, as mining rigs have become more specialized and the value of bitcoin has increased. This professionalism is reflected in the declining error rate from 2014. Since March 2016, less than 1% of blocks per month have had a time error.

Most block time errors are small, as the histogram below shows. 35% of block time errors are no longer than one minute, and 93% of errors are no longer than 10 minutes. The largest error is nearly 119 minutes long, close to the limit of the grace period in the protocol.

The average length of errors has decreased over time, as the chart below shows, from a yearly average of between 4 to 7 minutes prior to 2014, to between 3 to 4 minutes between 2014 and 2016, to an average of 26 seconds in 2018 so far.

It is not possible to definitively attribute an error to a particular mining pool. When a block time error occurs, it is unclear whether a lower block in the chain is reporting a late timestamp, or if a higher block in the chain is reporting an early timestamp.² As sequential blocks are often mined by different pools, a different set of miners would be responsible for errors if we assume lower blocks are always late, than if we assume higher blocks are always early. However, our findings are similar across these assumptions.

Block time errors appear to be fairly evenly distributed across named mining pools. Unnamed miners account for over 40% of errors, with 61 of the 97 named mining pools responsible for the other 60%. The mean error rate for these 61 mining pools is four block time errors every 100 blocks, and the median error rate is two errors every 100 blocks. The mining pools responsible for the largest number of errors have also often mined the largest numbers of blocks, so their error rate per 100 blocks is close to the average.

The total length of block time errors adds up to nearly 38 days. This is less evenly distributed as larger mining pools tend to have more errors as noted above, and some of these larger pools have longer errors. As shown in the charts below, unnamed miners are responsible for 45-50% of the total length of errors, depending on whether we assume it is always the lower block that is late, or always the higher block that is early. Three mining pools consistently have the longest total error time: GHash.io, BTC Guild and Eligius. GHash.io and BTC Guild are no longer operating, while Eligius last declared it mined a block in 2017.

Many people in crypto talk about ‘bitcoin days’, which feel like weeks in realtime. However, this does not seem to be the explanation for block time errors. The blockchain is not riddled with wormholes, nor do miners appear to be actively causing confusion. These errors appear related to developments in mining technology and organisation over the last ten years, but not related to particular mining pools. They are often short and are becoming shorter and less frequent. Yet the prevalence of block time errors is a reminder of the subtly and strangeness of blockchains: that the block height is the true record of when things happen, not block time. Satoshi did not need to invent time travel, instead Satoshi invented a new version of time.

_____________________________

¹ In our analysis, we just consider time errors between adjacent blocks. There are some cases where a block’s timestamp is later than the timestamps of several blocks that succeed it in the chain.

² There can be more complicated scenarios, for example where multiple blocks in a row are early or late. See here for a thorough treatment of these issues.