Next Article in Journal
Approach to the Impact of Digital Technologies on Sustainability Reporting through Structural Equation Modeling and Artificial Neural Networks
Previous Article in Journal
A User Purchase Behavior Prediction Method Based on XGBoost
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model

1
School of Information and Communication Engineering, Hainan University, Haikou 570228, China
2
School of Computer Science and Technology, Hainan University, Haikou 570228, China
*
Author to whom correspondence should be addressed.
Electronics 2023, 12(9), 2049; https://doi.org/10.3390/electronics12092049
Submission received: 17 February 2023 / Revised: 26 April 2023 / Accepted: 27 April 2023 / Published: 28 April 2023

Abstract

:
This study proposes an improved Byzantine fault-tolerant consensus RB-BFT based on the reputation model to address the problems of low reliability of primary nodes and high communication complexity in the practical Byzantine algorithm (PBFT). First, this algorithm establishes a dynamic reputation model of nodes to distinguish honest and malicious nodes in the system, lowering the likelihood of malicious nodes being chosen as primary nodes and increasing the dependability of primary nodes. Second, the algorithm introduces supervisory nodes for information supervision while reducing the centrality of the system. Finally, this algorithm improves the consistency protocol of the PBFT algorithm by optimizing the process of mutual communication between nodes in the preparation and commitment phases, which reduces the algorithm communication complexity from O(n2) to O(n). Theoretical and practical studies reveal that the RB-BFT algorithm enhances performance and reliability greatly.

1. Introduction

Since the introduction of Bitcoin [1], digital cryptocurrencies have developed rapidly. Their underlying blockchain technology has received widespread attention and research. According to access and management rights, there are three types of blockchain: public chain, consortium chain, and private chain [2]. The public chains pursue complete decentralization and openness, represented by Bitcoin and Ethereum. The consortium chain is only for a secure, efficient, and reliable consensus between members of a specific group and a limited number of third parties. It is not entirely decentralized, represented by the Hyperledger. The private chains are mainly used for private individuals or within an organization and are the most centralized [3].
The consensus mechanism is one of the blockchain’s core technologies, and the consensus algorithm’s performance directly affects the efficiency of the blockchain system [4]. In the consensus of consortium chain, there are many classical consensus algorithms, such as Practical Byzantine Fault Tolerance Algorithm (PBFT), Reliable and Fault Tolerant Algorithm (RAFT), Proof of Activity (PoA), Proof of Stake (PoS), Delegated Proof of Stake (DPoS), Tendermint [5,6,7,8], etc. In the RAFT algorithm, it is up to the leader node to pack the transaction information into blocks and synchronize the logs of the whole system. It has high efficiency and firm consistency [9]. The core of PoS consensus lies in equity, and nodes with more equity are more likely to be selected as bookkeeping nodes. DPoS consensus introduces a delegate selection mechanism based on PoS consensus, where nodes select agents to obtain block bookkeeping rights [10]. The main advantage of PoA is the use of appropriate incentives to ensure that nodes remain online and motivate nodes. Online miners will likely gain revenue even if they do not need mining [11].
As for the PBFT algorithm, it is a consensus algorithm widely used in the consortium chain at present. Lambert first described the Byzantine problem (BFT) in his paper “The Byzantine General Problem” [12]. Miguel Castro and Barbara Liskov proposed the PBFT consensus algorithm in 1999 and introduced it in detail in 2002 [13]. The PBFT algorithm divides nodes into client, primary, and ordinary nodes. The flow of the algorithm is divided into request, pre-prepare, prepare, commit, and reply, as shown in Figure 1 [14]. As a popular consensus algorithm in consortium chains, the PBFT algorithm reduces the complexity of the problem from the exponential to the polynomial level. PBFT can apply it to practical systems [15]. However, the increasing scale of network nodes has dramatically challenged the consensus efficiency and security of the PBFT algorithm in recent years due to the rise of consortium chains.
To improve the reliability of the primary node of the PBFT algorithm, increase the system’s fault tolerance, and reduce the communication complexity of the algorithm, this paper proposes a reputation-based Byzantine fault-tolerant algorithm (RB-BFT). The contributions of this paper are as follows:
(1)
Designing a fair and straightforward node reputation model, grading nodes according to their reputation values, and electing nodes with fast operation speed and high reputation values as primary nodes, thus improving the reliability of primary nodes.
(2)
Introducing a new node type supervising nodes to supervise the node consensus process and serving as a backup for primary nodes, improving the system’s security and reducing the centralization of the system.
(3)
Optimizing the consensus process of the PBFT algorithm, replacing the broadcast behavior between nodes in the preparation and confirmation stages with the collection of messages by primary nodes and broadcasting to ordinary nodes, reducing the communication complexity of the system, and improving the consensus efficiency.
The next pages are organized as follows: Section 2 describes related work. Section 3 presents the detailed design scheme of the RB-BFT algorithm. Section 4 provides an experimental analysis of the security and performance of the algorithm. Section 5 concludes the article.

2. Related Work

In recent years, research on PBFT algorithms has focused on security and efficiency.
Due to the considerable weight of the primary node in the PBFT algorithm, improving the primary node’s reliability can significantly ensure the algorithm’s security. To ensure the safety of the primary node, an expected improvement to the PBFT algorithm is introducing a reputation score. Zhang et al. proposed a reputation-based transaction processing mechanism, which reduced blockchain system resource consumption and effectively enhanced system resource utilization [16]. Mohsenzadeh et al. proposed a fair consensus model (FRCM) based on computational reputation, which could fairly select transactions of community members while effectively reducing the average response time [17]. Bellaj et al. proposed a blockchain-based trust (BTrust) management protocol for resource sharing, which introduced a multidimensional trust and reputation model using multiple weights and parameters to represent the reputation score of individual nodes [18]. Tang et al. designed a reputation-based consensus protocol (R-PBFT) using mixed reputation values, which improved transaction throughput and fault tolerance based on the PBFT algorithm [19]. Tang and Wang et al. proposed an improved PBFT algorithm for blockchain high-frequency transaction scenarios (tPBFT), which optimized the pre-preparation and reply phases of the PBFT algorithm by introducing a trust-fair scoring mechanism [20]. However, most of the approaches based on reputation points have some shortcomings, and the introduction of reputation points may lead to a more centralized system.
The PBFT algorithm suffers from a significant drop in efficiency when the number of nodes exceeds 100. Another expected improvement is the grouping of nodes to improve the efficiency and scalability of the algorithm. Chen et al. proposed a grouping consensus protocol under a large-scale consortium chain, introducing a reputation reward mechanism to group nodes with characteristics (FCBFT), thus enabling the consensus protocol to keep the system efficient and stable in the case of large-scale nodes [21]. Wang et al. proposed a feature-based trust grouping PBFT algorithm (GPBFT), which selected master nodes and performed grouping by trust degree evaluation. Each consensus group performed PBFT consensus independently to reduce the communication complexity [22]. Li et al. proposed a scalable PBFT consensus, first proposing an optimal two-layer PBFT scheme that minimized the communication complexity, and extended the method to PBFT systems with arbitrary layers [23]. Lee et al. proposed a two-layer blockchain reputation system for Telematics, which achieved the management of vehicle reputation score and privacy information through local and global models and possessed 1.4 times higher efficiency than the PBFT algorithm [24]. Yang et al. proposed a highly fault-tolerant consensus algorithm (NBFT) based on hash function grouping. The algorithm follows the principles of decentralization and democratization of blockchain and ensures an increased fault-tolerance ceiling and scalability [25]. The disadvantages of grouping are also evident, as a large number of groups can lead to system redundancy.
There are some other improvements to the PBFT algorithm. In [26], Yin et al. proposed the algorithm Hotstuff, which reduced the algorithmic complexity of PBFT from O(n2) to O(n) by improving the primary node selection method and the consensus process. It also introduced threshold signatures to guarantee the blockchain system’s security. In [27], Duan et al. proposed an improved consensus algorithm based on credibility for the problem of low consensus efficiency of the Hotstuff algorithm when Byzantine behavior of the primary node occurred. Dynamically adjusting node reputation based on behavioral performance and excluding malicious nodes improved the throughput and consensus latency of the Hotstuff algorithm in the case of Byzantine nodes. In [28], Gao et al. proposed a combination of the PBFT algorithm and RAFT algorithm and a credit mechanism to design node credit evaluation and grading protocols, add Byzantine node detection based on a feedback mechanism, and improve the system’s efficiency.
The difference between our proposed method and the previous method is the following two points:
(1)
Lower communication complexity: Our proposed approach improves the message model inside the PBFT consensus algorithm compared to traditional grouping consensus algorithms. The communication complexity of the simplified message model is O(n), which is lower than O(n2) for the PBFT algorithm and the traditional grouping algorithm.
(2)
Higher security: In algorithms with the same communication complexity, such as Hotstuff, the RB-BFT algorithm has higher security by setting reputation points and supervisory nodes to ensure the reliability of the primary node.

3. Algorithm Design

The RB-BFT algorithm consists of three parts: node reputation model, node classification and selection mechanism, and improved consensus process. The model uses the credit evaluation method of nodes to quantitatively evaluate the behavior of nodes in consensus to select nodes with a high trust degree to be elected as primary nodes and improve the system’s security. The mechanism introduces a new node type in the node classification process. The supervisory node is responsible for managing the reputation score in the design and acting as a backup for the primary node, taking over the work of the primary node when necessary. The improved process simplifies the two stages of preparation and confirmation of the original PBFT algorithm, and the communication complexity of the consensus process is reduced by changing the method of inter-node communications, as shown in Figure 2.
In order to determine the initial reputation value of nodes in the system and increase the cost of nodes to do evil, the RB-BFT algorithm introduces a deposit mechanism. First, all nodes join the consensus system after paying a deposit. The nodes determine the deposit amount, which is related to the initial reputation value of the nodes. The nodes’ deposit will be locked as a local reputation endorsement. All nodes entering the system obtain a base reputation score according to the reputation initialization mechanism. Then, according to the node classification and selection rules, the primary and supervisory nodes are selected for the current consensus round. The consensus process begins when the primary node obtains the client’s request, and the supervisor node oversees it. After one round of consensus, the supervisory node updates the reputation values of all nodes according to the update formula of reputation values. Figure 3 shows the flow of the RB-BFT algorithm.
The range of node reputation values is normalized to 0–1, with reputation values closer to 1 representing higher trustworthiness and closer to 0 representing lower trustworthiness. To effectively distinguish the range of reputation values of different nodes, 0.5 is the base reputation value, a reputation value above 0.6 is a suitable reputation node, above 0.9 is an excellent reputation node, and below 0.4 is considered a dishonest node.

3.1. Node Classification and Selection Mechanism

3.1.1. Node Classification

The RB-BFT algorithm introduces a new node-type supervisory node based on the PBFT classification node. Each consensus network consists of a primary node, a supervisory node, and several common nodes. The main purpose of setting supervisory nodes is to decentralize the power of primary nodes, monitor each node’s actions during the consensus process, and ensure the system’s security. The details are as follows:
Decentralization of power: The supervisory node is the backup node of the primary node and supervises each other with the primary node. The primary node and supervisory node have access to each other’s local logs, and when one behaves maliciously, the other can initiate impeachment. If the system passes impeachment, the evil-doer will have reputation points deducted and be removed from the consensus. Since both have local information about each other, one party can quickly take over the functions of the other, saving the system overhead caused by complex view transitions. When someone attacks the system, the attacker needs to gain control of both the primary node and the supervisory node to complete the system’s control, which increases the attack’s difficulty and improves the system’s security.
Consensus Monitoring: The supervisory node is responsible for monitoring the nodes in the consensus process, recording each node’s behaviors, and updating the nodes’ reputation value depending on node behavior. At the end of each consensus round, the supervisory node marks and kicks out the nodes that did evil and those with low reputation scores from the consensus. As consensus continues, the blockchain system will gradually reduce the number of malicious nodes, improving security.

3.1.2. Selection Mechanism

The selection of primary and supervisory nodes is based on the verifiable random function. The verifiable random function (VRF) is a random number generator that, given an input and a secret key, can compute an unexpected output and a proof [29]. VRF is a practical function that takes an input x and a secret key s k as inputs and generates a random output y = V R F _ H a s h ( s k , x ) with a corresponding proof P = V R F _ P r o o f ( s k ,   x ) . Anyone using the public key, input, and proof can verify the authenticity of the computation. It can be expressed as   V R F _ V e r i f y ( p k ,   x ,   P ) [30]. The random numbers generated by the VRF function are tamper-proof and unpredictable.
When primary and supervisory node selection is performed, all nodes are stratified according to the reputation value of the previous stage: reputation values of 0.6–0.9 for the supervisory node layer and reputation values of 0.9–1 for the primary node layer. The nodes within the supervisory node layer and the primary node layer each compute a random wait time using the VRF function and generate a verifiable proof. The node completing the wait time first (i.e., randomly generating the node with the shortest wait time) will broadcast a wait end message to other nodes in its consensus layer. Other nodes within the consensus layer receive the message and verify the authenticity of the waiting time using verifiable proofs and node public keys. After the authenticity check, the supervisor and primary node layers will choose the node with the least waiting time to be the supervisor and primary node. The pseudo-code for selection mechanism is described in Algorithm 1, where N 1 represents the primary node, N 2 represents the supervisory node, and T represents wait time.
Algorithm 1 Primary and supervisory node selection
Input: Initial reputation value of nodes, sk, pk
Output:  N 1 , N 2
1.   While reputation value >= 0.9 do
2.   Entry primary node layer;
3.   T = VRF_Hash(sk,x), P = VRF_Proof(sk,x);
4.   If T = 0 then
5.    Broadcast to other nodes in the layer;
6.    If VRF_Verify(pk, x, P) = true then
7.     Become N1;
8.    Else wait for other nodes;
9.   Else wait for other nodes;
10.   While reputation score >= 0.6 && score < 0.9 do
11.   Entry supervisory node layer;
12.   T = VRF_Hash(sk,x), P = VRF_Proof(sk,x);
13.   If T = 0 then
14.      Broadcast to other nodes in the layer;
14.      If VRF_Verify(pk, x, P) = true then
15.      Become N2;
16.    Else wait for other nodes;
16.   Else wait for other nodes;
17. End

3.2. Node Reputation Model

3.2.1. Reputation Value Initialization

After joining the system, a new node needs to determine the initial reputation value. To ensure fairness and increase the cost of nodes to do evil while reducing the extra complexity caused by reputation score voting among nodes, the RB-BFT algorithm uses a uniformly assigned base reputation value and margin weighting to determine the initial reputation value, as follows:
All nodes enter the system after paying the deposit. The system assigns node numbers 1, 2, …, and n to each node, from smallest to largest, according to the deposit amount. The deposit amount corresponding to the node number is recorded as S1, S2, …, and SN. The system randomly generates a random number from 1 to N. The initial bookkeeping node has the same node number as the lucky number. The initial bookkeeping node will calculate the initial reputation value for each node based on Equation (1). Then, the initial reputation value is sent to each node according to the node number. All nodes can confirm the authenticity of the information by accessing the local data of the initial bookkeeping node after receiving the information from the initial bookkeeping node. Suppose the initial bookkeeping node has problems accepting queries from other nodes. In that case, the node will be judged malicious; the initial bookkeeping will clear its reputation score, and its margin will be deducted. The system will re-select the initial bookkeeping node according to the above process.
R i = 0.5 + 0.5 S i S 1 S N S 1 α ,
where R i denotes the initial reputation value of the ith node, 0.5 is the base reputation score, and S i S 1 S N S 1 is the margin normalized weight. The α is the margin coefficient, which is used to adjust the degree of influence of the margin on the initial reputation value. The initial bookkeeping nodes obtain the value of α according to the actual situation and finally make the initial reputation value distribution of nodes satisfy the stratification condition in Section 3.2.2. The pseudo-code for reputation value initialization is described in Algorithm 2.
Algorithm 2 Reputation value initialization
Input: Initial nodes
Output: Initial reputation value of nodes
1.While Deposit = true do
2.  Entry the consensus system;
3.  Sorted by number of deposits;
4.  If random number = lucky number then
5.    Become bookkeeping node;
6.    Calculate the initial reputation value of the nodes;
7.    Send initial reputation values to other nodes;
8.  Else wait for the bookkeeping node;
9.  If verification = true then
10.   Credit value initialization completed;
11.  Else punish malicious nodes,
12.    Goto step 4;
13. End

3.2.2. Reputation Value Update

The behavior of nodes in the consensus process is defined into three types: correct behavior, timeout behavior, and malicious behavior. Proper behavior is the number of nodes’ normal consensus responses. Timeout behavior is the number of times a node fails to promptly receive or send a request. Malicious behavior is the number of times a node forges or sends false information. The difference between timeout behavior and malicious behavior is whether the node has intentionally modified the information.
After each consensus round, the supervisory node maintains a reputation list. The list mainly records the current reputation value of all nodes and various behaviors of nodes in this round of consensus. Then, the supervisory node calculates the updated node reputation value by the reputation update function and sends the updated reputation value to each node. Each node receives a message from the supervisory node and then verifies it. After the verification, the supervisory node updates its reputation value based on feedback from other nodes. The credit update function equation is as follows:
S t = k S t 1 + ( 1 k ) ( β × p p + n × φ γ × n n + p ) ,
R t = 1 1 + e S t ,
where R t represents the node’s reputation value at round t consensus, which takes values in the range (0, 1); S t is the impact factor; β denotes the reward coefficient; γ denotes the penalty coefficient; p represents the number of correct behaviors; and n represents the number of time-out behaviors. φ is the malicious behavior parameter; if the node has malicious behavior in this consensus round, φ is 0, and vice versa, φ is 1. k is a bias factor to indicate the influence of historical reputation value on current reputation value to prevent malicious nodes from committing mischief by gaining higher privileges by disguising a few rounds.
To avoid the possible polarization of the system’s credibility after a long period of operation, leading to the problem that always one or a few nodes act as primary nodes and a tendency of centralization, the RB-BFT algorithm sets δ as a consensus cycle: δ = 50, 100 rounds; the node reputation value is initialized again for each completed consensus cycle.

3.3. The Improved Consensus Process

The traditional PBFT algorithm can be viewed as a three-phase protocol consisting of three main phases: pre-prepare, prepare, and commit. The RB-BFT algorithm is improved mainly in the two phases of prepare and commit by changing the nodes to communicate with each other two by two and forwarding by the primary node, and adding the backup and supervision process of the supervisory node. The six steps of the consensus process are request, pre-prepare, prepare, commit, respond, and after-reply.
Request phase: The client initiates a transaction request to the primary node and sends the transaction information with its signature to the primary node and the supervisory node after the request is approved.
Pre-prepare phase: After receiving the request message from the client, the primary node verifies whether the signature and transaction information of the client is legitimate and then broadcasts the pre-prepared information to all common consensus nodes after the verification is passed. The supervisory node also verifies the request message from the client after receiving it and backs up the message information as the original request message after passing it.
Prepare phase: The common nodes verify the message after receiving a pre-prepared message from the primary node. The common nodes will send a consent message to the primary node if the authentication passes. Otherwise, it will send a deny message. When the primary node receives more than half of the consent messages, it confirms that the current system is ready and broadcasts this message to all common nodes. All common nodes synchronize their state into the prepared state. Supervisory nodes are responsible for monitoring node behavior during this process.
Commit phase: The consensus process for the commit phase is similar to the prepare phase. The primary node receives confirmation messages from more than half of the common nodes, verifies that the system is in the confirmed state, and broadcasts the committed state to each common node to synchronize the state of all nodes.
Reply phase: After the primary node commits that the system is in the committed state, it will reply to the client consensus reached and write the content of the transaction to the block.
After-reply phase: The supervisory node judges the behavior of nodes in this round of consensus and gives rewards and punishments for reputation scores.
The pseudo-code of the improved consensus process is shown below. The collection of nodes is defined as N = { N 1 ,   N 2 ,   N 3 ,   ,   N n } ; N 1 represents the primary node; N 2 represents the supervisory node; N i represents the common nodes, i = 3 , ,   N ; R i represents reputation value, i = 1 ,   2 ,   ,   N ; t represents the timestamp; D represents transaction information; MD is a message digest; c represents the client’s identification; V represents view information; Sig represents signature information; p represents the primary node’s identification; and TRUE/FALSE represents the common node’s agree or disagree statement. The pseudo-code for improved BFT algorithm based on reputation is described in Algorithm 3.
Algorithm 3 Improved BFT Algorithm Based on Reputation
Input:
   Node collection N
   Initial Ri
Output:
   Consensus result
   Updated R i
1:  Client send req ( ( R e q u e s t ,   t ,   D ,   M D ,   c ) , S i g c )
2:  while ( ( R e q u e s t ,   t ,   D ,   M D ,   c ) , S i g c ) ) = true do
3:     N 1 broadcast ( ( P P r e p a r e , V , t , D , M D , p ) , S i g p ) ;
4:    If ( ( P P r e p a r e , V , t , D , M D , p ) , S i g p ) = true then
5:      N i send ( ( P r e p a r e , V , t , M D , T R U E / F A L S E ) , S i g i ) ;
6:      N 1 receive ( ( P r e p a r e , V , t , M D , T R U E / F A L S E ) , S i g i ) ;
7:    Else do nothing;
8:    If prepared  ( ( V , t , M D , T R U E ) , S i g i ) then
9:      N i send ( ( C o m m i t , V , t , M D , T R U E / F A L S E ) , S i g i ) ;
10:     N 1 receive ( ( C o m m i t , V , t , M D , T R U E / F A L S E ) , S i g i ) ;
11:    Else do nothing;
12:    If committed  ( ( V , t , M D , T R U E ) , S i g i ) then
13:     Do ( ( R e p l y , t , M D , N , p ) , S i g n ) ;
14:      N 1 reply result to Client;
15:    Else do nothing;
16:     N 2 calculate R i ;
17:    N2 update Ri;
18:  End

4. Analysis and Evaluation

The experiments test the performance of the RB-BFT algorithm by comparing the performance of multiple consensus algorithms in terms of fault tolerance, communication complexity, throughput, and node reputation values. The hardware conditions for the experiments were the following: AMD Ryzen 7 5800H CPU, RTX 3060 graphics card, 16 GB RAM, and a standalone test environment in a virtual machine environment with a 64-bit Ubuntu 20.04 operating system. The PBFT, GPBFT, and RB-BFT algorithms were implement using the Java programming language and multiple ports to simulate the blockchain multiple-node environment. Communication between ports used the gRPC protocol; packet size was set to 1 KB. The comparison of algorithms is shown in Table 1.

4.1. Fault-Tolerance Analysis

Inevitably, node failures or downtime will occur during the execution of the consensus algorithm, so the algorithm must be fault tolerant. We assume that the total number of nodes in the system is N, the number of faulty or malicious nodes is f, and the number of correct nodes remaining is N-f. The traditional PBFT algorithm needs to receive N-f messages, considering the extreme case that there may be f malicious nodes in N-f messages or f malicious node messages are received first due to network reasons, and the number of correct messages is N-f-f. It is required that the right message must be in the majority to achieve majority agreement, i.e., N-f-f > f, with N being at least 3f + 1. The PBFT algorithm has an error tolerance of 1/3. The GPBFT algorithm uses the consensus mechanism of grouped PBFT, which uses the same internal process with the same fault tolerance as the traditional PBFT algorithm. The RB-BFT algorithm requires only N-f > f, i.e., RB-BFT has a fault tolerance of 1/2 in the case of the correct primary node. Considering the reputation mechanism used by the RB-BFT algorithm to select the primary node and the supervisory node mechanism, the failure rate and the evil rate of the primary node are very low. As the consensus proceeds, the system will gradually remove the malicious nodes, increasing the dependability of the primary node. At that point, the RB-BFT algorithm’s fault tolerance can be considered 1/2.

4.2. Communication Complexity Analysis

The system has n nodes and a three-stage broadcast process in the PBFT algorithm. The primary node broadcasts a message to the common nodes during the pre-prepare phase, and the number of communications during this phase is n − 1. During the preparation phase and commitment phases, each node broadcasts messages to other nodes, and the number of communications in both phases is n (n − 1). The number of communications for one round of PBFT is C = ( n 1 ) + n ( n 1 ) + n ( n 1 ) = 2 n 2 n 1 , so the complexity of the PBFT algorithm is O(n2). In the GPBFT algorithm, the nodes are divided into groups, and the PBFT algorithm is executed within each group. Then, the primary node at each layer executes the PBFT algorithm. According to the literature [19], the number of communications for one round of GPBFT is C = 2 ( s 1 ) + 2 s k ( k 1 ) ;  although the complexity of the GPBFT algorithm is less than that of PBFT, it is still O(n2). In the RB-BFT algorithm, the number of communications during the Pre-prepare and After-reply phase is n − 1. The number of communications during the Prepare and Commit phase is 2(n − 1). The total number of communications is C = ( n 1 ) + 2 ( n 1 ) + 2 ( n 1 ) + ( n 1 ) = 6 ( n 1 ) . The overall complexity of the algorithm is O(n). The number of communications for the three algorithms at different numbers of nodes is shown in Figure 3.
As shown in Figure 4, when the number of nodes is small, the number of communications for all three algorithms is small. With the increase in the number of nodes, the number of communications for the PBFT and GPBFT algorithms shows a rapid increase in the squared term, while the improved RB-BFT algorithm shows an almost linear slow increase.

4.3. Throughput Testing

Throughput is the number of packaged transactions per second, which reflects the consensus algorithm’s real-time data processing capability and is a crucial indicator of the consensus algorithm [31]. High throughput means the system can handle transactions well, and throughput is often expressed in terms of TPS. It is calculated as
T P S = S u m ( T r a n s ) Δ t / Δ t
Experiments are conducted to test the time taken by various algorithms to process the duplicate 100 transactions with the different numbers of nodes, and the throughput of the algorithms is calculated based on the above equation. The experimental results are shown in Figure 5.
As seen in Figure 5, the throughputs of the two algorithms are similar when the number of nodes is small. The PBFT algorithm’s throughput decreases significantly as the number of nodes increases. The RB-BFT algorithm has a significantly better throughput than the PBFT algorithm for the same number of nodes. This shows that the RB-BFT algorithm significantly improves throughput.

4.4. Reputation Value Analysis

The reputation model designed for this paper is analyzed and compared with the reputation model proposed in the literature [32,33], mainly comparing the changes in reputation values under different reputation value models. The parameters in Equation (2) are assumed to be k = 0.9; β = 3; γ = 9; set 19 rounds, 39 rounds of node malicious behavior, and every 50 rounds as a consensus cycle; δ = 50; and the results are shown in Figure 6.
As shown in the figure, the reputation model used by the RB-BFT algorithm has a relatively smooth reputation value change curve for the same consensus node in the consensus cycle. When a node commits evil behavior, the reputation value will drop rapidly. The reputation value dropped by one evil act requires the node to work generally for more than five rounds to recover, which limits the evil rate of the node. The node reputation value is initialized after every 50 rounds of consensus to prevent the divergence of node reputation values, which helps to keep the nodes motivated.

5. Summary and Outlook

In this paper, we propose a solution based on the reputation mechanism for the problem of low reliability of primary nodes and high communication complexity of the PBFT algorithm. A reputation scoring mechanism is used to select the nodes with high speed and good performance in the system as primary nodes. A supervisory node is set up to supervise the nodes in the design and instantly remove the malicious nodes from the system. The reputation scoring mechanism and supervisory node mechanism significantly reduce the possibility of malicious nodes being elected as primary nodes and enhance the reliability of primary nodes. In addition, the algorithm also optimizes the consensus process of the PBFT algorithm. The experimental results show that the improved algorithm has lower complexity and higher throughput. However, the approach proposed in this paper also faces some challenges. The RB-BFT algorithm follows the primary node design idea of the PBFT algorithm, which has the risk of centralization. Supervisory node setup and reputation value calculation may result in additional system overhead. In future research, we will further consider grouping and layering to reduce the algorithm’s complexity, improve the scalability algorithm, and promote consortium chain applications for wider networks and more efficient distributed scenarios.

Author Contributions

Conceptualization, F.H. and W.F.; methodology, F.H.; software, F.H.; validation, F.H., W.F. and J.L.; formal analysis, F.H.; investigation, F.H.; resources, Y.Z.; data curation, F.H.; writing—original draft preparation, F.H.; writing—review and editing, W.F.; visualization, J.L.; supervision, Y.Z.; project administration, Y.Z.; funding acquisition, W.F. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Major Science and Technology Project of Haikou, under Grant 2020-009, and the Key R&D Project of Hainan province (Grant #: ZDYF2021SHFZ243).

Data Availability Statement

The data used to support the finding of this study are included within the article.

Acknowledgments

The authors would like to thank the editors and the reviewers for their valuable time and constructive comments.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Available online: http://bitcoin.org/bitcoin.pdf (accessed on 1 April 2022).
  2. Li, Y.; Qiao, L.; Lv, Z. An Optimized Byzantine Fault Tolerance Algorithm for Consortium Blockchain. Peer-to-Peer Netw. Appl. 2021, 14, 2826–2839. [Google Scholar] [CrossRef]
  3. Zhang, W.; Sun, G.; Xu, L.; Lu, Q.; Ning, H.; Zhang, P.; Yang, S. A Trustworthy Safety Inspection Framework Using Performance-Security Balanced Blockchain. IEEE Internet Things J. 2022, 9, 8178–8190. [Google Scholar] [CrossRef]
  4. Fu, X.; Wang, H.; Shi, P. A Survey of Blockchain Consensus Algorithms: Mechanism, Design and Applications. Sci. China Inf. Sci. 2021, 64, 121101. [Google Scholar] [CrossRef]
  5. Cui, M.; Zhang, J.; Xue, Q. Improvement of practical Byzantine fault tolerance algorithm based on node reputation value matching. In Proceedings of the SPIE 12474, Second International Symposium on Computer Technology and Information Science (ISCTIS 2022), 124740C (8 December 2022), Guilin, China, 10–12 June 2022. [Google Scholar] [CrossRef]
  6. Gao, S.; Yu, T.; Zhu, J.; Cai, W. T-PBFT: An EigenTrust-Based Practical Byzantine Fault Tolerance Consensus Algorithm. China Commun. 2019, 16, 111–123. [Google Scholar] [CrossRef]
  7. Crain, T.; Vincent, G.; Mikel, L. DBFT: Efficient Leaderless Byzantine Consensus and Its Application to Blockchains. In Proceedings of the 2018 IEEE 17th International Symposium on Network Computing and Applications (NCA), Cambridge, MA, USA, 1–3 November 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 1–8. [Google Scholar] [CrossRef]
  8. Sui, H.; Y., J. An Improved Scheme of Practical Byzantine Fault Tolerant Algorithm. In Proceedings of the International Conference on Forthcoming Networks and Sustainability (FoNeS 2022), Hybrid Conference, Nicosia, Cyprus, 1–2 March 2022; Institution of Engineering and Technology: London, UK, 2022; pp. 795–800. [Google Scholar] [CrossRef]
  9. Wang, H.; Guo, K. Byzantine Fault Tolerant Algorithm Based on Vote. In Proceedings of the 2019 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery (CyberC), Guilin, China, 17–19 October 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 190–196. [Google Scholar] [CrossRef]
  10. Wang, H.; Tan, W.; Wu, J. OPBFT: Optimized Practical Byzantine Fault Tolerant Consensus Mechanism Model. In AI and Analytics for Public Health; INFORMS-CSS 2020; Springer Proceedings in Business and Economics; Yang, H., Qiu, R., Chen, W., Eds.; Springer: Cham, Switzerland, 2022. [Google Scholar] [CrossRef]
  11. Yu, X.; Zhong, Y.; Zhang, Z. Byzantine Fault Tolerant Consensus Algorithm Based on Credit Model and Verifiable Random Function. In Proceedings of the 2022 6th International Conference on Electronic Information Technology and Computer Engineering (EITCE’22), Xiamen, China, 21–23 October 2022; Association for Computing Machinery: New York, NY, USA, 2022; pp. 1659–1664. [Google Scholar] [CrossRef]
  12. Lamport, L.; Shostak, R.; Pease, M. The Byzantine Generals Problem. ACM Trans. Program. Lang. Syst. 1982, 4, 382–401. [Google Scholar] [CrossRef]
  13. Castro, M.; Liskov, B. Practical Byzantine Fault Tolerance. In Proceedings of the Third Symposium on Operating System Design and Implementation, New Orleans, LA, USA, 22–25 February1999. [Google Scholar]
  14. Xu, G.; Bai, H.; Xing, J.; Luo, T.; Xiong, N.N.; Cheng, X.; Liu, S.; Zheng, X. SG-PBFT: A Secure and Highly Efficient Distributed Blockchain PBFT Consensus Algorithm for Intelligent Internet of Vehicles. J. Parallel Distrib. Comput. 2022, 164, 1–11. [Google Scholar] [CrossRef]
  15. Yu, X.; Qin, J.; Chen, P. GPBFT: A Practical Byzantine Fault-Tolerant Consensus Algorithm Based on Dual Administrator Short Group Signatures. Secur. Commun. Netw. 2022, 2022, 8311821. [Google Scholar] [CrossRef]
  16. Zhang, J.; Cheng, Y.; Deng, X.; Wang, B.; Xie, J.; Yang, Y.; Zhang, M. A Reputation-Based Mechanism for Transaction Processing in Blockchain Systems. IEEE Trans. Comput. 2022, 71, 2423–2434. [Google Scholar] [CrossRef]
  17. Mohsenzadeh, A.; Bidgoly, A.J.; Farjami, Y. A Fair Consensus Model in Blockchain Based on Computational Reputation. Expert Syst. Appl. 2022, 204, 117578. [Google Scholar] [CrossRef]
  18. Bellaj, B.; Ouaddah, A.; Mezrioui, A. BTrust: A New Blockchain-Based Trust Management Protocol for Resource Sharing. J. Netw. Syst. Manag. 2022, 30, 64. [Google Scholar] [CrossRef]
  19. Tong, W.; Dong, X.; Shen, Y.; Zhang, Y.; Jiang, X.; Tian, W. CHChain: Secure and Parallel Crowdsourcing Driven by Hybrid Blockchain. Future Gener. Comput. Syst. 2022, 131, 279–291. [Google Scholar] [CrossRef]
  20. Tang, S.; Wang, Z.; Jiang, J.; Ge, S.; Tan, G. Improved PBFT Algorithm for High-Frequency Trading Scenarios of Alliance Blockchain. Sci. Rep. 2022, 12, 4426. [Google Scholar] [CrossRef] [PubMed]
  21. Chen, Y.; Li, M.; Zhu, X.; Fang, K.; Ren, Q.; Guo, T.; Chen, X.; Li, C.; Zou, Z.; Deng, Y. An Improved Algorithm for Practical Byzantine Fault Tolerance to Large-Scale Consortium Chain. Inf. Process. Manag. 2022, 59, 102884. [Google Scholar] [CrossRef]
  22. Wang, Y.; Zhong, M.; Cheng, T. Research on PBFT Consensus Algorithm for Grouping Based on Feature Trust. Sci. Rep. 2022, 12, 12515. [Google Scholar] [CrossRef] [PubMed]
  23. Li, W.; Feng, C.; Zhang, L.; Xu, H.; Cao, B.; Imran, M.A. A Scalable Multi-Layer PBFT Consensus for Blockchain. IEEE Trans. Parallel Distrib. Syst. 2021, 32, 1146–1160. [Google Scholar] [CrossRef]
  24. Lee, S.; Seo, S. Design of a Two Layered Blockchain-Based Reputation System in Vehicular Networks. IEEE Trans. Veh. Technol. 2022, 71, 1209–1223. [Google Scholar] [CrossRef]
  25. Yang, J.; Jia, Z.; Su, R.; Wu, X.; Qin, J. Improved Fault-Tolerant Consensus Based on the PBFT Algorithm. IEEE Access 2022, 10, 30274–30283. [Google Scholar] [CrossRef]
  26. Maofan, Y.; Dahlia, M.; Michael, K.R. HotStuff: BFT Consensus with Linearity and Responsiveness. In Proceedings of the 2019 ACM Symposium on Principles of Distributed Computing, Toronto, ON, Canada, 29 July–2 August 2019; ACM: New York, NY, USA, 2019; pp. 347–356. [Google Scholar] [CrossRef]
  27. Renhang, D.; Dong, Z.; Siniu, H. Improved Hotstuff Consensus Algorithm Based on Credibility. In Proceedings of the 10th China Command and Control Conference, Beijing, China, 7–9 July 2022; pp. 601–606. [Google Scholar]
  28. Wuqi, G.; Wubin, M.; Shanshan, H. Improved Byzantine Fault-Tolerant Algorithm Based on Alliance Chain. Wirel. Commun. Mob. Comput. 2021, 2021, 8455180. [Google Scholar] [CrossRef]
  29. Jing, C.; Silvio, M. Algorand. arXiv 2016, arXiv:1607.01341. [Google Scholar]
  30. Guo, G.; Zhu, Y.; Chen, E.; Zhu, G.; Ma, D.; Chu, W.C. Continuous Improvement of Script-Driven Verifiable Random Functions for Reducing Computing Power in Blockchain Consensus Protocols. Peer-to-Peer Netw. Appl. 2022, 15, 304–323. [Google Scholar] [CrossRef]
  31. Li, C.; Zhang, J.; Yang, X. Scalable Blockchain Storage Mechanism Based on Two-Layer Structure and Improved Distributed Consensus. J. Supercomput. 2022, 78, 4850–4881. [Google Scholar] [CrossRef]
  32. Cai, W.; Jiang, W.; Xie, K. Dynamic Reputation–Based Consensus Mechanism: Real-Time Transactions for Energy Blockchain. Int. J. Distrib. Sens. Netw. 2020, 16, 155014772090733. [Google Scholar] [CrossRef]
  33. Wang, T.; Guo, J.; Ai, S.; Cao, J. RBT: A Distributed Reputation System for Blockchain-Based Peer-to-Peer Energy Trading with Fairness Consideration. Appl. Energy 2021, 295, 117056. [Google Scholar] [CrossRef]
Figure 1. Process of the PBFT Algorithm.
Figure 1. Process of the PBFT Algorithm.
Electronics 12 02049 g001
Figure 2. Improved BFT Algorithm Based on Reputation Model.
Figure 2. Improved BFT Algorithm Based on Reputation Model.
Electronics 12 02049 g002
Figure 3. Flowchart of the improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model.
Figure 3. Flowchart of the improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model.
Electronics 12 02049 g003
Figure 4. Comparison of the relationship between the number of nodes and the number of communications.
Figure 4. Comparison of the relationship between the number of nodes and the number of communications.
Electronics 12 02049 g004
Figure 5. Throughput Comparison Chart.
Figure 5. Throughput Comparison Chart.
Electronics 12 02049 g005
Figure 6. Comparison of node reputation values under different reputation models.
Figure 6. Comparison of node reputation values under different reputation models.
Electronics 12 02049 g006
Table 1. Comparison with other algorithms.
Table 1. Comparison with other algorithms.
AlgorithmByzantine Fault ToleranceFault-Tolerance LimitCommunication ComplexityTPS (Max)
PBFT [11]Y1/3 O ( n 2 ) 1000+
RAFT [6]N1/2 O ( n ) 2000+
GPBFT [19]Y1/3 O ( n 2 ) 1000+
Hotstuff [25]Y1/3 O ( n ) 2500+
RB-BFT (proposed)Y1/2 O ( n ) 1000+
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

He, F.; Feng, W.; Zhang, Y.; Liu, J. An Improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model. Electronics 2023, 12, 2049. https://doi.org/10.3390/electronics12092049

AMA Style

He F, Feng W, Zhang Y, Liu J. An Improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model. Electronics. 2023; 12(9):2049. https://doi.org/10.3390/electronics12092049

Chicago/Turabian Style

He, Feiyang, Wenlong Feng, Yu Zhang, and Jian Liu. 2023. "An Improved Byzantine Fault-Tolerant Algorithm Based on Reputation Model" Electronics 12, no. 9: 2049. https://doi.org/10.3390/electronics12092049

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop