Blockchain Basics: Consensus Algorithm (Part 3)

The current article you are reading is Part 3.

Please see below for other articles contained in this series of Blockchain Basics.

Consensus Algorithm

The next topic we want to address is something that is essential to have in order for a decentralized network (such as a blockchain) to function properly, and that’s a robust consensus algorithm.

However, before we dive into the details as to what exactly a consensus algorithm is, let’s first take a step back and and look at examples that are more familiar to us from our everyday lives to figure out how decisions and agreements are made in a centralized world.

Let’s say for example that you are employed as a chef, working at a restaurant that is family owned.

Pexels

On a day-to-day basis, you go about your business doing the best that you can, but for instance, if there ever arises a situation where a dish gets sent back to the kitchen because a customer was unhappy with it and demanded a replacement, you would probably take one of the following courses of action to try and resolve the issue:

  • Prepare a replacement dish (if the problem is straight-forward and clearly the fault of the kitchen staff).
  • Consult the sous-chef (if there’s a little bit of ambiguity).
  • Consult the executive chef (if there is some ambiguity).
  • Consult the owner (if there is lots of ambiguity).

You get the idea…

In any case, as the bullet points above show, there is usually an established hierarchy in place at a private company, and ultimately, at the end of the day, it’s the owner of the restaurant who has the final say on how issues/concerns get addressed.

This doesn’t mean the outcome of any unilateral (or team) decision will be right or wrong, but the above example illustrates a flow chart, if you will, of how people working at a private restaurant can get on the same page and reach consensus.

Now, let’s assume you’re an employee working as an IC designer for a multinational semiconductor corporation.

For illustration purposes, we’ll assume that you’ve been working hard for the past six months on an important design project that is just about ready to be released to market.

Pexels

However, during the most recent conference call, your manager (the regional director) informed you that there are field failures (i.e., customer rejects of your company’s parts) coming in from a previous project which you worked on over a year ago.

Your manager now wants you to shift priorities immediately, and re-allocate all your time + energy towards “firefighting” the root cause of the field failures because your manager is adamant that this is a most important customer that you’re dealing with here, one that the company can ill afford to lose.

Pexels

So, naturally, you take heed of this message from your manager and immediately put your current design project on the back-burner so that you can concentrate solely on performing failure analysis on the old parts.

But before you can get too deep into your assignment, you’re soon interrupted. This time around, you receive a direct phone call from a company Vice President, who is located overseas and in charge of your entire design product line. The VP gives it to you straight up — Your new design project has been declared to be of utmost importance and progress cannot stop. No matter what. You are instructed to ignore your manager and get back to your design work ASAP!

Pexels

Although you’ve never met nor spoken to this VP before, you do know who this person is, and perhaps more importantly, you realize that this individual far outranks your own manager on the totem pole.

So, you know what you must do.

Internally, your own manager might not agree with the VP overriding their decision, but without being too dramatic here, we can say that there is a hierarchy in place to help achieve consensus.

In a centralized workplace, it typically doesn’t take us long to realize what our role is there and who are the people that outrank us. Furthermore, for all intents and purposes, we also take for granted and naturally assume that most everyone working at a company has their employer’s best interest at heart.

Why is that?

For starters, there is a CLEAR incentive for people to behave and do their jobs well — Money.

Pexels

Not only is it just money that drives us to excel, though, but our own reputations are on the line too.

With those examples out of the way and some context in place, we are now ready to take a look at how things are setup in a distributed + decentralized network, where the rules of the game, if you will, are slightly different than the centralized world we are all used to operating in.

As a refresher, let us remember than in a decentralized network environment, like in the case of blockchain, we’re still trying to make things run as smoothly (and correctly) as possible while accepting an altered reality where anyone and everyone can now become an active participant.

There are no longer any barriers (or screening) to entry (which has its own set of pros and cons).

In essence, we’re trying to establish trust with people we don’t know.

A trustless system means that the participants involved do not need to know or trust each other or a third party for the system to function. In a trustless environment, there is no single entity that has authority over the system, and consensus is achieved without participants having to know or trust anything but the system itself.

So, in order to keep a blockchain network like Bitcoin chugging along happily and without incident, participants must be able to agree on the events that are taking place (e.g., transactions from Point A to Point B).

Consensus much be reached.

If the participants cannot reach consensus, the network will never be secure and always be subject to: manipulation, attacks, fraud, etc.

For example, serious issues, such as double-spending could occur on a compromised blockchain network.

Double-spending is a potential flaw in a digital cash scheme in which the same single digital token can be spent more than once.

Unlike physical cash, a digital token consists of a digital file that can be duplicated or falsified.

Please see the following video for more details about double-spending:

In addition, the following short video is also definitely worth watching — It goes over the Byzantine Generals’ Problem, which describes another potential form of malicious attack that can bring a distributed network to its knees, if left unsolved:

As the following image will illustrate, being united as a cohesive unit with everyone else on the same team can ultimately be the deciding factor between “victory” (i.e., a working network) or “defeat” (i.e., an altogether worthless network).

Cryptonomist

Satoshi Nakamoto solved both the double-spending and Byzantine Generals’ Problem on the Bitcoin blockchain by implementing a consensus algorithm known as Proof-of-Work (PoW).

Without diving too deep into the technical details, let’s try to nevertheless shed some light as to how the Bitcoin network addressed the Byzantine Generals’ Problem, by highlighting the following section:

They use a proof-of-work chain to solve the problem.

Once each general receives whatever attack time he hears first, he sets his computer to solve an extremely difficult proof-of-work problem that includes the attack time in its hash. The proof-of-work is so difficult, it’s expected to take 10 minutes of them all working at once before one of them finds a solution.

Once one of the generals finds a proof-of-work, he broadcasts it to the network, and everyone changes their current proof-of-work computation to include that proof-of-work in the hash they’re working on. If anyone was working on a different attack time, they switch to this one, because its proof-of-work chain is now longer.

In addition to offering a working solution to the Byzantine Generals’ Problem, Bitcoin’s use of PoW as a consensus algorithm also provided a means for rewarding active participants (nodes) for validating transactions and securing the network.

Block rewards (newly generated BTC tokens) are currently given out to anyone who is able to successfully solve (find the right hash) an “extremely difficult” mathematical puzzle, and thus find new blocks (add new transactions to the Bitcoin ledger). On the Bitcoin network, a new block is currently produced every ~10 minutes or so.

Coin Telegraph

More specifically:

New bitcoins are generated by a competitive and decentralized process called “mining”.

This process involves that individuals are rewarded by the network for their services.

Bitcoin miners are processing transactions and securing the network using specialized hardware and are collecting new bitcoins in exchange.

Remember that whole point about money being a great tool to incentivize “good” behavior from people?

Block rewards are just that.

Also, because Bitcoin is often referred to as being “digital gold”, the term “mining” gets used a lot.

Visually, you might be thinking something that looks like this:

However, in actuality, Bitcoin mining is more like this:

The term Proof-of-Work seems most appropriate to describe the Bitcoin mining process because it takes a lot of computing power (i.e., hash rate), which is not free, and actually it uses quite a bit of electricity too.

In fact, Bitcoin mining now consumes more electricity than the entire country of Switzerland does in a given year!

Forbes

PoW is by no means the most elegant consensus algorithm out there, but as Bitcoin has proven over the years, it works.

An alternative to PoW is another form of consensus algorithm that has been gaining more and more popularity over the years in the blockchain space and that’s Proof-of-Stake (PoS).

Instead of relying on hefty (expensive) computing power + lots of electricity to solve complex mathematical puzzles to reach consensus and earn block rewards for miners, PoS lets token holders “stake” their own tokens (locking them away for a defined + fixed period of time, like a time deposit at a bank) to earn rewards, instead.

Algorand is an example of a “pure” PoS blockchain network.

As the following image shows, someone who owns 150,000 ALGO tokens (worth $26,752 at today’s prices) and stakes them would be projected to earn 681.6013 new ALGO tokens each month (worth $121.56 at today’s prices), or 8,179 new ALGO tokens in a year (worth $1,459 at today’s prices).

Staking Rewards: ALGO

Currently, the annual reward for staking ALGO tokens is 5.45%, or on an inflation-adjusted basis, 0.29%.

Staking Rewards: ALGO

Expanding upon the principles of PoS, there’s what’s called Delegated Proof-of-Stake (DPoS) which adds a voting component.

More specifically:

As a variation of the Proof-of-Stake mechanism, DPoS requires nodes to vote for other users who they trust to participate in the validation process. The nodes with the highest votes then authenticate the transactions.

In DPoS, validators (i.e., node operators who have delegated their own tokens and/or have received delegations from other token holders) process transactions, produce new blocks, and secure the network to earn rewards.

Further, in DPoS, rewards can be earned by more “passive” token holders who stake + delegate (but don’t have to be an active validator).

For example, on the Cosmos blockchain (which uses Tendermint BFT, a variation based on DPoS), by simply owning ATOM tokens and staking +delegating them, you can earn staking rewards.

As the following image shows, someone who owns 10,000 ATOM tokens (worth $22,400 at today’s prices) and stakes + delegating them would be projected to earn 68.2765 new ATOM tokens each month (worth $152.94 at today’s prices), or 819.3177 new ATOM tokens in a year (worth $1,835 at today’s prices).

Staking Rewards: ATOM

Currently, the annual reward for staking ATOM tokens is 8.19%, or on an inflation-adjusted basis, 1.80%. The current lock-up period is 21 days.

Staking Rewards: ATOM

In addition to Cosmos, there are other DPoS-based blockchain projects out there, like ICON, that also lets token holders earn rewards by staking + delegating (voting).

Please note: ICON uses its own form of token economics called Delegated Proof-of-Contribution (DPoC), which relies on active token holder participation (such as through voting) to not only secure the network but to govern it. We will make sure to cover the details of DPoC in a separate, future article.

ICONSENSUS

As it pertains specifically to ICON, the network uses its own form of DPoS consensus algorithm, which they call Loop Fault Tolerance (LFT). Most recently, ICON unveiled their new and improved LFT 2.0.

Shown below is a projection of what an ICON owner would earn by staking + voting 100,000 ICX tokens (worth $22,006 at today’s prices), which amounts to ~1,313 new ICX tokens each month (worth $289 at today’s prices), or ~15,759 new ICX tokens in a year (worth $3,468 at today’s prices).

Staking Rewards: ICX

Currently, the annual reward for staking ICX tokens is 15.76%, or on an inflation-adjusted basis, 9.76%. The current lock-up period is 11 days.

Staking Rewards: ICX

Generally speaking, the more tokens one holds, the more capability they will have to earn more rewards on a PoS-based or DPoS-based blockchain network. In contrast, on a PoW-based network, to earn more rewards, you need more computing (hash) power.

Further, it can be argued that compared to PoW, PoS/DPoS makes it harder for a malicious “hostile takeover” 51% attack to occur on a given network that has sufficient scalability/market cap valuation.

As detailed below:

The stake works as a financial motivator for the forger node not to validate or create fraudulent transactions. If the network detects a fraudulent transaction, the forger node will lose a part of its stake and its right to participate as a forger in the future. So as long as the stake is higher than the reward, the validator would lose more coins than it would gain in case of attempting fraud.

In order to effectively control the network and approve fraudulent transactions, a node would have to own a majority stake in the network, also known as the 51% attack.

Depending on the value of a cryptocurrency, this would be very impractical as in order to gain control of the network you would need to acquire 51% of the circulating supply.

For example, the ICON network currently has a market cap of ~$117 million, with a circulating supply of ~535 million ICX tokens. In order to take control of the ICON network, an attacker would need to spend ~$60 million to acquire ~273 million ICX tokens.

CoinMarketCap

Furthermore, any aggressive and concentrated efforts to acquire such a large number of ICX tokens would likely cause the token price to dramatically rise in value, which in effect would mean that the attacker would need to spend a lot more than ~$60 million to procure 51% of the ICON network.

In addition, due to the inherent nature of PoS/DPoS (which locks away ICX tokens like a time deposit), the further drastic reduction in available circulating supply of ICX tokens only makes the task of trying to take over the ICON network that much more difficult.

With all that said, it’s worth noting that 51% attacks have occurred before in the blockchain space, as earlier this year Bitcoin Gold (which uses PoW) was a victim, which lost $70,000, as a consequence of double spends.

Bitcoin.com

As covered in the article Blockchain Basics: Different Types of Networks (Part 1), although the transactions that occur on a blockchain network are intended + designed to be permanent (immutable), due to things like a 51% attack that can happen, it’s worth noting that it’s still possible (even if highly unlikely on the largest + most secure blockchain networks) for past data on a public ledger to be modified and altered.

Lastly, proponents of PoS and DPoS argue that these type of consensus algorithms represent an improvement over PoW because they’re less prone to becoming “too centralized”.

For context, in recent years, concerns over mining cartels gaining increasing control + power on the Bitcoin network have been a hot topic of conversation.

At this stage of the game, it’s likely still too early to know for sure whether or not blockchain networks based on PoS and DPoS will be able to offer a better solution to the problem of too much centralization occurring on what are supposed to be decentralized platforms.

Please see below:

Under POS, we still encounter the same problem. The only difference here is that instead of computational power, wealth inequity is the factor that weakens the claim of decentralization.

With POS you must keep your wallet online in order to have the chance to be chosen and therefore there is some cost to the process of validation.

Unlike POW and hashing power, the cost does not scale if you own more of the coin.

Therefore, more wealthy individuals have a much larger incentive to validate in POS and will also accumulate more coin at a faster rate. This, in my perspective, leads to concentration of voting power in the hands of the wealthy.

To address for any potential future problems associated with too much centralization on a supposedly decentralized network, protocols such as ICON were wise to put into place dynamic systems (e.g., ICON Incentives Scoring System; IISS) that can adapt and be refined over time, as needed.

For instance, although IISS 2.0 was released less than a year ago, the ICON network and its community has already been busy at work preparing for IISS 3.0, with the ultimate aim to make things better.

IISS 2.0

Things like introducing a mandatory bond to dissuade vote buying (i.e., requiring more “skin in the game”), slashing penalties, the ability for validators to cap further delegation, etc. are just some examples of techniques that a decentralized network can use to try and make things more fair.

In any event, with the crypto industry’s second most popular + valuable network, Ethereum, set to transition to PoS later (sometime) this year (from PoW), it’s probably safe to say that the ball game is only now starting.

And who knows, maybe way down the road, even Bitcoin will ultimately decide to switch over to PoS, too!?!

Coin Telegraph

Exciting times ahead!

Thanks for reading. Salamat po.

If you enjoy our content and feel like we are doing a good job in helping to grow the ICON Project and ICON community, please consider supporting us by voting for ICON Pinas.

Every last vote counts and can help so much!

You can learn more about ICON Pinas by following us here:

Facebook: https://www.facebook.com/IconPinas/

YouTube: https://www.youtube.com/channel/UCqkwvlG2636SqqtjOYAxOhQ

Twitter: https://twitter.com/IconPinas

Instagram: https://www.instagram.com/iconpinas

Telegram: https://t.me/icon_pinas

Medium: https://iconpinas.medium.com/

Disclaimer: Cryptocurrencies are EXTREMELY volatile! These assets are also very speculative in nature, and no one should ever buy any without first conducting their own thorough research + due diligence. Never put any more capital at risk than you can comfortably afford to lose all of!

As ALWAYS, proceed most carefully, and if you have any questions, please consult a professional financial advisor.

A P-Rep from 🇵🇭 representing the ICON Project. To learn more about ICON, please visit: https://icon.foundation/?lang=en

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store