<blockquote>
  <p>1- I read somewhere that one of the purposes of blockchain is that you can't change the blocks of the past without recomputing the entire thing. Is that assumption correct?</p>
</blockquote>

<p>Yes, that is correct. Each block builds upon (references) the one before it, so changing one in the past would require you to update (recompute) every block since then. </p>

<blockquote>
  <p>2- Miner will find a nonce, giving a block data, to generate a hash that matches a certain difficulty. Is that correct?</p>
</blockquote>

<p>Yes, a miner will vary the nonce/extra-nonce/transaction order/etc, until a valid block hash is found.</p>

<blockquote>
  <p>3- So the miner knows a new block. But not the entire chain. </p>
</blockquote>

<p>Incorrect. The valid block hash that the miner finds includes a reference to the prior block's hash. So in effect, the miner knows about the new block, and the entire chain before it, since all prior blocks are linked by their block hashes in this way. Each full node (which includes miners) will store a record of the blockchain so they can reference all new blocks and transactions against the blockchain history.</p>

<blockquote>
  <p>4- Where in the flow and by whom in the network the entire chain will be exchanged so they need to decide which chain is better?</p>
</blockquote>

<p>The longest valid chain is what the network's nodes will follow, which in practice means the valid chain with the highest accumulated proof of work.</p>

<blockquote>
  <p>5- By the way, what is the best chain given two versions of them?</p>
</blockquote>

<p>If two valid blocks with the same block height are found, whichever one is built upon first will be the winner. Please look up info on 'orphan blocks' to learn more about how this plays out. </p>

<blockquote>
  <p>6- ok, the blocks are correct and the chain is valid everybody agrees with that. Who in the network checked if A that passed 1btc to B had 1btc to perform this action?</p>
</blockquote>

<p>Each full nodes will check to ensure that all new transactions and blocks are valid, and they will ignore any that are invalid. Each node keeps track of where all of the bitcoins are located, a blockchain system has extreme redundancy. A full node operator can tailor their node to only store/relay certain types of information if they so desire, but all of the info </p>

CC BY-SA 3.0
2018-03-03T23:40:23.173Z
thanks for the explanations. 

when a miner finds a hash and will create a new valid block, what does it do with the new block? it will broadcast the block to the other nodes or it will broadcast his version of the entire chain to the other nodes?
Victor Ferreira
CC BY-SA 3.0
2018-03-04T00:16:14.280Z
The miner broadcasts the new block to other nodes in the network. Other nodes know the blockchain history, so they can independently verify that the new block is valid. Broadcasting the entire blockchain with every block would be very resource intensive.
chytrik
CC BY-SA 3.0
2018-03-07T03:16:34.500Z
they can verify if the block is valid, alright. But how could they decide between two blockchains if they only know their own blockchains plus a new block?
Victor Ferreira
CC BY-SA 3.0
2018-03-07T03:22:52.610Z
That is up to the node, in the case of multiple valid blocks at the chaintip (same blockheight), most nodes will follow the block they hear about first. If a node follows on block, but the other block is built upon first, then the node will switch and follow that chain instead. This is why traditionally, it is recommended that a user wait 6 block confirmations to be sure the chain will not be rewritten. As I mentioned above, look up 'orphan blocks' for more info.
chytrik
CC BY-SA 3.0
2018-03-03T23:29:32.467Z
2018-03-03T23:29:32.467Z
chytrik
<p>How can we be sure that the entire chain is valid?</p>

<p>1- I read somewhere that one of the purposes of blockchain is that you can't change the blocks of the past without recomputing the entire thing. Is that assumption correct?</p>

<p>So if you could hypothetically recompute everything, you could generate a new chain. I also read somewhere about some problems that Proof of Work try to solve and there was this possibility of a concurrent plausible solid chain.  How is that possible? Who can generate an entire chain? </p>

<p>I explain my doubt:</p>

<p>2- Miner will find a nonce, giving a block data, to generate a hash that matches a certain difficulty. Is that correct?</p>

<p>So the miner knows a new block. But not the entire chain. 3- Does it? So when it finds the nonce and hash it announces a new block to a different kind of node, let's say the full node (what is that exactly?). </p>

<p>4- Where in the flow and by whom in the network the entire chain will be exchanged so they need to decide which chain is better?</p>

<p>5- By the way, what is the best chain given two versions of them?</p>

<p>extra: 
6- ok, the blocks are correct and the chain is valid everybody agrees with that. Who in the network checked if A that passed 1btc to B had 1btc to perform this action?</p>

<p>Please could you clarify 1, 2, 3, 4, 5 and 6?</p>

<blockchain><mining-theory><nodes><full-node>
Who checks if the entire chain in valid?
Victor Ferreira
# Who checks if the entire chain in valid?

(Asked by: username_0 on 2018-03-03)

How can we be sure that the entire chain is valid?

1- I read somewhere that one of the purposes of blockchain is that you can't change the blocks of the past without recomputing the entire thing. Is that assumption correct?

So if you could hypothetically recompute everything, you could generate a new chain. I also read somewhere about some problems that Proof of Work try to solve and there was this possibility of a concurrent plausible solid chain. How is that possible? Who can generate an entire chain?

I explain my doubt:

2- Miner will find a nonce, giving a block data, to generate a hash that matches a certain difficulty. Is that correct?

So the miner knows a new block. But not the entire chain. 3- Does it? So when it finds the nonce and hash it announces a new block to a different kind of node, let's say the full node (what is that exactly?).

4- Where in the flow and by whom in the network the entire chain will be exchanged so they need to decide which chain is better?

5- By the way, what is the best chain given two versions of them?

extra:
6- ok, the blocks are correct and the chain is valid everybody agrees with that. Who in the network checked if A that passed 1btc to B had 1btc to perform this action?

Please could you clarify 1, 2, 3, 4, 5 and 6?

**Tags:** blockchain, mining-theory, nodes, full-node


---

## 1 answers

### Answer by username_1 on 2018-03-03. Score: 3 | Accepted answer

> 1- I read somewhere that one of the purposes of blockchain is that you can't change the blocks of the past without recomputing the entire thing. Is that assumption correct?

Yes, that is correct. Each block builds upon (references) the one before it, so changing one in the past would require you to update (recompute) every block since then.

> 2- Miner will find a nonce, giving a block data, to generate a hash that matches a certain difficulty. Is that correct?

Yes, a miner will vary the nonce/extra-nonce/transaction order/etc, until a valid block hash is found.

> 3- So the miner knows a new block. But not the entire chain.

Incorrect. The valid block hash that the miner finds includes a reference to the prior block's hash. So in effect, the miner knows about the new block, and the entire chain before it, since all prior blocks are linked by their block hashes in this way. Each full node (which includes miners) will store a record of the blockchain so they can reference all new blocks and transactions against the blockchain history.

> 4- Where in the flow and by whom in the network the entire chain will be exchanged so they need to decide which chain is better?

The longest valid chain is what the network's nodes will follow, which in practice means the valid chain with the highest accumulated proof of work.

> 5- By the way, what is the best chain given two versions of them?

If two valid blocks with the same block height are found, whichever one is built upon first will be the winner. Please look up info on 'orphan blocks' to learn more about how this plays out.

> 6- ok, the blocks are correct and the chain is valid everybody agrees with that. Who in the network checked if A that passed 1btc to B had 1btc to perform this action?

Each full nodes will check to ensure that all new transactions and blocks are valid, and they will ignore any that are invalid. Each node keeps track of where all of the bitcoins are located, a blockchain system has extreme redundancy. A full node operator can tailor their node to only store/relay certain types of information if they so desire, but all of the info

> **Comments:**
> **username_0**: thanks for the explanations.   when a miner finds a hash and will create a new valid block, what does it do with the new block? it will broadcast the block to the other nodes or it will broadcast his version of the entire chain to the other nodes?  
> **username_1**: The miner broadcasts the new block to other nodes in the network. Other nodes know the blockchain history, so they can independently verify that the new block is valid. Broadcasting the entire blockchain with every block would be very resource intensive.  
> **username_0**: they can verify if the block is valid, alright. But how could they decide between two blockchains if they only know their own blockchains plus a new block?  
> **username_1**: That is up to the node, in the case of multiple valid blocks at the chaintip (same blockheight), most nodes will follow the block they hear about first. If a node follows on block, but the other block is built upon first, then the node will switch and follow that chain instead. This is why traditionally, it is recommended that a user wait 6 block confirmations to be sure the chain will not be rewritten. As I mentioned above, look up 'orphan blocks' for more info.  

---

