Proof-of-stake is a cryptocurrency consensus mechanism for processing transactions and creating new blocks in the blockchain. A consensus mechanism is a method for validating records in a distributed database and keeping the database secure. In the case of cryptocurrency, the database is called the blockchain – so the blockchain provides the consensus mechanism.
Proof of Stake (PoS) is an algorithm aiming to achieve distributed consensus in the blockchain. This way of achieving consensus was first proposed here by Quantum Mechanic and later written up by Sunny King and his colleagues. This led to Peercoin based on Proof-of-Stake (PoS). A stake is a value/money we bet on a certain outcome. The process is called staking.
Understanding Proof-of-Stake (PoS)
Proof-of-stake decreases the amount of computational work necessary to confirm blocks and transactions. As part of proof-of-work, it kept the blockchain secure. Proof-of-stake changes the way blocks are verified using the coin owners’ machines, so there’s not as much computational work. Owners offer their coins as collateral – bets – for the ability to verify blocks and then become validators.
Validators are chosen randomly to confirm transactions and verify block information. This system randomly selects who will collect fees rather than using a competitive reward-based mechanism such as proof-of-work.
To become a validator, a coin owner must “stake” a certain amount of coins. For example, Ethereum requires 32 ETH to be staked before a user can become a validator.
Blocks are validated by more than one validator, and when a certain number of validators verify that the block is correct, it is complete and closed.
Different proof mechanisms may use different methods to achieve consensus. For example, when Ethereum implements sharding, a validator validates transactions and adds them to the shard block, which requires at least 128 validators on the committee.
Once the shards are verified, and a block is created, two-thirds of the validators must agree that the transaction is valid, then the block is closed.
Before Proof of Stake, the most famous way to attain distributed consensus was through Proof-of-Work (implemented in Bitcoin). But Proof-of-Work is quite energy intensive (electricity when mining bitcoins). Thus, a consensus mechanism based on proof-of-work increases the chances of an entity mining a new block if it has more computing resources. In addition to the two points above, there are other weaknesses of the PoW-based consensus mechanism, which we will discuss later. In such a scenario, a mechanism based on Proof-of-Stake is important.
What is Proof-of-Stake?
As the name implies, nodes in the network stake a certain amount of cryptocurrency to become candidates for validating a new block and receiving a fee. The algorithm then selects a node from the pool of candidates to verify the new block. This selection algorithm combines the amount of deposit (amount of cryptocurrency) with other factors (such as selection based on coin age, and randomization process) to make the selection fair for everyone in the network.
Coin-age-based selection:
The algorithm keeps track of how long each candidate validator node remains a validator. The older the node, the higher the chance of becoming a new validator.
Random Block selection:
The validator is selected by combining “lowest hash value” and “highest stake.” The node that has the best-weighted combination of them becomes the new validator.
A typical workflow of a PoS-based mechanism
Nodes perform transactions. The PoS algorithm puts all these transactions into a pool.
All nodes fighting to become validators for the next block raise the stake. This stake is combined with other factors such as “coin age” or “random block selection” to select a validator.
The validator verifies all transactions and publishes the block. His bet remains locked, and the forgery reward has also not yet been awarded. This is so that nodes in the network can “OK” a new block.
The validator will get the stake back and the reward if the block is OK. If the algorithm uses a mechanism based on coin age to select validators, the validator for the current block has its coin age reset to 0. This puts it in low priority for the next validator election.
If other nodes in the network do not validate the block, the validator loses his stake and is marked as “bad” by the algorithm. The process starts again from step 1 to create a new block.
Function
Fixed existing coins:
There are only a finite number of coins ever circulating in the network. There is no existence of bringing new coins into existence (as in mining in the case of Bitcoin and other PoW-based systems). Remember that the network begins with a finite number of coins or “from the beginning it starts with PoW, then moves to PoS in multiple cases.” This initiation with PoW is to bring coins/cryptocurrency to the network.
Transaction fee as a reward to coiners/counterfeiters:
Each transaction is charged a certain amount. This is collected and passed to the entity that creates the new block. Please note that the transaction fee will not be rewarded if the forged block is found to be fraudulent. In addition, the validator’s bet is also lost (also known as chopping).
The impracticality of 51% attack:
To perform a 51% attack, an attacker must own 51% of the total cryptocurrency in the network, which is quite expensive. This finds the attack execution too time-consuming, expensive, and not so profitable. There are problems with accumulating such a share of the total cryptocurrency, as there may not be as much currency to buy, and it will become more expensive to buy more and more coins/value. Also, validating incorrect transactions will cause the validator to lose their deposit, making the reward negative.
Energy saving: Since all nodes are not competing to add a new block to the blockchain, energy is saved. Also, no problem needs to be solved (as in the case of a Proof-of-Work system), thus saving energy.
Decentralization: In blockchains such as Bitcoin (a Proof of Work system to achieve distributed consensus), there is the added incentive of exponential rewards for joining a mining pool, leading to a more centralized nature of the blockchain. In the case of a system based on Proof-of-Stake (such as Peercoin), the rewards are proportional (linear) to the deposit amount. So it provides no additional benefits for joining a mining pool, thereby supporting decentralization.
Safety: A person trying to attack the net must own 51% of the stakes (quite expensive). This leads to a secure network.
Weakness of PoS mechanism
Big Bet Validators: If a group of validator candidates come together and own a significant share of the total cryptocurrency, they will have a better chance of becoming validators. The increased odds lead to bigger withdrawals, leading to more rewards being earned, which leads to owning a huge share of the currency. This can be the reason for the network to come to be centralized over time.
New technology: PoS is still relatively new. Research is ongoing to find the flaws, fix them, and make them viable for a live network with real currency transactions.
The “Nothing at Stake” Problem: This problem describes little to no disadvantage for nodes if they support multiple blockchains, in the case of blockchain forking. In the worst case, each fork will lead to multiple blockchains, and validators will work, and the nodes in the network will never reach a consensus.
Goals of Proof-of-Stake
Proof-of-stake is designed to reduce network congestion and environmental sustainability concerns associated with the proof-of-work (PoW) protocol. Proof-of-work is a competitive approach to verifying transactions that naturally encourages people to look for ways to gain an advantage, especially when monetary value is involved.
Bitcoin miners earn bitcoins by validating transactions and blocks. However, they pay their operating costs such as electricity and rent in fiat currency. What happens then is that miners exchange energy for cryptocurrency, which makes PoW mining consume as much energy as some small countries.
The PoS mechanism seeks to solve these problems by effectively replacing computing power with staking, where the ability of an individual to mine randomly is the network. This means there should be a drastic reduction in power consumption, as miners can no longer rely on massive farms of single-purpose hardware to gain an edge.
Proof-of-Stake security
Long touted as a threat to crypto fans, the 51% attack is concerning when using PoS, but there are doubts that it will happen. According to PoW, a 51% attack is when an entity controls more than 50% of the miners on the network and uses that majority to alter the blockchain. In PoS, a group or individual would have to own 51% of the staked cryptocurrency.
Controlling 51% of the cryptocurrency staked is very expensive. Under Ethereum’s PoS, if a 51% attack were to occur, honest validators on the network could vote to ignore the altered blockchain and burn the offender’s staked ETH. This incentivizes validators to act in good faith for the benefit of the cryptocurrency and the network.
Most of the other security features of PoS are not advertised, as this can create an opportunity to bypass security measures. However, most PoS systems have additional security features that add to the inherent security behind blockchains and PoS mechanisms.
Conclusion
“Proof of stake” and “Proof of work” are the two major consensus mechanisms that cryptocurrencies utilize to confirm new transactions, attach them to the blockchain, and generate new tokens. Proof of work, first pioneered by Bitcoin, uses mining to achieve these goals. Proof of stake – used by Cardano, the ETH2 blockchain, and others – uses stakes to achieve the same things.
Key Takeaways:
With proof-of-stake (POS), cryptocurrency owners verify block transactions based on the number of coins staked.
Proof-of-stake (POS) was created as an alternative to Proof-of-work (POW), the original consensus mechanism used to validate the blockchain and add new blocks.
While PoW mechanisms necessitate miners to clear up cryptographic puzzles, PoS mechanisms need validators to squeeze and stake tokens for the privilege of collecting transaction fees.
Proof-of-stake (POS) is considered less risky regarding the potential for a network attack because it structures the compensation in a way that makes the attack less advantageous.
The next block writer on the blockchain is chosen randomly, with higher odds assigned to nodes with larger stake positions.
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.