DEV Community

Discussion on: Blockchain: What is Mining?

Collapse
 
rlahiri profile image
Rahul Lahiri

Another basic question :-) What is the mechanism for resolving the winner if there are two valid blocks submitted at the same time by two miners that include overlapping but non-identical set of transactions? Is the block timestamp used to choose the winner? If so, does it create an incentive to use older timestamps?

Collapse
 
damcosset profile image
Damien Cosset

I believe, and I may be wrong about this, that the block who gets the most confirmations first wins. I think there are a number of confirmations to get to make sure that the block has been propagated and validated.

Collapse
 
rlahiri profile image
Rahul Lahiri

Thanks Damien!

Collapse
 
veereshdandur profile image
veereshdandur

Isn't the longest sub-block chain wins? Just making sure!

Thread Thread
 
damcosset profile image
Damien Cosset

I believe it depends on what blockchain we are talking about. For Bitcoin, the block that receives the needed confirmations is added to the blockchain. Because it takes 10 minutes to mine a block, there are no conflicts between different blockchains states.

In Ethereum however, blocks are mined a lot faster, so there can be some conflicts in this regard. I don't know much about it, but it is called the GHOST protocol ( Greedy Heaviest Observed Subtree). This is basically what you said in your comment. The longest sub-block chain wins and becomes the truth.

It all depends how long it takes to mine a block. If it's low, you will need a system to resolve conflicts like Ethereum does.