A zero-day bug has been discovered in the Bitcoin mining mechanism - ForkLog: cryptocurrencies, AI, singularity, the future

BTClogo# A zero-day bug has been discovered in the Bitcoin mining mechanism

Since launch, a computational error was present in the Bitcoin mining algorithm, allowing blocks to be mined at an extremely high speed. This was revealed by researcher Loïc Morel.

Satoshi made a mistake.

There has been a bug in Bitcoin mining since day one. It’s a simple calculation error by Satoshi that could be exploited to mine blocks at a crazy fast rate. This is one of the bugs that BIP-0054 (is under discussion) addresses. I… pic.twitter.com/GurNv3qKrZ

— Loïc Morel (@Loic_Pandul) April 11, 2026

According to the publication, the flaw is related to the difficulty adjustment mechanism

Every 2016 blocks (roughly every two weeks), nodes recalculate the target value so that one block appears every 10 minutes, regardless of miners’ computational power. For this adjustment, nodes measure the duration of the last period, compare it to the target value (2016 x 600 = 1,209,600 seconds), and then adjust the difficulty accordingly.

“The mistake lies precisely in these calculations. To measure the timing of blocks in the past period, the node compares the timestamp of the first block of the period with that of the last. It seems logical instinctively, but in fact, this is an error because there are only 2015 intervals between the first and last blocks, not 2016,” — explained Morel

If we denote t0 as the timestamp of the first block, and t2015 as the timestamp of the last, the node calculates the elapsed time as T = t2015 — t0. This results in 2015 intervals (from t0 to t1 > from t1 to t2 > … > from t2014 to t2015)

To obtain 2016 intervals, a different formula must be used: T = t2015 — t-1, where t-1 is the timestamp of the last block of the previous period.

This is called the “off-by-one” error. This bug introduces an error of approximately 0.05% toward slightly increased difficulty.

However, the real problem lies elsewhere. The flaw causes the adjustment periods not to overlap — the timestamp of the last block of one period is not considered when calculating the next.

Time manipulation

This gap makes a “time distortion” attack possible. Its principle is as follows:

  1. A miner controlling most of the computational power begins setting the minimum allowable timestamps for all blocks in the period (except the last).
  2. In the last block of the period, they artificially assign the maximum allowable timestamp.
  3. After the period ends, the difficulty is adjusted. Due to the attacker’s manipulation of timestamps, the measured period duration is longer than it actually was. As a result, the difficulty decreases.
  4. The attacker repeats a similar manipulation in the next period. Since the periods do not overlap, the first block of the second period of the attack can have a timestamp from the distant past, while the previous block has a timestamp in the future. This gap increases from period to period.

By repeating this process multiple times, an attacker could theoretically reduce the mining difficulty to a level where up to six blocks are created per second (instead of one every 10 minutes).

“The consequences would be terrible: temporary blockages become useless, the network is overloaded, the number of reorganizations increases, and transaction confirmations lose value. All this would allow an attacker to collect block rewards at a frantic pace,” — added the researcher.

The attack would be impossible if the first and last blocks of two consecutive periods matched.

How to fix this bug?

Morel noted that the issue can be fixed with a soft fork within BIP-0054.

The initiative involves ensuring that the first block of a new difficulty period has a timestamp that does not exceed the timestamp of the last block of the previous period by more than two hours.

This restriction restores “some form of continuity” between periods, prevents manipulation of time intervals, and makes the “time distortion” attack impossible.

Recall that in February, Castle Island Ventures partner Nick Carter predicted a “corporate takeover” of Bitcoin due to the quantum threat.

BTC0,33%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pin