CN116389040A - Reputation-based blockchain consensus method, device and computer equipment - Google Patents

Reputation-based blockchain consensus method, device and computer equipment Download PDF

Info

Publication number
CN116389040A
CN116389040A CN202310050815.XA CN202310050815A CN116389040A CN 116389040 A CN116389040 A CN 116389040A CN 202310050815 A CN202310050815 A CN 202310050815A CN 116389040 A CN116389040 A CN 116389040A
Authority
CN
China
Prior art keywords
reputation
consensus
round
node
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310050815.XA
Other languages
Chinese (zh)
Inventor
刘齐军
丁孟
王诗堃
储超尘
谭林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Tianhe Guoyun Technology Co Ltd
Original Assignee
Hunan Tianhe Guoyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Tianhe Guoyun Technology Co Ltd filed Critical Hunan Tianhe Guoyun Technology Co Ltd
Priority to CN202310050815.XA priority Critical patent/CN116389040A/en
Publication of CN116389040A publication Critical patent/CN116389040A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/102Entity profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/30Decision processes by autonomous network management units using voting and bidding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Complex Calculations (AREA)

Abstract

The invention relates to the technical field of blockchains, and provides a reputation-based blockchain consensus method, a reputation-based blockchain consensus device and computer equipment, wherein the method comprises the following steps: counting historical consensus voting information of a node, and performing logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight to obtain the current trust degree of the node; performing weight balance on the last-round reputation value of the node and the current trust degree by using a reputation correction threshold value to determine a current-round reputation value; and carrying out current round consensus according to the current round credit values of the nodes. By adopting the method, the rights and interests crushing attack, the brining attack, the Sybil attack and the like can be avoided, the robustness is improved, and the decentralization characteristic is ensured.

Description

Reputation-based blockchain consensus method, device and computer equipment
Technical Field
The invention belongs to the technical field of blockchains, and particularly relates to a reputation-based blockchain consensus method.
Background
Blockchain technology, also known as distributed ledger technology, can solve the problem of agreement between untrusted parties. The method has the characteristics of decentralization, traceability, anonymity, auditability and the like. The consensus protocol is used for ensuring the consistency of data copies maintained by all nodes in the blockchain network, avoiding the occurrence of the problems of data non-uniformity and information asymmetry, and is an algorithm for driving the blockchain to advance. Currently, blockchain technology uses three mainstream consensus protocols, including the PoW (Proof of Work) protocol, the PoS (Proof of trust) protocol, and the PBFT (Practical Byzantine Fault Tolerance, bayer fault tolerance protocol) protocol. Among them, the PoW protocol is generally called the smart consensus, and nodes in the consensus have to repeatedly calculate hash values to achieve the consensus. The calculation of the hash value makes it necessary to consume a computational effort to generate a block in the PoW, and as the height of the block increases, the computational effort consumed increases, which causes unnecessary waste. Furthermore, to ensure security, transactions in the PoW must wait for six blocks to be acknowledged, which greatly reduces the throughput of the PoW protocol.
The core principle of the PoS protocol to achieve consensus is based on the stock right held by the node instead of the computing power in the PoW, which has been applied to PPCoin, and can effectively avoid the problem of the waste of computing power in the PoW consensus. However, since ppcoi uses coin age as a weight, the "age" of the coin increases even if the node is not connected to the network. As shown in fig. 1, node J is offline through the intentional network, accumulating up to 70% of the weight. It allows node J to gradually dominate the consensus and even determine the generation of new blocks. That is, one node dominates the accounting of the blockchain, which does not conform to the decentralization characteristics of the blockchain. The derivative agreement PoA combines PoS with the midst clever consensus so that only online nodes can acquire mining revenue and transaction fees. However, these protocols rely on the interests of the nodes to agree on, which does not guarantee the robustness of the blockchain. As shown in fig. 2, a node O of low interest may try a sequence of different stakeholders (forking) to maximize its own interest, since forking does not consume any resources, which is known as a equity breaking attack in the blockchain. The node P of high interest will be continuously bribed with other nodes, and once their share right reaches more than 50%, the whole blockchain can be controlled to launch the double-flower attack, which is always advantageous and profitable in the case that the amount of the bribed is less than the commodity transaction price, which is called a bribed attack in the blockchain. There is also a random election competition mechanism, the Follow-the-satoshi algorithm, which differs from PoS in that it uses secure multiparty computation to maintain leadership unpredictability, but it assumes that most nodes participating in the joint coin-op protocol are not destroyed by adversaries for a significant period of time. In general, the protocols derived from the PoS protocol have the problems of being vulnerable to equity crushing attack, brining attack, needing security assumption, and the like.
The PBFT protocol is improved by the BFT (bayer fault tolerance) protocol, and compared with the PoW protocol and the PoS protocol, the PBFT protocol can realize good fault tolerance and excellent performance. In the PBFT protocol, however, the nodes in the blockchain are equal and may participate at will. It is easy to cause a malicious node to create any number of pseudonyms, as shown in fig. 3, which can then be used to vote for its own improper interests (i.e. double consumption), thereby easily breaking the security of the network and even controlling the entire network system, which is known as a Sybil attack in the blockchain. Although it has been proposed to combine the Zhongson-Smart consensus with the PoS or BFT protocol and to circumvent the Sybil attack in a way that the BFT protocol completely replaces the Zhongson-Smart consensus. However, all of these protocols are based on recent resources, equity, or external trust of the nodes to achieve consensus, potentially creating undesirable hierarchies between nodes and compromising the decentralization of the blockchain system.
Disclosure of Invention
Accordingly, in view of the above-described problems, it is desirable to provide a reputation-based blockchain consensus method, apparatus, computer device, and storage medium that can prevent a equity crushing attack, a bribery attack, a Sybil attack, and the like, thereby improving robustness and ensuring decentralization characteristics.
The invention provides a block chain consensus method based on reputation, which comprises the following steps:
counting historical consensus voting information of a node, and performing logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight to obtain the current trust degree of the node;
performing weight balance on the last-round reputation value of the node and the current trust degree by using a reputation correction threshold value to determine a current-round reputation value;
and carrying out current round consensus according to the current round credit values of the nodes.
In one embodiment, the weight balancing the previous round of reputation value of the node and the current trust level by using the reputation correction threshold value, and determining the current round of reputation value includes:
calculating the difference between the current trust and the absolute value of the credit value of the previous round, and calculating the current round of accumulated deviation according to the difference between the absolute values and the accumulated deviation determined by the consensus of the previous round;
calculating a reputation correction threshold according to the difference between the absolute values and the current wheel accumulated deviation;
and carrying out weight balance on the previous-round reputation value and the current trust degree by utilizing a reputation correction threshold value, and determining the current-round reputation value.
In one embodiment, the weight balancing of the previous round of reputation value and the current trust level of the node by using the reputation correction threshold value, before determining the current round of reputation value, further includes:
judging whether the node has offline non-voting behaviors in the history consensus voting according to the history consensus voting information;
and when the offline non-voting behavior is determined to exist, the current trust level is reserved, and when the offline non-voting behavior is determined to not exist, the block generation time is utilized to conduct reputation consumption on the current trust level.
In one embodiment, the logistic regression calculation formula is as follows:
Figure SMS_1
wherein, repu (i) cur Is the current confidence level; n represents the current nth round consensus; mu is node i accumulated parameterThe number of the common wheels is the same as that of the common wheels;
Figure SMS_2
indicating whether the node i normally participates in voting in the x-th round of consensus, wherein the normal voting is 1, and the abnormal voting is 0;τ x indicating whether the node i maliciously votes in the x-th round of consensus, wherein the maliciously votes are 1, and the maliciously votes are 0;υrepresenting malicious voting penalty weights; e is the natural logarithm.
In one embodiment, the reputation consumption function is as follows:
Figure SMS_3
wherein,,
Figure SMS_4
=0 means node i was not voted offline in the x-th round of consensus; e is natural logarithm; Δb represents the block generation time.
In one embodiment, the weight equalization is calculated as follows:
Figure SMS_5
wherein t represents the current t-th round consensus; repu (i) t A reputation value representing a t-th round consensus; repu (i) t-1 Representing the reputation value of the t-1 th round; gamma denotes a reputation correction threshold, and the initial value of gamma is 1.
In one embodiment, the reputation correction threshold is calculated as follows:
Figure SMS_6
wherein,,thersholdfor the set threshold value(s),thershold=0.25; c is a defined parameter, c=0.6;φ t the repu (i) represents the difference in absolute value of node i,ψ t the repu (i) represents the current wheel accumulated bias,ψ t-1 the repu (i) represents the accumulated bias of the previous consensus determination.
A reputation-based blockchain consensus apparatus, comprising:
the credit determining module is used for counting historical consensus voting information of the node, and carrying out logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight to obtain the current trust degree of the node;
the reputation correction module is used for carrying out weight balance on the previous-round reputation value of the node and the current trust degree by utilizing a reputation correction threshold value to determine the current-round reputation value;
and the consensus module is used for carrying out current round consensus according to the current round credit value of each node.
The present invention also provides a computer device comprising a processor and a memory storing a program executed by the processor to implement the steps of the reputation-based blockchain consensus method described above.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the reputation based blockchain consensus method described above.
The block chain consensus method, the device, the computer equipment and the storage medium based on the reputation achieve consensus by introducing the reputation as the voting weight of the consensus node, and the total reputation of the node is not changed, so that Sybil attack can be effectively resisted. And, utilize the logic regression to dynamically update the reputation of the node based on node's behavior, punish malicious nodes in order to reduce their probability of launching equity crushing attacks and brining attacks. Meanwhile, the reputation is corrected by using the reputation correction threshold value, so that the reputation is increased very slowly, and the decentralization property of the blockchain is guaranteed.
Drawings
FIG. 1 is a schematic diagram of coin age accumulation resulting in block link point equity centralization in one embodiment.
FIG. 2 is a diagram of a low-interest node attempting to fork a high-interest node to execute the brix in one embodiment.
FIG. 3 is a schematic diagram of a malicious node implementing a Sybil attack in one embodiment.
FIG. 4 is a flow diagram of a reputation-based blockchain consensus method in an embodiment.
FIG. 5 is a graph illustrating the comparison of the latency performance of the consensus protocol and the PBFT protocol according to the present invention under a block size change in an embodiment.
FIG. 6 is a graph illustrating the throughput performance of the consensus protocol versus the PBFT protocol according to an embodiment of the present invention with block size variation.
Fig. 7 is a schematic diagram of comparing delay performance of the consensus protocol and the PBFT protocol according to the present invention under a change of the number of nodes in an embodiment.
Fig. 8 is a schematic diagram of comparing throughput performance of the consensus protocol and PBFT protocol according to the present invention under a change in the number of nodes in an embodiment.
FIG. 9 is a block diagram of a reputation based blockchain consensus device in an embodiment.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In one embodiment, as shown in FIG. 4, a reputation-based blockchain consensus method is provided that includes the steps of:
and step S101, counting the historical consensus voting information of the nodes, and carrying out logistic regression calculation according to the historical consensus voting information and the malicious voting penalty weight to obtain the current trust degree of the nodes.
And step S103, carrying out weight balance on the last round of reputation value and the current trust degree of the node by utilizing the reputation correction threshold value, and determining the current round of reputation value.
The historical consensus voting information refers to the voting situation that the node has already had a consensus before the current round of consensus, and comprises whether the node normally participates in voting in each round of consensus, whether the node maliciously votes in each round of consensus and the like. The malicious voting penalty weight is a penalty weight preset for malicious voting, and based on actual demand setting, the larger the malicious voting penalty weight is, the larger the penalty on node malicious voting is. Logistic regression models are the main common model for studying the dichotomy problem, which describes the relationship between a set of independent and binary dependent variables. The method uses a sigmoid function based on linear regression to enable the prediction result to be located in the [0,1] interval, and the embodiment can realize the dynamic authorization of the reputation by establishing a logistic regression model to evaluate the change of the node reputation and the consensus behavior thereof. As part of the consensus protocol, the model may be executed in each node that participates in the consensus. The reputation is calculated independently, the calculation of the reputation is determined by the behavior of the node in performing the consensus, and can be broadcast simultaneously with the consensus information. According to the influence degree of node behaviors on the block consensus result, the embodiment classifies the node behaviors into the following three types: # good: transaction information lists in the network are normally received and broadcast, and the same information list is sent to other nodes. #bad: transaction information lists in the network are normally received and broadcast, and different information lists or information lists forged by the node are sent to other nodes. #offine: the list of transaction information in the network is not received and broadcast. The reputation of this embodiment is a dynamically changing process because the node's consensus behavior is not fixed at each round. In the model, the set reputation value R is a real number ranging from 0 to 1, and the larger the reputation value is, the higher the credibility is. For the newly added consensus node of the system, the initial reputation value is set to 0.5.
The reputation correction threshold is a threshold set for correcting the reputation growth rate, and the reputation value of the node is not increased too fast by the reputation correction threshold, so that reputation centering in the initial stage of the network is avoided, and since whether the node has a dislike tendency is not known from the beginning, the reputation correction threshold gamma is set to be 1 in the beginning. The previous round of reputation value is the reputation of the node in the previous round of consensus, and the reputation of the node in the beginning of the t-th round of consensus is equal to the reputation of the node in the ending of the t-1 th round of consensus. The current round reputation value is the finally determined reputation of the current round consensus, and the current trust level is the reputation determined before correction is not performed.
Specifically, the current trust degree of the node is calculated according to a logistic regression model by utilizing parameters such as historical consensus voting information, malicious voting penalty weight and the like. And then, carrying out weight balance on the current trust degree and the last-round reputation value by utilizing a reputation correction threshold value to obtain a corrected reputation value as the current-round consensus reputation value of the node, namely, the current-round reputation value, and avoiding that the reputation value is quickly increased to destroy the stability of a consensus protocol by correcting the current-round reputation value.
In one embodiment, step S101, the calculation formula of the node reputation metric function based on the logistic regression model is as follows:
Figure SMS_7
wherein, repu (i) cur Is the current confidence level; n represents the current nth round consensus; mu is the cumulative number of the consensus rounds of participation of the node i, namely the round length;
Figure SMS_8
indicating whether the node i normally participates in voting in the x-th round of consensus, wherein the normal voting is 1, and the abnormal voting is 0;τ x indicating whether the node i maliciously votes in the x-th round of consensus, wherein the maliciously votes are 1, and the maliciously votes are 0;υrepresenting malicious voting penalty weights; e is the natural logarithm. The operation of the consensus protocol of the present embodiment is divided in time into a series of rounds, each round producing a block, performing the same steps. The credit is calculated according to the historical value before each round of start, and dynamic trust credit is granted by judging the honest signature and malicious signature behaviors of the node in each round.
In one embodiment, step S103 includes: calculating the difference between the current trust and the absolute value of the credit value of the previous round, and calculating the current round of accumulated deviation according to the difference between the absolute values and the accumulated deviation determined by the consensus of the previous round; calculating a reputation correction threshold according to the difference between the absolute values and the current round accumulated deviation; and carrying out weight balance on the previous-round reputation value and the current trust degree by utilizing the reputation correction threshold value, and determining the current-round reputation value.
Specifically, because the increase of the reputation value of the nodes in the logarithmic growth phase of the model by logistic regression is quite rapid, malicious nodes which are purposely well represented in the early stage of consensus cannot be punished, and stable implementation of the consensus protocol is not facilitated. Therefore, in order to avoid such a situation, the embodiment further corrects the model, and weights and balances the reputation when the nodes are in consensus according to the current reputation of the nodes and the reputation when the nodes are in the last round of consensus, and the corrected reputation measurement function, namely the calculation formula of the weight and balance, is as follows:
Figure SMS_9
wherein t represents the current t-th round consensus; repu (i) t A reputation value representing a t-th round consensus; repu (i) t-1 Representing the reputation value of the t-1 th round; and gamma represents a reputation correction threshold, the initial value of gamma is 1, and the reputation increasing rate can be corrected through gamma, so that the reputation increasing rate cannot be increased too fast, and reputation centralization in the initial stage of a network is avoided. The calculation formula of the reputation correction threshold gamma is as follows:
Figure SMS_10
wherein,,thersholdthe threshold value to be set is a threshold value set to prevent γ from becoming too saturated to 1, and this embodiment is preferablethersholdSetting to 0.25 can prevent gamma from becoming too saturated to be 1 and can also let repu (i) t The resulting reputation is not directly evaluated against a current reputation function. c is a defined parameter for controlling the reaction weight to the most recent behavior of the node. The greater c, the higher the weight that the user gives to the most recent reputation deviation than the previously accumulated reputation deviation, which is preferred in this embodiment to have c=0.6.φ t The repu (i) represents the difference between the current trust level of the node i and the absolute value of the last round of reputation value.ψ t The repu (i) represents the current wheel accumulated bias,ψ t-1 the repu (i) represents the accumulated deviation of the last round of consensus determination, i.e. the previous t rounds of nodesAnd finally, accumulating the deviation.
In one embodiment, after step S101 and before step S103, the method further includes: judging whether the node has offline non-voting behavior in the history consensus voting according to the history consensus voting information; when the offline non-voting behavior is determined to exist, the current trust level is reserved, and when the offline non-voting behavior is determined to not exist, the block generation time is utilized to conduct reputation consumption on the current trust level.
Wherein, the reputation is the expression form of the probability that the node is selected as the committee and the consensus voting weight, and the larger the reputation is, the higher the probability of participating in generating the block is, thereby bringing about the inconveniencing benefit. To maintain the number of online nodes in the network, the present embodiment further introduces a reputation consumption function. That is, the method of dynamically granting reputation according to the present embodiment is composed of two functions, namely, a reputation metric function and a reputation consumption function. Reputation consumption is set to ensure engagement of nodes, rather than having nodes engage in the generation of chunks in a reputation consuming manner. Because security and stability of the network is not guaranteed when the number of online members in the committee is too small.
Specifically, the reputation consumption of a node is determined based on the historical voting conditions of the node, primarily prior to revising the reputation. When the node is judged to have offline non-voting behaviors in the historical consensus voting according to the historical consensus voting information, the current trust level is reserved to be free from reputation consumption, and when the offline non-voting behaviors are determined to not exist, the current trust level is subjected to reputation consumption by utilizing the block generation time.
In one embodiment, the reputation consumption function is as follows:
Figure SMS_11
wherein,,
Figure SMS_12
=0 means node i was not voted offline in the x-th round of consensus; e is natural logarithm; Δb represents the block generation time. Increasing the block generation time means increasing the difficulty of block uplinkAt this point, the rational node may choose to go offline (# offly) temporarily in order to participate in tile generation when the difficulty of the uplink is lower and the opportunity is greater. More and more nodes start to go offline, the proportion of nodes participating in consensus is lower and the probability of success of malicious nodes becomes larger. Therefore, the reputation consumption of the nodes which do not participate in the block generation is increased while the block generation time is increased, so that the participation of the nodes is improved, and the operation safety of the block chain network is maintained.
Step S105, current round consensus is carried out according to the current round credit value of each node.
Specifically, after the current round reputation value of each node is obtained, the current round reputation can be obtained based on the reputation value in the consensus process. It should be appreciated that the current round reputation values for the various nodes may be calculated in advance prior to consensus, or may be calculated in real time by the various nodes as needed during consensus. This embodiment is commonly divided into two processes: a master node update algorithm and an improved PBFT consensus algorithm.
The main node updating algorithm is to replace the main node according to the credit of the node. Assuming that the higher the reputation value of a node, the higher the probability of being selected as the master node in the master node update process, such as:
Figure SMS_13
. Where N is a set of consensus nodes, n= { N 1 , N 2 , ... N Q }. In each round of consensus, there is one primary master node Np, and the other nodes are backup nodes. All consensus nodes first cache the received transaction information locally. And Np packages the valid transactions sent by the clients into one chunk. Each node maintains an updated node information table NIL. The NIL contains the collection of neighboring nodes in the current blockchain system and the information, reputation (corresponding to voting weight) and node ID of that node, the initial reputation of the node being 0.5.P is the probability of being selected as the master node. D is an exponential distribution (reputation distribution in reputation distribution networks in C2C networks and most social networks is exponential). The main node update is mainly in the copy nodeThe node with the maximum credit value in the current node is selected as the master node by the duplicate node, and a master node change message is broadcast to other nodes. And after receiving the change information of the main node, the node calculates whether the number of the received information exceeds 2f (f is the number of the Bayesian nodes), and updates the main node after the number of the received information exceeds 2 f.
In the modified PBFT consensus algorithm, the present embodiment evaluates the reputation value of each node based on the information list NIL provided by each consensus node, which can detect malicious nodes therein, and can delete these nodes from NIL. Because of the high punishment to the malicious nodes, the reputation of the honest nodes gradually accumulates, so that the floor in the consensus process gradually increases, and the influence of the malicious nodes gradually decreases. The PBFT algorithm modified in this embodiment is as follows:
input: transaction Tx.
And (3) outputting: new block B containing transaction Tx n
Step 1: client c: the transaction cluster TxCluster is broadcast to the master node 0.
Step 2: master node 0: and verifying whether the transaction Tx in the transaction cluster is valid or not, and if the transaction Tx is invalid, directly deleting the transaction Tx. Then the effective transaction is packed into a block, and a block header B is generated according to the information in the block body head
Step 3: master node 0: broadcasting a pre-preparation message to each copy node, the content being
Figure SMS_14
Where h is the height of the current new block and d is the block header B head T is the current timestamp, D 0 Is the ID, NIL of the current master node 0 0 Is a node information list of the master node 0.
Step 4: replica nodes 1,2: after receiving the preparation message sent by the master node 0, firstly verifying the validity of the new block, and respectively sending the preparation message to other nodes after the verification is passed, wherein the content is as follows
Figure SMS_15
,D i Is the ID, NIL of the duplicate node i i Is a node information list of the duplicate node i.
Step 5: replica nodes 1,2: calculating the reputation value R of the node to which the message is currently sent, if R is greater than or equal to R thershold Then the consensus status of the transaction information is updated locally and pre-commit information is sent, the content is
Figure SMS_16
Step 6: master node 0: comparing pre-submitted information received from the duplicate nodes, calculating the current reputation of each node according to improved logistic regression, updating the information list of the local consensus node, sending the consensus result back to the client and all the duplicate nodes, and sending a submitted message
Figure SMS_17
Step 7: replica nodes 1,2: after the submitting state is completed, the local consensus node information list is updated, and the consensus result is fed back to the client so as to prepare for the next round of consensus process.
In addition, the condition for the node to update its consensus state in this embodiment is that the reputation value R for the consensus node to send a message to is sufficiently large. R should not be lower than a set threshold R thershold Threshold R thershold The calculation formula of (2) is as follows:
Figure SMS_18
from this, the consensus process of the PBFT consensus algorithm modified in this embodiment is divided into four main phases: pre-preparation, pre-commit and commit. By adding a pre-commit phase in the consensus protocol, not only can each node be ensured to correctly reach consensus, but also the performance can be improved.
Compared with the prior art, the block chain consensus method based on the credit has the following advantages:
resist Sybil attack: the reputation is introduced as the voting weight of the consensus nodes to achieve consensus, and as the total reputation of the nodes cannot be changed, a large number of false nodes cannot be created by malicious nodes to improve influence to destroy network security, so that Sybil attack can be effectively avoided.
Avoiding rights and interests shredding attacks and brining attacks: malicious nodes cannot afford a high reputation penalty due to the existence of penalty weights. For example, in the first round of consensus, one node only has 36% of its reputation of issuing honest tickets after issuing a malicious ticket. And the credit penalty rises rapidly along with the increase of the consensus round number, and the existence of the penalty strength is unacceptable for any rational node, so that the probability of launching the right and benefit crushing attack and the brining attack by the nodes can be reduced, and the attack is avoided.
Ensuring the decentralization property: the reputation is modified by the reputation modification threshold value, so that the reputation is very slowly increased, and the reputation is between 0 and 1 and has an upper limit, so that the decentralization property of the blockchain is ensured.
Low communication overhead: dynamic authorization of node reputation is added during node consensus and pre-commit phase is added during node consensus, although the time complexity of the present invention is still O (N 2 ) But the total traffic is (n 2 +2n-3), compared to the total number of communications of PBFT (2 n 2 N-1) the number of communication between the nodes of the invention is reduced.
In addition, the block chain consensus method based on the credit also has the advantage of high performance. As shown in fig. 5, 6, 7 and 8, schematic diagrams of performance experiment results of the consensus protocol (hereinafter referred to as RIPPB) of the present invention and the conventional PBFT protocol are provided.
Referring to fig. 5 and 6, there are graphs showing the performance of comparing delay and throughput by changing the block size with the number of nodes fixed to 20. It was found that the delay (Latency) of the RIPPB and PBFT increased significantly with increasing block size, but the rate of increase of the RIPPB was 30% lower than that of the PBFT. In addition, the increase in block size means an increase in the number of transactions within the block, which increases the Throughput (TPS) of the PBFT and RIPPB protocols, and obviously the throughput of the RIPPB is higher than the PBFT. However, because of network capacity limitations, throughput increases significantly slower as the block size approaches or exceeds 4M.
Referring to fig. 7 and 8, which are graphs showing performance such as latency and throughput by varying the number of nodes with a block size fixed to 1/8 MB. It can be seen that the RIPPB protocol significantly reduces the delay in generating blocks by the consensus nodes compared to the PBFT protocol. And the reduction in delay of block generation of the consensus nodes is more pronounced as the number of consensus nodes increases. Compared with PBFT, the throughput of RIPPB is improved comprehensively, up to 28%, and the throughput reduction speed is reduced as the number of consensus nodes is increased.
In one embodiment, as shown in FIG. 9, a reputation-based blockchain consensus apparatus is provided comprising:
the reputation determining module 901 is configured to count historical consensus voting information of a node, and perform logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight, so as to obtain current trust of the node.
The reputation correction module 903 is configured to balance weights of a previous-round reputation value and a current trust level of the node by using a reputation correction threshold value, so as to determine the current-round reputation value.
And the consensus module 905 is configured to perform current round consensus according to the current round reputation value of each node.
In one embodiment, the reputation correction module 903 is further configured to calculate a difference between the current confidence level and an absolute value of a previous reputation value, and calculate a current round of cumulative deviation according to the difference between the absolute values and the cumulative deviation determined by the previous round of consensus; calculating a reputation correction threshold according to the difference between the absolute values and the current round accumulated deviation; and carrying out weight balance on the previous-round reputation value and the current trust degree by utilizing the reputation correction threshold value, and determining the current-round reputation value.
In one embodiment, the system further comprises a reputation consumption module for judging whether the node has offline non-voting behavior in the history consensus voting according to the history consensus voting information; when the offline non-voting behavior is determined to exist, the current trust level is reserved, and when the offline non-voting behavior is determined to not exist, the block generation time is utilized to conduct reputation consumption on the current trust level.
Specific limitations regarding reputation-based blockchain consensus means can be found in the limitations of reputation-based blockchain consensus methods hereinabove and are not described in detail herein. The various modules in the reputation-based blockchain consensus apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules. Based on such understanding, the present invention may be implemented in whole or in part by a computer program to instruct related hardware to perform the above-described embodiment methods, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of the above-described respective reputation-based blockchain consensus method embodiments. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc.
In one embodiment, a computer device is provided, which may be a server, including a processor, a memory, and a network interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a reputation-based blockchain consensus method. For example, a computer program may be split into one or more modules, one or more modules stored in memory and executed by a processor to perform the present invention. One or more modules may be a series of computer program instruction segments capable of performing particular functions to describe the execution of a computer program in a computer device. The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is a control center of the computer device, connecting various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the computer device by running or executing the computer program and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A reputation-based blockchain consensus method, comprising:
counting historical consensus voting information of a node, and performing logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight to obtain the current trust degree of the node;
performing weight balance on the last-round reputation value of the node and the current trust degree by using a reputation correction threshold value to determine a current-round reputation value;
and carrying out current round consensus according to the current round credit values of the nodes.
2. The method of claim 1, wherein the weighting the previous round of reputation values for the node and the current trust level using a reputation correction threshold to determine a current round of reputation values comprises:
calculating the difference between the current trust and the absolute value of the credit value of the previous round, and calculating the current round of accumulated deviation according to the difference between the absolute values and the accumulated deviation determined by the consensus of the previous round;
calculating a reputation correction threshold according to the difference between the absolute values and the current wheel accumulated deviation;
and carrying out weight balance on the previous-round reputation value and the current trust degree by utilizing a reputation correction threshold value, and determining the current-round reputation value.
3. The method according to claim 1 or 2, wherein the weighting of the previous round of reputation values of the node and the current trust level using a reputation correction threshold, before determining the current round of reputation values, further comprises:
judging whether the node has offline non-voting behaviors in the history consensus voting according to the history consensus voting information;
and when the offline non-voting behavior is determined to exist, the current trust level is reserved, and when the offline non-voting behavior is determined to not exist, the block generation time is utilized to conduct reputation consumption on the current trust level.
4. The method of claim 1, wherein the logistic regression calculation formula is as follows:
Figure QLYQS_1
wherein, repu (i) cur Is the current confidence level; n represents the current nth round consensus; mu is the cumulative number of consensus rounds participated by the node i;
Figure QLYQS_2
indicating whether the node i normally participates in voting in the x-th round of consensus, wherein the normal voting is 1, and the abnormal voting is 0;τ x indicating whether the node i maliciously votes in the x-th round of consensus, wherein the maliciously votes are 1, and the maliciously votes are 0;υrepresenting malicious voting penalty weights; e is the natural logarithm.
5. The method of claim 3, wherein the reputation consumption function is as follows:
Figure QLYQS_3
wherein,,
Figure QLYQS_4
=0 means node i was not voted offline in the x-th round of consensus; e is natural logarithm; Δb represents the block generation time.
6. The method according to claim 1 or 2, characterized in that the weight equalization is calculated as follows:
Figure QLYQS_5
wherein t represents the current t-th round consensus; repu (i) t A reputation value representing a t-th round consensus; repu (i) t-1 Representing the reputation value of the t-1 th round; gamma denotes a reputation correction threshold, and the initial value of gamma is 1.
7. The method of claim 2, wherein the reputation correction threshold is calculated as:
Figure QLYQS_6
wherein,,thersholdfor the set threshold value(s),thershold=0.25; c is a defined parameter, c=0.6;φ t the repu (i) represents the difference in absolute value of node i,ψ t the repu (i) represents the current wheel accumulated bias,ψ t-1 the repu (i) represents the accumulated bias of the previous consensus determination.
8. A reputation-based blockchain consensus apparatus, comprising:
the credit determining module is used for counting historical consensus voting information of the node, and carrying out logistic regression calculation according to the historical consensus voting information and malicious voting penalty weight to obtain the current trust degree of the node;
the reputation correction module is used for carrying out weight balance on the previous-round reputation value of the node and the current trust degree by utilizing a reputation correction threshold value to determine the current-round reputation value;
and the consensus module is used for carrying out current round consensus according to the current round credit value of each node.
9. A computer device comprising a processor and a memory, the memory storing a computer program, wherein the processor is configured to implement the blockchain consensus method of the reputation of any of claims 1-7 when executing the computer program.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the reputation blockchain consensus method according to any of claims 1-7.
CN202310050815.XA 2023-02-01 2023-02-01 Reputation-based blockchain consensus method, device and computer equipment Pending CN116389040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310050815.XA CN116389040A (en) 2023-02-01 2023-02-01 Reputation-based blockchain consensus method, device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310050815.XA CN116389040A (en) 2023-02-01 2023-02-01 Reputation-based blockchain consensus method, device and computer equipment

Publications (1)

Publication Number Publication Date
CN116389040A true CN116389040A (en) 2023-07-04

Family

ID=86979472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310050815.XA Pending CN116389040A (en) 2023-02-01 2023-02-01 Reputation-based blockchain consensus method, device and computer equipment

Country Status (1)

Country Link
CN (1) CN116389040A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116709341A (en) * 2023-07-31 2023-09-05 中国人民解放军军事科学院***工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116709341A (en) * 2023-07-31 2023-09-05 中国人民解放军军事科学院***工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony
CN116709341B (en) * 2023-07-31 2024-04-30 中国人民解放军军事科学院***工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony

Similar Documents

Publication Publication Date Title
US10355869B2 (en) Private blockchain transaction management and termination
Sompolinsky et al. Phantom
US11405181B2 (en) Lightweight blockchain based on split-trust
CN111131209B (en) Improved efficient consensus method, system, computer device and storage medium
EP3399448B1 (en) Methods and apparatus for a distributed database within a network
US11729001B2 (en) Distributed proof-of-work for sharded or parallel blockchains
CN112468302A (en) Editable blockchain based on verifiable multiparty secret sharing
CN112073483A (en) Authority certification consensus method and system based on credit and committee endorsement mechanism
CN112163856A (en) Consensus method and system for block chain and Internet of things fusion scene
US11275564B2 (en) Decentralized random number generator
CN109743182B (en) Intelligent contract approval method and system based on block chain
CN116389040A (en) Reputation-based blockchain consensus method, device and computer equipment
CN116015672B (en) PBFT consensus mechanism based on reputation model
CN117527834B (en) Improved PBFT consensus method based on reputation scoring mechanism
CN112651830A (en) Block chain consensus method applied to power resource sharing network
Aluko et al. Proof-of-reputation: an alternative consensus mechanism for blockchain systems
Hentschel et al. Flow: Separating Consensus and Compute--Block Formation and Execution
CN115499379A (en) Information interaction method, device, equipment and medium based on block chain
Xu et al. A blockchain-based federated learning scheme for data sharing in industrial internet of things
CN113420323B (en) Data sharing method and terminal equipment
CN111970370B (en) Communication equipment system-oriented multilayer block chain protocol expansion system and method
CN115378788B (en) Block chain performance self-adaptive optimization method based on hierarchical consensus and reinforcement learning
CN114861233B (en) Fragmenting asynchronous Bayesian family fault-tolerant consensus method and device without trusted third party
Mohsenzadeh et al. A novel reputation-based consensus framework (RCF) in distributed ledger technology
Otsuki et al. Impact of saving attacks on blockchain consensus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination