What Are Stale Blocks? Simply Explained

Crypto Bolts
5 min readMay 29, 2018

--

Data transfer between computers is quick, but not instantaneous. The farther away two computers are from each other geographically, the slightly longer it takes for data to transfer between those computers. Sometimes these communication delays cause conflicts on the Bitcoin Network that result in the production of Stale Blocks.

What Are Stale Blocks?

Stale Blocks are blocks that are no longer part of the current best blockchain because they were overridden by a longer chain.

Longest Chain Wins

The Bitcoin blockchain is put together with the underlying rule that the longest chain wins. We can have multiple chains circulating around the Bitcoin Network because of the delays caused by large geographical separations of nodes.

If there are multiple chains competing on the network, each one is referred to as a different version of truth. The version of truth that can get blocks appended to it quicker, thereby becoming longer, serves as the current best blockchain for Bitcoin. The transactions on the current best blockchain are those that are reflected in all Bitcoin user account balances.

— — — — — —

Connecting back, stale blocks are successfully mined, valid blocks whose transactions were not realized because they were part of a version of truth that lost the race of being the longest chain.

How Does a Block Go Stale?

Bitcoin at its core is a network of connected computers, or nodes, that are located all around the globe. When a Bitcoin miner successfully finds a valid next block to append, that block gets propagated to the entire network, but first reaches the nodes that are geographically closest to where that block was discovered. It doesn’t take long for every Bitcoin node on the network to receive the propagated block. However, if two miners located on polar opposite ends of the globe successfully find a valid next block at the same time, we have a conflict on the network.

Here’s how the situation might play out: Imagine we have a Bitcoin miner in India and a Bitcoin miner in Canada.

Say these two miners successfully find a valid next block at the same time or within seconds of each other. The Indian miner’s block starts propagating to nodes that are geographically closer to India while, at the same time, the Canadian miner’s block starts propagating to nodes that are geographically closer to Canada.

This is a conflict because the Bitcoin Network now has two different versions of truth spreading around the nodes. Both proposed blocks are valid, but only one can be appended.

The surrounding nodes store the version of truth that they receive on their copy of the blockchain and start mining on top of it to solve for the newest block. At this point it becomes a race for which version of truth can get blocks appended quicker.

Say now, a 3rd miner from China, who received India’s block first, successfully mines the next block.

That Chinese node then announces this upgraded version of truth to the network and it starts to propagate.

Eventually (quite quickly) the Indian/Chinese version of truth will reach the nodes that originally accepted Canada’s version of truth. Those nodes will then need to decide which version of truth to mine on top of, at which point they will select the Indian and Chinese’s version since it is the longer chain.

After switching to India/China’s version of truth, the nodes in America drop Canada’s block and continue to build on the longest, best current version of the blockchain. Canada’s block then becomes a stale block; it was part of the blockchain temporarily on a select group of nodes’ records but was overridden.

All miners are now on the same page and mining continues on the longest chain, until another split on the network occurs.

What Happens When a Block Goes Stale?

If you had a wallet running on the nodes that originally accepted Canada’s version of truth, it would show (before correction) that the transactions in Canada’s block are part of the blockchain. After that version of truth is overridden, however, those transactions are returned to the mempool to be picked up in a future block. Stale blocks are usually not a serious threat to the network but they do leave room for fraud and attacks on the network.

For example, a sender who’s transaction was a part of a stale block could technically endorse a second transaction to spend those same funds before the original transaction reprocesses. They could bolster this second transaction with a larger specified transaction fee so that miners are more likely to include the second spend in an upcoming block before the original transaction gets reprocessed. Although this is not a common occurrence, it’s in the best interest of blockchain networks to pace themselves in such a way to avoid the production of stale blocks.

Key Takeaways

  • Communication between computers takes time and physical distance is a key factor affecting that timing
  • Communication delays can cause conflicts on the Bitcoin network, resulting in Stale Blocks
  • Stale Blocks are blocks that are part of an alternative chain that was discarded from the current best blockchain
  • Stale Blocks are produced when multiple versions of truth compete on the network

--

--

Crypto Bolts

Your Source of Clear Explanations For All Things Crypto