Skip to main content

Command Palette

Search for a command to run...

Consensus Mechanism in Blockchain

Published
2 min read
Consensus Mechanism in Blockchain

Nowadays blockchain and web3 are creating hype every day all over the world. Everyone is talking about blockchain technologies, mining, cryptocurrency, etc. In this article, I am going to talk about one of the most important mechanisms of every blockchain protocol which plays a huge role in preventing the blockchain network from hackers and malicious attacks i.e Consensus Mechanism.

consensus (1).jpeg So by using the consensus mechanism the blockchain network gets prevention from external malicious attacks i.e. adding a random block in the blockchain. If any miner or validator of the blockchain network tries to add the malicious block(collection of invalid transactions) in the blockchain then the consensus protocol used in the blockchain network didn't allow such activities in the blockchain. Let's talk about the algorithms about consensus mechanism. Mostly there are 2 consensus protocols used these days:

- Proof of work

- Proof of stake

Proof of Work

Proof of work is first applied in Bitcoin to validate the transactions in the blockchain which is also used in the Ethereum and other blockchain networks for transaction validation purposes. In this method, the miners have to solve complex mathematical problems to get the hash(Tha hash should include the values inside the target value which is defined by the algorithm in the blockchain. The target values changes in a certain period of time.) of the block with the valid set of transactions. After calculating the valid hash and adding the block in the blockchain the miners get the rewards. In proof of work, the miners should have a rich set of resources for calculating the mathematical problem which costs a large amount of money.

Proof of Stake

Proof of stake is first introduced by the Cardano blockchain network in which the validation process of a block is done by staking. In proof of stake, there are validators instead of miners the validators should deposit certain amount of crypto to take part in the validation process and the system selects the validators based on the deposited value of crypto. The more crypto validator deposits the more chances of him/her to get selected to validate the blocks and earn rewards. In this method, the validation can be done with any kind of device. The only thing that is needed to take part in validation is the stake(money or coins or tokens).