When selecting a block to build on, miners are supposed to use these rules.
- Mine on the longest valid chain
- Break ties in favour of the earliest received full block
The problem is that the 2nd rule requires information on when each block was received.
If two blocks are found at around the same time and broadcast, half of the miners would end up seeing each of the blocks first. The network wouldn't agree on which block is the longest.
Some nodes would see one confirm for transactions in one block and some would see one confirm for transactions in the other block.
When the next block is found, the tie will likely be broken.
A deterministic way to find break ties means that the entire network will instantly agree on which block to build on.
The problem with this approach is that it can lead to miners withholding some blocks.
If the target was 10 million, then each valid block would have a hash ranging from 0 to 10 million. If a miner hits a block and gets a low hash (say 1 million), then they can have high confidence that they will be able to win any tie break.
They could hold back their block and release it when someone else sends a new block. The other person will probably have a hash above 1 million (90% chance), so they will probably win the tie.
This means that their competitors end up wasting time searching for a block just to lose the tie immediately.
The problem is that miners can tell if the block that they just found is has a good chance of winning the tie break.
This can be avoided by using both hashes to determine the winner.
The strength of a block can be defined as
S
n = [2*H
n - sum(H
k)] mod T
T is the target and H
k is the hash of the kth block involved in the tie.
Each time a new block is added to the set, a random number is effectively added to sum(H
k). This means that all strengths are effectively re-randomized and all of the blocks involved in the tie have an equal chance of winning.
For the two block case, the strengths are
S
1 = [H
1 - H
2] mod T
S
2 = [H
2 - H
1] mod T
The block with the highest strength wins.
This means that a miner has no way to know if the block that they just found is going to win the tie break. No matter what the hash of the block, there is always a 50% chance of winning any resulting tie.