1

A miner is in the process of creating and mining a block of 1400 transactions. Suddenly they receive a broadcast that a new block was confirmed with 200 of the transactions currently in that miner's block. How does a miner proceed in this scenario - dropping the 200 and adding 200 others from the mempool and trying to mine a block?

In a second scenario, two blocks are created almost at the same time and they each have some of the same and some different transactions. I'm assuming (a) that there is then a race to consensus for each and the first to 51% wins a confirmation. If so, then similar to above (b) the block with losing transactions has all the dissimilar transactions dumped back in the mempool. But what if a second chain surfaces with two blocks? Now all the confirmations in (a) that aren't confirmed in this second block get dumped back into the mempool and hopefully finally mined into the blockchain?

The takeway for me >>> Obviously this system does work since its very popular! But it seems that transactions can take a very long time and no way to really guarantee that they will occur unless a payor decides to pay a high fee to almost confirm that miners will pay attention to his transactions first and most will include that transaction into the miner's next block to add to the chain.

1 Answer 1

2

How does a miner proceed in this scenario - dropping the 200 and adding 200 others from the mempool and trying to mine a block?

If the miner is trying to build on top of the block that was received, then he will have to drop the 200 transactions that were included in the other block. He will also not be able to include the other transactions in the next block that were present in the block he received. Apart from this, he is not restricted which valid transaction he can include. He can fill in more valid transactions, remove some or remove all the transactions and just mine the block with coinbase transaction. It's up to his discretion.

Two blocks are created almost at the same time and they each have some of the same and some different transactions.

Imagine a scenario where two miners find a solution at the same time and both the blocks are valid. As soon as they find the solution, they will relay the block to the full nodes. The nodes will add the block that reaches to them first and add it on top of the existing blockchain. However, when they receive the other block at the same height, they will not discard it but maintain a copy of it. So here you have a blockchain fork, where around half the nodes have a different version of the blockchain at the best height. Other mining nodes will start mining the subsequent block based on the copy of the blockchain that they are seeing (on top of the block that they received first.) Now, one of the miner will find a solution and propagate it to the network. More likely than not, it will not happen to be simultaneous like the previous block. So when that block is propagated, the network converges back to a shared state. Now, as the network converges the full nodes will discard the transactions from the mempool that are already confirmed.

4
  • Superbly explained. Many thanks for the effort. Mar 26, 2019 at 0:29
  • @rossmclochness if you think it adequately answers your question you can click the tick mark near the answer so others know this is an accepted answer and they find it helpful
    – Ugam Kamat
    Apr 24, 2019 at 17:01
  • so, if two miners create valids block in the same height (with transactions in common), is probably that one of them will not gain any ravenue for that mining??? Mar 13, 2020 at 20:08
  • @eduardopascualaseff Yes. When a miner mines a block, the payout comes through the coinbase transaction. This coinbase transaction is not spendable until 100 blocks following the mining of the block. Most reorganizations settle themselves within 2-3 blocks. So one of the miner's payout transaction will never be included in the main chain.
    – Ugam Kamat
    Mar 15, 2020 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.