Published in

TOP Network

# Toppie Lessons №4&№5: Something about Consensus Algorithm

One important characteristic of blockchain technology is its distributed nature. All network participants (nodes) can each possess a copy of the blockchain, so that there is not one single point of failure. However, because of the blockchain’s distributed nature, there must be a way for these nodes to reach agreement as to the shared state of the blockchain. This agreement, or consensus, is achieved by use of consensus algorithms. These algorithms enables network participants to agree on the contents of the blockchain in a distributed and trustless manner.

Begin with Bitcoin — PoW

The very first implementation of a distributed and trustless consensus algorithm is Bitcoin’s proof-of-work (PoW) algorithm. PoW requires miners to solve complex cryptographic puzzles before they can add a block to the blockchain. In exchange for solving the puzzle, miners are rewarded with bitcoins, this is known as a block reward. It is important to note that each block that is added to the blockchain must follow a certain set of consensus rules. For example, Bitcoin’s consensus rules include rules such as: no double-spends, transactions and blocks must be in the correct format, and only a certain amount of block rewards can be given in exchange for solving the cryptographic puzzle. Blocks that do not follow these consensus rules will be rejected by network nodes. The combination of the PoW consensus algorithm and the consensus rules produces a reliable network in which agreement as to the shared state of the blockchain can be achieved.

The Bitcoin POW mechanism is so costly that it consumes the same amount of electricity it takes to power a country like Switzerland in one year. Bitcoin’s current estimated annual electricity consumption is 61.4 TWh, which is also equivalent to 1.5% of the electricity consumed in the United States.

## Proof of Stake: What are the Benefits?

Proof of stake is a consensus algorithm blockchain that deals with the main drawbacks of the proof of work algorithm. In this one, every block gets validated before the network adds another block to the blockchain ledger. There is a little bit of Twist in this one. Miners can join the mining process using their coins to stake.

The proof of stake is a new type of concept where every individual can mine or even validate new blocks only based on their coin possession. So, in this scenario the more coins you have, the better your chances are.

First of all, this type of consensus algorithms doesn’t require any amount of heavy hardware backup. You only need a functional computer system and a stable internet connection. Any person who has enough coins on the network will also be able to validate transactions.

Proof of stake consensus algorithm blockchain is much more energy efficient then proof of work. It doesn’t even need too much power consumption.

It also reduces the threat of a 51% attack.

Even though proof of stake seems quite lucrative than Proof of work, still there is one significant disadvantage. The main drawback of the system is that full decentralization is not possible ever.

This is simply because only a handful of nodes get to participate in the staking on the network. Individuals with the most coins will eventually control most of the system.

## Delegated Proof of Stake

DPoS is a consensus algorithm maintaining irrefutable agreement on the truth across the network, validating transactions and acting as a form of digital democracy.

Invented by Daniel Larimer, Delegated Proof-of-Stake (DPoS) is an alternative consensus mechanism that requires coin holders to vote for “delegates”, who are then responsible for validating transactions and maintaining the blockchain. DPoS is an alternative to the more commonly known, Proof-of-Stake (PoS) model, which requires miners to put up a stake in the required cryptocurrency before they are able to process transactions and add them to the blockchain.

Savings on energy costs: In contrast to PoW, which requires large amounts of energy in-order to decide who gets to add the next block to the blockchain, with DPoS, witnesses are given a specific time schedule to do so.

Despite the advantages offered by the DPoS consensus mechanism, it is still not without its faults. One such fault is:

Sufficient decentralization can never be achieved

Sufficient decentralization can never be achieved: Intuitively, it seems that the more witnesses validating blocks, the more decentralized a system will be. However, this notion fails to take into account the scalability of the network as a trade-off. In reality, a network can not have an excessive amount validators or else it risks slowing down. Therefore, a balance must be struck between the number of block producers, and the scalability of the network.

## pBFT: What is Practical Byzantine Fault Tolerance (pBFT) ?

The so-called P2P system is a system in which all nodes have equal status and with “boss”. The biggest problem of without the boss is that the network have no factual ruling. If the data is not unified in each node, how to reach a consensus? It becomes to a problem. The well-known consensus algorithms are POW, POS and pBFT we are going to talk about pBFT today. Its full name is Practical Byzantine Fault Tolerance.

To be precise, the so-called BFT, which is Byzantine fault tolerance, refers to the ability of the system to continue to operate normally if there are malicious components and continuously sending error messages to the system. There are several algorithms for implementing BFT. One of the most common is called pBFT.

## Principle of pBFT

pBFT was introduced in 1999. This algorithm is used in many distributed computer systems. Later in the blockchain field, pBFT was also very influential.

Under the pBFT model, one node is treated as the primary node and the other nodes are the backup nodes. All nodes in the system will communicate with each other, and the ultimate goal is that everyone can reach a consensus on the data with a minority majority principle. If the primary node shows obvious signs of lying, other nodes can also join to replace the primary node.

Pros and Cons

Let me talk about the advantages first. First, pBFT does not have to wait for confirmation. A transaction is sent in pBFT, and there is no need to wait six times for confirmation like Bitcoin’s POW algorithm. If a block is recognized by the system through the pBFT algorithm, then this block is the final block and will not be revoked. Because the consensus of each node is determined at the same time, the blockchain maintained by pBFT will not be forked like POW, so there is no need to wait for confirmation to ensure that the chain in which the current block is located is the longest chain. Second, pBFT does not consume energy. Because pBFT does not require mining, each consensus process will not consume as much power as POW. In short, pBFT is efficient and energy efficient.

But pBFT also has obvious shortcomings. First, the biggest drawback is that the number of nodes cannot be too much. Because the frequent communication between the nodes is guaranteed, the entire consensus network should not be too large, which makes it impossible for the entire network to be globally decentralized like POW. Second, pBFT does not prevent witch attacks. One of the reasons why POW consumes energy is to prevent witch attacks. Witch attack refers to a malicious user falsifying multiple accounts in various ways to carry out the consensus process. POW is difficult to add a new account by huge money consumption, and pBFT does not have this guarantee. Therefore, pBFT is more suitable for a coalition chain with an access permit, and is not suitable for a public chain without a barrier to entry.

In short, the difference between pBFT and POW is very obvious.

Directed Acyclic Graphs (DAG)

A lot of crypto-experts acknowledge Bitcoin as the blockchain 1.0 and Ethereum as the blockchain 2.0. But nowadays, we are seeing a new player in the market with even more modern technology.

Some are also saying that it is the blockchain 3.0. While a lot of contenders are fighting to get the title of blockchain 3.0, TOP is going to be ahead of the game with the application of Directed Acyclic Graphs also known as the DAG. Apart from TOP, other chains also adopts DAG to their system.

How Directed Acyclic Graphs (DAG) Works?

You could think of DAG as a consensus algorithm. But DAG is basically a form of data structure. While most of the blockchains are a “chain” of “blocks” containing data, DAG is a seamless graph where data gets stored topologically. DAG could come convenient handling specific problems like — data processing, routing, compression.

It takes about 10 minutes to create a block using the Proof-of-Work consensus algorithm. Yes, the PoW is a slowpoke! Rather than working on a single chain, DAG implements the “side-chains.” A side-chain allows different transactions to perform independently on multiple chains.

This will reduce the time of creating and validating a block. Well, actually, it dissolves the necessity of blocks altogether. Moreover, the mining seems to be a waste of time and energy too!

Here, all the transactions are directed and maintain a particular sequence. Moreover, the system is acyclic, meaning the chance of finding the parent node is zero as it a tree of nodes, not a loop of nodes. DAG is showing the world a possibility of blockchains without the blocks!

Basic Concepts of Directed Acyclic Graphs DAG

No More Double Spending

The traditional blockchain allows the mining of on single block at a time. There is a possibility that more than one miner will try to validate a block. This creates a likelihood of double spending.

Moreover, the situation might lead to soft even hard forks. The DAG validates a particular transaction based on the previous number of transactions. This makes the blockchain system safer and more robust.

Less Width

In other consensus algorithms, the transaction nodes get added to the whole network. This makes the width of the system bulkier. Whereas, DAG links the new transactions to the older transaction graph. This makes the entire network lean and more straightforward to validate a particular transaction.

Faster and Smarter

As DAG has blockless nature, it can handle transactions way faster. In fact, it makes the PoW and the PoS look like grandpas in a race.

Favorable to the Smaller Transactions

In fact, the smaller payments are more commonly witnessed. But the substantial payment fees of Bitcoin and Ethereum doesn’t seem that much friendly to the smaller amounts. On the other hand, DAG is perfectly suitable to the smaller ones because of the negligible transaction fees.

You can find TOP Network on:

Email Contact: contact@topnetwork.org

Official Website: http://www.topnetwork.org

Telegram: https://t.me/topnetwork_top

TOP Network is a decentralized open communication network that provides cloud communication services on the blockchain. TOP offers secure, low-cost services such as messaging, calling, video, VPN, CDN, IoT data sharing and more.

TOP Network is also a high-performance public blockchain platform designed to handle real-world business of any size or volume. Powered by innovations including three-layer network, two-layer sharding, two-layer lattice DAG and PBFT-DPoS*, TOP can process several hundred thousand transactions per second on the blockchain.

The long-term mission of TOP Network is to build a public blockchain infrastructure for all Dapps. Our world-class team of over 100 developers is striving for this goal.

TOP Network originated from the common underlying network layer of Dingtone, CoverMe and SkyVPN, three communication apps built by the TOP team before the blockchain project. These apps, having attracted over 50 million users in total, will be ported to TOP Network upon the launch of TOP and generate huge volumes of transactions in the TOP ecosystem.

TOP Network was founded by serial entrepreneur Steve Wei and his colleagues in late 2017. Steve was one of the earliest employees of WebEx in the 1990s. After WebEx, he founded a successful video conferencing software company which was acquired by Huawei in 2010. In 2012, Steve co-founded Dingtone, a public listed company operating popular communication apps such as Dingtone, CoverMe and SkyVPN.

TOP Network has closed \$11 million early investments from prestigious institutional investors and individual billionaire investors, including DHVC, Fenbushi Capital, NEO Global Capital (NGC), Ontology Global Capital (OGC), LD Capital and more.

--

--

--

## More from TOP Network

TOP Network is a decentralized blockchain ecosystem composed of public blockchain, DApps & decentralized communication.

## TOP Network Official Account

TOP Network is a decentralized blockchain ecosystem composed of public blockchain, DApps & decentralized communication. Website: www.topnetwork.org