Homework on Stale Blocks

Hi Ivan,
There will be two versions of blockchain circulated, and propagated.
The stale block is the one which will finally be NOT accepted by the network.
IT occur when two miners solves a block at the same time, and one version will become a “truth”, and second will not be accepted, and therefore thrown away.
This is why it is important to wait for more than one block in the blockchain to be confirmed. Generally, approx 6 blocks chain is recommended as a prooved truth.

1 Like

Since the coinbase or block reward is also part of the stale block it gets dropped as well. Its basically just a special transaction without inputs :slight_smile:

1 Like

The blockreward (coinbase tx) is unspendable for 100 blocks in case it would result in a stale block.
So miners who successfully mined a block and this block ended up as a stale block, don’t get the reward.

2 Likes
  1. What happens in the bitcoin network when two miners solve a block at the same time?
    When two miners solve a block at the same time, the network ‘forks’ and at that time there are two versions of the blockchain with the two valid blocks at the end of each one. This situation is not permanent and the next block will be critical in deciding the valid strain of the blockchain. Whichever version of the blockchain receives the next block would most likely be accepted, but this would be due to consensus; the majority of the network acknowledging the winning block. Afterwards, the blocks on the competing chain would be removed, and the transactions returned to the Mempool.
  2. What is a stale block?
    A stale block is a block that has been discarded/dropped from the blockchain.
  3. How do stale blocks occur?
    Stale blocks occur when there is a forked strain of the blockchain that was not confirmed, eventually. These blocks would be dropped and considered ‘Stale’. Another term used for Stale Blocks are “Orphaned Blocks”.
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
    It is important to wait for more than one block to be confirmed because there is always the possibility that your transaction(s) are part of a version of the blockchain that be considered invalid due to the chain splitting at one point and loosing Consensus. Best practice has been advised to wait for the confirmation of six(6) blocks after your block confirmation.
1 Like

My Answers:

  1. They will both be approved. but once another miner comes along and attach itself to one of the blocks… Making that chain longer and likely with more POW. Then that chain is then accepted and the other one will be dropped = Stale
  2. A drooped or removed block
  3. If they don’t get 6 confirmations, they were likely dropped/ stale
  4. 6 confirmations are needed in order to make sure a block will not be dropped
1 Like

Homework on Stale Blocks - Questions

  1. What happens in the bitcoin network when two miners solve a block at the same time?

If two different blocks are mined at the same time, by different miners, there can temporarily exist more than one chain. The different chains can then be built on, by different miners. This will continue until the longest chain is sufficiently distributed in the network. All the nodes will then automatically change their truth to consist of the longest chain, as soon as they receive it. The longest chain is “measured” by the total difficulty of the blocks in the chain (amount of work put into it), not the number of blocks.

  1. What is a stale block?

A stale block is a block that has been involved in a chain on parts of the network, but has since been “cancelled”, after another longer chain has replaced it. Stale blocks are also called orphaned blocks.

The transactions of the stale blocks will fall back into the mempool, if they have not been already also confirmed in any of the blocks in the longest chain.

  1. How do stale blocks occur?

Stale blocks occur when one “version” of the blockchain (the longes one) replaces chains that have been temporarily built, as a result of different parts of the network building on different chains. This can happen when two or more miners mine a new block at the same time, and distribute it to they local “area” of the network. One of the chains will then result in stale blocks, as soon as the longest chain is sufficiently distributed.

  1. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?

The 10 minute time target for the bitcoin blockchain is set to minimize the risk for stale blocks to occur, and to make sure the longest chain is distributed in the network before a new block is added.

This is also why it’s important to have more than one confirmation of a transaction before it can be seen as completed.

1 Like
  1. Two chains are created and network folks temporarily.

  2. A block that is rejected, not chosen to go forward and are returned to the mempool.

  3. Stale blocks occur when the smaller chain of the folk is rejected by the network.

  4. It is important to wait because if a transaction ends up in a stale block the transaction will be rejected and sent back to the mempool.

2 Likes

Thanks for the reply! I was thinking there could end up being more than 21 million bitcoin otherwise.

Thanks for the reply! How does one know if their transaction was part of a stale block? How common are stale blocks?

Stale block occurs as soon as one chain gets more PoW and is propagated through the entire network. The 6 confirmations is just a rule of thumb we take to make sure our transaction is not part of a stale block :slight_smile:

2 Likes

At the time a fork happens there is no way of knowing if your transaction is going to be part of a stale block. When this kind of fork happens both chains are considered valid on different parts of the world and are “competing” with each other.
These forks are not that common, but there has been a stale block that occurred a while ago:

2 Likes

Thanks, seems like it must happen only a few times a year. That’s very low odds of being included in a stale block.

  1. When two miners solve a block at the same time both blocks are valid in the system for at least 6 blocks. Once all miners are sync the longest blockchain remains and the shorter block becomes stale, meaning all transactions are returned to the mempool from that block.

  2. A block that is valid but is shorter than other chains has become stale and is no longer part of the bitcoin blockchain.

  3. When there are two valid blocks in the system but only the longest remains in the blockchain, the smaller block with less POW becomes stale.

  4. It is important to wait 6 blocks for confirmation to ensure your transaction is not dropped in a stale block.

1 Like

That is true, but if there are no rules to handle these edge cases, the forks would never be solved thus breaking the chain

1 Like

Theoretically two chains could carry on forever in case if blocks would continue to be added on both chains. However with more blocks this becomes less and less possible in practice. The rule of thumb of 6 blocks or confirmations the probability of this being the case basically drops to 0. :slight_smile:

1 Like
  1. You get 2 versions of the blockchain.
  2. A block that was once part of the blockchain but then removed because another version of the blockchain got accepted instead
  3. When the blockchain have two versions of the blockchain active at the same time and then one blockchain got accepted as the real one. The other blockchains deviant blocks tx’s is removed and put back to mempool.
  4. Becsuse of above possibility to happen.
1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time? other miners will add new blocks to each of the blocks and continue to propagate the blockchain, in order to determine which chain is the valid blockchain, the longest chain will be accepted as the correct chain and the blocks that have been added to the second chain are dropped and the transactions returned to the mempool.
  2. What is a stale block? a block that has been dropped from the blockchain and transactions returned to the mempool because there is a longer blockchain which is accepted by the other nodes / miners as the correct version
  3. How do stale blocks occur? stale blocks occur when a longer block chain is adopted that does not contain the blocks that are referred to as stale
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction? until there are at least six confirmations, it is possible for blocks to be orphaned and transactions returned to the mempool.
1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time?

Temporarily we have 2 versions of truth, a problem that eventually will be solved when the next block(s) are added to the blockchain.

  1. What is a stale block?
    A block that was added to the blockchain initially but later it was dropped because it was not part of the longest chain (difficulty wise)

  2. How do stale blocks occur?
    When two miners find the new block at the same time and broadcast it to the network, eventually the last block in one of these 2 parallel blockchains will be dropped, thus occurring a stale block.

  3. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
    To make sure your transaction is final and the block that it belongs to can no longer be dropped

1 Like

EXACTLY! Good thinking!!!

2 Likes
  1. What happens in the bitcoin network when two miners solve a block at the same time?

    • Both the blocks are valid and the transactions get propagated through the network.
    • The longest chain is then accepted as the original.
  2. What is a stale block?

    • It is a block that has been rejected by the network and all the transactions in this specific block gets sent back to the mempool.
  3. How do stale blocks occur?

    • Stale blocks occur when two miners solve a block at the same time and one of the blocks that were mined get rejected.
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?

    • Because the transaction you sent might be in the stale block and returned to the mempool.
    • When receiving a transaction the same might occur where that incoming transaction get rejected and sent back.
1 Like