We all hear the word blockchain everywhere and truth be told most of us don't know how a blockchain works.
So I have decided to explain how blockchain technology works in the simplest way possible.
A Blockchain can be described as a decentralized ledger that stores data in a continuously growing list of records or blocks.
To understand what a block is we first have to understand the main components of a block.
A block has 3 main components:
When some data in a block has been changed it will cause all the following blocks to be invalid as they no longer contain a valid hash of the previous block.
But this is not enough to secure the Blockchain...
So something called proof of work is used to secure the network.
Proof of work was first suggested by Cynthia dwork and Moni Naor in 1993 to reduce DDoS attacks and spamming on a network.
Proof of work requires a user to solve a moderately difficult hash to get access to a shared resource.
Bitcoin uses the Hashcash proof of work system to secure the network and also to prevent Double Spending
The proof of work on the network slows down the creation of new blocks, Each new block is created in a 10-minute time gap.
And the difficulty of the proof of work increases with 2000 blocks mined.
A blockchain has a high level of security as it uses hashing and proof of work mechanisms to prevent block tampering.
A Blockchain being a distributed p2p network also helps increase the security of the Blockchain
i.e. When someone joins the network he will receive a full copy of the blockchain.
So let's say Bob has joined the network,
He will receive the whole copy of the blockchain and he can now create blocks and earn the block rewards.
After Bob has created a block every single node on the network gets the new block and the nodes then verify the block, If everything is ok the nodes then add the block to their own copy of the blockchain.
Okay, let's say that Bob wants to tamper with a block.
So first Bob has to tamper with a block and the following blocks.
After that Bob has to redo the proof of work for everyone single block and also take control of at least 51% of the network and if he can't get control of the majority of the network the other nodes will reject the blocks tampered by Bob.
This attack could happen if all the major bitcoin mining pools join together and combine their hash rates.
So to prevent such attacks cryptocurrencies are changing to better consensus algorithms like Proof of Stake in case of Ethereum.