<p>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 <a href="https://blockchain.info/orphaned-blocks" rel="noreferrer">https://blockchain.info/orphaned-blocks</a>. 
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.</p>

CC BY-SA 4.0
2018-10-12T20:41:42.187Z
"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
CC BY-SA 3.0
2018-02-12T09:39:25.513Z
2018-02-12T09:39:25.513Z
Ethan
<p>Yes, it is possible, and you can actually follow "orphaned blocks" here: <a href="https://blockchain.info/orphaned-blocks">https://blockchain.info/orphaned-blocks</a></p>

<p>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.</p>

<p>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).</p>

CC BY-SA 3.0
2015-11-30T08:08:08.073Z
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
CC BY-SA 3.0
2017-07-26T17:14:39.860Z
When does the reward go to the miner who solved the blocked, is it instantaneous or after 51% have confirmed?
honeybadger
CC BY-SA 3.0
2017-10-27T21:05:10.380Z
@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
CC BY-SA 3.0
2017-10-27T21:14:10.377Z
@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
CC BY-SA 4.0
2019-10-28T01:02:01.283Z
Indeed, it seems that not always the longest chain is accepted. You could notice from the link you provided https://blockchain.info/orphaned-blocks that some orphaned blocks hold greater number of transactions than the confirmed blocks!
Mohamad-Jaafar NEHME
CC BY-SA 3.0
2013-03-06T11:17:23.587Z
2013-03-06T11:17:23.587Z
Nicolai
<p>The process of mining as described in the answer to <a href="https://bitcoin.stackexchange.com/questions/8031/what-are-bitcoin-miners-really-solving">this question</a> is simultaneously repeated by multiple miners.</p>

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

CC BY-SA 3.0
2013-03-06T17:37:19.287Z
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
<mining-theory><blockchain-fork><consensus><best-chain><stale-block>
What happens if two miners mine the next block at the same time?
Emre K.
# What happens if two miners mine the next block at the same time?

(Asked by: username_0 on 2013-03-06)

The process of mining as described in the answer to [this question](https://bitcoin.stackexchange.com/questions/8031/what-are-bitcoin-miners-really-solving) 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?

**Tags:** mining-theory, blockchain-fork, consensus, best-chain, stale-block

> **Comments:**
> **username_1**: 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.  

---

## 2 answers

### Answer by username_4 on 2013-03-06. Score: 34 | Accepted answer

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).

> **Comments:**
> **username_5**: 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?  
> **username_6**: When does the reward go to the miner who solved the blocked, is it instantaneous or after 51% have confirmed?  
> **username_7**: @username_5 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).  
> **username_7**: @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.  
> **username_8**: Indeed, it seems that not always the longest chain is accepted. You could notice from the link you provided https://blockchain.info/orphaned-blocks that some orphaned blocks hold greater number of transactions than the confirmed blocks!  

---

### Answer by username_2 on 2018-02-12. Score: 16

What username_4 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.

> **Comments:**
> **username_3**: "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?  

---

