Proof of work and proof of stake are two different algorithms employed by cryptocurrencies to verify transactions. Chances are you are hearing these terms over and over again because of Ethereum.
Ethereum has finally decided to switch from PoW to PoS.
So in this article, I am going to talk about both PoS and PoW, and how the Ethereum mining scene is going to change forever as well.
The concept of cryptocurrency can be alien to a lot of people let alone these two verification processes. So before you get to know what proof of work and proof of stake really are, you need to have a clear idea about the whole cryptocurrency system.
What Is A Cryptocurrency?
You can view cryptocurrency as an alternate currency that resides in the digital world. They are digital assets that users can trade between them digitally. Cryptocurrencies are generated using a system and at a rate that is publicly known.
Whereas government bodies and corporate boards control the supply of fiat currencies. The first decentralized cryptocurrency was Bitcoin and since then numerous cryptocurrencies (or altcoins) have been created.
But still to this day, Bitcoin remains the king of cryptocurrencies.
Cryptocurrency Vs Fiat Currencies
One of the main differences between cryptocurrencies and traditional currencies is how they are controlled. Fiat currencies are dependent on a centralized system and you have to trust that centralized system. This centralized system knows your bank balance and even little details like your shopping habits!
Whenever you send or receive money the transaction goes through the centralized server. The server then accepts or rejects the transaction. If the server accepts the transaction, the details are added to a centralized ledger system.
Whereas in cryptocurrencies there is no centralized server to take care of transactions. Instead, the whole system is distributed and decentralized network. In this network, every node is as powerful as the next one. But still, there has to be some sort of ledger to hold the transaction details right?
Yes, there is a ledger and it is public. This public ledger is called blockchain and it is easily accessible by all the nodes. This brings us to our next topic of discussion, trustless and distributed consensus.
Trustless Transactions And Distributed Consensus
The real essence of cryptocurrencies is their decentralized and distributed nature. In a traditional currency system, we put a lot of trust in third-party services. We need them for verifying transactions for us and keep a track of our account balance.
Suppose you want to buy a Ledger Nano S for you. Now you use PayPal, Visa, MasterCard or any other payment gateways to complete the transaction. The amount is debited from our account and is credited to the seller buy the gateway. These gateways keep a private ledger on their servers and they do the tiresome work of verifying transactions.
But in case of cryptocurrencies, we don’t have to put our trust in some third party. Anyone can easily access the public ledger or blockchain anytime they like and verify the transactions themselves.
The verification of transactions, depending upon the underlying platform, can be done in two ways – Proof of Work and Proof of Stake.
Proof of Work – Extremely Simplified
Whenever you do a transaction in a cryptocurrency platform the system does a whole lot of work under the hood. First of all, it groups your transaction and a lot of other transactions into a block in real time.
The system secures the block using some cryptography problems. Some of the most used cryptographies in the field of blockchain are – SHA256, scrypt, CryptoNight, X11 etc.
Now we need some nodes which will verify these blocks for us and check whether all the transactions are legitimate. But to do that they will have to solve a ridiculously complex yet useless mathematical puzzle at first.
The process of solving this cryptographic puzzles are called proof of work. And the nodes which perform this task are called miners.
The system gives a reward to the first miner who solves the block and adds the block to the blockchain. The reward amount is preset and it is publicly known. The miners not only help in verifying transactions they also create new currencies in a proof of work environment.
In technical terms, mining can be called inverse hashing. A miner determines a number that can be used only once. This number is called nonce. Based on this nonce the block data results in less than a given threshold. This threshold is called difficulty and it determines how competitive the mining process will be.
When the difficulty increases the cost of mining also increases and the reward decreases. In its inception, the supply rate of Bitcoin was 50 units per 10 minutes but currently, it is at 12.5 Bitcoins.
Problems With Proof of Work
Bitcoin and a whole lot of other altcoins use proof of work. But the proof of work is not an efficient solution let alone the ultimate. The cryptographic puzzles, also called CPU cost functions are resource heavy. And these puzzles are getting tough, day by day. So the network is demanding more computing power and more efficient miner.
Usually, graphics cards are used to mine proof of work cryptocurrencies. But in professional mining farms, ASICs are used. ASICs or Application Specific Integrated Circuits are extremely powerful and highly efficient systems. They can be used to mine Bitcoin and many other altcoins.
Use of this specialized hardware requires a lot of electricity and other resources. And in my opinion, this is a waste of energy. In a proof of work system, we are wasting energy by solving technically useless computational puzzles. Although mining farms are trying their best to become efficient by building farms in Iceland and whatnot, it is not really the solution.
According to a study conducted by Motherboard in 2015, a single Bitcoin transaction used up the same amount of electricity that could power 1.57 American households for a day. This is simply unacceptable and unsustainable.
Cryptocurrencies have the potential to become alternatives to fiat currencies. But if a single transaction is 6000 times more energy intensive then it is a tough choice. This where the concept of Proof of Stake comes into play.
Proof of Stake – Overly Simplified Version
In Proof of Stake, there are no miners. Instead, there are validators or forgers. The system has the same end goal as PoW – to verify transactions and put them on the blockchain. But the algorithm of PoS is entirely different. As discussed above in proof of work the miners solve useless cryptographic puzzles to verify the block.
But in a proof of stake system, the forgers do this task. The system deterministically chooses a validator based on their stake in the cryptocurrency. The stake value is directly related to the total wealth of the validator and the total amount of time the wealth has been in his possession.
In PoS every node places a bet on its block. If the block turns out to be legitimate then it might get added to the blockchain. On the contrary, if the block turns out to be invalid then the forger gets penalized and the bet amount is debited from their balance.
There are no rewards for the validators in the proof of stake system. Instead, the validators receive the transaction charge as compensation. So in proof of stake validators don’t generate new coins like miners in a proof of work system.
This algorithm was at first suggested on the bitcointalk forum in 2011. In 2012 PeerCoin implemented it for the first time. Since then it has been used by several other altcoins like Nxt, BlackCoin, ShadowCash, NuShares etc.
Proof of Work Vs Proof of Stake
I hope after all these explanations the difference between them is quite apparent. But allow me to summarize it for you. Proof of work requires mining, which results in wastage of unreasonable amount of energy. There is no concept of mining in proof of stake, so bye bye energy wastage.
As the difficulty increases more powerful and efficient hardware is needed for PoW mining. In case of PoW, anyone with the right amount of stake can participate in the bidding regardless of the computational power of their systems. In PoW the system doesn’t punish the fraudsters.
But in PoS dishonesty is discouraged and heavily penalized whereas honesty is incentivized. In proof of work, the miner doesn’t have to be a loyal user of that cryptocurrency. But in proof of work, a validator is always a loyal user.
So right now you might be thinking, proof of stake is the real deal as there are no real drawbacks. But you are wrong!
Problems With The Proof of Stake Algorithm
The main concern people have with the proof of stake system is that rich will get richer while the poor ones will stay poor. You need to have a significant amount of tokens in your wallet as well as you have to keep it locked in for a reasonable amount of time to become a validator.
Consider Ethereum – it is the world’s largest distributed computing network. If it gets controlled by a very few then it is kind of alarming.
Ethereum has started developing their version of PoS named Casper and the hard fork is going to happen very soon.
Why Is Ethereum Switching to PoS?
Ethereum has decided to switch from PoW to PoS to address a few issues. Ethereum’s founder and main scientist Vitalik Buterin wants to adopt PoS because it is scalable than PoW. Currently, Ethereum can handle anywhere between 10 to 20 transactions per second. But with PoS the number is expected to increase significantly.
Plus PoS is considered to be more secure than PoW. To influence over the network in PoW someone or some group has to have 51% of the total computing power of the network. This way they can double spend or even block transactions.
This type of attack is called 51% attack. But it is simply not possible in PoS system since supplying invalid blocks is heavily penalized. So even if an attack takes place it will appreciate the currency instead of depreciating its value.
The Ethereum Foundation is also concerned with the effect of mining on nature and natural resources. With all these reasons in mind, Ethereum Foundation decided to make the switch.
(Read) How To Build Your Own Ethereum Mining Rig?
How The Switch Is Planned to Happen
The switch from PoW to PoS of Ethereum consensus is planned to happen in stages. Before the Casper protocol can be implemented, a new network needs to be rolled out in place of the old one.
This new network is being called Metropolis, and it will be hard forked in two stages as well – Byzantine and Constantinople. The Byzantine hard fork has already been carried out on 16th of October and it is performing smoothly till date.
Casper is going to be a hybrid platform, employing both PoS and PoW. Where miners will be able to mine using PoW method and every 100th block will be checked with PoS.
Ethereum Foundation’s Vlad Zamfir is also working on his version of Casper. As per him, while Vitalik is looking for an immediate solution he is more into finding the theoretically optimal PoS solution.
Proof of stake is still in its infancy. At this moment we can only say that PoS looks promising and has a lot of potentials. It is undoubtedly safer and more efficient than proof of work. Also, it is scalable – a problem every cryptocurrency is entitled to face if it gets popular.
Instead of wasting the computing power on mining this distributed network of computers can be used in creating more powerful decentralized applications and smart contracts.
So in my opinion proof of stake really is the way to go.
Good article but you didn’t explain how will the system determine if block is valid? With mining, miners are calculating the hash – mapping one code to another and once it matches, they know this is the right one. With PoS, how will they decide which one is right if there is no calculations, just someone saying this block is ok? It would be good if you can clarify this. Thanks!
Hello, maxitrol. Thanks for reading the article. I actually skipped some critical details about Proof of Stake mechanism to make the article easier to read. But since you asked, I will explain here.
PoW and PoS transactions are very different from each other. In PoS when the time comes to verify a block of transactions and add it to the blockchain, the validator nodes actually bet on the block. The validator nodes know the reward, so they lock that amount and create a staking transaction. That is why in a PoS environment there is always more output coin than input (the actual transactions+the staking transaction). The staking transactions are automatically verified by the system.
Now, the PoS algorithm takes some data from the staking transaction – blocktime, transaction time, output number and hash, and also takes the actual transaction block’s timestamp and the stake modifier. The “stake modifier” is a random number generated by hashing last 64 blocks together. Only a few entropy bits are taken into consideration, in this case.
After that, the PoS algorithm generates a hash from all the collected data.
After generating the block hash, the staking difficulty is calculated. It can be simply calculated by dividing the base difficulty with the number of coins you are staking. But there are some restrictions too, to make it as fair as possible.
The hash is compared to the staking difficulty. And then it is the same process as PoW. The validator also signs the block header to prove that it owns the block.
Now, you might be wondering if PoS still needs hashing to function, then more computing power will equal to more hashes per second. The answer is a big NO. You see the whole data set for generating the block is immutable except for the current block’s timestamp. But again it can be modified up to a certain degree else other nodes will not accept it. Also, the system masks the lower bits of the block time to make the hashes much easier to calculate. So it all boils down to a matter of luck in case of PoS.
Proof of Stake is a very complex algorithm. That is why most explanations use mathematical expressions to describe it. But I hope I was able to explain it in simple words for you.