In general, consensus refers to the collective agreement of a majority within a group indicating that they support a particular decision. Within the realm of blockchain, consensus mechanisms serve as a framework responsible for validating transactions and certifying their authenticity. The purpose of this mechanism is to compile a comprehensive record of all legitimate transactions involving cryptocurrency within the blockchain. This fosters confidence among the traders in the coin’s reliability.
Primarily, there are 2 kinds of consensus mechanisms: Proof of Work (PoW) and Proof of Stake (PoS). PoW is the older of the two mainly used by Bitcoin, Ethereum 1.0, and many others. PoS, on the other hand, powers Ethereum 2.0, Cardano, and other newer cryptocurrencies.
Proof-of-work is one of the consensus protocols used by cryptocurrencies to validate the accuracy of a new transaction added to a blockchain. It is the original crypto consensus mechanism used by Bitcoin. The idea of PoW was developed by Cynthia Dwork and Moni Naor in 1993 and later implemented by Satoshi Nakamoto in the Bitcoin whitepaper.
PoW blockchains are secured and validated by a process called mining. Random people working on the blockchain to verify these transactions are called miners. The miner must solve a complex mathematical problem to verify the transaction and add a new block. The first to solve the problem are rewarded with:
- A certain amount of cryptocurrency to be given away as rewads is pre-decided by the network. In the case of Bitcoin, the miners receive 6.25 BTC which is halved every 4 years. The next halving is due around 2024 making the mining reward roughly 3.125 BTC.
- A certain percentage of the transaction fees. As the halving continues and becomes 0 the miners are likely to receive only the percentage transaction fees as their mining reward.
Bitcoin was the first digital currency to solve the most prevalent issue of double -spending through the PoW consensus mechanism. Double spending is the ability of an individual to spend the same amount of digital currency at two different places simultaneously. This creates a gap between the currency available and spending records. The miners on the network not only secure a transaction but also detect and prevent double-spending.
How does PoW Work?
Blockchains are nothing but a distributed ledger recording all transactions. Information like the transaction amount, wallet addresses, time, and date of the transaction is recorded in a block and encrypted into a Block Header. The block header is a hexadecimal number generated through the blockchain’s hash function. Now, because the blockchain ledger is a chain of such blocks, information from every block is included in the next to prevent it from being altered. This means that the hash from each block is used in the block that follows it. When a block is closed the hash must be verified before a new block is created.
This is where PoW comes into play. Let’s imagine a central bank that holds all your money. Every time a transaction is made using that bank, there are intermediaries to verify the occurrence of such transactions and they either add money or withdraw money from your account. In simple words, there is a centralized authority looking into the authenticity of the transactions. But in a decentralized world, this validation is done by miners through the PoW consensus protocol.
The hash is a 64-digit hexadecimal number that is encrypted and generated in milliseconds for a large number of transactions. The series of numbers in the hash is called NONCE (number used once). When a miner tries to guess the hash, it generates a new hash from the publicly available information using NONCE equal to 0.
- If the hash is less than the target hash, then the miner has successfully solved the puzzle and a new block gets added to the blockchain. In other words, the transaction is verified.
- If the hash is greater than the target hash, the program adds a value of 1 to the NONCE, and a new hash is generated to be solved.
List of Top 10 Cryptocurrencies using the PoW Consensus Protocol
Cost of Proof-of-Work
Bitcoin’s proof-of-work mechanism is quite costly and an energy-consuming process. Mining Bitcoins and cryptocurrencies on a larger scale require mining hardware. With several miners racing to validate a transaction, billions of hashes are generated every second. With the required hardware, the computation of billions of hashes consumes somewhere between 0.1 to 1 joule of energy which means that billion Watts are consumed every second globally to validate transactions using PoW. The per unit rate of electricity varies across the world, however, with the approximate estimation of the energy consumed the cost would be around $50000 per hour.
|Central processing unit CPU
|Graphics processing unit GPU
|Field-programmable gate array FPGA
|Application-specific integrated circuit ASIC