Proof of Work and Proof of Stake

block chain Jul 27, 2019

As the blockchain gained popularity, many consensus mechanisms policies were created. The first one was created by bitcoin, and many others were built to solve problems that exist in other mechanisms. In the following sections, I will discuss a few popular ones.

  • Proof of work (PoW)
  • Proof of stake (PoS)

In addition to these three, there are many other consensus mechanisms that are not covered in this book, such as proof of importance, proof of elapsed time (PoET)                                                , proof of authority (PoA), proof of burn, proof of capacity, proof of activity, and so on. Feel free to explore these on your own; each has its pros and cons and fits different needs.

Proof of Work

PoW is the first and most popular mechanism; it’s used by bitcoin and Ethereum, which are the most popular cryptocurrencies at the time of writing. PoW is achieved by having a network of miners and presenting the miners with a mathematical problem. When miners solve a problem, they are rewarded with a cryptocurrency. The reward is the proof of the “work” done, and that’s where the name comes from.

Note

Ethereum’s development community is looking to move from PoW to PoS or ProgPoW (reduced ASICs’ hash rate benefit mechanism).

PoW determines what peer does the work by the amount of computer power (hash rate) and allocates the work as a percentage so it’s fair. PoW does not trust any peer on the network individually, but the network trusts all of them as a collective network.

This does not mean that one miner competes against another miner. A network of miners (called a pool) can compete against another pool of miners for the job. The higher hash rate the pool has, the more chances it has to get the “work.”

As covered previously, cryptocurrencies are decentralized and work without one trusted computer in charge of the ledger. The PoW is the mechanism that ensures data integrity and discourages malicious attacks.

The proof of work (PoW) is the mathematical puzzle the miner needs to solve. A miner needs to find a solution to a complex mathematical problem to become the leader and be able to create the next best block to be added to the blockchain. The more miners that exist in the network, the more complex the mathematical difficulty that needs to be solved. For bitcoin, only one block is added every ten minutes with only one winner, so the competition is fierce. Solving a problem puts the chips in the computer to work, which consume electricity and produce heat. Think of your computer running an intensive video game that includes lots of media or your computer processing a video for production.

You can also use this online resource, which connects to a bitcoin peer and does all sort of calculations to figure out the next difficulty:

This information is useful for figuring out mining profitability. At the time of writing, bitcoin shows 5 trillion as the difficulty rate, with an estimated next difficulty increase of +3.74% and a total hash rate of 43 trillion GH/s. It also shows that one block takes 9.9 minutes to create, and it generates about 25 bitcoins. A quick calculation shows that if every 10 minutes we get a block the data size of 4.2 MB per year, then 80 bytes of data per block ∗ 6 hours ∗ 24 hours ∗ 365 days = 4.2 MB of data per year.

Having a block created every ten minutes is a limiting factor, and the number of transactions that can be included in each block is limited. That creates a scalability issue that other consensus mechanisms tried to improve on.

To summarize, each miner is racing to solve the same problem; once the problem is solved, the process restarts. This problem is a mathematical puzzle known as the proof-of-work problem, and the reward is given to the first miner who solves the problem. Then the verified transactions are stored in the public ledger.

This PoW is not without its own disadvantages; this type of algorithm can create all sorts of problems in today’s world. For instance, if one mining pool controls more than 51 percent of the total mining power, the entire blockchain security is at risk as you have one central collective not much different than having one computer. A DDOS attack against the network can put the entire trustworthiness of the network at risk.

This actually happened and is not just a theory. At the time of writing, bitcoin gold, a forked version of bitcoin, has suffered a DDOS attack.

A distributed denial-of-service (DDoS) attack happens when multiple systems are attacking a target’s system resource/bandwidth.

On PoW, as the difficulty goes up, that means less profit. Less profit results in less incentive to mine coins. Ethereum cryptocurrency is facing a problem of reduced miners in the network, and in 2018 Ethereum had to plan a “difficulty bomb,” which reduced the difficulty (raising profit for miners), as well as switch from PoW to PoS to increase scalability.

How is an attack is achieved? A pool that accounts for 51 percent of the network’s hashing power is able to create its own block and post it faster than the main blockchain updates. The block holds 51 percent of the network and is able to double spend coins by removing transactions after spending so that the coins are not taken from the originating

wallet. This threat is real. At the time of writing, Bitmain, a mining company, controls more than 40 percent of the total bitcoin’s hash rate.

Many view PoW as unsustainable and insufficient because of the amount of electricity a miner uses and the slow transaction speed compared to other algorithms. To put things in perspective, bitcoin’s current estimated annual electricity consumption is about 60 to 73 terawatt hour (TWh) per year. That’s a similar amount of electricity that it takes to power Switzerland in a year; imagine multiple coins becoming as popular as bitcoin utilizing PoW.

Read more about PoW in the bitcoin white paper at                    https://bitcoin.org/bitcoin.pdf                   written by Satoshi Nakamoto.

Proof of Stake

PoS was created by Sunny King and Scott Nadal in 2012 as an alternative to solve the PoW cons mentioned earlier.

PoS relies on how many coins a peer holds. The peer needs to stake the number of coins it wants to mine.

Instead of hashing power, we have stake power, and there is no dependency on energy consumption because there is no puzzle to solve. PoS provides a similar hashing block scheme to bitcoin’s PoW, but it limits the number of peers. This provides the needed security yet lowers the cost and power consumption. A network fee is provided to peers instead of giving a reward for solving a mathematical puzzle as in PoW.

PoS determines what peer does the work by the size of the stake the peer holds. This achieves a distributed consensus at less energy and less cost. DDOS attacks and frauds are still possible. However, attackers cannot transact more digital currency than they are staking. Otherwise, they would lose their deposits, so the chances are lower for an attack. Keep in mind that attackers can stake other people coins and

won’t care to lose these coins as they are not theirs, so there are still ways for a DDOS attack.

Any peer can participate in the mining process by staking coins in order to validate a new transaction. To become a miner, there are two options; you can stake your coins to be used by a trustworthy node (but you can lose your coin via a fraud of the PoS network by the node), or you can submit a full node to be selected as a miner. Decentralization is limited as only a few miners can hold most of the coins and have majority control. For the work, each miner gets selected randomly; it’s not based on solving a puzzle. Take a look at Table

  • NEO: Staking wallets return approximately 5.5 percent per year. There’s no need to mine; you get gas coins just by holding coins.
  • Others: LSK, PIVX, NAV, RDD, BEAN, Linda, DCR, NEBL, OK, STRAT.

Although some coins provide annual returns, keep in mind that in case the coin market cap stays stable, a single coin will be worth less over time, as new coins are generated. By staking a wallet, the hold (HODL) wallet’s value is less affected as you get more coins to maintain your wallet value. Similar to how a bank gives you an X% interest rate and the inflation is X%, your balance shows more funds, but realistically you own the same amount of money.

Neeraj Dana

Experienced Software Engineer with a demonstrated history of working in the information technology and services industry. Skilled in Angular, React, React-Native, Vue js, Machine Learning