Homework on Stale Blocks

Hi @Alko89 - Thank so you much for your clarification on this matter. So, I guess I got a bit muddled with verifications and confirmations!

So, the verification, or validation is regarding whether the transaction meets the criteria of the protocol’s ruleset, right, before it is broadcast to the network?

Once the transaction is broadcast; picked up by a node; placed in it’s mempool; and then (if selected) mined into a block, that’s its first confirmation - however, without a second confirmation, this block could end up being unconfirmed.

This would be the case if two blocks were mined at the same time, wherein the other block could potentially have the next block appended to it, making it the longest chain, rendering the block containing this transaction a stale block.

After six confirmations on the bitcoin blockchain, the transaction would go through, with the funds appearing at the receiver’s address, right?

1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time?
    Then you have two competing blockchains until one becomes longer and propagates through the network and the transactions in new blocks on the shorter one are returned to the mempool where they’ll be batched into a new block.

  2. What is a stale block?
    A stale block is a block that was dropped because it was on a shorter blockchain.

  3. How do stale blocks occur?
    When two miners mine valid blocks at the same time, you end up with two competing chains then when one becomes longer the new blocks from the shorter chain are considered “stale” and are returned to the memoool.

  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
    To ensure that your transaction is on the “winning” chain.

1 Like

Correct, but every node verifies the tx itself when it receives it :slight_smile:

This actually depends on the UI. Bitcoin-cli for example will show you block rewards after 100 blocks, because coinbase can only be spent after 100 blocks.
Some wallets might also show you a transaction that is still pending in the mempool. And most wallets will show you the balance once it is confirmed once.
Exchanges for example won’t allow you to trade when you deposit funds before some confirmations pass.
Needless to say its entirely up to the way the wallet is implemented. :slight_smile:

1 Like

Transactions and blocks gets verified many times.
Your Wallet when broadcasting it, then each node validates it,…
If you install a new Bitcoin node and start syncing the blockchain, your node will basically check, verify and validate everything from scratch (from the genesis Block til the most recent block)
That’s why it can take so long time to sync when you install a full node bitcoin client.

1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time? you have part of the network with one version of truth and another part of the network with a different version but both can be true.
  2. What is a stale block? when a block that has been appended to the network gets dropped and the tx go back into the mempool
  3. How do stale blocks occur? when the network splits and one of the two(or more) paths is selected via longest chain wins principle.
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction? to ensure your block doesn’t become an orphan block
2 Likes
  1. Two differents version will appears of the blockchains until later one only one version subsites
  2. A Stale block is a valid block that has been dropped.
  3. It occurs when 2 versions of truth exists and after the creation of an longer chains it will remain only one chains so all the other blocsks that was not on that chains will be drop and those transactions will go back to the mempool.
  4. To ensure that the transactions will not be drop if the block is an orphand block
2 Likes
  1. some nodes in the network will add one of the blocks to their chain and others will add the other block based on which one travels to them first. so there will be two different versions of the blockchain for a short time.

  2. A stale block is a block that was in the blockchain at one point but has been removed.

  3. They occur when two different blocks are mined simultaneously, creating two versions of the blockchain until the next block is mined using only one of the existing chains and therefor the other version of the blockchain is dropped.

  4. It’s important because there is a possibility the block your transaction is in could become a stale block until a few more blocks are mined after it with that block still being included in the chain.

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

Both blocks will be appended in the blockchain through different nodes. However, only the faster block that is broadcasted into the network will be kept prior to the 10 minute mark. The other block will be discarded and becomes what is termed as an orphaned block.

  1. What is a stale block?

Is a fully formed block that could not become part of the longest chain of blocks in the network.

  1. How do stale blocks occur?

Stale blocks occur when they loose the race of being appended to the chain of blocks that becomes the longest chain. And thus, get discarded.

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

To make sure that the transaction will be appended to the longest-chain of blocks and will not become a stale block.

1 Like

1.- The next blocks decide which blockchain has the most PoW and the winner gets taken as the real one.
2.- A mined block that gets dropped from the blockchain.
3.- These blocks are the ones that get dropped because its block chain resulted in having less PoW than other one based in a block that was mined at the same time.
4.- Because its block can be dropped and therefore make your transaction invalid.

1 Like
  1. The block with the longest chain is preserved and the other is discarded.

  2. It’s a block that was in the blockchain at one time but got removed.

  3. When 2 valid blocks are produced at the same time, the blockchain keeps the block with the longest chain. The other block discarded becomes a stale block.

  4. Because it might be the case that your transaction is in a block that will be dropped.

1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time? Won the one who is in the longest chain and the other one bock is discarded, the discard block is a stale or orphan block that have to wait or more simple goes again to the mempool.
  2. What is a stale block? Is a rejected block cause by the simultaneous arrival of 2 valid blocks but only one is the one that can be valid.
  3. How do stale blocks occur? simultaneous arrival of 2 valid blocks
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction? Considering that we have to wait at least 6 confirmed block before goes to the chain, to guarantee this 10 mins is the time for the process.
2 Likes
  1. there are 2 valid blocks at that time. the next block mined from one of those blocks (a miner starts mining based on the block that was commicated to him first) determines which become the block integrated in the blockchain.
  2. The block that was mined but did not become part of the blockchain.
  3. e.g. 2 blocks are mined at approx the same time and communicated to the network. A miner picks the first it receives up and creates a new block based on the block that he received. Once the miner sends out the new (and now longer) blockchain, the not used block becomes a stale block.
  4. The transactions from a stale block are moved back into the mempool even though they were in a valid block. Those transactions need to be picked up and put into a new block to be valid.
2 Likes

Both blocks are added to the blockchain.

A stale block is a block that is invalidated/dropped by the blockchain because it is part of a shorter blockchain than the new current blockchain.

They occur after two miners solve the nonce at the same time, and a new miner finds the new nonce of the other block. Thus the stale block is invalidated and the transactions are returned to the mempool.

It is important to make sure that the entire network has had time to update itself in order to make sure that the current chain is valid and there is no new chain that is longer.

1 Like
  1. The chain will not be determined to be correct until the next block has been added, as some nodes will have one version and other nodes the other version, so until a further block gets added and confirms the longest chain there may temporarily be two chains propagating.
  2. Once the next block gets added and the chain is confirmed (as in last example) the other chain that although it has a ‘correct’ block it is no longer the longest chain, hence its block becomes an orphan or stale block and all transactions are dumped back into the mempool.
  3. Stale blocks come from two simultaneous ‘correct’ blocks getting created by different miners and added to the chain, until a further block gets added to one chain making that the longest they will both be ‘correct’ but only one will go on to be the longest chain. The other becomes a stale block.
  4. In case your TX ends up being in a stale block!!
2 Likes
  1. If two miners solve a block at the same time they will propagate that block through their network of nodes, then whenever another miner in the network solves for the next block and it is added to the chain, it will link on to one of the two potential blocks making one chain longer, and that is the chain that will be chosen to be the confirmed chain, orphaning the other block.
  2. A stale block is a block that was mined at the same time as a competing block, but its competitor had other minors add their blocks to it, so it no longer is has the longest pow, so it is disregarded by the network, and added back to the mempool.
  3. see 2.
  4. It is important to wait for 6 more blocks or confirmations to ensure that your transaction has been confirmed on a fully propagated block and not on a stale block.
2 Likes
  1. You then have two competing version of the blockchain as the two miners are then writing their own versions of the blockchain.

  2. A stale block is a discarded block from a competing blockchain which was deemed as invalid

  3. Stale blocks occur when there is more than one miner writing a new block for the blockchain at the same time. Those miners then produce their version of the blockchain. The version of the blockchain which is the longest and has the highest difficulty is deemed as valid.

  4. As it might be the case that your transaction is in a block that might be dropped.

1 Like
  1. The blockchain will split into two.
  2. A stale block is a block that does not get chosen to be in the blockchain
  3. After the blockchain splits only one of the two will be recorded permanently on the blockchain. The system chooses which side is longer/did more work, and the other side are stale blocks.
  4. It is good to wait for more than one transaction just in case your transaction was recorded on a stale block
1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time?
    Another version of “truth”/of the blockchain is beeing created. These two miners are propagating their version of the block through the network. Miners are mining on two different versions of the last block.
  2. What is a stale block?
    A stale block is a dropped block which was invalidated after another version of the blockchain was accepted in the network based on the example above.
  3. How do stale blocks occur?
    Different valid blocks coexist in the network on example above given, until the next block is finished and adds on one of both versions. This version becomes the trusted and accepted version, because it’ll be the longest chain. The other block becomes the stale block.
  4. 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 will not be on a stale block and get dropped.
1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time?
    one will win. the longest blockchain wins in the end
  2. What is a stale block?
    an orphand block which was accepted by the blockchain. but because there was another block (source of truth) the stale block will be dropped
  3. How do stale blocks occur?
    multiple miners solve the puzzle at the same time and try to add their block to the blockchain and propagate to the network.
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
    you have to check that the chain has been accepted. the more confirmations the longer the chain length. the rest of the unaccepted chain will be returned to the mempool
1 Like
  1. They both get their blocks on the blockchain until another miner mines on one of them. Than the longest fork will win.

  2. a block that is not taken as the truth and is sent back into the mempool.

  3. when 2 miners mine a block at the same time.

  4. Because our transaction could be part of a stale block and it is recommended to wait for 6 confirmations.

1 Like