Proof-of-Work and Proof-of-Stake are the most common consensus algorithms used in blockchains.

What is a Consensus algorithm?

A blockchain is decentralized i.e., no central authority controls it. Individuals also known as nodes, maintain and update the blockchain network. These nodes are worldwide and may not know each other. So, in order to make them agree on a single data value, consensus algorithms are required. Consensus algorithms also make sure nodes do not commit or attempt any faulty practices.
Each consensus algorithm has it's own pros and cons. Let's see how PoW and PoS differ from each other.


What is Proof-of-Work?

The Proof-of-Work concept was introduced in 1993. It went largely unused until Satoshi Nakamoto created Bitcoin in 2009. As bitcoin is the first-ever cryptocurrency to use decentralized, peer-to-peer technology, Satoshi used proof-of-work to reach consensus among nodes and to secure the bitcoin blockchain. Secure the bitcoin blockchain means that transactions cannot be manipulated and no one can take control over the blockchain network.

As the bitcoin blockchain uses proof-of-work, each node(an individual computer participating in the network) is called a miner. Miners have to verify the transactions and bundle them into a block. Miners solve complex cryptographic puzzles in order to add a new block to the blockchain. Think of complex puzzles, they are difficult to solve but once solved, it is easy for others to verify whether they are correct or not. In the same way, technically speaking, miners have to keep on guessing a random number also called Nonce. This nonce combined with the data in the block, when passed through a hash function generates a Block Hash.

This block hash is the solution to the puzzle, it's like the fingerprint of a block. It is verified by the other miners in the network and thus the block is added to the blockchain. Each block in the blockchain contains the block hash of the previous block too. The block hash represents the work done by the miner, hence it's known as Proof-of-Work.

proof of work explained, bitcoin's consensus algorithm explained

The probability that a nonce gives the valid block hash is 0.0000000000000000002%. Just imagine how many nonces have to be guessed and how many computations have to be made in a second by the miners. Specialized ASICs(Application Specific Integrated Circuits), which have high processing power are used for this purpose. These machines consume a lot of electricity, like a lot. According to the statistics given by the digiconomist, the estimated annual electricity consumption of the bitcoin network is more than 50 TWh, it is good enough to power more than 7 million households in U.S. or also could power the entire countries like New Zealand or Chile. Even the electricity consumed for computing a single bitcoin transaction could power 23 U.S. households for a day.

However, this is not all about Bitcoin electricity consumption. About 74% of energy for Bitcoin mining comes from renewable energy sources. More information about Bitcoin mining energy consumption can be found here.

What if someone tries to attack the network having a proof-of-work consensus algorithm?

If someone wants to manipulate the transactions in a block, they have to recalculate the block hash of that block and the hashes all other blocks in the network. A successful attack thus requires a lot of computational power and time to do those calculations, which means that the incurred cost for the attack will be greater than the reward they are going to get if they have attacked successfully.

The disadvantages of proof-of-work algorithm :

✖The 51% attack

The computing power of the whole network is known as the network hash rate and is measured in hashes/second. The bitcoin network hash rate is 119 Exahashes/s. Consider this, if anybody is capable of having mining power of more than 51% of the network hash rate can cause an attack on the blockchain. The attackers cannot alter the data in the previous blocks but they can halt the network so that new transactions won't happen and they can manipulate the transactions while the network is on the attack.

Here is the hash rate distribution of the top four mining pools in the bitcoin network(at the time of writing this article) :
  • F2pool - 19.5%
  • Poolin - 16.5%
  • Antpool - 12.8%
  • BTC.com - 10.3%
These pools constitute 59.1% of the bitcoin network's hash rate. If they decide to combine, they can create a 51% attack but what happens? Miners are the ones, who get rewards in bitcoin for mining. If they lead these attacks, nobody would use bitcoin, and ultimately bitcoin loses its value. Those rewards they get won't be valuable anymore. In 2014, a mining pool tried to exceed more than 50% of the hash rate but reduced their hash rate voluntarily and also never exceeded 40% again in the future.

✖It requires expensive computer hardware, initially graphic cards like Nvidia GTX 1070, GTX 1070Ti etc., are used for mining, later 100 times more powerful ASICs were introduced. They cost anywhere from $1000 to $10000. 

✖And as we have seen, proof of work consumes a large amount of electricity. Though it guarantees security, it is not useful beyond that.
Some companies are already trying to combat this issue by using renewable sources of energy for producing electricity like solar power. It will be a one time investment for solar panels and they don't need to bear electricity expenses monthly. That would be more profitable for them.

Some of the cryptocurrencies using proof of work consensus algorithms are :

  • Bitcoin
  • Ethereum
  • Litecoin
  • Dash
  • Monero
  • Zcash
  • Ravencoin

Every cryptocurrency having proof of work, may not have the same hash function. Hash function of a cryptocurrency entirely depends on the developer of the cryptocurrency. A hash function is responsible for the amount of processing power required to create a new cryptocurrency and also the type of computer hardware to be used.

Bitcoin uses SHA-256(Secure Hashing Algorithm 256 bits) whereas Litecoin(LTC) uses the Scrypt algorithm. SHA-256 stresses the hardware and consumes a lot of electricity, but Scrypt mining is optimized only to do on GPUs rather than the costly ASICs. But, Scrypt compatible ASICs are created which is not expected by the LTC developers. Cryptocurrency Dash uses the X11 algorithm, X11 requires 30% less power and processors run 40% cooler than they do with SHA-256 or Scrypt. Monero uses the Cryptonight algorithm which is suitable to be run even on normal CPUs.

Ethereum is going to shift from Proof-of-Work to Proof-of-Stake algorithm soon. But why?

NEXT
What is Proof-of-Stake? How does it work?
and
How to earn by Staking cryptocurrency?

Post a Comment

Previous Post Next Post