Proof-of-Work (PoW) in Blockchain
Proof of Work (PoW) in the blockchain is a consensus mechanism that lets miners add a new block to the network based on the computation done to find the perfect hash. Network participants validate transactions added by the new block. Let's understand more!
Table of Content
- What is the Consensus Mechanism?
- What is Proof-of-Work (PoW) in blockchain?
- How does the Proof-of-Work Algorithm work?
- Benefits of Proof of Work
- Limitations of Proof of Work
- Which cryptocurrencies use PoW?
- Beyond PoW
What is the Consensus Mechanism?
In simple terms, Consensus means achieving a decision state with which all network participants agree. For instance, a group of friends agrees to play football without conflicts. Here, deciding to play football together is a state of consensus or mutual agreement.
In the case of Blockchain, it forms at least 51% of nodes or participants in the network agree on the upcoming change. If it happens, the network will update with the new change. Else, it rejects the change by mutual agreement.
- Helped 25K+ students
- Get news regarding upcoming exams, top colleges and more
Let’s jump to the article’s focus, i.e., Proof-of-Work (PoW).
What is Proof-of-Work (PoW)?
Proof-of-Work (PoW) consensus mechanism is the oldest yet most popular. The idea first popped in 1993 when Moni Naor and Cynthia Dowrk published an article exploring the potential of algorithms to prevent fraud. Later, Satoshi Nakamoto coined the algorithm (an anonymous figure behind the discovery of Bitcoin) in his whitepaper on “Bitcoin: A peer-to-peer E-Cash system” in 2008.
PoW plays a significant role in the evolution of Blockchain Technology. The idea is to create a verification system that is hard to crack.
The decentralized network works on the principle of not trusting but staying cooperative. Blockchain (a decentralized network) chain of linearly connected information-contained blocks secured using cryptography. Here, each block contains the hash of its previous block to keep connected.
Moreover, every block contains several other pieces of information like timestamp, block height, transaction records, Merkle Root Hash, block hash, previous block hash, difficulty level, and many more in the block header. The other section contains a set of financial transactions whose hashes will eventually convert into the Merkle root. Hence, a blockchain is a chain of blocks of transactions.
Mining a Block
When it comes to adding a new block to the chain, it’s seen as a new update to the current system. Therefore, it requires network participants’ permission. To decide to add a new block or not, Proof-of-Work (PoW), a consensus mechanism, is used. Only verified transactions get added to the network.
In contrast, not all blocks are valid. Most proposed blocks are considered invalid by the network. The Blockchain protocol defines the Block validity. A Blockchain network has an arbitrary “Difficulty” setting managed by the protocol, which changes how hard it is to mine a block. Here, mining means adding a new block.
Miners propose the new blocks in the chain. They are externals who wish to add their block to the network. The work required to create a valid block is where the value comes from. Miners receive rewards in proportion to their share of the computation power they spend to mine a new block. By mining a valid block, the miner proves the work done.
In Blockchains like the Bitcoin network or Ethereum, the difficulty level can change to ensure that blocks are created regularly.
How does the PoW Algorithm work?
A Proof-of-Work (PoW) consensus algorithm works so that each miner needs to cross the difficulty level to prove the block valid. A block is only marked as “valid” if the hash value of the entire block is below the difficulty hash.
Block Hash < Difficulty Hash
A block contains crucial transaction information that can’t be changed. So, the Miners change the nonce to get the hash lower than the difficulty threshold. The nonce is a block component that can be altered to achieve difficulty-level restrictions.
Let’s take an example to understand how it works.
Harry is a Bitcoin miner who wishes to add his block of Bitcoin (a digital currency) transactions to the network. However, to make his block valid. First, he has to change the block nonce until the hash of his block gets lower than the difficulty threshold.
Let’s say,
Harry’s block Hash: 817de9e0c
Difficulty Hash: 001000000
Nonce: 8263
For, this, Block Hash > Difficulty Hash, which is considered invalid.
817de9e0c1 > 001000000
Harry will change the nonce until he gets the first 3 digits as zeroes.
After continuously changing nonce for hours, he finally got the hash.
Harry’s block Hash: 000383ec5
Difficulty Hash: 001000000
Nonce: 6778
Now, the difficulty threshold got achieved. Block Hash < Difficulty Hash.
Hence, Harry’s block will be marked as valid and will get added to the blockchain. Harry gets a few bitcoins as block rewards for mining a block in the bitcoin blockchain for spending the computation power to find the valid hash.
This process is entirely based on chance. Hence, the miner’s job is to change the nonce value until the overall block hash reaches lower than the difficulty hash. There are other responsibilities of miners, but that’s a topic for another article.
Benefits of PoW
The following are the advantages of the Proof-of-Work (PoW) mechanism:
- A hard-to-find solution. Yet, easy verification.
- Initial consensus mechanism, PoW doesn’t need the initial staking of coins before mining. One can start with 0 coins, and it will go only positive.
- Easy to implement in comparison with other blockchain consensus mechanisms.
- It is fault-tolerant. It means the failure of one component will not shut down the whole blockchain network.
- Give miners an earning opportunity for adding a block.
- PoW is the oldest, most trusted, and most popular consensus protocol.
Limitations of PoW
The following are the disadvantages of the Proof-of-Work (PoW) mechanism:
- A lot of energy gets wasted as only one miner can eventually add its block.
- It requires heavy computation power hence massive resource and energy consumption.
- A 51% attack risk on the network. The controlling entity can acquire 51% to dominate the network.
- Spread environmental hazards using additional machinery.
- Pow is a time and energy-consuming process.
- It needed heavy expenses for hardware.
- Risk of denial of service attacks by intruders.
Which cryptocurrencies use PoW?
Following are the cryptocurrencies which are currently using Proof-of-Work (Pow):
- Bitcoin
- Ethereum
- Dogecoin
- Litecoin
- Monero
- Bitcoin Cash
- DigiByte
- Bitcoin Gold
- Ethereum Classic
- Zcash
- Kadena
- Bitcoin SV
- Ravencoin
- Siacoin
- Horizen
Beyond PoW
It doesn’t seem like a fair deal to miners who don’t have heavy machinery to operate such hefty computation. Following Proof-of-Work (PoW) mechanism comes with substantial expense and effort. It also requires gas as a transaction fee. Hence, much research is going on to replace this consensus mechanism. Some alternative algorithms include Proof-of-Stake (PoS), Proof-of-History (PoH), Proof-of-Authority (PoA), Proof-of-Capacity (PoC), Proof-of-Elapsed-Time (PoET), and many more.
Conclusion
The above article goes through the basics of consensus mechanisms and Proof-of-Work (PoW). It also covered the working of PoW, benefits, and limitations. I hope you enjoyed reading the article. Please share your review and Queries below.
FAQs
What are the types of Blockchain networks?
Permissioned blockchain (Private Blockchain), Permissionless Blockchain (Public Blockchain), and Hybrid Blockchain.
What are the applications of Blockchain?
Blockchain is used for financial services, to create digital assets (like NFTs), supply chains, smart contracts, and many more
What is the double-spending problem?
Double spending means transferring from the same balance to multiple accounts. For instance, Bob has 50 Bitcoins in his account. He transfers 40 Bitcoins to Gracy. Then he transferred 30 Bitcoins to Alice. This is a case of double-spending.
What are the other blockchain consensus?
Some alternative consensus protocols include Proof-of-Stake (PoS), Proof-of-History (PoH), Proof-of-Authority (PoA), Proof-of-Capacity (PoC), Proof-of-Elapsed-Time (PoET), and many more.
This is a collection of insightful articles from domain experts in the fields of Cloud Computing, DevOps, AWS, Data Science, Machine Learning, AI, and Natural Language Processing. The range of topics caters to upski... Read Full Bio