part 3 #StartInvestingInCrypto

we continue talk about blockchain

Each block has :

1. Data

2. Hash

3. Hash of the previous block

Consider the following example, where we have a chain of 3 blocks. The 1st block has no predecessor. Hence, it does not contain has the previous block. Block 2 contains a hash of block 1. While block 3 contains Hash of block 2.

Hence, all blocks are contained hashes of previous blocks. This is the technique that makes a blockchain so secure. Let’s see how it works

Assume a hacker can change the data present in Block 2. Correspondingly, the Hash of the Block also changes. But Block 3 still contains the old Hash of Block 2. This makes Block 3, and all succeeding blocks invalid as they do not have the correct Hash of the previous block.

Therefore, changing a single block can quickly make all following blocks invalid.

Proof of work

Hashes are an excellent mechanism to prevent tempering, but computers these days are high-speed and can calculate hundreds of thousands of hashes per second. In a matter of a few minutes, an attacker can tamper with a block and then recalculate all the hashes of other blocks to make the blockchain valid again.

To avoid the issue, blockchains use the concept of Proof-of-Work. It is a mechanism that slows down the creation of the new blocks.

A proof-of-work is a computational problem that takes a certain to effort to solve. But the time required to verify the results of the computational problem is very less compared to the effort it takes to solve the computational problem itself.

In the case of Bitcoin, it takes almost 10 minutes to calculate the required proof-of-work to add a new block to the chain. Considering our example, if a hacker would to change data in Block 2, he would need to perform proof of work (which would take 10 minutes) and only then make changes in Block 3 and all the succeeding blocks.

This kind of mechanism makes it quite tough to tamper with the blocks, so even if you tamper with even a single block, you will need to recalculate the proof-of-work for all the Blocks