<p>The tie is broken by the first of the two that gets extended with a child block.</p>
<p>In practice, in case two conflicting blocks at the same height appear on the network, every node will pick the one they saw first as winner. Because communication across the earth happens at a finite speed, some miners may see one side of the fork first, and other miners may see another one first, even if there is some time between them (up to ~seconds). However, the one that was actually first will most likely reach more other miners first than the other one, and that one will thus have the most chance of being built upon first.</p>
<p>Note that in theory it is possible for this discrepancy to persist: it is possible that a block is found on both sides of the split ~simultaneously again. In that case, it will be the block after that that determines the winner, and so forth. However, under reasonable assumptions, the probability that this persists for long is extremely small, and that is also what is observed in practice. Reorganizations of more than 2 blocks deep are extremely rare.</p>

CC BY-SA 4.0
2021-10-12T11:11:46.287Z
Are there historical records with exact numbers on this? For instance, "only 32 reorganizations of depth 3 happened in the history of bitcoin, and 0 of depth 4". Not an expert, just curious.
Federico Poloni
CC BY-SA 4.0
2021-10-12T11:42:50.740Z
I don't have an actual source (as observing reorganizations isn't deterministic - it depends on which blocks you see first), but it wouldn't surprise me if the only reorg more than 2 deep after 2010 was the July 2015 BIP66 activation fork, where some new miners kept mining on top of an invalid block produced by an old node through spy mining. IIRC that was around ~30 blocks deep before it was resolved.
Pieter Wuille
CC BY-SA 4.0
2021-10-12T11:50:51.203Z
What happens if by some fluke both miners find the nonce at the exact same time, down to the nanosecond?
nick012000
CC BY-SA 4.0
2021-10-12T11:52:04.137Z
It doesn't matter how close the two blocks are found, the procedure is the same: every node will accept the first one they see, but switch over when the other one is extended first.
Pieter Wuille
CC BY-SA 4.0
2021-12-30T19:47:10.743Z
@PieterWuille I follow your explanation: let's blockA and blockB being "simultaneous" valid different solutions. 99% nodes have heard blockA first, 1% received blockB second. Then blockZ is found valid with hash of blockA: Then what happens "in the code" of the 1% node : for them, blockZ is not valid because it does not use the hash of blockB: does these 1% nodes become a hardfork?
totalMongot
CC BY-SA 4.0
2021-12-30T19:59:07.890Z
All three blocks are valid. The validity is just a function of the block's contents and that of its ancestors, and absolutely nothing else (specifically, it does not depend on when the node learned about these blocks). There is a difference between validity and which block is considered active however: the 1% see blockB, and then learn blockA+blockZ, which have more work, so they switch over.
Pieter Wuille
CC BY-SA 4.0
2021-10-11T18:34:03.807Z
2021-10-11T18:34:03.807Z
Pieter Wuille
<p>I am trying to understand how the consensus mechanism works. My understanding is that multiple nonces can satisfy the target hash requirement. What I'm trying to understand now is: if two miners come up with two different nonces, how does consensus take place?</p>
<p>Is this &quot;tie&quot; broken with the longest chain rule or is there another tie-breaking mechanism?</p>

<mining-theory><consensus><nonce>
If two miners come up with two valid nonces, how does consensus take place?
Amostafa
# If two miners come up with two valid nonces, how does consensus take place?

(Asked by: username_0 on 2021-10-11)

I am trying to understand how the consensus mechanism works. My understanding is that multiple nonces can satisfy the target hash requirement. What I'm trying to understand now is: if two miners come up with two different nonces, how does consensus take place?

Is this "tie" broken with the longest chain rule or is there another tie-breaking mechanism?

**Tags:** mining-theory, consensus, nonce


---

## 1 answers

### Answer by username_1 on 2021-10-11. Score: 6 | Accepted answer

The tie is broken by the first of the two that gets extended with a child block.

In practice, in case two conflicting blocks at the same height appear on the network, every node will pick the one they saw first as winner. Because communication across the earth happens at a finite speed, some miners may see one side of the fork first, and other miners may see another one first, even if there is some time between them (up to ~seconds). However, the one that was actually first will most likely reach more other miners first than the other one, and that one will thus have the most chance of being built upon first.

Note that in theory it is possible for this discrepancy to persist: it is possible that a block is found on both sides of the split ~simultaneously again. In that case, it will be the block after that that determines the winner, and so forth. However, under reasonable assumptions, the probability that this persists for long is extremely small, and that is also what is observed in practice. Reorganizations of more than 2 blocks deep are extremely rare.

> **Comments:**
> **username_2**: Are there historical records with exact numbers on this? For instance, "only 32 reorganizations of depth 3 happened in the history of bitcoin, and 0 of depth 4". Not an expert, just curious.  
> **username_1**: I don't have an actual source (as observing reorganizations isn't deterministic - it depends on which blocks you see first), but it wouldn't surprise me if the only reorg more than 2 deep after 2010 was the July 2015 BIP66 activation fork, where some new miners kept mining on top of an invalid block produced by an old node through spy mining. IIRC that was around ~30 blocks deep before it was resolved.  
> **username_3**: What happens if by some fluke both miners find the nonce at the exact same time, down to the nanosecond?  
> **username_1**: It doesn't matter how close the two blocks are found, the procedure is the same: every node will accept the first one they see, but switch over when the other one is extended first.  
> **username_4**: @username_1 I follow your explanation: let's blockA and blockB being "simultaneous" valid different solutions. 99% nodes have heard blockA first, 1% received blockB second. Then blockZ is found valid with hash of blockA: Then what happens "in the code" of the 1% node : for them, blockZ is not valid because it does not use the hash of blockB: does these 1% nodes become a hardfork?  
> **username_1**: All three blocks are valid. The validity is just a function of the block's contents and that of its ancestors, and absolutely nothing else (specifically, it does not depend on when the node learned about these blocks). There is a difference between validity and which block is considered active however: the 1% see blockB, and then learn blockA+blockZ, which have more work, so they switch over.  

---

