A Review: Consensus Algorithms on Blockchain

Blockchain is a distributed public ledger that keeps track of all transactions that have ever taken place in the system. As a distributed ledger, a consensus mechanism is required to ensure all the transaction functions properly. In order to reach a consensus, it is critical to emphasize the importance of performance and efficiency. The use of the right consensus algorithm will signif-icantly improve the efficiency of a blockchain application. This paper reviewed several types of consensus algorithms used in blockchain and discusses the idea of a new consensus algorithm that can improve the performance of consortium blockchain.

. Blockchain structure [4]. 2) Private blockchains are permissioned blockchains in which information is exclusively available to a certain group and its change acceptance is limited to that group, e.g., a blockchain-based payroll system. This is a centralized blockchain, which means that a central authority decides who can read, write or participate in the blockchain. Hence, a single authority defines the consensus me- These 3 types of blockchain differ in terms of how nodes come to an agreement and the consensus algorithm used. The selection of the appropriate consensus algorithm is very important in determining the performance of these types of blockchains. Thus, this paper focuses on studying and evaluating the existing common consensus algorithms used in blockchain by providing the flow, advantages and disadvantages of those consensus algorithms and discussing the idea of the new consensus algorithm for the consortium blockchain.
The rest of the paper is organized as follows. This paper introduces the existing common consensus algorithms, how their work, pros and cons in chapter 2.
This paper also proposes a new consensus that can be used in consortium blockchain in chapter 3. Finally, this paper makes a conclusion in chapter 4.

Consensus Algorithms
Consensus algorithms originated from the famous Byzantine general problems [2], which was first presented in the paper "The Byzantine generals problem" by Lamport in 1982 [5]. The Byzantine general problem can be described as follows.
Byzantine is the capital of the ancient eastern Roman Empire. To resist foreign enemies, a general and his troops are each stationed on several fiefs (estates of land) in Byzantine. Each general can give 2 orders: whether to attack or retreat when facing enemies. A war can be won with the fewest possible casualties only when all honest generals agree on an attack or withdrawal order. However, Byzantine is so large that these generals are unable to discuss the order together because they must guard their own fiefs. Therefore, the general's commands are sent by messengers. The generals make their last decisions on whether to attack or retreat by giving orders to the other generals and collecting orders from them.
In this case, there are 2 possibilities. Either some of these generals or the messengers are traitors. If the generals are traitors, they may send the wrong orders or different orders to different generals. If the messengers are traitors, they could intentionally sabotage the mission by delivering the wrong information. As a result, this would ultimately undermine the overall decision of the honest generals. It is concluded that the Byzantine generals' problem can be defined as the problem of getting honest generals to reach a consensus in presence of several traitors.
In the early days of blockchain systems, blockchain consensus algorithms such as Proof of Work (PoW), Proof of Stake (PoS) and Practical Byzantine Fault Tolerance (PBFT) were used. Recently, a huge number of new blockchain consensus algorithms have come out. According to some surveys [2] such as [6] [7] [8] [9], these new consensus algorithms can be broken down into 3 categories: 1) Variants of the original consensus algorithms, e.g., Bitcoin-NG [10] and Journal of Computer and Communications Algorand [11], which are the improvements of PoW and PBFT, respectively; 2) Combinations of the original consensus algorithms, e.g., Delegated BFT (DBFT), which is the combination of PoS and PBFT, and e.g., Proof of Activity (PoA) [12], which is the combination of PoW and PoS; 3) DAG-based consensus algorithms, e.g., ByteBall [13] and Hashgraph [14].
The consensus mechanism is the blockchain's cornerstone and a key assurance of the blockchain system's security. It is used to deal with the problem of ensuring data consistency in a distributed system with the presence of several failure nodes. Crash fault nodes and Byzantine fault nodes are 2 types of failure nodes. Crash fault nodes fail only by halting; that is, they can only stop working and have no other malicious behaviors present [15]. Messages can only be delayed or lost in this situation. Byzantine fault nodes, on the other hand, behave abnormally. They can send incorrect messages to other nodes or send different messages to different nodes to sabotage the consensus process.
In the field of traditional distributed systems, consensus algorithms have been explored for many years. How these consensus algorithms work, and their advantages and disadvantages are explained in the next section.

Proof of Work (PoW)
Proof of Work is the first Blockchain algorithm introduced in the blockchain network [16]. Cynthia Dwork and Moni Naor [17] proposed the idea of Proof of Work (PoW) and later Satoshi Nakamoto applied it in the Bitcoin paper in 2008.
A PoW algorithm works by requiring nodes on the network to solve a mathematical problem in order to create the next block and verify the legitimacy of transactions on the network. PoW algorithm flow is illustrated in (Figure 2). This mathematical solving is done through the Hash function. Hash is a random and complex mathematical formula that is used for confirmation of the transactions stored in blocks [18]. All the nodes compete to be the first to find a solution via brute force, which requires a huge number of attempts. Whoever is the first to find the solution, can have the right to create a new block and once it is verified, the block will be added to the platform. These nodes that participate in the computation are called miners and the process of solving the problem is called mining [19].
The advantage of the Proof of Work algorithm is its high security and a significant degree of decentralization. However, its main disadvantage is greater energy and resource consumption. Miners need a lot of processing power to figure out the solution to the difficult mathematical problem in terms of hashing billion nonces or more. It leads to a waste of precious resources (money, energy, space, hardware). Moreover, it is time-consuming. Miners must examine a large number of nonce values to find the right solution to the problem that must be solved to mine the block. Furthermore, to solve this problem, it will take some time due to the complexity of solving the hash function. Therefore, this algorithm is not suitable for a big and fast-growing network that requires huge numbers  of transactions per second [20]. Tschorsch et al. [21] state that low throughput, high latency and inefficiency are the drawbacks of the PoW algorithm.

Proof of Stake (PoS)
To solve the large computing power consumption problem of PoW, researchers proposed the Proof of Stake (PoS) consensus algorithm. The process of PoS is different compared to PoW because the users of the PoS protocol do not require to solve the mathematical problem to achieve consensus. Users, on the other hand, only need to use cryptocurrency as a stake to achieve consensus. There are 2 ways to participate in staking. PoS algorithm flow is illustrated in (Figure 3).
First, the user can loan their coins to other users that will participate in the pool and then share the profit with them. However, the user will need to find a reliable person to stake with. Another method is to join the pool. Everyone that participates in that specific pool will divide the profit based on the stake amount.
The creator of a new block is chosen from a pool of users that have staked a certain amount of cryptocurrency and no users can predict its turn in advance. Islahuddin et al. [23] state that the amount of stake a person has in the system determines the mining. If a miner has more stakes in the blockchain, the chances of mining are more. For instance, if the stake in the given cryptocurrency is at  also greatly increases the difficulty of attack. Xiang et al. [2] said that, although this method reduces the waste of computing power, it may have the risk of monopoly, which leads to the centralization trend of the system while allowing malicious attackers to have a clear target to attack, risking the security.

Delegated Proof of Stake (DPoS)
This algorithm was introduced by Daniel Larimer [27]. It is proposed to improve PoS security by relying on stakeholders voted to pick block producers or witnesses. According to Qianwen Wang et al. [28], DPoS similar to the board vote, allows the holder to cast a certain number of nodes and proxy them for verification and accounting. In the blockchain with DPoS, each node can choose the witnesses based on its stake. DPoS algorithm flow is illustrated in (Figure 4).
The top N witnesses who participated in the campaign and received the most votes have the accounting right across the entire network. The number of N of witnesses is defined such that at least 50% of voting stakeholders believe there is sufficient decentralization. The elected witnesses are rewarded for creating new blocks one by one as directed. The witnesses need to ensure adequate online time. If a witness is unable to create the block for which they were assigned, the activity of the block will be transferred to the next block and stakeholders will vote for a new witness to take its place. DPoS makes the most use of the stakeholders' votes to reach a consensus fairly and democratically [26].
The DPoS consensus mechanism is simple and efficient since it does not require mining or complete node verification. Instead, it is validated by a limited number of witness nodes. It is also power-saving compared to PoW and PoS.
However, this limitation on the number of witness nodes would make the network more centralized [18]. Moreover, due to the mechanism that each witness node takes turns generating blocks, the identity of the witness is already known Figure 4. DPoS algorithm flow [26]. and always constant, which would make the blockchain system more vulnerable to collusion attacks [29].

Practical Byzantine Fault Tolerance (PBFT)
PBFT was proposed by Castro and Liskov in a paper published in 1999 to solve the problem of General Byzantine originally [5]. The focus of the PBFT algorithm is to provide practical Byzantine state machine replication for tolerating the Byzantine fault [20] and making the algorithm workable in practical system applications [30]. The maximum number of malicious nodes, f cannot exceed 1/3 of the total number of nodes, n hence, n > 3f + 1 is required by PBFT. The process of PBFT algorithm is divided into 3 phases: pre-prepare, prepare and commit [31]. PBFT algorithm flow is illustrated in (Figure 5). The pre-prepare and prepare phase are used to completely organized requests sent in the same view even when the primary, which proposes the ordering of requests, is faulty.
The prepare and commit phase are used to verify that requests are completely sorted across all views before they are committed. In each phase, a node advances to the next phase if it receives votes from more than two-thirds of all nodes. Under the premise of ensuring activity and safety, the PBFT algorithm provides a fault tolerance of (n − 1)/3.
In [32], the authors said, energy efficiency and high throughput are considered as its advantages and some points such as few or no parameter available for being scalable and possible delays as the network should wait for all nodes' votes are noted as its disadvantages.

Proof of Luck (PoL)
The goal of the development of this protocol is to overcome the issues available in the previously available consensus algorithms such as slowness, energy usage and time consumption. This algorithm uses the trusted execution environment (TEE) platform [33] to generate a trusted random number for choosing a leader. This algorithm has high immunity against the double-spending attack because the attacker must be very lucky to perform such an attack [34]. However, the main problem of this protocol is its reliance on Intel, which conflicts with the blockchain principle of decentralization. Other than that, another problem with this algorithm is that if the node's clock is not synchronized with the network clock, it may lose its chance of being lucky.

Proof of Burn (PoB)
The concept of Proof of Burn (PoB) idealized by Iain Stewart [35] is an alternative consensus algorithm that attempts to address the PoW system's high energy consumption issue. It is often called a PoW system without energy waste. In this algorithm, miners burn coins by sending them to a non-spending address.
Burning here means that a user is required to send some cryptocurrency to an "eater address" to receive coins, tokens or mining privileges on the network. The Eater Addresses are unable to use these coins for any purpose. The burned coins are recorded in a ledger, making them truly unspendable. It is an expensive activity for the user but this activity consumes no resources and energy. An Eater Address is randomly generated and does not have any private key. As a result, no user will ever be able to spend the coins stored on these addresses.
This algorithm is creating more stability as the user who would risk a short- term loss and invests in this way will stay in the network for a longer period to gain profits. Furthermore, this enhances decentralization and results in a better-distributed network. However, PoB algorithm is not proven to work on larger scales. It will need to be tested further to ensure its effectiveness and security.

Proof of Authority (PoA)
Wood et al. proposed the Proof of Authority (PoA) algorithm [36] which is essentially an optimized equity proof model. The difference between PoS and PoA consensus is that the latter, leverage user's identity instead of user's digital assets.
This means that, it is based on the reputation of trusted parties in a blockchain network [37]. The network relies on a number of pre-approved validators known as "authorities" to validate transactions and create new blocks. As the PoA algorithm stakes identity, users who want to be "authorities" must willingly disclose their identities. To be regarded as trustworthy, validators must follow a set of norms. One of these requires them to register with the same identity they use on the platform in the public notary database. More rules must be followed in order for the network to function. Becoming a validator is not easy. Candidates must go through a screening process in which they must show their long-term com-

Use Cases for Public, Private and Consortium Blockchain
In a permissionless or public blockchain, anyone can access and create data [38].
Smart contracts and nodes can be published and run by anybody. They do not require approval to join the blockchain and communicate with other users. The consensus algorithms in this blockchain are often used in cryptocurrency and document validation.
In a private blockchain, a single organization will have the authority over the network. It can define as a blockchain that operated in a restricted environment, such as a closed network. The consensus algorithms in this blockchain are often used in asset ownership and supply chains [39]. Journal of Computer and Communications In a permissioned or consortium blockchain, not everyone can join the blockchain. To join the network, each member will need specific permission from the network administrator or owner. This is important for businesses, banks and other institutions that wish to follow the rules and have complete control over their data. All of the participating nodes in a consortium blockchain are known and chosen. The consensus algorithms in this blockchain are often used in digital assets-backed platforms, trade, finance and supply chain industries [40].

Discussion
Despite the fact that there are many consensus algorithms introduced and used in the blockchain, the existing consensus algorithms are mostly concerned with the public blockchain while the consortium blockchain is given the least attention [41]. This can be supported by [42] and [43] that said, at present, most of the researches on consensus algorithms are focused on the public blockchain and there are few consensus algorithms that have been developed for consortium blockchain.
Consortium blockchain is a permissioned blockchain, in which the primary nodes are pre-specified by the participants which are composed of many parties. Thus, whoever wants to access to the ledger needs to be a member of any organization. Consortium blockchain also consists of known and trusted users. So, this paper suggested an optimized PBFT algorithm to meet the needs of the consortium blockchain. Generally, PBFT algorithm is widely used in a consortium blockchain because PBFT greatly improves the performance of the blockchain consensus. PBFT algorithm is suitable for a high-performance network with a small number of nodes [26]. However, when there are a large number of nodes involved, the communication overhead occurs. The number of messages exchanged and processed in the network increase dramatically as the number of nodes increase. Therefore, to overcome the shortcomings of PBFT, the clustering method will be added in the phase of PBFT algorithm to effectively reduce the communication overhead in PBFT consensus algorithm.
In the current algorithm which is PBFT algorithm, all nodes need to communicate with each other to achieve a consensus. This leads to high communication with a larger number of nodes which resulted in higher communication overhead. Therefore, by implementing the clustering method by grouping the nodes sequentially, the nodes only need to communicate with their group member instead of communicating will all the nodes in the network. The nodes will be grouped into a few groups, sequentially, which is the first 3 nodes will be grouped in group 1 and followed by group 2, group 3 and so on. The nodes will communicate and achieve the consensus in their group only and the result for the communication overhead will be reduced. The concept to achieve the majority node, which is two-thirds in this proposed algorithm is still the same as with PBFT algorithm.