'What happens once you tamper with a block on a blockchain?

I'm learning about blockchains and one topic I don't quite understand is what happens when you tamper with a block on the chain. What happens to what comes after it?

I get the whole concept of proof-of-work and the hash of both the block itself and the previous one. Mainly, what I don't quite get is once it is proven that a certain block was altered and tampered with due to it no longer connecting to the chain, what happens to the rest that comes after this block?

I know there are two main scenarios that are possible:

  • The block tampered with is the newest block;
  • The tampered block is in the middle of the chain;

If it's the newest block, wouldn't the ones that come after it actually approve that information and the data inside the tampered one pass since the hash of the previous block would actually be the one from the tampered? And what if the tampering happened after that block is already on the chain? Would the whole system just cracks and that copy of the blockchain be unconsidered?

Because blockchains work as a system where there's not only one ledger, but several, I get that a block to be added has to pass through a rigorous proof-of-work procedure and if you temper with a block in the middle of the chain, even though you succeeded to mine all following blocks again it still wouldn't work because the several other ledgers will say that this action is not legitimate. Hence, I ask again; where does this block go? Does it just disappear?

Moreover, what stops me from creating a block with fake information, let's suppose that it says I received 5 BTC and I crack the proof-of-work and succeed in finding a nonce that works; how does the system later understand that the information I provided is fake since I'd broadcast to all ledgers that I cracked the nonce and my block is added to the chain?

I'd love it if someone could go over this, it would really help me a lot.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source