1
I am confused with the block chaining, as i know a block header contains a reference to the previous block header hash with the merkle root and other fields. This header hash is related (computed) to the header and not including the block of transactions, so if the header is tampered the chain will fail. I understood that, but if the transactions in the block are edited, it will not change the header hash only if the merkle root is re-calculated.
My question is when a node receive a block, how it verifies it (just rehashing the header, or recalculating merkle root first then rehashing the header)?
ok i got it now, i was missing these verification rules. You were talking about full nodes, what about other simple nodes, do they do these verifications too ? – anis herbadji – 2019-04-15T09:34:32.457
Simple Payment Verification (SPV) nodes that many lightweight wallet uses, downloads only the block headers and not the transactions included in each block. SPV nodes rely on a slightly different method of verification and banks on peers to provide partial views of the relevant parts of the blockchain on demand. SPV nodes link the transaction and the block containing it using Merkle path. Thus it does not have full visibility of the blockchain, but however, it cannot be fooled into assuming that a transaction is included in a block when in fact it isn't. – Ugam Kamat – 2019-04-15T09:45:48.463