Homework on Stale Blocks
1. What happens in the bitcoin network when two miners solve a block at the same time?
Blocks first reach the nodes in the network that are closest to them geographically.
In this case, where we have two blocks being produced and appended to the blockchain in different parts of the world, we temporarily have two versions of the truth.
2. What is a stale block?
These arise through the process outlined in the previous question, but they get dropped by the network before they are able to be confirmed, resulting in the transactions that they contained being returned to the mempool, in preparation for eventually being added to a later block.
3. How do stale blocks occur?
The next block can only append to one of the two versions of the blockchain, rendering the other block redundant (this becomes the stale block), whereas the longest chain remains, as governed by the bitcoin protocol.
4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
This is because the new block could potentially become a stale block, if another block was produced at the same time elsewhere in the network - if this was to happen, the transaction would be returned to the mempool, which, upon being added to a fresh new block, would allow for that transaction to be double spent.
In the bitcoin network, transaction must be verified six times before it is considered confirmed - this means that by that point, six blocks sharing a chain of hashes linking back to the block which contains the transaction have successfully been appended to the blockchain.