Ameer Rosic
12 months ago

Proof of Work vs Proof of Stake: Basic Mining Guide

12 months ago
4
38
Join over 115,115 Members
Angel Investors, Startups & Blockchain developers...
Yes, Get Access!
No Thanks!

Recently you might have heard about the idea to move from an Ethereum consensus based on the Proof of Work (PoW) system to one based on the so-called Proof of Stake.

In this article, I will explain to you the main differences between Proof of Work vs Proof of Stake and I will provide you a definition of mining, or the process new digital currencies are released through the network.

Also, what will change regarding mining techniques if the Ethereum community decides to do the transition from “work” to “stake”?

This article wants to be a basic guide to understanding the problem above.

Proof of Work vs Proof of Stake: Basic Mining Guide

What is the Proof of work?

First of all, let’s start with basic definitions.

Proof of work is a protocol that has the main goal of deterring cyber-attacks such as a distributed denial-of-service attack (DDoS) which has the purpose of exhausting the resources of a computer system by sending multiple fake requests.

The Proof of work concept existed even before bitcoin, but Satoshi Nakamoto applied this technique to his/her – we still don’t know who Nakamoto really is – digital currency revolutionizing the way traditional transactions are set.

In fact, PoW idea was originally published by Cynthia Dwork and Moni Naor back in 1993, but the term “proof of work” was coined by Markus Jakobsson and Ari Juels in a document published in 1999.

But, returning to date, Proof of work is maybe the biggest idea behind the Nakamoto’s Bitcoin white paper – published back in 2008 – because it allows trustless and distributed consensus.

Start Your Free Trial Today

Free Trial

What’s trustless and distributed consensus?

A trustless and distributed consensus system means that if you want to send and/or receive money from someone you don’t need to trust in third-party services.

When you use traditional methods of payment, you need to trust in a third party to set your transaction (e.g. Visa, Mastercard, PayPal, banks). They keep their own private register which stores transactions history and balances of each account.

The common example to better explain this behavior is the following: if Alice sent Bob $100, the trusted third-party service would debit Alice’s account and credit Bob’s one, so they both have to trust this third-party is to going do the right thing.

With bitcoin and a few other digital currencies, everyone has a copy of the ledger (blockchain), so no one has to trust in third parties, because anyone can directly verify the information written.

What is Blockchain Technology? A Step-by-Step Guide For Beginners

Proof of work and mining

Going deeper, proof of work is a requirement to define an expensive computer calculation, also called mining, that needs to be performed in order to create a new group of trustless transactions (the so-called block) on a distributed ledger called blockchain.

Mining serves as two purposes:

  1. To verify the legitimacy of a transaction, or avoiding the so-called double-spending;

  2. To create new digital currencies by rewarding miners for performing the previous task.

When you want to set a transaction this is what happens behind the scenes:

  • Transactions are bundled together into what we call a block;

  • Miners verify that transactions within each block are legitimate;

  • To do so, miners should solve a mathematical puzzle known as proof-of-work problem;

  • A reward is given to the first miner who solves each blocks problem;

  • Verified transactions are stored in the public blockchain

This “mathematical puzzle” has a key feature: asymmetry. The work, in fact, must be moderately hard on the requester side but easy to check for the network. This idea is also known as a CPU cost function, client puzzle, computational puzzle or CPU pricing function.

All the network miners compete to be the first to find a solution for the mathematical problem that concerns the candidate block, a problem that cannot be solved in other ways than through brute force so that essentially requires a huge number of attempts.

When a miner finally finds the right solution, he/she announces it to the whole network at the same time, receiving a cryptocurrency prize (the reward) provided by the protocol.

From a technical point of view, mining process is an operation of inverse hashing: it determines a number (nonce), so the cryptographic hash algorithm of block data results in less than a given threshold.

This threshold, called difficulty, is what determines the competitive nature of mining: more computing power is added to the network, the higher this parameter increases, increasing also the average number of calculations needed to create a new block. This method also increases the cost of the block creation, pushing miners to improve the efficiency of their mining systems to maintain a positive economic balance. This parameter update should occur approximately every 14 days, and a new block is generated every 10 minutes.

Proof of work is not only used by the bitcoin blockchain but also by ethereum and many other blockchains.

Some functions of the proof of work system are different because created specifically for each blockchain, but now I don’t want to confuse your ideas with too technical data.

The important thing you need to understand is that now Ethereum developers want to turn the tables, using a new consensus system called proof of stake.

What is a proof of stake?

Proof of stake is a different way to validate transactions based and achieve the distributed consensus.

It is still an algorithm, and the purpose is the same of the proof of work, but the process to reach the goal is quite different.

Proof of stake first idea was suggested on the bitcointalk forum back in 2011, but the first digital currency to use this method was Peercoin in 2012, together with ShadowCash, Nxt, BlackCoin, NuShares/NuBits, Qora and Nav Coin.

Unlike the proof-of-Work, where the algorithm rewards miners who solve mathematical problems with the goal of validating transactions and creating new blocks, with the proof of stake, the creator of a new block is chosen in a deterministic way, depending on its wealth, also defined as stake.

No block reward

Also, all the digital currencies are previously created in the beginning, and their number never changes.

This means that in the PoS system there is no block reward, so, the miners take the transaction fees.

This is why, in fact, in this PoS system miners are called forgers, instead.

Why Ethereum wants to use PoS?

The Ethereum community and its creator, Vitalik Buterin, are planning to do a hard fork to make a transition from proof of work to proof of stake.

But why they want to switch from one to the other?

In a distributed consensus-based on the proof of Work, miners need a lot of energy. One Bitcoin transaction required the same amount of electricity as powering 1.57 American households for one day (data from 2015).

And these energy costs are paid with fiat currencies, leading to a constant downward pressure on the digital currency value.

In a recent research, experts argued that bitcoin transactions may consume as much electricity as Denmark by 2020.

Developers are pretty worried about this problem, and the Ethereum community wants to exploit the proof of stake method for a more greener and cheaper distributed form of consensus.

Also, rewards for the creation of a new block are different: with Proof-of-Work, the miner may potentially own none of the digital currency he/she is mining.

In Proof-of-Stake, forgers are always those who own the coins minted.

How are forgers selected?

If Casper (the new proof of stake consensus protocol) will be implemented, there will exist a validator pool. Users can join this pool to be selected as the forger. This process will be available through a function of calling the Casper contract and sending Ether – or the coin who powers the Ethereum network – together with it.


What is Blockchain Technology? A step-by-step guide than anyone can understand

“You automatically get inducted after some time,” explained Vitalik Buterin himself on a post shared on Reddit.


“There is no priority scheme for getting inducted into the validator pool itself; anyone can join in any round they want, irrespective of the number of other joiners,” he continued.

The reward of each validator will be “somewhere around 2-15%, ” but he is not sure yet.

Also, Buterin argued that there will be no imposed limit on the number of active validators (or forgers), but it will be regulated economically by cutting the interest rate if there are too many validators and increasing the reward if there are too few.

A safer system?

Any computer system wants to be free from the possibility of hacker attacks, especially if the service is related to money.

So, the main problem is: proof of stake is safer than proof of work?

Experts are worried about it, and there are several skeptics in the community.

Using a Proof-of-Work system, bad actors are cut out thanks to technological and economic disincentives.

In fact, programming an attack to a PoW network is very expensive, and you would need more money than you can be able to steal.

Instead, the underlying PoS algorithm must be as bulletproof as possible because, without especially penalties, a proof of stake-based network could be cheaper to attack.

To solve this issue, Buterin created the Casper protocol, designing an algorithm that can use the set some circumstances under which a bad validator might lose their deposit.

He explained: “Economic finality is accomplished in Casper by requiring validators to submit deposits to participate, and taking away their deposits if the protocol determines that they acted in some way that violates some set of rules (‘slashing conditions’).”

Slashing conditions refer to the circumstances above or laws that a user is not supposed to break.

Conclusion

Thanks to a PoS system validators do not have to use their computing power because the only factors that influence their chances are the total number of their own coins and current complexity of the network.

So this possible future switch from PoW to PoS may provide the following benefits:

  1. Energy savings;

  2. A safer network as attacks become more expensive: if a hacker would like to buy 51% of the total number of coins, the market reacts by fast price appreciation.

This way, CASPER will be a security deposit protocol that relies on an economic consensus system. Nodes (or the validators) must pay a security deposit in order to be part of the consensus thanks to the new blocks creation. Casper protocol will determine the specific amount of rewards received by the validators thanks to its control over security deposits.

If one validator creates an “invalid” block, his security deposit will be deleted, as well as his privilege to be part of the network consensus.

In other words, the Casper security system is based on something like bets. In a PoS-based system, bets are the transactions that, according to the consensus rules, will reward their validator with a money prize together with each chain that the validator has bet on.

So, Casper is based on the idea that validators will bet according to the others’ bets and leave positive feedbacks that are able accelerates consensus.

Join over 115,115 Members
Angel Investors, Startups & Blockchain developers...
Yes, Get Access!
No Thanks!

Comments

    Nice article, but I am afraid the story of PoS is not coming out clear. I am not clear how a PoS would work. For example, I don’t think there will be a nonce and hash mechanism (?!). So how will blocks be added to the chain ? How will they be immutable ? Just because a forger ‘A’ has higher stake, why should I believe him/her ? It is possible that ‘A’ is trying to dupe all other smaller players “B to Z” for ulterior reasons ? Are there situations like forking in PoS ? what are those Slashing conditions ? IS it possible that a forger might ending being on the wrong side unwillingly ? How is that handled ? When will a consensus emerge or something is forged correctly or incorrectly ? What will happen if a later audit found that a consensus made earlier needs to be reversed ? It would be nice if this is compared by providing a use case and compare how it would be done in PoW Vs PoS. Everyone understands the economic benefits of POS, what people like me are not getting it is, how is the consensus achieved ?
    @Satya "Venu" Gopal Malyala
    I’d append a question into your list if I may, about the role of miners in a PoS system, if there is any…
    Is the mining era close to its end?
    I am trying to figure out the economical impact of this switch from PoW to PoS.
    As far as I understand, with PoS there is no need of miners, and there is no need in general of computational effort. Am I right? This means that there won’t be dedicated nodes for mining.

    Edited on September 14, 2017
    @andreapeano
    Miners will still need to validate transactions, its just they take a set percentage fee of the amount being exchanged. The reward will be taken as a cut rather than being make from nothing. This therefore creates a finite amount of the currency which makes it more stable.
    @Satya "Venu" Gopal Malyala
    I also want to add that it will make rich more richer by eating out all small players which is very bad model as it will again move towards centralization rather than a decentralized network.
    @Raja4Shekar
    Mining pools will still exist, with the current system the more powerful groups get more rewards so people join mining pools, the same would be for for PoS its just the reward is as a cut from the blocks transaction value.
    I don’t understand proof of stake despite this explanation. Why would I trust this validator/forger? Are they not incentivized to accept tx’s that favour them? How are they monitored and disciplined? Doesn’t PoS make the rich, richer and create a total imbalance of power?
    The way I understand PoS, the more Ether you have the more chances you have to be selected as forger? Is there any hope for the rest of the aspiring new forgers with minimal Ether holdings? Is there a minimum stake required to qualify as a potential pick by the validator pool?
    NXT has been using POS successfully for some time now. Block generations with their transaction fees are competed for and is directly proportional to the number of coins a wallet has. No need to run and maintain a miner; just buy some coins and forge instead. No need to worry about upgrading obsolete equipment and the like. I think POS is the way of the future.
    PoS vests control over the currencies on those with most stakes. In other words, the “interest” rate as incentive or disincentive, might take a back seat to the desire to control most of the currencies that have been made available beforehand. So the PoS brings into the Cryptocurrency centralizing dynamics that the system cannot control. It sets up the whole Cryptocurrency system for some kind of a “central banking” capture. The question to be answered is how can this be avoided?
    So what a person buys a dozen coins and puts them as a collateral to a process that he doesn’t even control or understand?
    Who owns and operates the computer that actually updates the blockchain?
    The idea behind proof of stake has rejected by the majority of the people because bitcoin is already considering a ponzy and exchanges are being closed by the governments like China, so if this happens then this will have a bad impact on cryptocurrency. People will for sure consider it a ponzy as the proof of stake means invest and get paid, means more money you will invest, more chances will be you will get paid. so it will be just worthless and people will lose their faith regarding cryptocurrency.
    Edited on September 19, 2017
    @samalvi
    I agree. Once trust or loss happens people will exit the cryptocurrency market in droves. The floats and liquidity are low and these will be driven down rapidly (remember dot.com bubble/bust). But, blockchain is not going away. That is the real play here. Mining is done unless you have a solar farm to support thousands of GPU’s you need due to exponentially increasingly difficult algorithms to solve. So in effect and actuality Mining has already been centralized in just a few short years. Only the early miners will see big profits. No different than the Gold Rush in California and Alaska. Those late to the party got stuck with the bill. But the early miners and the mining supply companies made a fortune. I would say if you didn’t start mining a couple years ago, then you are too late to join the “mining party”.
    As far as PoS I don’t understand the value it adds besides reducing electrical costs. Maybe the future is better “mining equipment” (aka something that solves complex algorithms) that doesn’t use electricity???….
    so…with PoS, they way i see it, the people who already have ethereum to burn are going to control everything, and the ones who got into the mining game too late are basically screwed? the rich getting richer….
    @nikanika
    That is already the case. The “mining for the common man” ship sailed away years ago.
    @ariadimezzo
    so we need to make it available for the common man again and not the other way around, or other wise it will again be a centralized rather than a decentralized network which is very bad as it collapse the very basic idea of decentralized blockchain.
    Proof Of Stake seems to be leading towards a scenario where the power would rest in the hands of a few. Does not sound good. Not sure if i am missing something here.
    @Amrik Mahal
    Mining will also centralized at the end. Anything competing in nature, the few of the strongest will get stronger and stronger and the rest will fail to compete. This is because of rising mining cost in which big mining farm is more efficient and the less efficient mining farm will fail to profit from higher difficulty. That is the nature of the system.
    You need money to make money. By requiring a balance of Ether, or whatever coin, it eliminates forgers with little stake possibly looking to cause trouble. Think of it like a fancy bar/club. They don’t want headbangers coming in, so they charge more to get the crowd they want. Similar with PoS…”show us your serious and you’ll be rewarded”
    So basically, once Ethereum changes to Proof Of Stake, a scenario will unfold wherein people who hold small amounts of Ether will what? Be treated as a headbanging moron in an upscale fancy club? This does not seem fair. It immediately brings to mind a ponzy scheme where the people in one specific category, the haves, or the major players in the market, will be able to use the investments of people in another category, smaller players, or have-nots, to drive the value of this second categories investments into worthlesslessness. This defeats the very idea behind why crypto currencies are catching on in today’s world…the decentralization, the trustless system, the blockchain treating everyone equally because each transaction, whether small or large, is only verifiable if the community says it’s verifiable. If Ethereum changes to a system that only rewards the larger players, I am not an economist but I must say that it is easy to imagine that at that point the idea behind blockchain technology, decentralized transactions and ledgers, a trustless system, an alternative to fiat currencies that have turned out country into the absolute shithole it is will all become a moot point. And then, what would be the point in a alternative/digital currency? The point now is to replace the broken system with all if it’s wealth imbalance favoring the rich to get richer and leaving the less rich to have virtually no chance at attaining anything in this country (I realize that crypto currencies obviously have technological advantages as well but the main groundswell of interest and support of crypto currencies comes not from people who think Visa must be replaced because of the fees they charge to handle transactions, but rather from people who want a form of currency that is obtained via fairness and has a true market value that isn’t corrupted by the countless things that currently corrupts the dollar)
    I would say that the comments on this article are an indication of what the general public thinks about POS vs POW. The strongly worded comments likening Ethereum’s potential change to POS to a scenario where the rich get richer are widely ignored and any direct responses just accentuate the fact that yes, a change to POS will favor the rich. If Vitalik Buteren does not take the opportunity to explain to the average joe why we shouldn’t think of POS as a means to an end for wealthy investors to become wealthier, than he is agreeing that it is true. The absence of an answer is the same as confirmation that the widely held beliefs about POS are nothing but true. I would also like to comment on the state of journalism in this country. Most of us get our news from the internet. This article attempted to explain a very complicated topic to the uninitiated public. The framework of the article was excellent. However, without the function of an editor proofreading the article and putting it into proper English, the very topics which the article comes close to helping joe public understand technologically advanced topics are lost in a turn of improper English within a word here or there. The article is clearly written in the vernacular of a non-native English speaker. I mean no offense, in fact the opposite. Like I said, the topics broached are very difficult to understand and the author goes about explaining things in a terrific fashion. However, the final copy of the article MUST be proofread and edited to eliminate the errors in its grammar. Having done so would have turned the existing article front a 7 to a 9, a very distinct difference.
    Proof-of-Stake – ARE YOU SURE it’s a good IDEA??? GPU mining business would stop and miners would concentrate in other currencies possibly getting rid of ethereum. It would most likely dramatically decrease ethereum’s value. Moreover – it would be controlled by the richest minorities which is a typical scenario for self-oriented future plans and corruption. I’d suggest to stay at Proof-of-Work model and evolve the power and possibilities.. smart-contracts will cover expensive computer calculations, for instance, by powering autonomous AI technologies which could consist of sience research, transportation, robotics, etc, etc.. Much higher demand for electricity which becomes too expensive? – Tesla is solving that problem… People, why would we still keep on living by the old system model where the earth is for god’s and slaves.. i like philosophy of Jacque Fresco and even ethereum could be the key to it.. not by the governments – by the people..
    A later article https://blockonomi.com/ethereum-casper/
    explained how small players would exist in a scenario of high stakes required;
    “For instance, Ethereum founder Vitalik Buterin has recently thrown around a guesstimate of needing approximately 1,000 ETH to be one of the network’s inaugural stakers. He said that number could be dropped down to as low as 10 ETH over time.
    Whatever the number ends up being, users will still be able to band together and create “staking pools,” just like there are robust mining pools in the Bitcoin and Ethereum communities today.

    You’ll simply pitch your desired amount of ether in, lock in down with your peers, and rake in the dividends together (to be shared proportionally, of course).”

    One motive for the POS scheme part from saving energy is the ability to speed up transactions. Such a direction takes some power out of the arguments that blockchain processing would make cryptocurrency impractical for many applications that need to occur frequently.

    Edited on January 14, 2018
    mining pools have far more than 1000eth, the pools will act as the forgers and people will contribute to the mining pool. As a result the system for most miners will stay relatively the same.
    It looks like Vitalik and Ethereum team have a plethora of interwoven and conflicting interests to solve. I will start with the biggest agency problem everyone is ignoring:

    1) How to give the VC’s bankrolling Ethereum a clean exit with expected returns of >20x on exit. They will be pushing hard for POS as it will create scarcity of ETH and push up their token holdings vastly for an exit. We should not ignore that the VC’s interests and ETH community interests might be wholly orthogonal to each other.

    2) How to keep the little guy vested and reward his/her loyalty to maintaining the integrity of the blockchain? Is this not the whole point of blockchain? Decentralized and distributed custodians of trust? Heads up! That ideal is long dead with mining pools creating hidden centralized power structures whose interests might not always be best aligned to the future of ETH nor the little minnows contributing to their pools. So, while moving this hidden centralized (concentration of control) to POS will certainly free up restrictions for the Ethereum developers to make changes, it will not democratize anything.

    3) Who is being rewarded for what economic value? This is a fundamental question that needs to be clarified. Simply having ‘staking pools’ as trust agents is going to create other imbalances. Who is going to pay for the processing of trust (transaction verification)? What is the infrastructure going to look like? Or is that also going to get centralized as we already have in banks and effectively shafting all the minnows? If someone ‘stakes’ a very large amount of ETH, but has no supporting hardware to process transactions, what is his/her economic value?
    When you buy bonds/equity and get a yield, you are lending money to another entity that will invest that money in other assets to create economic value. The more speculative the assets are, the higher the risk of your investment and consequently the higher the required yield. These yields are not arbitrarily set. They are set by the market pricing the perception of default and clearing accordingly. How is the reward system of ‘staking pools’ going to work? Who is creating what economic value, who is setting the interest yields and according to what risk perceptions? And, what (crypto) economics are going to managing ETHs price inflation other than artificially restricting liquidity through ‘staking’?
    One always has to ask why should one person/entity be entitled to a return without taking any risk (i.e. investment in economic generating assets)? The only concept that generates a return without creating underlying economic value is a Ponzi scheme. There, the risks are aggregated and dumped onto the last one in. So, beware of misaligned economic fundamentals.

    4) How to solve the ever-increasing energy burden of crunching hashes? Maybe this constraint should also be solved by market forces and Ethereum should just create the right incentives for the market to innovate in this space?
    – One thing they can do is to keep a lid on algorithm complexity growth so that it is proportional to Moore’s Law thus ensuring mining/forging overheads remain sustainable.
    – Also, the increasing variable costs of crunching MH/KWh will create pressure to innovate for energy efficient solutions. Maybe the reward system can be changed to include KWh (and/or green power) consumed regardless of your regional tariff. There is a plethora of opportunities to innovation and create value here. It just needs the right incentives.

    Regardless of the trust agent’s end design (POS, POW or POS/POW hybrid), my advice is that Ethereum needs to ensure that market forces determine prices, yields and transaction processing capacity. ETH’s end design needs to focus on creating the right incentives for the various stakeholders who create economic value and carry the risks and then releasing control to the community.