Proof of Work Vs. Proof Of Stake : Most Comprehensive Guide on the Internet.
If you have tried to understand how Bitcoin, Ethereum, or other cryptocurrencies work, you must have come across these two terms again and again:
Proof of work (POW)
Proof of stake (POS)
And I know many of you have given up trying to learn these terms because they are too technical to understand.
But they’re actually fairly simple concepts.
Since each Blockchain is a system of decentralized “nodes” (or computers confirming transactions occurring on the network and maintaining a decentralized consensus across the system) it is important for these nodes, also known as “miners” in the Proof of Work system, or “Validators” in the Proof of Stake system, to be incentivized to keep confirming transactions.
The way in which “miner” or “validator” nodes confirm transactions and how those nodes are incentivized to do so is the main distinction between Proof of Work and Proof of Stake.
Or simply Proof of work and proof of stake are two kinds of computer algorithms that are responsible for today’s success of digital currencies like Bitcoin and Ethereum.
In short, cryptocurrencies are what they are today because of these algorithms. This is how cryptos achieve their “distributed consensus”…
So what actually is Distributed Consensus?
Distributed consensus simply means a large pool of people who are geographically segregated agreeing on something. In cryptocurrencies like Bitcoin, ‘something’ here means agreeing on which transactions or blocks are valid and which are invalid to be added/rejected to the blockchain.
Given the importance of consensus mechanisms, I think it is very important for technical as well as non-technical users to understand this behind-the-scenes mechanism of cryptocurrencies.
So without any further delay, let’s get started.
What Is Proof Of Work (POW)?
Proof-of-Work, or PoW, is the original and initial consensus algorithm in a Blockchain network.
It is a computer algorithm which is currently used by cryptocurrencies like Bitcoin, Ethereum, Litecoin, and others to reach an agreement – or rather a decentralized agreement – around adding a particular block onto the blockchain.“Proof of Work”, as its name implies, requires that the decentralized participants that validate blocks show that they have invested significant computing power in doing so.In bitcoin, validators (known as “miners”) compete to process a block of transactions and add it to the blockchain. They do this by churning enough random guesses on their computer to come up with an answer within the parameters established by the bitcoin program.
Hang on, that’s confusing. So, they wildly guess and hope that their resulting answer ends up in a certain range?
To understand this Process, one need to be familiar with these Terms :
Nonce:
The main character in this game is called a “nonce”, which for trivia lovers, is an abbreviation of “number used once”. In the case of bitcoin, the nonce is an integer between 0 and 4.294.967.296.
Hashes:
The other main character is a “hash”, which is an algorithm (= a really long and complicated formula) that converts any sequence of characters (it could be the word “dog”, or it could be an entire novel) into a string of 64 letters or numbers.
Hashes are a big part of what makes bitcoin secure. If you change so much as a comma in the text that is hashed (= has the algorithm applied to it), or if you so much as add a space, you get an entirely new hash. It could be a little different, or it could be very different, the outcome is random. Only it’s not really random, because every time you pass a particular text through a hash, you get the same string. If you change something, it’s different. For a given text, it’s always the same. Change one thing, and it’s not.
Mining Algorithm:
Hashcash (SHA-256) is the proof of work function that Bitcoin miners use to solve computationally difficult math problems in order to add blocks onto the blockchain. This hashcash function produces a specific kind of data that is used to verify that a substantial amount of work has been carried out.
To understand it more thoroughly, let’s see the workflow which miners follow.
To successfully mine a block, a miner needs to hash the block’s header in such a way that it is less than or equal to the “target”.
The target, at the time of writing this article, is that the SHA-256 hash of a block’s header must be a 256-bit alphanumeric string, and must start with 18 zeros. The target changes as the difficulty changes every 2016 blocks.
The miners arrive at this particular hash (or target) by varying a small portion of the block’s header, which is called a “nonce”. A nonce always starts with “0” and is incremented every time for obtaining the required hash (or target).
Since the varying of the nonce is hit and miss, the chances of getting this particular hash (or target), which starts with a lot of zeros, is very low.
Therefore, many attempts must be made by a miner by varying the nonce, and hence, a lot of work has to be performed.This requires an enormous amount of computational power and hardware resources thus proving that a large amount of work has been carried out before mining any individual block.
As the network is growing, it is facing more and more difficulties. The algorithms need more and more hash power to solve. So, the complexity of the task is a sensitive issue.
And in this way, whichever miner first obtains the correct Hash will win the mining reward of set number of coins.
What Is Proof Of Stake (POS)?
Proof of Stake (PoS) concept states that a person can mine or validate block transactions according to how many coins he or she holds. This means that the more Bitcoin or altcoin owned by a miner, the more mining power he or she has ,in proof of stake system requires the user to show ownership of a certain number of cryptocurrency units.
It was proposed by a Bitcointalk forum user in 2012 because POW required too much electricity and energy, and miners felt that mining a single block was a waste of resources.
Also, a few studies have suggested that running and maintaining POW networks (like Bitcoin) is as costly as powering millions of homes in the US.Alternatively, POS is a much more user-friendly (and environmentally friendly) alternative to POW.
In this type of consensus model, the number of coins you have are stored in the system matters. The larger your “stake” is, the higher the chances are that you won’t breach the system (because you have a huge stake in its optimal performance).
The creator of a new block is chosen in a pseudo-random way, depending on the user’s wealth, also defined as ‘stake’. In the proof of stake system, blocks are said to be ‘forged’ or ‘minted’, not mined. Users who validate transactions and create new blocks in this system are referred to as forgers.
This pseudo-random selection happens after analyzing several different factors to ensure that not only people having a huge stake are selected, but others are also selected. Some of these selection factors are randomized block selection, coin age-based selection, masternodes, etc. We will talk about the selection methods later in the article.
POS is generally applied to those cryptocurrencies that are pre-mined so that users have access to the coins for staking. This means that the supply of POS cryptos are fixed from the start and there is no block mining or forging reward like POW.
In order to validate transactions and create blocks, a forger must first put their own coins at ‘stake’. Think of this as their holdings being held in an escrow account: if they validate a fraudulent transaction, they lose their holdings, as well as their rights to participate as a forger in the future. Once the forger puts their stake up, they can partake in the forging process, and because they have staked their own money, they are in theory now incentivized to validate the right transactions.The incentive that POS forgers get is the transaction fee attached to that block.
Cyptocurrencies that currently run the proof of stake system are BlackCoin, Lisk, Nxt and Peercoin, among others.
Block Selection Methods :
For a proof of stake method to work effectively, there needs to be a way to select which user gets to forge the next valid block in the blockchain. Selecting the forger by the size of their account balance alone would result in a permanent advantage for the richer forgers who decide to stake more of their cryptocurrency units. To counter this problem, several unique methods of selection have been created. The most popular of these methods are the ‘Randomized Block Selection’ and the ‘Coin Age Based Selection’ methods.
Randomized block selection:
In the randomized block selection method of selection, a formula which looks for the user with the combination of the lowest hash value and the size of their stake, is used to select the next forger. Since the size of the stakes are public, each node is usually able to predict which user will be selected to forge the next block. Nxt and BlackCoin are two proof of work cryptocurrencies that use the randomized block selection method.
Coin Age based selection:
The coin age based system selects the next forger based on the ‘coin age’ of the stake the potential forger has put up. Coin age is calculated by multiplying the number of days the cryptocurrency coins have been held as stake by the number of coins that are being staked. Coins must have been held for a minimum of 30 days before they can compete for a block. Users who have staked older and larger sets of coins have a greater chance of being assigned to forge the next block. Once a user has forged a block, their coin age is reset to zero and then they must wait at least 30 days again before they can sign another block. The user is assigned to forge the next block within a maximum period of 90 days, this prevents users with very old and large stakes from dominating the blockchain thereby making the network more secure. Because a forger’s chance of success goes up the longer they fail to create a block, forgers can expect to create blocks more regularly. This mechanism promotes a healthy, decentralized forging community. Peercoin is a proof-of-stake system based cryptocurrency which uses the coin age selection process combined with the randomized selection method. Peercoin’s developers claim that this makes a malicious attack on the network more difficult, since purchasing more than half of the coins is likely costlier than acquiring 51% of proof-of-work hashing power.
Most proof of stake coins that pay a reward in the form of a transaction fee for verifying transactions and creating new blocks, set a target interest rate which users can expect to earn from staking their coins. In the case of cryptocurrencies where forgers create new coins, this rate also becomes the maximum rate at which the currency supply is inflated over time.
Proof of stake systems are more environmentally friendly and efficient, as the electricity and hardware costs are much lower than the costs associated with mining in a proof of work system. A greater number of people are encouraged to run nodes and get involved because it is easy and affordable to participate in this system; this results in more decentralization.
This is only a general guide to the proof of stake system. Each cryptocurrency issuer will most likely customize this system with a unique set of rules and provisions of their own as they issue their currency or switch over from the proof of work system. Additionally, this is a rapidly evolving industry, and apart from proof of work and proof of stake, there are currently several other systems and methodologies of transaction verification and block creation being tested and experimented with.
There are much more differences between the various Proof of Stake algorithms that are being developed but I am limiting to what I said so far just to provide a higher level of differences.
There are currently issues with PoS as well, such as a small group of people owning a majority of tokens/coins will be the Validators but it is still evolving and eventually more solid and robust will be out there at some point in time.
Conclusion:
Both PoS and PoW have their ups and downs, and we’ll be excited to see how the market responds to coins that utilize either system or a hybrid of both. One last thing to keep in mind for PoW, however, is that once all a currency’s coins are minted and circulated, block rewards will cease to exist. This may incentivize PoW coins to update to a PoS model, but only time will tell.
Congratulations @shyamkarnani! You received a personal award!
Happy Birthday! - You are on the Steem blockchain for 1 year!
Click here to view your Board
Congratulations @shyamkarnani! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!