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.

1 Answer 1


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.

  • 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
    Commented Dec 30, 2021 at 3:28
  • @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. Commented Dec 30, 2021 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.