Stop Breaking Your Head Over Consensus Algorithms - A Simple Guide For Amateurs

in #steemit6 years ago (edited)

As a newbie into the crypto world, I once got so pissed off with the entire concept of the blockchain that I almost broke my head hitting the wall (exaggerating a little). But Why?

No! Not because I lost money or it did something terrible to me, but because of the confusion in the terminology and the mechanism behind it. Back then, my google search used to be something like this: "what is blockchain" "what is block" "how is this chain formed" "what is bitcoin" "what the hell is proof of work" - and the list goes on!

Some people blindly invested in the so-called "trend," losing and earning a lot of money, but I wasn't going to shoot an arrow in the dark. So I started learning from the scratch. Though it has lead to a lot of head scratching, it was apparently very beneficial.

Even before getting onto steemit, I knew a little about PoW and PoS, but then got to know that steem is based on yet another consensus algorithm called DPoS (Delegated Proof of Stake).

 

I'm sure a lot of people like me faced the same thing. So I decided to write a clear and straightforward article on the different consensus algorithms, which even a first-time reader would understand.

Proof Of Work (PoW) :

 

POW is the original consensus algorithm used in the bitcoin network. Whenever we transfer a bitcoin to another user, the transaction is recorded in a decentralized ledger called block. The responsibility of validating such transactions and arranging these blocks is taken up by special nodes called miners, and this process is known as mining. The miners compete against each other to record these transactions and in return, they get rewarded in the form of tokens/coins. But, wait it cannot be that simple right!!! So to achieve this, the miners need to solve a complicated mathematical puzzle that will require a lot of computational power and with the network growing at the current rate, it only becomes more and more difficult. The miner who solves the puzzle first will create the new block and the remaining miners validate the transactions recorded in this new block and then the block gets added to the blockchain. This is called proof of work. Still don’t get it? Never mind!! To better understand it, let’s consider the Byzantine General analogy given by the man himself Satoshi Nakamoto in his “Duality: An excerpt”, in which he beautifully narrates this mechanism .

“A number of Byzantine Generals each have a computer and want to attack the King's wi-fi by brute forcing the password. Once they stimulate the network to generate a packet, they must crack the password within a limited time to break in and erase the logs, lest they be discovered. They only have enough CPU power to crack it fast enough if a majority of them attack at the same time. They don't particularly care when the attack will be, just that they agree. It has been decided that anyone who feels like it will announce an attack time, which we'll call the "plan", and whatever plan is heard first will be the official plan. The problem is that the network is not instantaneous, and if two generals announce different plans at close to the same time, some may hear one first and others hear the other first. They use a proof-of-work chain to solve the problem. Once each general receives whatever plan he hears first, he sets his computer to solve a difficult hash-based proof-of-work problem that includes the plan in its hash. The proof-of-work is difficult enough that with all of them working at once, it's expected to take 10 minutes before one of them finds a solution and broadcasts it to the network. Once received, everyone adjusts the hash in their proof-of-work computation to include the first solution, so that when they find the next proof-of-work, it chains after the first one. If anyone was working on a different plan, they switch to this one, because its proof-of-work chain is now longer. After about two hours, the plan should be hashed by a chain of 12 proofs-of-work.

 

Every general, just by verifying the difficulty of the proof-of-work chain, can estimate how much parallel CPU power per hour was expended on it and see that it must have required the majority of the computers to produce in the allotted time. At the least, most of them had to have seen the plan, since the proof-of-work is proof that they worked on it. If the CPU power exhibited by the proof-of-work is sufficient to crack the password, they can safely attack at the agreed time. This is an example of what the proof of work could do, it simultaneously converges the general view and generates a computational proof of the majority consensus without having to trust anyone.”

Popular Implementations: Bitcoin, Ethereum

The main idea behind POW is to avert cyber attacks such as DDOS. If the puzzle becomes too easy to solve then the network will be prone to attacks and a situation will arise wherein a single large organization can control a majority of the network. If such a scenario arises then where is the point of decentralization? Fortunately, there is nothing to worry folks, because, at the current mining difficulty levels, it is said that even large powerful governments cannot gain a majority, as it is very very expensive to have such levels computational powers.

Though PoW is pretty solid, due to the amount of computational power, cost, and energy inefficiency, it is not profitable for individuals like us. So it paved the way for better mechanisms which are widely in use today.

Proof Of Stake (PoS):

PoS is one such alternative consensus algorithm to POW. In PoS, the number of coins you hold determines how likely you are to create the next block. It's more like a lottery system, so naturally, everyone has the same opportunity, but the more lottery tickets you have, i.e., the more coins you hold, the higher are the chances to win. This mechanism is well suited for platforms with fixed coin supply and has been widely used by many ICOs.

Popular implementations: Decred, Ethereum (soon), Peercoin

 

LPoS (Leased Proof of Stake) and DPoS (Delegated Proof of Stake) are slight advancements to the fundamental concept of PoS. Now, what's the need for another improvement over PoS? It looks pretty good, right?

Leased Proof of Stake (LPoS)

Well, in classic PoS the one who possesses more coins are likely to stake the next block, but what about the holders with low balances? They are entirely out of the picture, aren't they? That means the nodes are indirectly in control of the higher stakeholders, which flaws the concept of decentralization and security of the blockchain.

To eliminate the issue, it's necessary that the chain is wide-spread and even the smallholders have an opportunity to have their share of incentives. LPoS achieves this by allowing the smallholders to lease their holding balance to more prominent holders. Leased coins increase the probability of the staking node thereby increasing the chances of staking the next node. The leased coins, however, remain in control of the holder, who is rewarded proportionally along with the leasers.

Popular implementations: Waves

Delegated Proof of Stake

DPoS, the consensus applied to Steem itself, "is similar to the consensus algorithm adopted by companies throughout the world. People with a vested interest in the future value of Steem vote to select individuals responsible for including testimony in the public record." (as quoted in the Steem whitepaper)

source:lisk.io

 

In other words, people who have a vested interest in the value of Steem, elect a list of nodes that will have the opportunity to stake new blocks and add them to the chain. The people who own these nodes are called witnesses; the captains of the ship. Understanding witness properly is itself a little tricky, so I'll write a detailed article on it later.

For now, you need to understand that in DPoS, all the coin holders elect the staking nodes that are responsible for the new blocks. This will engage all the coin holders, but unlike LPoS, they might not get a direct reward for doing this.

Popular Implementations: Steemit, EOS, BitShares

Proof of Importance (PoI):

PoI is like a small upgrade to the basic concept of PoS. Along with the weight of your coin wallet, here your contribution to the network also matters. It's based on the idea that network productivity should also be a factor in the reward system. So along with holding coins, you also need to take part actively in the community and also your reputation, your transaction amount, transaction frequency, etc.

Popular Implementations: NEM

 

Sort:  

And there are dozens more ways of deciding consensus. It is almost like nobody can agree on what is best, so everyone pushes their own unique agenda to look like they are innovators.

This list was rather small there are way more as you pointed out!

Amazing understanding over crypto-sphere.

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

This post has received a 1.52 % upvote from @booster thanks to: @keetify.

You got a 2.87% upvote from @postpromoter courtesy of @keetify!

Want to promote your posts too? Check out the Steem Bot Tracker website for more info. If you would like to support the development of @postpromoter and the bot tracker please vote for @yabapmatt for witness!

Congratulations @keetify! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The results, the winners and the prizes

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

You are an expert on crypto...you can reach me something's...

Congratulations @keetify! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!