DEV Community

Ahmad Jamaly Rabib
Ahmad Jamaly Rabib

Posted on • Updated on

Diving into blockchain as a beginner: part 2 extended

First part here
Second part here

Hello again!

In the last part we were just focusing on what the blockchain is. But now we will focus more on how blockchain really works.


As we know from before Blockchain is a decentralized network. So there is no central authority responsible to manage and maintain this data. Instead this data is distributed or we can say copied to the nodes participating in this network.


Blockchain is a network of joined or linked blocks. The first block is called the genesis block which is hardcoded and not dependent on any other blocks. Each blocks except the genesis block is dependent on the previous block.

Blocks

From the top figure we found that all the blocks are linked and dependent to previous blocks.

Working Blockchain

From the top animation we can see that the 4th block is dependent on 3rd block, 3rd block is dependent on 2nd block. It goes onwards. From this we can understand that the 4th block is dependent on all previous blocks.

In order to add a block, a hash has to generate for the block. Hashing is a cryptographic process that can be used to validate the authenticity and integrity of various types of input. It is widely used in authentication systems to avoid storing plaintext passwords in databases but is also used to validate files, documents, and other types of data.

Let’s assume that we have three blocks with some transactions stored in them. To link these blocks, every block is assigned a unique hash ID that is generated using the data present in that block. So when someone tries to modify a block, the hash ID of that block changes as well.

Now, the hash ID of the first block is stored in the second block. And the hash ID of the second block is stored in the third block. This process is repeated for all the subsequent blocks. Thus, we have a chain of blocks referred to as the “blockchain”.

Now say I want to change the data on the second block, then we have to change the data on 3rd and 4th blocks. Otherwise the later blocks will be invalid. Because they are dependent on this previous block.

Thats why changing the data of any block is very expensive and difficult to acheive. It actually cannot be changed or reversed. Thats why it is called immutable.

The paritipating nodes/blocks manages the blockchain network. So if any block tries to change the data then the modification has to be validated by other blocks. If other blocks find out the modification is incorrect then they will reject it. Sounds simple right?

Immutable Blockchain

I will try to get some understanding about solidity and Ethereum in next part. See you there!

Top comments (0)