Homework on Stale Blocks

Nicely summarized! :grin:

1 Like

I think you meant the blockchain !

The block is dropped because there is a different version of the blockchain with more blocks or more proof of work.

Basically we don’t want out transaction to be in a block that is dropped.

Hi there! Only with different transactions?

Yes I meant the blockchain splits not the block.

  1. The longest chain wins
  2. The dropped block is orphaned/stale
  3. A “new” miner creates a new block on the chain before the others. So that chain gets added after 6 confirmations
  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, there are two competing versions of the truth that are equally valid (and where the puzzle was solved with nonce lower than the target number, despite some difference in transactions in the block). Other nodes nearest to the respective miners of each of these valid blocks may start propagating each of the two simultaneously leading to the below problems.

  1. What is a stale block?

A stale (or orphaned) block is a validly mined block which has been discontinued (for the reasons below) and therefore the transactions contained in it are dropped back into the mempool. This means that the miner doesn’t receive the block reward or transaction fees and further that the transactions they had validated are not fully “confirmed” and are cancelled out.

  1. How do stale blocks occur?

Stake blocks occurs when, after the two valid blocks were mined at the same time and propagated by different nodes simultaneously, a new miner comes along and mines the next block, appending to whichever of the valid blocks is encountered first (or chosen for any reason) - and because that block is then appended to the preceding block, it is likeliest to remain the version of truth chosen by the network which itself will always prefer the longest chain of valid blocks. Thus the other valid block mined simultaneously with the previous block becomes “orphaned” as you cannot have two competing versions of the blockchain (or the truth) indefinitely.

  1. 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 when sending or receiving a transaction (& best practice is six blocks) because this vastly reduced the probability that your transaction will be part of an orphaned block in which case it would resultantly be dropped back into the mempool.

1 Like

This is not correct. The reason we wait for a few confirmations is to be sure our transaction is not part of a stale block. 6 confirmations is a rule of thumb :slight_smile:

  1. Both blocks will be transmitted to the other nodes. For a while 2 different versions of the chain will exist untill miners mine the following block creating a longer chain in one of both. the longest chain wins and the other ‘chain’s’ transactions are invalid. This will create a stale block.

  2. A stale block or orphaned is a block that had been accepted and caused a fork in the blockchain, but has now rejected by the network.

  3. Stale blocks occur when there is a fork in the network due to two miners solving the problem at the same time with different blocks and eventually the network rejects one of the blocks as new blocks have been mined without that in the chain.

  4. It is important to wait for 6 confirmations to be sure that the block your transactions are in is not dropped from the chain.

1 Like
  1. Both blocks will be added to the network, and propagate the information to near nodes. Only when a new block is append to one of competitor blocks, then the blockchain will determine the longest is the corrected version of chain and discard the other.

  2. A stale block is a block that exist for a period of time in blockain as unconfirmed state, that eventually was overcome by a longer version of blocks. Essentially it’s a rejected block.

  3. A block becomes stale when another chain version is longer.

  4. Since there are many miners competing to add their blocks to the chain, there will be several truths. So is required to wait for the validation of network to validate which transactions will be accepted, therefore only when several nodes get in agreement then a transaction change to confirm state. This validation require 6 block confirmations.

The transactions are still valid, they just get put back into the mempool to be included in the next block(s) :slight_smile:

1 Like

Transactions are already accepted once in the mempool. The reason we wait is in case if our transaction was mined in a stale block. The wait of 6 confirmations is a rule of thumb how long to wait :slight_smile:

1 Like

What happens in the bitcoin network when two miners solve a block at the same time?
A: The respective mined blocks from each miner are propagated to the network nodes physically closest. After consensus/confirmation, usually after the next block or blocks are mined, the longest chain via the greatest POW is kept as the valid chain. The stale block’s transactions are then sent back to the mem-pool. (Interestingly, in January of 2020, a stale block on the Bitcoin blockchain resulted in a double-spend of about 3 USD. This actually lends some credibility to the argument that the chain is not 100% immutable)

What is a stale block?
A: A valid block that was confirmed not to create the longest chain via POW, thus, it is over-ridden by the longer version of the blockchain and Tx’s are returned to the mem-pool.

How do stale blocks occur?
A: When two blocks are mined simultaneously, the block is confirmed but found not to be the block with the greater POW. It is left out of the blockchain and, thus, is a “stale” block.

Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
A: So as to prevent the occurrence of a stale block, and more importantly, the potential double-spend that can result from the stale block. When it comes to bitcoin Tx’s, generally speaking, the greater the amount of bitcoin being sent in a transaction, the more confirmations, up to 6, are needed before the transaction is complete.

2 Likes

Could you please link this? I am interested.

3 Likes

https://cryptonews.com/exclusives/stale-block-reminds-the-importance-of-bitcoin-confirmations-5737.

1 Like
  1. They both can appended their blocks for validation and acceptance which could likely give rise to potentially 2 different chains in the network when the next block is added.

  2. A stale or orphan block is one where 2 or more miners happened to add new blocks to the network at virtually the same time. This resulted before all nodes received the same version of the resulting network and each block was appended to a different node. Then when a subsequent block is added to one of those 2 branches, only one branch is longer and the block that was added to the now shorter chain will be dropped and the longer chain will be validated.

  3. This can happen when blocks are being propagated rapidly so that different parts of the network are receiving new blocks before the entire system is aware of them. This is why the system’s difficulty is managed to allow time (usually 10 minutes between block addition) for the entire network to fully in receipt of the sequence.

  4. Since the possibility of stale or orphaned blocks exists even if this block receives 1 or 2 confirmations as accepted to the network, there could be the “stale situation” that could lead to you transaction being in a block that gets dropped. So the likelihood of being dropped after 6 confirmations received is mathematically very low and waiting until you receive those 6 confirmations is advisable.

1 Like

Answers:

  1. Then there will be a split within the blockchain network. With that being said, the two blocks which fill the split respectively contains the the correct nonces which in turns create 2 version of the same truth.

  2. A stale block is basically a block which has been drop from the block chain network that will be return to the mempool.

  3. Stale blocks occur firstly when two miners solve a block at the same time hence creating a split, and a subsequent miner pick up one of the split and continue to mine on the chain which then form a longer chain. Henceforth, the shorter chain after which the same block which arises from the split will be drop and thus become stale.

  4. That is to ensure there is only one version of truth in case a split occurrence happen, and by waiting for one or more block to be confirm it allows the blockchain network to pick the longest chain thus dropping a potential stale block.

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

The block, and/or, subsequent blocks that gets linked onto the block chain that has most proof of work, or in other words, the most difficulty, or lowest target, will eventually get confirmed onto the blockchain.
The block, or subsequent linked blocks that get discarded will be placed in the mempool.

  • What is a stale block?

Stale blocks are blocks that were invalidated because the blockchain it was linked to was unconfirmed. Another named used are orphaned blocks.

  • How do stale blocks occur?

Still blocks occur when the block chain it was a part of was not confirmed and subsequently invalidated. These blocks are placed in the mempool to await to be chosen for inclusion to another block by a miner.

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

According to the lecture, it is good to wait for six blocks to consider your transaction confirmed to avoid being dropped from the block chain and placed in the mempool, thus delaying your transaction from being included in a block.

1 Like
  1. When two miners solve a block at the same time, the network now has 2 blockchains or 2 versions of the truth. These 2 versions of the truth will be propogated through the network, so some nodes will have 1 version of the truth and others will have the other version of the truth. Miners will start mining on 1 of the blockchains until the network has the longer blockchain. At this point the shorter blockchain will be dropped and the whole network will accept the long version of the blockchain.
  2. A stale block is a block that was once on the blockchain, but was dropped because there is now a new longer version of the blockchain.
    3.Stale blocks occur when there is a new longer version of the blockchain. So the newest block on the short blockchain is orphaned.
  3. It is important to wait for more than one block to be confirmed when sending or receiving a transaction, because this ensures that your transaction was not in a potential stale block.
1 Like
  1. The network will choose the longest chain to continue adding blocks. The longest chain is not only measured by numbers of blocks, but particularly by PoW ( Hashing power spent on those blocks ). So the other miners nodes will continue adding blocks on the chain that has more blocks with more hashing power used. Why? because those miners needs to be sure to add their block in the most secured chain and the hashing power spent is what guides them to choose a chain when this situation happens.

  2. Is the block that was not chosen by the network when two miners proposed their block at the same time.

  3. Idem 2

  4. Since it is a worldwide network, computers (nodes) are distributed around the world. For the network to be efficient, all nodes must agreed on the same information that will be integrated in the blockchain, for that to happen, information (transactions in this case) must travel physically between computers around the World. That takes time (10 minutes on the Bitcoin network), even for a computer, so in order to make sure that all nodes have the same information we must wait at least 6 blocks confirmations to be sure that our transaction (which is in the block) is integrated in the most secured chain.

1 Like