Homework on Stale Blocks

Questions 1,2, and 3. When two miners solve a block at the same time, they both will send their block information to the closest nodes to them. Eventually, a new miner will solver a puzzle after those two. Whoever the new miner chooses will stay on the blockchain. The other block called stale block will be rejected and all its tx will go back to the mempool.

  1. It is important to wait for more than one block to be confirmed when sending or receiving a transaction because it ensures you that your block will not be dropped . If it is dropped, it will go back to the mempool, which the transaction will take longer to be verified.
1 Like

No problem. Keep up the great work. :smiley:

Correct. The worse part is that you could sell a good and you would have your transaction reversed if you didn’t wait for more confirmations. :slight_smile:

1 Like

Stale Blocks

  1. What happens in the Bitcoin network when two miners solve a block at the same time?
    When two miners create a block at the same time, different nodes will agree on both blocks to be added to their ledger database. Multiple miners can mine from both separate blocks, but in the end, the longest chain wins. The block continues onto the blockchain, and the other block, becomes dropped or stale/orphaned, with the transactions within the dropped block returning to the mempool.

  2. What is a stale block?
    Stale blocks, are blocks that are no longer valid on the blockchain. Running into a situation with a stale block, is when different blocks were created at the same time and eventually one of the two blocks will have a longer chain, dropping the second block.

  3. How do stale blocks occur?
    When miners are appending their block onto each of the 2 blocks, whichever chain becomes longer, will knock the other chain out of play, causing the block to become stale. The transactions of the knocked out block are kicked back to the mempool for miners to once again pickup for a new block.

  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
    Waiting for more than one block to be confirmed, carries a higher chance, of your transaction to append to the blockchain. If too many blocks are created too quickly, they may risk being dropped, as they will be propagating on top of multiple other blocks. Waiting for one block to be confirmed, will help the network to sync together, having all the nodes up to date.

1 Like
  1. You get a forked block so you have two blocks working through the network with the same information.

  2. A block that removed from the blockchain because another block that was produced at or around the same time is part of a longer blockchain.

  3. When one of the forked blocks is part of a longer chain, the other block becomes stale.

  4. To verify that your block is not dropped from the chain.

1 Like

great, but the reason we wait for a few blocks to get mined is because of the possibility of our transaction being part of a stale block :slight_smile:

2 Likes

If two blocks were the same than that wouldn’t be a problem :slight_smile: the reason these forks happen is because two different blocks were mined.
This could be the reason how two independent miners construct blocks or the fact that not all unconfirmed transactions are held by a node in the network since some transactions weren’t fast enough to propagate to it at the time the block was constructed. Thus two different blocks get mined that are both valid.

1 Like
  1. Both versions are accepted by various nodes. The miner who mines the next block decides which version is accepted based on which version he was seeing.

  2. A stale block is one that is dropped from the blockchain. These are blocks that were on alternate versions of the block chain that were eventually replaced by a longer chain.

  3. Stale blocks occur when two blocks are mined at roughly the same time.

  4. You should wait for 6 confirmations to ensure that your transaction wasn’t part of a stale block.

1 Like
  1. When two miners solve a block at the same time a fork is created (two blocks appended simultaneously to the last block in the chain).

  2. When a new block is appended, that node shares its copy of the chain with the rest of the network. When a fork is created, different nodes may recognize either of the two blocks in the fork as the “truth.” When another block is created, it will be appended to one of the two blocks in the fork depending on which version of the chain the node is recognizing. This newly appended block creates the longest chain, and the longest chain determines the truth of the blockchain and the rest of the network begins to recognize this chain. The block in the other fork is rejected and its transactions are returned to the mempool. This rejected block is “stale” or “orphaned.”

  3. Stale blocks occur when two blocks are appended to the chain at the same time creating a fork. Eventually one of the two blocks in the fork will be the first to have a new block appended to it which will create the truth of the blockchain. The other block in the fork becomes “stale.”

  4. It is important to wait for more blocks to be confirmed when sending or receiving a transaction because this allows time to be certain that the block containing that transaction has officially become part of the blockchain and not rejected, resulting in the transactions being returned to the mempool.

1 Like

Homework on stale blocks:
1.If two miners solve a block at the same time the chain will fork in two.
2.A stale or orphaned block is a block that has been rejected because it was not on the longest chain.
3.When two blocks are solved at the same time.
4.To make sure your block doesn’t become a stale block.

1 Like

They actually happen when one of the chains gets dropped. You can’t know for sure which one will go stale until that happens. :smiley:

1 Like

Hi Alko89, thanks for the reply. Just to confirm on your response, if less confirmations/ less blocks are mined, there is a higher chance of your transaction being dropped? You a referring to answer 4? My response is the opposite to your answer but with the same idea leading up to the response.

  1. The miners start to propagate their blockchain through the nodes and the third miners that attach the following block is the one that choose the correct chain to follow
  2. Is a block that have been rejected but for a period of time and in some nodes it was in the blockchain
  3. When miners propagate in the nodes different versions of the blockchain with different mined blocks
  4. To have a confident probability that the transaction will not be reversed
1 Like

Yes, the rule of thumb is 6 confirmations. Theoretically there is a possibility that after a fork occurs due to two miners mining a block at the same time, the next two blocks are also mined at the same time on both chains, this could go on forever in theory, but its basically impossible in practice. Eventually one chain will win by doing more PoW and the other one will be dropped. Once this happens the transactions on the shorter chain will be dropped. :slight_smile:

  1. Both blocks are valid (for the moment). They will be appended to the blockchain and split it into two different paths. These two chains will continue to evolve until the network catches up with the news. The network will then choose the chain with the most PoW and invalidate all the blocks on the other chain down to the splitting point. There can only be one bitcoin blockchain.

  2. It’s a block that at one point in time was properly appended to the blockchain and later invalidated by the network because it belonged to parallel chain that had less PoW. The network will always resolve this conflict by choosing the chain with most PoW (most secure).

  3. New blocks are mined about every 10 minutes and the bitcoin blockchain runs in a global network of nodes that depend on good connection (internet/satellite) and speed, to continually broadcast the latest blockchain update to their peers. This mining time window of 10 min is usually not enough for the whole network to be synchronized, leaving room for more than one miner to finish his block at the same time and these being appended to the blockchain and consequently splitting the chain onwards until the network realizes it at takes action by choosing the chain with most PoW and making all the parallel blocks into stale blocks (once legit blocks into invalid blocks). All the TXs in these blocks go back to the mempool until a miner picks them up again for a new block.

  4. Because the network is not real-time synchronized and more then one block can be finished at the same time, there are moments when more than one blockchain coexists and continue to evolve. A TX can also coexist since different miners can include the same TX in his block or just exist in one of the chain branches. Either way, the network will eventually sort this out by choosing the strongest chain (most PoW). The TXs on the winner chain stay and the TXs in the stale blocks go back to the mempool. Meaning, it is also possible that a same TX can temporarily coexist on the blockchain and in the mempool. So, a time buffer for more than one block (preferably 6 or more) to be confirmed increases the assurance that a TX is recorded on the true blockchain, and only there.

  1. There is temporarily 2 versions of the truth. The valid version of the blockchain will eventually be determined by the miner that mines the next block. It is the miner that decides which version it will build on. The longest version of the blockchain is the true version and will be accepted by the network.

  2. It is a block that is not on the longest version of the blockchain. And is not accepted by the network to be valid. The stale block will be forgotten by the network and the unconfirmed transactions in the block will be put back into the mempool

  3. They occur when the version of the blockchain they are in is not the longest one and the block is not accepted by the network.

  4. In case the transaction is in a stale block. A general rule is that after 6 blocks the transaction will definitely be accepted.

1 Like

The nodes will eventually accept the block that is first to get a subsequent block added to it. The other block’s transactions will be returned to the mempool. It is important to wait for at least six confirmations of a block being confirmed when sending or receiving transactions because of incidences of staleblocks. A staleblock occurs when there were two versions of the blockchain at the same time, but the blocks (staleblocks) who were not part of the longer chain are dropped and all transactions returned to the mempool.

1 Like
  1. What happens in the bitcoin network when two miners solve a block at the same time? the block splits and eventually one of the splits will be dropped as the other block achieves the more “difficult” status.
  2. What is a stale block? A stale block is the same as an orphan block. These are blocks that are dropped from the block chain because of another more difficult block.
  3. How do stale blocks occur? Stale blocks occur as a result of the blockchain splitting when two miners hash their block at the same time. One of the two blockchains will advance and the least difficult block chain will result in stale blocks that go back to the mempool.
  4. Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction? This allows the network to catch up and all the potentials splits to sync up to the longest most difficult blockchain.
  1. If their blocks contain different TXs then the two miners will add valid but different blocks to the chain. The chains will propagate across different nodes which creates 2 versions of the truth for a period of time.

  2. A block that gets rejected by the network because it is a member of a new chain segment that is not the longest new segment.

  3. Because nodes are scattered all over the world and therefore cannot be updated with new blocks at the same time. Consequently, different miners can append their next blocks on unequal chain segments. Only one of these threads (the longest one) can be the master chain. Blocks in the other (shorter) threads are considered “stale”.

  4. To allow enough time for the blockchain to be synchronized across all nodes in the world so to reduce to chance of orphaned/stale blocks.

Maybe not all the blocks, as when this happens, normally is just the last block (the one that was mined at the same time) the one that is different in the two chains.

I would say that you will only send to the mempool the transactions that were not included in the valid block. Actually, there is a high chance that many transactions are included in both blocks, as miner’s mempools are similar and they choose txs with higher sats/byte first.

1 Like