<p>Recall that in order to be a valid block, it has to have a valid proof of work: the hash of the header has to be below the current target value (i.e. start with a sufficient number of zeros).  If you just alter something in the block (e.g. the destination of the coinbase transaction), its hash will change and almost certainly will no longer meet the proof-of-work target.  So you'll have to also find a nonce value which does result in a hash that meets the target.  This is just as much work as mining a new block from scratch and carries no particular benefit compared to regular mining.</p>

<p>If you succeed in doing so, then there will simply be two candidate blocks for the head of the block chain: the original one, and your new "tampered" version (whose hash will necessarily be different from that of the original one).  Miners will be free to choose either one to build their blocks on top of.  Soon, a consensus will be reached as to which one is part of the block chain and which one is an orphan.</p>

CC BY-SA 4.0
2021-12-30T03:28:22.940Z
Nate, are you saying if a hacker successfully creates the new block with an appropriate hash for the modified transaction, it is 50/50 as to whether the tampered one is kept or the original (depends on random chance of what the other nodes decide is correct)?
Vik
CC BY-SA 4.0
2021-12-30T03:42:15.430Z
@Vik: Probably not literally 50/50.  In practice, most nodes will decide according to some deterministic criteria; usually, the one that they saw first. (This does have some randomness due to unpredictable propagation time.) But the protocol doesn't require this, and would have no way to enforce it even if it did, so in principle something else could happen.
Nate Eldredge
CC BY-SA 4.0
2018-09-15T17:26:13.613Z
2018-09-15T17:35:25.190Z
2018-09-15T17:35:25.190Z
Nate Eldredge
<p>We know for each block in block chain, it has the previous block header hash which make the block be tampered become difficult. If the block is tampered, then all blocks after this tampered block need to be tampered too.</p>

<p>However, how can we prevent latest block (last block in the chain) be tampered ? There is no next block follow it which means there is no header hash in next block.</p>

<p>Thanks in advance.</p>

<blockchain><hash>
How to protect the latest block in block chain be tampered?
bubu0321
# How to protect the latest block in block chain be tampered?

(Asked by: username_0 on 2018-09-15)

We know for each block in block chain, it has the previous block header hash which make the block be tampered become difficult. If the block is tampered, then all blocks after this tampered block need to be tampered too.

However, how can we prevent latest block (last block in the chain) be tampered ? There is no next block follow it which means there is no header hash in next block.

Thanks in advance.

**Tags:** blockchain, hash


---

## 1 answers

### Answer by username_1 on 2018-09-15. Score: 2 | Accepted answer

Recall that in order to be a valid block, it has to have a valid proof of work: the hash of the header has to be below the current target value (i.e. start with a sufficient number of zeros). If you just alter something in the block (e.g. the destination of the coinbase transaction), its hash will change and almost certainly will no longer meet the proof-of-work target. So you'll have to also find a nonce value which does result in a hash that meets the target. This is just as much work as mining a new block from scratch and carries no particular benefit compared to regular mining.

If you succeed in doing so, then there will simply be two candidate blocks for the head of the block chain: the original one, and your new "tampered" version (whose hash will necessarily be different from that of the original one). Miners will be free to choose either one to build their blocks on top of. Soon, a consensus will be reached as to which one is part of the block chain and which one is an orphan.

> **Comments:**
> **username_2**: Nate, are you saying if a hacker successfully creates the new block with an appropriate hash for the modified transaction, it is 50/50 as to whether the tampered one is kept or the original (depends on random chance of what the other nodes decide is correct)?  
> **username_1**: @username_2: Probably not literally 50/50.  In practice, most nodes will decide according to some deterministic criteria; usually, the one that they saw first. (This does have some randomness due to unpredictable propagation time.) But the protocol doesn't require this, and would have no way to enforce it even if it did, so in principle something else could happen.  

---

