Bitcoin Forum
April 26, 2024, 02:30:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Two miners solving a block at the same time  (Read 228 times)
Bitophile (OP)
Newbie
*
Offline Offline

Activity: 62
Merit: 0


View Profile
December 07, 2017, 09:00:32 PM
 #1

I assume this doesn't happen (or is effectively handled) but I just want to understand how. If two miners from different countries solve a block at the same time (may be a few milliseconds apart) and add to their chain and the nodes close to it verify the proof of work, how does the blockchain pick the correct block? by time?
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714141839
Hero Member
*
Offline Offline

Posts: 1714141839

View Profile Personal Message (Offline)

Ignore
1714141839
Reply with quote  #2

1714141839
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
December 07, 2017, 09:20:20 PM
 #2

I assume this doesn't happen

It happens many times per week.

(or is effectively handled)

It is.

but I just want to understand how. If two miners from different countries solve a block at the same time (may be a few milliseconds apart) and add to their chain and the nodes close to it verify the proof of work, how does the blockchain pick the correct block?

Each node chooses whichever block they receive first.

For a short while the network is split.  Some nodes and miners have accepted one block and the miners are working on building a new block on top of it.  Other nodes and miners have accepted the other block and the miners are working on building a new block on top of it.

One of those sets of miners will eventually complete a next block.  When they broadcast it, any nodes or miners that received the same initial block as them will simply accept this new block and add it to their blockchain.  Any nodes or miners that initially received the OTHER block will see that there is a chain of TWO new blocks that is longer than their current chain of ONE block.  Since the protocol requires them to accept the longest valid chain (most proof-of-work), they will abandon the block that they have and replace it with the two blocks.  They will then relay these two blocks to any nodes or miners that they are connected to.

These abandoned blocks are commonly called "orphaned blocks" and are the reason that services will sometimes require multiple confirmations before they consider a transaction to be completed.

by time?

Nope.

If the blockheight is the same, then they accept the first block they see.  If the blockheights are different, then they accept the chain of blocks with the most proof-of-work (typically the chain with the most blocks).
Bitophile (OP)
Newbie
*
Offline Offline

Activity: 62
Merit: 0


View Profile
December 07, 2017, 10:26:24 PM
 #3

These abandoned blocks are commonly called "orphaned blocks" and are the reason that services will sometimes require multiple confirmations before they consider a transaction to be completed.

Thanks for a very detailed answer. Now I see why the miners reward need to wait for 6 confirmations to be spent.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
December 07, 2017, 11:30:59 PM
Last edit: December 28, 2017, 05:39:29 PM by DannyHamilton
 #4

Thanks for a very detailed answer. Now I see why the miners reward need to wait for   6   100 confirmations to be spent.

Fixed that for you.
Bitophile (OP)
Newbie
*
Offline Offline

Activity: 62
Merit: 0


View Profile
December 15, 2017, 07:52:34 PM
 #5

Thanks for a very detailed answer. Now I see why the miners reward need to wait for  6    50 confirmations to be spent.

Fixed that for you.

Thank you so much. Had a wrong information set in my mind somehow.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!