Blog

Proof of Work (PoW) Vs Proof of Stake (PoS)

 

Before we dive into the meat of the matter, let’s define what it means for blockchains to achieve consensus.

What is Blockchain?

Blockchain is a decentralized distributed ledger of transactions that makes the records of any digital asset transparent and unchangeable and works without involving any third-party intermediary. No server controls this network so in other to ensure no fake transaction is created, there has to be some way for everyone to agree on which transactions are valid.

All the servers in a blockchain are called “nodes.” And their job is to process transactions. Where some nodes have the capacity to add blocks of transactions to the chain, others are designed to maintain and grow the ledger. In Proof of Work (PoW) networks (which we’ll cover later) like Bitcoin, these nodes are called miners.”

For Proof of stake (PoS), nodes commit funds to the network – a process referred to as “staking” – for a chance to be picked as the next block writer instead of nodes contending with each other to be rewarded for solving cryptographic puzzles, as is the case with PoW.

In PoS networks, nodes that can add blocks are referred to as “validators,” which are participants who are responsible for verifying transactions on a blockchain. Each validator has an opportunity to be selected to write the next block and receive its rewards.

What is Proof-of-Work?

Proof-of-work is a system that allows computers to compete against each other. Computers (nodes) in the system compete to see the first to solve a complex puzzle. Winners of this competition are then permitted to add a new block of transactions to the chain.  In other words, proof-of-work involves a competition to see which new block has the most crypto staked and which new block has the most computational work performed in its favor.

This process is referred to as mining because the energy and resources required to complete the puzzle are often considered the digital equivalent of the real-world process of mining precious metals from the earth.

Because of the way the complex puzzle is created, the only way to solve them is by trial or error method. Here is a simple example:

  1. The Proof of Work mathematical sum = 33+17
  2. The correct answer is 50.
  3. The first miner to get the correct answer wins the mining reward.
  4. Miner 1 and Miner 2 will compete with each other for the reward.

Miner 1

Attempt 1: 33+17= 40    *Incorrect*

Attempt 2: 33+17= 39    *Incorrect*

Attempt 3: 33+17= 55     *Incorrect*

Miner 2

Attempt 1: 33+17 = 51    *Incorrect*

Attempt 2: 33+17= 49     *Incorrect*

Attempt 3: 33+17 = 50    *Correct*

Miner 2 could guess the correct answer on his third attempt, making him the winner and eligible for the reward. In the real world, computers can guess millions of contrasting combinations in seconds, which requires a huge amount of electricity.

So generally, the more computational power the hardware has, the better the chance you have of solving the puzzle first.

When this puzzle gets solved by any miner, that miner is permitted to create a new block (a grouping of transactions) and broadcast it to the node network, which will individually carry out audits of the existing ledger and the new block. When the checks are completed, the newly created block is “chained” onto the previous block, thereby forming a chronological chain of transactions. The miner receives bitcoins for supplying their resources (energy) as rewarded

Proof-of-work, mining, and security

Mining entails a great deal of electricity and safeguards the network by certifying that only those that can prove they have expended resources are granted the right to add a new set of transactions to the blockchain.

This future makes it difficult, time-consuming, and expensive to attack a proof-of-work system like Bitcoin’s. Attackers would require purchasing and setting up mining equipment and paying for the electricity to run the equipment. They would then compete to solve the puzzle and attempt to append a block of transactions containing fake bitcoins to the chain.

Should the vile miner successfully unravel the puzzle first, they would try to broadcast a new block of transactions out to the rest of the network. The network’s nodes would then carry out an audit to ensure the legitimacy of the block and the transactions within it.

As the nodes check the new block against the former version of the ledger, the counterfeit bitcoins will be detected and the block would be considered invalid based on consensus rules.

Proof-of-work makes it seemingly impossible to counterfeit bitcoin else a vile miner controls over 50% of the entire network — this implies they must control about 51% of both the collective computing power of miners, which is referred to as the hashrate, and the computer nodes in the network. If they eventually control over half of the network, the corrupt actor could broadcast a bad block to the network which in turn accepts their nodes and the block to the chain.

Considering how large Bitcoin’s network has grown and how much energy miners put into the proof-of-work system; such an attack would be almost impossible today.

What is Proof-of-Stake?

In the proof-of-stake system, validators (network node that helps process and validates transaction) are selected to find a block based on the number of tokens they hold rather than having a random competition amongst miners to determine which node can add a block.

In this arrangement, the “stake” amount, or quantity of crypto a user holds, substitutes the work miners do in proof-of-work. In this staking, the network structure is secure because a potential participant must acquire cryptocurrency and hold them in other to be chosen to form a block and earn rewards.

Participants are required to spend and dedicate a certain amount of financial resources to the network, this is similar to how miners must consume electricity in a proof-of-work system. Those who invested a huge amount on coins to earn these rewards have a vested interest in the network’s continued success

See the source image
Quick difference in a glance. Image Source: fr.bitdegree

Quick facts:

  • Proof-of-work and proof-of-stake are consensus mechanisms or algorithms that help blockchains coordinate data in a secured way.
  • These algorithms regulate which network node can add a new block of transactions to the chain
  • Both mechanisms are proven methods for maintaining blockchains, though they differ.
  • Proof of Work requires ALL of its miners to attempt solving a complex puzzle, with the winner determined by the person with the most powerful computing hardware devices.
  • Proof of Stake model randomly chooses the winner based on the amount they have staked/coin an individual has

Pros and cons of proof-of-work and proof-of-stake

Featured image source: 101 Blockchains

Comments

  • Avatar
    Felix Aikhuele
    July 8, 2022

    This was a lot to take in. I learnt a lot thank you very much.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Plus loading...