The process of mining as described in the answer to this question is simultaneously repeated by multiple miners.

Is it possible for two miners to find the next block at the same instant? If it is, what happens if they do?

  • 4
    It doesn't even need to be in the same instant. As long as the second block is found before the first block is widely known, there will be a fork. – Nick ODell Mar 6 '13 at 17:37
up vote 27 down vote accepted

Yes, it is possible, and you can actually follow "orphaned blocks" here: https://blockchain.info/orphaned-blocks

Bitcoin clients always trust the longest chain, so if two blocks is mined on the same time, it's up to (51% of) the miners to decide which is going to be 'accepted' and which is going to be worthless.

This is one of the reasons why you shouldn't trust only a few confirms, as the confirms could be a orphaned blockchain. After "enough" confirms, everyone will mine on the "correct" blockchain, because any work(mining) on a orphaned blockchain is waste of power (unless your trying to perform a 51% attack).

  • 6
    How does one know which of the two blocks is accepted by 51%? What prevents two blocks to be accepted by 50/50? At which point is it obvious that a block is orphaned? – Andrew Savinykh Nov 30 '15 at 8:08
  • 1
    When does the reward go to the miner who solved the blocked, is it instantaneous or after 51% have confirmed? – kasa Jul 26 '17 at 17:14
  • 1
    @Andrew A miner accepts the first block that reached him. So lets say 51% will accept be on one block and 49 on other. When next block is mined on one of these chains all the miners switch to that chain. It is likely that 51% will mine next block first on their chain. Thus the notion of which chain is accepted by majority (51% in this case). – croraf Oct 27 '17 at 21:05
  • @kasa When one chain outpaces the other by many new blocks (so the block in question is confirmed by many new blocks stacked on top of it) we can be sure that the reward is given. How much many is in this context is defined by the protocol: you can spend the reward after 100 blocks confirmed it. – croraf Oct 27 '17 at 21:14

What Nicolai said is not completely right. The network would decide which one is the main chain according to the following block mined. Let's assume that block A and B are mined at almost the same time. The miners would accept the first block that was broadcast to them, so there would be some miners accept A and others accept B, it doesn't matter whether A/B is accepted by 51% or more miners or not. Miners accepting A would try to mine the next block on top of A, while other miners accepting B would try to mine the next block on top of B. If next block to be found is on the top of A, then miners mining on the B will turn to the A chain, which is the main chain. BTW, the block B is named as an orphaned block, you can find more on the https://blockchain.info/orphaned-blocks. Of course, there may be a circumstance that the next block is mined at roughly the same time both on top of A and on top of B, then the process mentioned above would circulate again till the problem gets solved. Now you can understand why the new blocks won't be spendable until at least 120 blocks have been built on top of it in a chain.

  • "won't be spendable until at least 120 blocks have been built on top of it in a chain" Does the protocol force certain rules regarding this? Can I spend my UTXOs if they belong to the last mined block? Or I need to wait til an arbitrarily number of blocks (defined by the protocol) are mined on top of it? – John Smith Oct 12 at 20:41

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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