Blockchain Trilema and Consensus Mechanisms in Blockchain Technology

in #blockchain6 years ago

Blockchain Trilema and Consensus Mechanisms in Blockchain Technology

trilema

It's been a while since I sat myself down and write about anything related to blockchain or crypto space. This being said, I thought I should start with an introduction on consenus mechanisms, how do they work and why are they needed in blockchain technology. Since there are quite a few consensus mechanisms out there already, each with their own use case of implementation, in this article I will focus on the most common two: Proof of work and Proof of Stake. So grab a coffee ☕ and let's dive straight into it.

proof-of-work

What is a Consensus Mechanism?

Perhaps one of the greatest features of (most) blockchains is decentralization. In order to achieve decentralization in distributed systems, there is the need to enforce a consensus mechanism — a set of rules or instructions that tell the blockchain how to deal with new data. Consensus mechanisms enable parties involved in a transaction to come to an agreeent by giving financial rewards or punishments. They also provide a solution to double spending problem achieving reliability in a network with untrusted peers. In other words, consensus mechanisms are used in order to reach agreement on a single decision within the network.
Consensus protocols provide two guarantees with respect to order and timing:

  • Safety: As long as the protocol does not have more than some threshold of faulty participants, other participants cannot convince a client to accept an incorrect or invalid message.
  • Liveness: As long as the protocol does not have more than some threshold of faulty participants, other participants cannot indefinitely delay the acceptance of a correct message.

Safety and liveness are inseparable properties of fault-tolerant protocols. Fault tolerant protocols use techniques to guarantee liveness which affect safety and vice-versa.

For example, the consensus mechanism in blockchain technology is used in order to make sure that Alice has sent 5 coins to Bob and she is not able to use again the same coins for another transaction. This is known as the double-spend problem, and Bitcoin which was developed by Satoshi Nakamoto, is the first protocol to solve the problem.

proof-of-work

Proof of Work (POW)

proof-of-work

Imagine you are in a room with 9 of your mates and you are all gived 6 cards. You must use basic calculations and the available cards only once in order to achieve the set result. The first one to find an answer will get rewarded with a prize. Simple! Fundamentally speaking, this is Proof of Work(POW), the original consensus mechanism used in Bitcoin blockchain and developed by Satoshi Nakamoto.

But you might ask, how about if two or more answers are found???
Multiple valid solutions can be found for any given puzzle. However, only one of the solution needs to be found in order for the puzzle to be solved. Bitcoin's POW uses a “longest chain wins” metric to decide on which history is the correct history. And this history should match the expected history if all nodes in the network were honest. POW is a succesful consensus mechanism due to it`s two fundamental properties:

  • First property ensures that a predefined amount of work has been invested by the party providing the proof of work.
  • Second property ensures the proof is easily verifiable.

For example, the hashing algorithm used in Bitcoin`s POW is double-SHA256 (SHA2562) and
the predefined structure is a hash less or equal to a target value T. The success probability PR, of finding a nonce n for a given message msg, such that H = SHA256 2(msg||n) is less or equal to the target T is:

Pr[H ≤ T] = T / 2256

This will require a party attempting to find a proof of work to perform on average, the following amount of computations:
1 / Pr[H ≤ T] = 2256 / T

Multiple valid solutions can be found for any given block. However, only one of the solution needs to be found in order for the puzzle to be solved. Finding solutions to a proof of work puzzle is a probabilistic process with the success of probability defined by the amount of computation available and a predefined difficulty. In other words, the more computation power, the higher hash rate which results in a higher profit from mining. The following parameters are used in order to calculate the profit:

  • Difficulty factor
  • Hash Rate (TH/s)
  • BTC/USD Exchange rate
  • Pool Fees in %
  • Hardware cost in USD
  • Power watts
  • Power cost (USD/kWh)

In Proof of work consensus algorithm, the more power the mining hardware consumes, the higher the hash rate. This results in a higher profit from mining.[1]
See "Is Bitcoin Mining Profitable in 2018" - Ofir Beigel, 99Bitcoins, 2018.

proof-of-work

Proof of Stake (POS)

Comparatively to proof of work algorithm where blocks are created by miners and their computational power at hand, proof of stake ensures blocks are added to the blockchain by minters who stake their tokens for proposing the next block. The weight of each validator depends on the number of tokens (stake) available in their wallet.

Unlike to POW used in Bitcoin, Proof of stake consensus mechanism does not use anny miners or heavy computation power to valdate blocks. Instead, their stake is used in order to validate the next block in exchange of a reward. If they commit fraud, their stake would fall in value, which in theory eliminates fraud.
Proof of stake has a few advantages over Proof of Work as follows:

  • Efficiency - since it does not require intense computational power to add new blocks, it is more environmental friendly.
  • Cheaper - It does not require expensive equipment to run and consumes less energy.
  • Less centralized - there is no advantage over collusion. However, it favours large stake holders.
  • Secure - neutralizes the 51% attacks as a holder would need to buy a lot of coins to do so.

Arguably, POS seems less centralized than POW but that is not necesarelly true. Since investors receive interest on their long positions, proof of stake encourages hoarding more than proof of work. As Andreas Antonopoulos explained during the Wisma BeeOn Group in Kuala Lumpur, Malaysia, proof of stake allows the rich to get richer therefore having a centralizing impact on the holders of the cryptocurrency. In contrast, proof of work miners are forced to release a certain number of coins to the market in order to invest in new mining hardware and to pay electricity bills which allows a relatively constant amount of newly mined Bitcoins to hit the market every day.

proof-of-work

Conclusion

proof-of-work

When it comes to adopting new protocols in Blockchain technology there is always a trade-off between Security, Scalability and Decentralization. This is often known as The Blockchain Trilema. The more centralized the decision-making process is, the faster the decision can be taken and the more scalable the network is. On the other hand, the less centralized a network is, the longer it takes to come to a consensus.

Finding the perfect balance between the three is going to be a challenging quest in the following years and, as we speak, brilliant minds are working to different consensus mechanisms that could potentially achieve the balance. As of such there is Delegated Proof of stake, Byzantine fault tolerance or Direct Acyclic graph. While I am optimistic about the ability of active developers to overcome the scaling problem in the long run, I must recognize that proof of work’s proven track record of at least ten years makes it the undefeated champion of consensus mechanisms; at least for now.

proof-of-work

I hope you enjoyed this post and found it useful. If you like this kind of posts or you want me to cover any particular aspect of blockchain in particular, please leave a comment below!

media by mr.div

Sort:  

Hello @cryptoctave! This is a friendly reminder that you can download Partiko today and start earning Steem easier than ever before!

Partiko is a fast and beautiful mobile app for Steem. You can login using your Steem account, browse, post, comment and upvote easily on your phone!

You can even earn up to 3,000 Partiko Points per day, and easily convert them into Steem token!

Download Partiko now using the link below to receive 1000 Points as bonus right away!

https://partiko.app/referral/partiko

Coin Marketplace

STEEM 0.29
TRX 0.32
JST 0.051
BTC 98115.73
ETH 3873.53
USDT 1.00
SBD 3.98