Proof of What? Understand the Distributed Consensuses in Blockchain

#9 — Proof of Work? Proof of Stake? Delegated Proof of Stake? An overview of the different distributed consensuses

Sandoche ADITTANE
Learning Lab
7 min readMay 8, 2018

--

A good analogy for a consensus!

Cryptocurrencies needs 4 components to work: the data structure, the cryptography and the consensus along with eventual rewards.

Since cryptocurrencies are decentralized in a peer to peer network, nodes, which are computers who are running the cryptocurrency software, have to decide which transactions should be included in the next block and agree on that. This is where consensus is taking part!

There are different consensus to define the rules of agreement. The very first one used in bitcoin is Proof of Work and it is also the most used.

This article is part of my Learning challenge where I learn about one topic each month. As you can imagine, this month, I was learning about blockchain & cryptocurrencies. I based this studies on a Coursera MOOC, a few articles, some whitepapers and the building of my own Proof of Stake Cryptocurrency and Coin Generator. Click here, if you want to know more about my methodology.

If you don’t know how a cryptocurrency technically work I recommend to start with the following article.

Why consensus is needed?

Since cryptocurrencies are decentralized in a peer to peer network, nodes, which are computers who are running the cryptocurrency software, have to decide which transactions should be included in the next block and agree on that.

There are different consensus to define the rules of agreement. The very first one used in bitcoin is Proof of Work and it is also the most used.

Before explaining how Proof of Work and other types of consensus work, let’s give an example of what would happen if there was no consensus.

Let’s imagine a very small cryptocurrency called SmallCoin, with 3 nodes (X, Y, Z), each block can take up to 3 transactions maximum, and then add one block to the blockchain every hour. Alice broadcasts 3 transactions, and Bob broadcasts 3 other transactions and all of them are valid. The node X, decides to put the 3 transactions of Alice, the node Y decide to put 3 transactions of Bob, and Z, 2 transaction of Alice and one of Bob.

Who is right? 🤔 how can all the node agree on which block will be the next one on the blockchain? One solution could be to choose every time one node randomly like a lottery. The problem is the following: if one of the nodes, let’s say X, opens 97 other nodes (by running 97 instances of the software for example), he will have the power, and will be able to blacklist some users and for example never accept the transactions of Bob! This is called a Sybil attack.

In reality, bitcoin blockchain adds one block to the blockchain every 10 minutes, and there is not any limit of 3 transactions per block, but a size limit of 1 megabyte per block, and today (13th April of 2018), 10050 bitcoin nodes are running (see the last number here: https://bitnodes.earn.com/). Bitcoin fight against Sybil attack using the Proof of Work consensus.

Proof of Work (PoW)

The more computational work you provide, the more chance you have to find a block, the working process is called mining and consumes a lot of electricity.

A bitcoin mining Farm

Some cryptocurrencies: Bitcoin, Ethereum (they may eventually change in the future), Litecoin, Monero

Most of them use a Blockchain data structure but you can find some exception like Nano (Raiblocks) using a Block Lattice (one blockchain per account!, read more here: https://github.com/nanocurrency/raiblocks/wiki/Block-lattice) or IOTA, using a Tangle.

Proof of Stake (PoS)

The more coins you stake (own in your account) the more chance you have to find the next block. Some cryptocurrencies also take in account the age of the coin: how long you have been staking them. You need to keep your wallet online to stake and get the rewards (the transactions fees and sometimes the new coins added). Note that some cryptocurrencies ask you a minimum balance to be able to stake. The process of finding blocks and getting the rewards is called mining, or sometimes forging.

Basically, instead of buying mining equipment you buy coins, and you keep them online. Since there is no calculation made except checking the validity of transactions, it is very energy efficient 🌳. Some of these cryptocurrencies can even run in a Raspberry Pi.

These coins can be compared with stocks with dividends. You can usually find on the internet the annual return rate. The rate usually decreases year after year.

Peercoin is the first of all the cryptocurrencies who used Proof of Stake (combined with Proof of Work), most of the Proof of Stake started with Peercoin source code.

Some other PoS cryptocurrencies: Dash (~7.5% annual return), Pivx (~4.8% annual return), OKCash (~10% annual return) or NXT

Find a complete list here: https://www.poslist.org/

Delegated Proof of Stake (DPoS)

The more coin you stake the more voting power you have to select the nodes who are going to validates the next block. It is like a democracy. Not everyone is acting but users have a voting power. The one you can vote for are called delegates. One of the most upvoted delegates will receive in a random way the reward. The rewards are sometimes shared with the voters. If nodes are acting malicious, they are not likely to be elected again. That’s how DPoS protects the network. The first DPoS cryptocurrency is BitShares.

Some other DPoS cryptocurrencies: SteemIt, EOS, Lisk, Ark

Proof of Capacity (PoC)

The more disk space you have the more chance you have to mine the next block. It’s also very energy efficient. If you have unused hard drives you can use them to mine it!

Burstcoin is the first and the only Proof of Capacity cryptocurrency.

It even works with a Raspberry Pi and solar electricity.

Proof of Space and Time (PoCT)

Proof of Space and Time is similar to Proof of Capacity. The “Space” and “Capacity” have actually the same meaning! It just adds another parameter, the time, I would say the time of staking. It is also energy efficient.

There is only one coin made by BitTorrent founders, and it is still work in progress: Chia.

Distributed Acyclic Graph (DAG / Tangle)

The DAG is a data structure different than a blockchain. It doesn’t use any blocks. It’s a lot of interlinked transactions. To put it simply, when a user, Alice, does a transaction, she will validate two previous transactions. Since it’s not using any mining it’s also energy efficient.

There are two famous cryptocurrencies using this structure with a different consensus: Iota and Byteball.

Note that in Iota there are no rewards, in Byteball the transaction fees are collected.

Practical Byzantine Fault Tolerance (PBFT)

In PBFT every node has to communicate to all the other nodes to validate the transactions. Once it’s valid it keeps the state and it gets replicated. Therefore it cannot have more than 30 nodes to the network. This consensus can handle 1000 transactions per second.

Some PBFT using solutions: Hyperledger, Tendermint (both are blockchain platforms and not currencies)

Federated Byzantine Agreement (FBA)

This solution is similar to the previous one but instead of asking all the nodes to validates transactions, a limited group of nodes will work together to validates the transactions.

Some cryptocurrencies using the FBA consensus: Ripple, Stellar

Delegated Byzantine Fault Tolerance (DBFT)

This protocol is similar to the Delegated Proof of Stake. It works through the votes of the users, to select the nodes they trust. The main difference is that 66% of the delegates have to be in agreement in order to add the block to the blockchain whereas, in DPoS, only one of the delegates is chosen to select the next block.

The Neo cryptocurrency is using the DBFT consensus.

Proof of Authority (PoA)

Only a few known accounts called validators can validate transactions and create the next blocks. It’s very centralized and it’s mostly used by private blockchains.

The POA blockchain is using Proof of Authority consensus.

Conclusion

There are many consensuses, and the number keeps growing. I probably miss some of them so feel free to comment to complete this list! Also, I am curious to know your opinion about the consensus which will have the best future?

What’s next?

This article is part of my Learning Challenge about Blockchain & Cryptocurrencies. Like this one, I made 5 others article related to the topic.

If you liked this post, please click the clap 👏button below a few times to show your support! Also, feel free to comment and give any kind of feedback. Don’t forget to follow me!

Want to see more articles like this one? Support me on Patreon 🙌

--

--

Sandoche ADITTANE
Learning Lab

Hello, I’m Sandoche Adittane. I learn about one topic every month and write a post about it!