3

Say that there are two normal nodes and two miners in a network. Both normal nodes submit a transaction to the network at the same time.

One miner picks up the transaction of one node, and other miner picks up the transaction of the other node, and both tries to mine the next block.

Say that both miners could mine the blocks at the same time.

Now, how can the network come to an agreement about which miner mined the next block?

1 Answer 1

1

When 2 blocks are generated at the same time, the agreement on which block is the "winner" depends on the next block.

If there's blocks b1 and b2 for height H, the block that is mined at H+1 determines which of b1 and b2 is on the main chain. If H+1 built on b1, then b1 is the block; if the miner mining the block at H+1 instead chose b2, then b2 is the block on the main chain.

The community agrees on the "longest" chain. Sometimes there are multiple chains of equal length, and that's why it can be important to wait for a number of block confirmations, before considering that a transaction will not be undone by a chain reorganization.

4
  • Thanks for the answer. It's clear now. But, according to this, if a powerful miner could mine on a previous block which has few predecessors and generate more blocks than currently is, wouldn't this miner be able to rewrite the chain? Commented Oct 31, 2016 at 2:53
  • 1
    While the powerful miner is mining on previous blocks, the rest of the miners are also extending the blockchain, so the powerful miner won't be able to catch up unless they are more powerful than the rest of the network. If there was such a miner, yes they would be able to perform a 51% attack: ethereum.stackexchange.com/questions/542/…
    – eth
    Commented Oct 31, 2016 at 10:55
  • @eth What happens to the other transactions in the losing block? Do we assume other nodes still have this transaction in their TX pool and can include this in a subsequent block on the main chain?
    – Shiri
    Commented Mar 14, 2018 at 15:46
  • @Shiri Yes, correct assumption.
    – eth
    Commented Mar 15, 2018 at 2:35

Your Answer

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

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