babybitcoin.space

What Happens if Two Miners Solve a Block at the Same Time?

Bitcoin’s blockchain resolves the problem of two miners solving a block at the same time through a process of temporary divergence followed by automatic consensus. The network does not have a single official clock or a central authority to declare a winner. Instead, both blocks are treated as valid for a short period, and the conflict is settled by which block’s descendants accumulate more proof of work first. The losing block becomes an orphan - discarded by the network - and its transactions are returned to the mempool. This mechanism is called the "longest chain rule," and it is the backbone of Bitcoin’s distributed agreement.

A moment of honest ambiguity

When two miners find a valid block nearly simultaneously, each propagates its block across the network. Nodes do not immediately reject one in favor of the other. Instead, each node accepts the first valid block it receives and relays it to peers. Because the network is not globally synchronized - information travels at the speed of light, but nodes are scattered across the planet - different parts of the network can see different blocks first.

Imagine two miners, Alice and Bob, working in different regions. Alice finds a block at height 800,000. Bob, unaware, also finds a block at height 800,000 one second later. Some nodes receive Alice’s block first and add it to their local copy of the chain. Others receive Bob’s block first. For a brief window, the network is split into two competing views: one chain ending in Alice’s block, the other in Bob’s.

This is not a fork in the sense of a permanent split. It is a temporary divergence. Neither side is "wrong" yet. The network simply has two candidate blocks at the same height.

How the network picks a winner

The resolution relies on the next block. Miners do not care which of the two blocks is "correct" in an abstract sense. They care about extending a chain that pays them the block reward. So they choose the block they heard about first, and they start mining on top of it.

Eventually, some miner finds a new block - height 800,001 - on top of either Alice’s or Bob’s block. That new block is broadcast. Nodes that had accepted the other candidate now see a longer chain: the one that includes the new block. By rule, nodes always adopt the chain with the most cumulative proof of work. The chain that gets the next block becomes longer, and the other chain is abandoned.

The block that was left behind is called an orphan. Its transactions are not permanently lost. They go back into the mempool, where they await inclusion in a future block. The miner of the orphan block receives no block reward, and the transactions it contained are unconfirmed again.

Why this rarely happens

Solo miners solving blocks at the exact same time is rare, but it happens. The probability scales with the total hash rate and the block propagation time. When Bitcoin was younger and the network was smaller, orphaned blocks were more common. Today, with faster propagation and higher hash rates, the chance of two blocks being found within seconds of each other is low but not zero.

Pooled mining changes the math slightly. Large mining pools have low-latency connections to their members. When a pool finds a block, it broadcasts it quickly. But even so, two pools can find blocks in the same second. The same resolution applies: the network chooses the chain with more accumulated work.

A subtle detail: the "selfish mining" edge

There is a known attack called "selfish mining" that exploits this temporary ambiguity. A miner who finds a block can keep it secret instead of broadcasting it. If the attacker finds a second block before the rest of the network finds the first one, the attacker now has a two-block lead. Releasing both blocks then forces the network to orphan the public chain. This is not a practical attack for most miners - it requires a significant share of the total hash rate - but it is a reminder that the "longest chain" rule is not a law of physics. It is a convention that holds as long as the majority of miners follow it.

What you actually notice as a user

If you send a transaction and it ends up in an orphaned block, your wallet will show it as unconfirmed. You do not need to do anything. The transaction will be picked up by the next block that includes it. You might see a "replace by fee" option in some wallets, but that is for stuck transactions, not for orphans. In practice, most users never notice a reorg beyond a few blocks.

Why the network does not care about the orphan

The orphan block is not "invalid" in the sense of containing bad data. It is simply a block that lost the race. The transactions inside it are still valid. The miner who produced it wasted electricity and time, but that is their cost of doing business. The network as a whole suffers no loss of integrity. The key point is that the blockchain does not fork permanently because the rules for resolving the conflict are automatic and deterministic. There is no vote, no judge, no manual intervention. The longest chain is the truth, and the truth is whatever the majority of miners extend.

The broader principle

This is not a bug in Bitcoin. It is a feature of a system without a central clock. Any distributed system that must agree on an ordering of events faces this problem. Bitcoin's answer is to make the cost of disagreement real: a miner who builds on a losing block loses their work. That economic incentive is what keeps the network honest. It is also why the rule is "never trust a transaction until it has at least six confirmations" - by then, the chance that a competing chain outpaces the current one is astronomically small.

In short: two miners solving a block at the same time creates a brief, local disagreement that resolves itself within a minute or two. The next block decides. The orphaned block is forgotten, its transactions return to the pool, and the network moves on. It is messy in theory, but it works in practice because the incentives align.

Not financial advice. babybitcoin.space publishes market data and general information about babybitcoin. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to bitcoin