Proof-of-Work (PoW) in the blockchain is a consensus mechanism that allows miners to add a new block to the network based on calculations made to find the perfect hash. Network participants verify the transactions added by the new block.
For a decentralized network like Blockchain, keeping all network participants in sync is essential. However, it seems far-fetched for everyone to agree on one thing. Blockchain uses a consensus mechanism to create governance among all network participants. In this article, we will go through one of the most popular and basic consensus protocols i.e., Proof-of-Work (PoW) in the blockchain.
What is a consensus mechanism?
Simply put, consensus means reaching a decision that all network participants agree on. For example, a group of friends agrees to play soccer without conflict. Reaching a decision to play football together is a state of consensus or mutual agreement here.
“The main purpose is giving a group of different kinds of nodes. However, the update will take place according to several established rules among a group of participants in a secure manner.”
In the case of Blockchain, at least 51% of nodes or network participants agree on the upcoming change. If this happens, the network is updated with the new change. Otherwise, he rejects the change by mutual agreement.
The Proof-of-Work (PoW) consensus mechanism is the oldest yet most popular. The idea emerged in 1993 when Moni Naor and Cynthia Dowrk published a paper exploring the potential of algorithms to prevent fraud. Later, Satoshi Nakamoto created the algorithm (the anonymous figure behind the discovery of Bitcoin) in his white paper “Bitcoin: a peer-to-peer E-Cash system” in 2008.
PoW plays a significant role in the development of Blockchain technology. The goal is to create an authentication system that is hard to crack.
The decentralized network works on the principle of distrust but cooperation. Blockchain (decentralized network) is a chain of linearly connected blocks containing information secured by cryptography. Here, each block contains the hash of its previous block to stay connected.
Additionally, each block contains several other information such as timestamp, block height, transaction records, Merkle Root Hash, block hash, previous block hash, difficulty level, and many more in the block header. The second part contains a set of financial transactions, the hash of which is eventually converted to a Merkle root. So Blockchain is defined as the chain of blocks of transactions.
Adding a new block to the chain is considered a new update to the current system. It, therefore, requires permission from network participants. In order to decide whether to add a new block or not, Proof-of-Work (PoW), a consensus mechanism, is used. Only verified transactions are added to the network.
In contrast, not all blocks are valid. Most proposed block networks are considered invalid. The Blockchain protocol defines the validity of a block. The blockchain network has an arbitrary “Difficulty” setting managed by the protocol that changes how hard it is to mine a block. Mining here means adding a new block.
Miners design new blocks in the chain. They are externals who want to add their block to the network. The work required to develop a valid block is where the value comes from. Miners receive rewards in proportion to their share of the computing power they spend mining a new block. The miner proves the work done by mining a valid block.
The difficulty level can vary in blockchains such as the Bitcoin network or Ethereum to ensure that blocks are created at regular intervals.
How does the PoW algorithm work?
The Proof-of-Work (PoW) consensus algorithm works by requiring each miner to overcome a difficulty level to prove the validity of a block. A block is marked as “valid” only if the hash value of the entire block is lower than the difficulty hash.
Block Hash < Hash Difficulty
The block contains important transaction information that cannot be changed. So miners change the nonce to get the hash below the difficulty threshold. A nonce is a part of a block that can be changed to limit the difficulty level.
Let’s take an example to understand the working PoW and how it works.
Harry is a Bitcoin miner who wishes to add his block of Bitcoin (digital currency) transactions to the network. However, for his block to be valid. First, he must change the block until the hash of his block falls below the difficulty threshold.
let’s say:
Harry block Hash: 817de9e0c
Hash difficulty: 001000000
Nonce: 8263
Harry will change the nonce until he gets the first 3 digits as zeros.
After continuously changing the nonce for hours, he finally got the hash.
Harry block Hash: 000383ec5
Hash difficulty: 001000000
Nonce: 6778
The difficulty threshold has now been reached. Block Hash < Hash Difficulty.
Therefore, Harry’s block will be marked as valid and added to the blockchain. For mining a block in the Bitcoin blockchain, Harry gets a few Bitcoins as a block reward for spending the computing power to find a valid hash.
This process is completely based on chance. So the miner’s job is to change the nonce value until the total hash of the block is lower than the difficulty hash. There are other responsibilities of miners, but that is a topic for another article.
Advantages of Proof-of-Work
Below are the advantages of the Proof-of-Work (PoW) mechanism:
A hard-to-find solution. Still, easy verification.
As an initial consensus mechanism, PoW does not need initial stakes of coins before mining. One can start with 0 coins and it will only be positive.
Ease of implementation compared to other blockchain consensus mechanisms.
It is fault tolerant. It means that the failure of one component will not shut down the entire blockchain network.
Give miners the opportunity to earn by adding a block.
PoW is the oldest, most trusted, and most popular consensus protocol.
Limitations of Proof-of-Work
Below are the disadvantages of the Proof-of-Work (PoW) mechanism:
A lot of energy is wasted because only one miner can finally add their block.
It requires a lot of computing power and, therefore, massive consumption of resources and energy.
51% risk of network attack. A controlling person can get 51% to control the network.
Spread environmental hazards with attachment machines.
Pow is a time and energy wipe-out process.
It required a lot of hardware costs.
Risk of Denial of Service Attacks by Intruders.
Which cryptocurrencies use PoW?
Below are the Major cryptocurrencies that currently use Proof-of-Work (Pow):
bitcoin
Ethereum
Dogecoin
Litecoin
Monero
Bitcoin Cash
DigiByte
Bitcoin gold
Ethereum Classic
Zcash
Outside of PoW:
This doesn’t seem like a fair deal to miners who don’t have the heavy machinery to run such massive calculations. Complying with a Proof-of-Work (PoW) mechanism involves considerable cost and effort. It also requires gas as a transaction fee. Therefore, 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 others.
Proof of Work vs. Proof of Stake
Proof of work and proof of stake are two discrete consensus mechanisms for cryptocurrency, but there are important differences between them.
Both methods confirm incoming transactions and add them to the blockchain. With Proof of Stake, network participants are known to as “validators” other than miners. One important difference is that instead of solving math problems, validators lock up a set amount of cryptocurrency – their stake – in a smart contract on the blockchain.
In interchange for “staking” cryptocurrency, they get a chance to prove new transactions and earn a reward. However, if they incorrectly verify wrong or fraudulent data, they may lose some or all of their deposit as a penalty.
Proof of stake makes it easy to involve more people in blockchain systems as validators. There is no need to buy expensive computing systems and consume huge amounts of electricity to bet cryptocurrencies. All you need are coins.
Conclusion
Proof of work is the most desired of the two main consensus mechanisms for verifying transactions on blockchains. While not without limitations, miners using proof of work help ensure that only legitimate transactions are recorded on the blockchain. The above article goes through the basics of consensus mechanisms and Proof-of-Work (PoW). It also covered how PoW works, its benefits, and its limitations.
Key takeaways:
Proof of work (PoW) is a decentralized consensus mechanism that stands in need of network members to put attempts into solving an arbitrary mathematical puzzle to prevent anyone from gaming the system.
Proof of work is largely used in cryptocurrency mining to clarify transactions and mine new tokens.
With proof of work, Bitcoin and other cryptocurrency transactions can be processed peer-to-peer securely without needing a trusted third party.
Proof of work at scale requires a huge amount of energy, which only increases as more miners join the network.
Proof of Stake (POS) was one of several new consensus mechanisms created as an alternative to proof of work.
The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.
Passionate Machine learning professional and data-driven analyst with the ability to apply ML techniques and various algorithms to solve real-world business problems. I have always been fascinated by Mathematics and Numbers. Over the past few months, I have dedicated a considerable amount of time and effort to Machine Learning Studies.
We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.
Show details
Powered By
Cookies
This site uses cookies to ensure that you get the best experience possible. To learn more about how we use cookies, please refer to our Privacy Policy & Cookies Policy.
brahmaid
It is needed for personalizing the website.
csrftoken
This cookie is used to prevent Cross-site request forgery (often abbreviated as CSRF) attacks of the website
Identityid
Preserves the login/logout state of users across the whole site.
sessionid
Preserves users' states across page requests.
g_state
Google One-Tap login adds this g_state cookie to set the user status on how they interact with the One-Tap modal.
MUID
Used by Microsoft Clarity, to store and track visits across websites.
_clck
Used by Microsoft Clarity, Persists the Clarity User ID and preferences, unique to that site, on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.
_clsk
Used by Microsoft Clarity, Connects multiple page views by a user into a single Clarity session recording.
SRM_I
Collects user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
SM
Use to measure the use of the website for internal analytics
CLID
The cookie is set by embedded Microsoft Clarity scripts. The purpose of this cookie is for heatmap and session recording.
SRM_B
Collected user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
_gid
This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected includes the number of visitors, the source where they have come from, and the pages visited in an anonymous form.
_ga_#
Used by Google Analytics, to store and count pageviews.
_gat_#
Used by Google Analytics to collect data on the number of times a user has visited the website as well as dates for the first and most recent visit.
collect
Used to send data to Google Analytics about the visitor's device and behavior. Tracks the visitor across devices and marketing channels.
AEC
cookies ensure that requests within a browsing session are made by the user, and not by other sites.
G_ENABLED_IDPS
use the cookie when customers want to make a referral from their gmail contacts; it helps auth the gmail account.
test_cookie
This cookie is set by DoubleClick (which is owned by Google) to determine if the website visitor's browser supports cookies.
_we_us
this is used to send push notification using webengage.
WebKlipperAuth
used by webenage to track auth of webenagage.
ln_or
Linkedin sets this cookie to registers statistical data on users' behavior on the website for internal analytics.
JSESSIONID
Use to maintain an anonymous user session by the server.
li_rm
Used as part of the LinkedIn Remember Me feature and is set when a user clicks Remember Me on the device to make it easier for him or her to sign in to that device.
AnalyticsSyncHistory
Used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries.
lms_analytics
Used to store information about the time a sync with the AnalyticsSyncHistory cookie took place for users in the Designated Countries.
liap
Cookie used for Sign-in with Linkedin and/or to allow for the Linkedin follow feature.
visit
allow for the Linkedin follow feature.
li_at
often used to identify you, including your name, interests, and previous activity.
s_plt
Tracks the time that the previous page took to load
lang
Used to remember a user's language setting to ensure LinkedIn.com displays in the language selected by the user in their settings
s_tp
Tracks percent of page viewed
AMCV_14215E3D5995C57C0A495C55%40AdobeOrg
Indicates the start of a session for Adobe Experience Cloud
s_pltp
Provides page name value (URL) for use by Adobe Analytics
s_tslv
Used to retain and fetch time since last visit in Adobe Analytics
li_theme
Remembers a user's display preference/theme setting
li_theme_set
Remembers which users have updated their display / theme preferences
We do not use cookies of this type.
_gcl_au
Used by Google Adsense, to store and track conversions.
SID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
SAPISID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
__Secure-#
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
APISID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
SSID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
HSID
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
DV
These cookies are used for the purpose of targeted advertising.
NID
These cookies are used for the purpose of targeted advertising.
1P_JAR
These cookies are used to gather website statistics, and track conversion rates.
OTZ
Aggregate analysis of website visitors
_fbp
This cookie is set by Facebook to deliver advertisements when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
fr
Contains a unique browser and user ID, used for targeted advertising.
bscookie
Used by LinkedIn to track the use of embedded services.
lidc
Used by LinkedIn for tracking the use of embedded services.
bcookie
Used by LinkedIn to track the use of embedded services.
aam_uuid
Use these cookies to assign a unique ID when users visit a website.
UserMatchHistory
These cookies are set by LinkedIn for advertising purposes, including: tracking visitors so that more relevant ads can be presented, allowing users to use the 'Apply with LinkedIn' or the 'Sign-in with LinkedIn' functions, collecting information about how visitors use the site, etc.
li_sugr
Used to make a probabilistic match of a user's identity outside the Designated Countries
MR
Used to collect information for analytics purposes.
ANONCHK
Used to store session ID for a users session to ensure that clicks from adverts on the Bing search engine are verified for reporting purposes and for personalisation
We do not use cookies of this type.
Cookie declaration last updated on 24/03/2023 by Analytics Vidhya.
Cookies are small text files that can be used by websites to make a user's experience more efficient. The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies, we need your permission. This site uses different types of cookies. Some cookies are placed by third-party services that appear on our pages. Learn more about who we are, how you can contact us, and how we process personal data in our Privacy Policy.