<p>The thing you have to keep in mind is that there isn't just one chain.  Every individual running a full node has their own chain, and validates all the blocks on it as they receive them from the miners.  If a block is invalid, full nodes and other miners will ignore it, and not include it in their own chains.  It is possible that two nodes disagree on which block is the head of the chain.</p>

<p>This type of fork happens about once per day, where half the network thinks block <code>A</code> is the real block, and half the network thinks block <code>B</code> is the real block.  This is perfectly fine, and resolves itself when either block <code>A + 1</code> or  block <code>B + 1</code> is found.  The protocol dictates that nodes accept the longest chain as the real chain, and alternative chains get removed.</p>

<p>The answer to <a href="https://bitcoin.stackexchange.com/questions/5540/what-does-the-term-longest-chain-mean">this question</a> may help you understand.</p>

CC BY-SA 3.0
2016-06-01T17:16:24.513Z
2016-06-01T17:16:24.513Z
2017-04-13T12:47:36.707Z
Jestin
<p>There are valid blocks and there are confirmed blocks.   A block is valid if a miner solves the hash puzzle and has included all valid transactions.  However, The block is only confirmed once it is firmly part of the longest chain, i.e. there's no chance it can become orphaned.   In this case we can say all nodes have reached consensus.   The default for bitcoin clients is to wait 6 blocks.    And newly mined/minted coins cannot be spent for 100 blocks.</p>

CC BY-SA 3.0
2018-01-24T16:19:25.563Z
2018-01-24T16:19:25.563Z
DPen
<p>A block is checked in two places: First, it's checked before a miner starts working on it, and second, it's checked by every other node before accepting the block as valid.</p>

CC BY-SA 3.0
2016-06-01T17:25:48.577Z
2016-06-01T17:25:48.577Z
Nick ODell
<p>I'm trying to understand how mining works and I'm stuck on the part about validating blocks and adding them to the blockchain. </p>

<p>When a miner finds a solution to a block, he shares it with the network, where other miners validate his new block by checking if the hash of the block (using the found nonce) is smaller than the target, right?</p>

<p>At which point does the validation of the block happen and how many users do have to validate the block so it gets appended to the blockchain?</p>

<p>Does this happen before a miner creates a new block? So basically he'd take a new block in the network, validate it, if it's okay, he takes that one as his "previous block" reference?</p>

<blockchain><mining-theory><block-header>
At which point do blocks get validated in the mining process?
NthDegree
# At which point do blocks get validated in the mining process?

(Asked by: username_0 on 2016-06-01)

I'm trying to understand how mining works and I'm stuck on the part about validating blocks and adding them to the blockchain.

When a miner finds a solution to a block, he shares it with the network, where other miners validate his new block by checking if the hash of the block (using the found nonce) is smaller than the target, right?

At which point does the validation of the block happen and how many users do have to validate the block so it gets appended to the blockchain?

Does this happen before a miner creates a new block? So basically he'd take a new block in the network, validate it, if it's okay, he takes that one as his "previous block" reference?

**Tags:** blockchain, mining-theory, block-header


---

## 3 answers

### Answer by username_3 on 2016-06-01. Score: 6 | Accepted answer

A block is checked in two places: First, it's checked before a miner starts working on it, and second, it's checked by every other node before accepting the block as valid.


---

### Answer by username_1 on 2016-06-01. Score: 3

The thing you have to keep in mind is that there isn't just one chain. Every individual running a full node has their own chain, and validates all the blocks on it as they receive them from the miners. If a block is invalid, full nodes and other miners will ignore it, and not include it in their own chains. It is possible that two nodes disagree on which block is the head of the chain.

This type of fork happens about once per day, where half the network thinks block `A` is the real block, and half the network thinks block `B` is the real block. This is perfectly fine, and resolves itself when either block `A + 1` or block `B + 1` is found. The protocol dictates that nodes accept the longest chain as the real chain, and alternative chains get removed.

The answer to [this question](https://bitcoin.stackexchange.com/questions/5540/what-does-the-term-longest-chain-mean) may help you understand.


---

### Answer by username_2 on 2018-01-24. Score: 0

There are valid blocks and there are confirmed blocks. A block is valid if a miner solves the hash puzzle and has included all valid transactions. However, The block is only confirmed once it is firmly part of the longest chain, i.e. there's no chance it can become orphaned. In this case we can say all nodes have reached consensus. The default for bitcoin clients is to wait 6 blocks. And newly mined/minted coins cannot be spent for 100 blocks.


---

