CN113259179B - Byzantine fault-tolerant consensus method and system based on node scoring - Google Patents

Byzantine fault-tolerant consensus method and system based on node scoring Download PDF

Info

Publication number
CN113259179B
CN113259179B CN202110677787.5A CN202110677787A CN113259179B CN 113259179 B CN113259179 B CN 113259179B CN 202110677787 A CN202110677787 A CN 202110677787A CN 113259179 B CN113259179 B CN 113259179B
Authority
CN
China
Prior art keywords
node
nodes
confirmation
view
subset
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.)
Active
Application number
CN202110677787.5A
Other languages
Chinese (zh)
Other versions
CN113259179A (en
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.)
Nanjing Shaoyan Intelligent Technology Co.,Ltd.
Original Assignee
Hangzhou Yunzhisheng Intelligent 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 Hangzhou Yunzhisheng Intelligent Technology Co ltd filed Critical Hangzhou Yunzhisheng Intelligent Technology Co ltd
Priority to CN202110677787.5A priority Critical patent/CN113259179B/en
Publication of CN113259179A publication Critical patent/CN113259179A/en
Application granted granted Critical
Publication of CN113259179B publication Critical patent/CN113259179B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • 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/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • 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/22Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The invention provides a Byzantine fault-tolerant consensus method and a system based on node scoring, which comprises the steps of taking relevant important information of nodes as a scoring standard, scoring each node by an analytic hierarchy process, then changing the communication complexity of the nodes from all-to-all to all-to-c (c is a small constant) according to the node scoring on the basis of PBFT and SBFT, selecting a confirmed node subset by the node scoring, reducing the communication complexity, improving the speed of achieving consensus and supporting more nodes to participate in consensus; in addition, a view change mechanism for the confirmation node subset is established, the purpose of confirming the view change of the node subset is to switch in time when the confirmation node subset has errors, and the scheme can work well in a network with more malicious nodes by combining a node scoring mechanism, so that resources are utilized well, and the communication complexity is reduced. The scheme can work well in a complex network which accords with reality, and also can work well in a network with more nodes.

Description

Byzantine fault-tolerant consensus method and system based on node scoring
Technical Field
The invention relates to the technical field of block chains, in particular to a Byzantine fault-tolerant consensus method and system based on node scoring.
Background
The Chinese book Smart first proposed the bit currency in 2008, and the block chain technology gets more and more attention from people in various circles. The block chain technology is applied to the electronic medical record system, so that the islanding phenomenon of medical data can be broken, and more useful information can be shared by more users by placing the information on the block chain. Hospitals and research institutions can better study and analyze diseases through medical big data after authorization of users. Through various characteristics of the blockchain, the data can be guaranteed not to be tampered, the privacy of a user can be protected, and the user, a hospital and other organizations can achieve a perfect balance on medical data. According to statistics, 773 hospitals, 6780 secondary hospitals and 4989 primary hospitals are owned nationwide. If a shared database is to be established among the multiple hospitals, there is a high demand for efficiency in achieving consensus by the consensus mechanism. The consensus mechanism, which is the core of the blockchain technology, fundamentally determines the security, availability, system performance, and the like of the whole blockchain system. It is feasible to apply the conventional PBFT and SBFT to a system with a small number of nodes participating, but applying them to a system with a large number of nodes will cause a problem of low consensus efficiency. Therefore, aiming at the problems, the improvement of the load node number and the consensus efficiency of the consensus mechanism provides an efficient consensus mechanism which can be applied to the participation of more nodes.
In summary, PBFT and SBFT suffer from the following disadvantages:
1. the communication complexity is high;
2. is not suitable for complex networks;
3. the advantages of the network are not fully utilized, and the node selection algorithm is too simple;
4. only work well in systems with few nodes.
Disclosure of Invention
The invention provides a Byzantine fault-tolerant consensus method and system based on node scoring, which aim to overcome the defects in the prior art.
S1, taking information including network, attribute and transaction on the nodes as scoring standards, setting corresponding weight for the scoring standards, and calculating the total score of each node according to the weight of the scoring standards of each node;
s2, initializing a system key and initializing node selection, wherein the initializing node selection comprises selecting a main node and a plurality of confirmation nodes through a verifiable random function, and the confirmation nodes form a confirmation node subset;
s3, when any node has view change, sorting the total scores of the nodes from big to small, then selecting a certain number of nodes in the front of the order, and reselecting the main node and the confirmation node among the certain number of nodes in the front of the order by running a verifiable random function;
s4, processing the request sent by the client by constructing a consistency protocol between the reselected main node and the confirmation node, wherein the consistency protocol verifies the correctness of all transactions based on the root of the Merkle tree in the request sent by the verification client;
and S5, establishing a main node view switching protocol and a confirmation node subset view switching protocol, and when the consensus of the main node or/and the confirmation node is abnormal, replacing the main node or/and the confirmation node which generates the abnormality according to the main node view switching protocol and the confirmation node subset view switching protocol.
In the whole process, the communication complexity is changed from all-to-all to all-to-c, the confirmed node subset is selected through node scoring, the communication complexity is reduced, the speed of achieving consensus is improved, and meanwhile more nodes can be supported to participate in consensus; in addition, a view change mechanism for the confirmation node subset is established, the purpose of confirming the view change of the node subset is to switch in time when the confirmation node subset has errors, and the scheme can work well in a network with more malicious nodes by combining a node grading mechanism.
In a specific embodiment, the S1 specifically includes:
step 1: for a certain node, constructing a hierarchical structure model of the node by taking the scoring standard as an element in a hierarchy based on a hierarchical analysis method, wherein the hierarchical structure model comprises the following components from high to low:
the first hierarchy represents a target layer, the target layer containing an element X;
the second level represents a standard layer comprising n elements, wherein n is a positive integer;
the third level represents a sub-standard layer, which comprises p elements, wherein p is a positive integer;
step 2: according to the importance of the elements in the standard layer to the elements in the target layer, the elements in the standard layer are compared in pairs, the comparison result is quantized into a numerical value, and normalization processing is carried out to obtain the weight of each element in the standard layer relative to the target layer
Figure 352638DEST_PATH_IMAGE001
Wherein
Figure 884114DEST_PATH_IMAGE002
Representing n elements in the standard layer;
and step 3: according to the importance of the elements in the sub-standard layer to the elements in the standard layer, the elements in the sub-standard layer are compared in pairs, the comparison result is quantized into a numerical value, and normalization processing is carried out to obtain the weight of each element in the sub-standard layer relative to the standard layer
Figure 961791DEST_PATH_IMAGE003
Wherein
Figure 869704DEST_PATH_IMAGE004
Representing p elements in the sub-standard layer;
and 4, step 4: total weight of each element in the sub-standard layer
Figure 349227DEST_PATH_IMAGE005
Comprises the following steps:
Figure 51604DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 882157DEST_PATH_IMAGE007
represents the second of the sub-standard layers
Figure 797023DEST_PATH_IMAGE008
The number of the elements is one,
Figure 662211DEST_PATH_IMAGE009
represents the second in the standard layer
Figure 535489DEST_PATH_IMAGE010
An element;
and 5: node pointkTotal score of (2)
Figure 853338DEST_PATH_IMAGE011
The following were used:
Figure 70430DEST_PATH_IMAGE012
wherein the content of the first and second substances,
Figure 790125DEST_PATH_IMAGE013
representing nodeskIn the elements
Figure 834304DEST_PATH_IMAGE014
The score obtained in the above-mentioned manner,
Figure 373870DEST_PATH_IMAGE005
presentation element
Figure 161697DEST_PATH_IMAGE014
The weight of (c).
In a specific embodiment, the elements in the sub-standard layer include: network speed, number of failed messages, network bandwidth, number of error messages, number of times to become master, number of times to become a confirming node, computing power, number of sent transactions, and number of completed transactions.
In a specific embodiment, the initializing the system key in S2 specifically uses a threshold signature algorithm, and the specific steps include:
the nodes in the system are numbered, and a master key (MSK) and a Master Public Key (MPK) of the system and a public key and a private key corresponding to each node are generated through a BLS threshold signature algorithm, wherein each node stores the Master Public Key (MPK) of the system and public keys of other nodes.
In a specific embodiment, the S3 specifically includes:
reselecting the master node by running an authenticatable random function:
when the view of the master node is changed, sorting the total scores of all the nodes from large to small, selecting five nodes with the maximum total scores, confirming that the node subset runs a verifiable random function in the five nodes, and finally obtaining one node as the master node;
reselecting the confirmation node by running a verifiable random function:
when the view of the confirmation node subset changes, the total scores of all the nodes are sorted from large to small, the master node runs a verifiable random function on 2c nodes with the largest scores to finally obtain c nodes, and the c nodes are used as c confirmation nodes to form the confirmation node subset, wherein c is a positive integer.
From the above, the communication complexity of the scheme is global, so the consensus efficiency and the throughput of the scheme are higher than those of the PBFT, and the scheme can be well applied to networks with more nodes than the PBFT.
In a specific embodiment, the consistency protocol in S4 specifically includes:
the master node is one, the backup nodes are m, the confirmation nodes are c, and 1+ m + c = n = 3f +1, where m, c, n are positive integers, the adversary model of the consistency protocol is n = 3f +1, and the consistency protocol is implemented by four processes of requesting, preparing, submitting, and replying:
requesting:
the client packs the transaction information into a request in a Merkle tree form, and then sends the request to the main node;
preparing:
after receiving the request, the master node numbers the request, then performs hash processing and signs the request by using a private key of the master node, and finally sends < prepare, v, n, p, d (m) < σ p (d (m)), m > as a preparation message to all other nodes, wherein v is a view number, n is a sequence number of the request, d (m) is a summary of the request, σ p (d (m)) is a signature of the master node on the request by using the private key, and m is the content of the request;
submitting:
after receiving the preparation message, the backup node and the confirmation node respectively perform the following checks:
checking whether the digest of the request and the signature are correct;
checking whether the view v in the request is the same as the current view;
checking whether the current node receives other requests with the sequence number n;
checking whether the received request is within a current receive window;
if the above-mentioned check results are all yes, then will<submit, v, n, p, σi(m), i>Sending to the subset of validation nodes as a commit message, where σi(m) for the threshold signature of node i on the request, when the subset of validation nodes receives 2f +1 commit messages with the same request sequence number, the subset of validation nodes obtains all signatures (σ) of the 2f +1 commit messages with the same request sequence numberi(m) | 1 ≦ i ≦ n) and combined into the final signature σ (m), and finally the confirmation node subset sends the signature σ (m) to all other nodes<reply, v, n, σ(m)>As a reply message;
and (3) recovering:
when receiving at least
Figure 470319DEST_PATH_IMAGE015
After the reply message is received, all nodes verify the signature sigma (m) by using a system Master Public Key (MPK), if the verification is successful, the reply message is written into a local log, and the state of the request with the sequence number n is set to be successful.
In a specific embodiment, the protocol for switching views of the master node in S5 specifically includes:
when the consensus of the main node is abnormal, the timer of the backup node i is overtime in the current view v, the backup node i triggers the view switching operation of the main node and switches the current view to the view v +1, and the method comprises the following four steps of requesting, distributing, converting and confirming:
requesting: when the timer in the backup node is overtime, the backup node sends a message requesting for switching the view of the main node to the confirmation node subset, and the format of the message requesting for switching the view of the main node is<primary-view-change-request,v+1,i, σi(p)>Where i is the sequence number of the backup node, σ i (p) is the threshold signature of the backup node i on the message, where p is the sequence number of the new primary node;
after the confirming node subset receives at least f +1 messages requesting for switching the view of the main node, threshold signatures of f +1 nodes corresponding to the messages are synthesized into a complete signature sigma (p), the confirming node subset reselects a new main node through S3, and then the confirming node subset sends a view distribution message to a backup node, wherein the view distribution message is in a format of < primary-view-assign, v +1, p, sigma (p) >, and p is a sequence number of the new main node;
conversion: when the backup node receives a message greater than or equal to
Figure 685399DEST_PATH_IMAGE016
When the same view distribution messages exist, a system public key is used for verifying sigma (p), if the verification is successful, the sequence number of the main node is changed into p, and a confirmation message representing that the new main node is successfully verified is sent to a confirmation node subset;
confirming that all backup nodes have received the allocation view message and successfully change the sequence number of the master node to p when the confirming node subset receives 2f confirmation messages.
In a specific embodiment, the protocol for confirming the node subset view switching in S5 specifically includes:
when the backup node does not receive enough messages sent by the confirmation node subset within the designated time, the view of the confirmation node subset is changed, and the specific process comprises the following steps of requesting, allocating, converting, confirming, reconfirming and restarting:
requesting: when the timer in the backup node is overtime, the backup node sends a message for requesting to switch the view of the confirmation node subset to the main node, and the format of the message for requesting to switch the view of the confirmation node subset is<confirmed-node-view-change-request,v+1,i,σi(r)>Where i is the serial number of the backup node, σi(r) is the threshold signature of backup node i on the message;
when the master node receives the messages of requesting to switch the view of the subset of the confirmation nodes, which are more than or equal to f +1, the master node synthesizes the threshold signatures of the f +1 nodes corresponding to the messages into a complete signature sigma (R), the master node reselects a new subset of the confirmation nodes through S3, and then the master node sends a view distribution message to the backup nodes, wherein the view distribution message has a format of < fixed-node-view-assign, v +1, R, sigma (R) >, and R is the serial number of the new subset of the confirmation nodes;
conversion: after receiving the distribution view message sent by the main node, the backup node verifies sigma (r) by using a system public key, and if the verification is successful, a confirmation message representing that the new confirmation node subset is verified successfully is sent to the main node;
confirming that the master node indicates that the backup nodes all receive the sent view distribution message and successfully change the sequence number of the confirmed node subset into R when receiving 2f confirmation messages, and at the moment, the master node sends the preparation message which is not successfully executed in the previous view to the backup nodes and the new confirmed node subset;
and (4) confirming: after receiving the message containing the preparation message sent by the main node, the backup node and the new confirmation node subset send a re-confirmation message to the main node to indicate that the message sent by the main node is received;
restarting: and after receiving the reconfirmation messages of which the number is more than or equal to 2f, the main node sends an execution message to the new confirming node subset to start a new round of consensus.
According to a second aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, carries out the above-mentioned method.
According to a third aspect of the present invention, a byzantine fault-tolerant consensus system based on node scores is provided, the system comprising:
the communication complexity is changed from all-to-all to all-to-c, the confirmed node subset is selected through node scoring, the communication complexity is reduced, the speed of achieving consensus is improved, and meanwhile more nodes can be supported to participate in consensus; in addition, a view change mechanism for the confirmation node subset is established, the purpose of confirming the view change of the node subset is to switch in time when the confirmation node subset has errors, and the scheme can work well in a network with more malicious nodes by combining a node grading mechanism.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flow chart of a byzantine fault-tolerant consensus method based on node scoring according to an embodiment of the present invention;
FIG. 2 is a diagrammatic illustration of a coherency protocol process in accordance with a specific embodiment of the present invention;
FIG. 3 is a diagram illustrating a host node view switching protocol process in accordance with an embodiment of the present invention;
FIG. 4 is a diagram illustrating an exemplary acknowledgement node subset view switching protocol process in accordance with an embodiment of the present invention;
fig. 5 is a flowchart of a byzantine fault-tolerant consensus method based on node scoring according to an embodiment of the present invention;
FIG. 6 is a table of scoring criteria for a particular embodiment of the present invention;
FIG. 7 is a graph of probability versus time for a particular embodiment of the present invention, PBFT, SBFT, and the present scheme;
FIG. 8 is a graph of throughput versus number of nodes for a particular embodiment of the present invention;
FIG. 9 is a relationship between runtime and throughput for a particular embodiment of the present invention;
FIG. 10 is a graph of throughput versus delay for a particular embodiment of the present invention;
fig. 11 is a block diagram of a byzantine fault-tolerant consensus system based on node scoring, according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a flowchart of a node-scoring-based byzantine fault-tolerant consensus method according to an embodiment of the present invention. The method comprises the following steps:
and S1, taking information including network, attribute and transaction on the nodes as scoring standards, setting corresponding weights for the scoring standards, and calculating the total score of each node according to the weights of the scoring standards of each node.
In a specific embodiment, the scoring criteria and the weights in S1 specifically include:
(1) determining weights by analytic hierarchy process
When an analytic hierarchy process is applied to analyze a decision problem, the problem must be organized and layered to build a hierarchical model. The hierarchical model can be divided into three levels, a first level representing a target level, a second level representing a standard level (e.g., a factor level), and a third level representing a sub-standard level (e.g., an attribute level).
Each level of elements is compared in pairs based on their importance to the higher level elements. Starting from the top level of the hierarchy and going down, pairwise comparisons at a given level can be reduced to a series of squares
Figure 712261DEST_PATH_IMAGE017
As follows:
Figure 38200DEST_PATH_IMAGE018
wherein
Figure 466908DEST_PATH_IMAGE019
Indicating the relative importance of the ith element compared to the jth element,
Figure 852890DEST_PATH_IMAGE020
indicating the relative importance of the jth element compared to the ith element.
The matrices having reciprocal properties, i.e.
Figure 632627DEST_PATH_IMAGE019
And
Figure 995213DEST_PATH_IMAGE020
the relationship of (c) is as follows.
Figure 278427DEST_PATH_IMAGE021
In the analytic hierarchy process, subjective pairwise comparisons were made from relative importance scales from 1 to 9.
In this example, according to the analytic hierarchy process,
Figure 100889DEST_PATH_IMAGE019
and
Figure 836764DEST_PATH_IMAGE020
the values of (a) are determined according to the following criteria:
Figure 504506DEST_PATH_IMAGE022
after all the pairwise decision matrices are formed, the weight vectors are calculated according to an arithmetic mean-based method
Figure 907805DEST_PATH_IMAGE023
. The weight calculation includes two steps, firstFirst, to the judgment matrix
Figure 635590DEST_PATH_IMAGE024
Normalization processing is performed and then weights are calculated.
Figure 858761DEST_PATH_IMAGE025
Figure 595773DEST_PATH_IMAGE026
According to the hierarchical model, the object of the first level has only one element A, the second level is a standard level with n elements,
Figure 587999DEST_PATH_IMAGE027
the third level, a sub-standard level, has p elements,
Figure 486685DEST_PATH_IMAGE028
Figure 462731DEST_PATH_IMAGE029
has a weight of
Figure 236390DEST_PATH_IMAGE030
Figure 348703DEST_PATH_IMAGE029
The weight of the upper level element of (1) is
Figure 683869DEST_PATH_IMAGE031
. Total weight
Figure 881632DEST_PATH_IMAGE032
Can be calculated by the following equation.
Figure 960447DEST_PATH_IMAGE033
(2) Scoring attribute selection
The hierarchical model is divided into three levels. The first layer is a target layer, the second layer is a factor layer, and the third layer is an attribute layer. The elements of the attribute layer are network speed (C1), failure message number (C2), network bandwidth (C3), error message number (C4), master node forming number (C5), node forming confirmation number (C6), computing capacity (C7), transaction sending number (C8) and transaction completion number (C9), which are all important factors influencing node scoring.
(3) Total node score
To obtain the scores of the nodes, a scoring criteria table is constructed as shown in fig. 6. Based on the scoring criteria, we can obtain the final score of node i: (
Figure 927266DEST_PATH_IMAGE034
),
Figure 308699DEST_PATH_IMAGE035
Can be calculated by the following equation.
Figure 226715DEST_PATH_IMAGE036
In the formula, the first and second sets of data are represented,
Figure 843641DEST_PATH_IMAGE037
representing node i as an element
Figure 664966DEST_PATH_IMAGE038
The score obtained in the above-mentioned manner,
Figure 76356DEST_PATH_IMAGE039
presentation element
Figure 248711DEST_PATH_IMAGE038
The weight of (c).
And S2, initializing the system key and initializing the node selection, wherein the initializing the node selection comprises selecting a main node and a plurality of confirmation nodes through a verifiable random function, and the confirmation nodes form a confirmation node subset.
In a specific embodiment, S2 specifically includes:
(1) key initialization
The key initialization process uses a threshold signature algorithm, and signature aggregation and key aggregation can be realized. It may merge all signatures and public keys in a transaction into one single signature and public key and the merging process is not visible. The system has N nodes, numbered N1, N2, N. And generating a master key (MSK) and a Master Public Key (MPK) of the system and a public key and a private key corresponding to each node through a BLS threshold signature algorithm. The private key and the public key of the node Ni (i is more than or equal to 1 and less than or equal to n) are respectively si and pi. Each node stores a system Master Public Key (MPK) and public keys of other nodes.
(2) Node selection initialization
The nodes in the system are divided into a primary node, c (c is a small constant) confirmation nodes and a plurality of backup nodes. The node selection mainly comprises main node selection and confirmation node selection, and when the system operates for the first time, the main node and c confirmation nodes (confirmation node subsets) are selected through a verifiable random function.
And S3, when the view of any node is changed, sorting the total scores of the nodes from large to small, then selecting a certain number of nodes in the front sorting, and reselecting the master node and the confirmation node among the certain number of nodes in the front sorting by running a verifiable random function.
In a specific embodiment, S3 specifically includes:
after the system completes the initialization operation of node selection, the nodes are selected by sorting the node scores to select a certain amount of nodes which are sorted at the top, and running verifiable random functions among the nodes to select the nodes.
(1) Master node selection
When the view of the main node is changed, the sub-set of the confirmed nodes obtains the score of each node through a formula, and the scores are ranked from large to small. And (4) confirming that the node subset runs the verifiable random function in the five nodes with the maximum scores to obtain a final node, wherein the node is the master node.
(2) Validating node subset selection
When the view of the node subset is confirmed to be changed, the main node calculates the score of each node through a formula, and then the scores are sorted from large to small. And then the master node runs a verifiable random function on the 2c nodes with the largest score to obtain c final nodes, and the confirmation nodes form a confirmation node subset.
S4: and processing the request sent by the client by constructing a consistency protocol between the reselected main node and the confirmation node, wherein the consistency protocol is used for verifying the correctness of all transactions based on the root of a Merkle tree in the request sent by the verification client.
Consistency agreement based on node scoring. The confirmed node subset is selected through node scoring, the communication complexity is reduced, the speed of achieving consensus is improved, and meanwhile more nodes can be supported to participate in consensus.
In a specific embodiment, fig. 2 shows a schematic diagram of a coherence protocol process of a specific embodiment of the present invention, and the coherence protocol in S4 shown in fig. 2 specifically includes:
the enemy model of the scheme is n = 3f + 1. In the scheme, only one main node, m backup nodes and c confirmation nodes (confirmation node subsets) satisfy 1+ m + c = n = 3f + 1. The scheme is mainly divided into four stages of requesting, preparing, submitting and replying. As shown in fig. 2, the scheme changes the communication complexity from all-to-all to all-to-c in the whole process. Because the communication complexity of the scheme is global, the consensus efficiency and the throughput of the scheme are higher than those of PBFT, and the scheme can be well applied to networks with more nodes than PBFT.
In this embodiment, the consistency protocol is implemented by four processes, specifically, request, preparation, submission, and reply:
(1) requesting:
the client packs the transaction information into a request in a Merkle tree form, and then sends the request to the main node;
(2) preparing:
after receiving the request, the master node numbers the request, then performs hash processing and signs the request by using a private key of the master node, and finally sends < prepare, v, n, p, d (m) < σ p (d (m)), m > as a preparation message to all other nodes, wherein v is a view number, n is a sequence number of the request, d (m) is a summary of the request, σ p (d (m)) is a signature of the master node on the request by using the private key, and m is the content of the request;
(3) submitting:
after receiving the preparation message, the backup node and the confirmation node respectively perform the following checks:
checking whether the digest of the request and the signature are correct;
checking whether the view v in the request is the same as the current view;
checking whether the current node receives other requests with the sequence number n;
checking whether the received request is within a current receive window;
if the above-mentioned check results are all yes, then will<submit, v, n, p, σi(m), i>Sending to the subset of validation nodes as a commit message, where σi(m) for the threshold signature of node i on the request, when the subset of validation nodes receives 2f +1 commit messages with the same request sequence number, the subset of validation nodes obtains all signatures (σ) of the 2f +1 commit messages with the same request sequence numberi(m) | 1 ≦ i ≦ n) and combined into the final signature σ (m), and finally the confirmation node subset sends the signature σ (m) to all other nodes<reply, v, n, σ(m)>As a reply message;
(4) and (3) recovering:
when receiving at least
Figure 669328DEST_PATH_IMAGE015
After each reply message, all nodes use the systemAnd the Master Public Key (MPK) verifies the signature sigma (m), if the verification is successful, the reply message is written into a local log, and the state of the request with the sequence number n is set to be successful.
And S5, establishing a main node view switching protocol and a confirmation node subset view switching protocol, and when the consensus of the main node or/and the confirmation node is abnormal, replacing the main node or/and the confirmation node which generates the abnormality according to the main node view switching protocol and the confirmation node subset view switching protocol.
In a specific embodiment, the master node view switching protocol in S5 specifically includes:
when the consensus of the master node is abnormal, the timer of the backup node i times out in the current view v, the backup node i triggers the view switching operation of the master node to switch the current view to the view v +1, wherein the four steps include requesting, allocating, converting and confirming, fig. 3 shows a schematic diagram of a master node view switching protocol process of a specific embodiment of the present invention, and the specific steps are as follows:
(1) requesting: when the timer in the backup node is overtime, the backup node sends a message requesting for switching the view of the main node to the confirmation node subset, and the format of the message requesting for switching the view of the main node is<primary-view-change-request,v+1,i, σi(p)>Where i is the sequence number of the backup node, σ i (p) is the threshold signature of the backup node i on the message, where p is the sequence number of the new primary node;
(2) after the confirming node subset receives at least f +1 messages requesting for switching the view of the main node, threshold signatures of f +1 nodes corresponding to the messages are synthesized into a complete signature sigma (p), the confirming node subset reselects a new main node through S3, and then the confirming node subset sends a view distribution message to a backup node, wherein the view distribution message is in a format of < primary-view-assign, v +1, p, sigma (p) >, and p is a sequence number of the new main node;
(3) conversion: when the backup node receives a message greater than or equal to
Figure 610740DEST_PATH_IMAGE016
When the same view distribution messages exist, a system public key is used for verifying sigma (p), if the verification is successful, the sequence number of the main node is changed into p, and a confirmation message representing that the new main node is successfully verified is sent to a confirmation node subset;
(4) confirming that all backup nodes have received the allocation view message and successfully change the sequence number of the master node to p when the confirming node subset receives 2f confirmation messages.
In a specific embodiment, the confirming of the node subset view switching protocol in S5 specifically includes:
when the backup node does not receive enough messages sent by the acknowledgement node subset within the specified time, the view of the acknowledgement node subset is changed, and the specific process includes requesting, allocating, converting, acknowledging, reconfirming, and restarting, fig. 4 shows a schematic diagram of a acknowledgement node subset view switching protocol process of a specific embodiment of the present invention, and the specific steps are as follows:
(1) requesting: when the timer in the backup node is overtime, the backup node sends a message for requesting to switch the view of the confirmation node subset to the main node, and the format of the message for requesting to switch the view of the confirmation node subset is<confirmed-node-view-change-request,v+1,i,σi(r)>Where i is the serial number of the backup node, σi(r) is the threshold signature of backup node i on the message;
(2) when the master node receives the messages of requesting to switch the view of the subset of the confirmation nodes, which are more than or equal to f +1, the master node synthesizes the threshold signatures of the f +1 nodes corresponding to the messages into a complete signature sigma (R), the master node reselects a new subset of the confirmation nodes through S3, and then the master node sends a view distribution message to the backup nodes, wherein the view distribution message has a format of < fixed-node-view-assign, v +1, R, sigma (R) >, and R is the serial number of the new subset of the confirmation nodes;
(3) conversion: after receiving the distribution view message sent by the main node, the backup node verifies sigma (r) by using a system public key, and if the verification is successful, a confirmation message representing that the new confirmation node subset is verified successfully is sent to the main node;
(4) confirming that the master node indicates that the backup nodes all receive the sent view distribution message and successfully change the sequence number of the confirmed node subset into R when receiving 2f confirmation messages, and at the moment, the master node sends the preparation message which is not successfully executed in the previous view to the backup nodes and the new confirmed node subset;
(5) and (4) confirming: after receiving the message containing the preparation message sent by the main node, the backup node and the new confirmation node subset send a re-confirmation message to the main node to indicate that the message sent by the main node is received;
(6) restarting: and after receiving the reconfirmation messages of which the number is more than or equal to 2f, the main node sends an execution message to the new confirming node subset to start a new round of consensus.
In a preferred embodiment, 10 cloud servers, numbered s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 are used as experimental environments. Each server has a different configuration than the other servers. s1 server configuration (network bandwidth, CPU, memory) 1Mbit/s, 1CPU, 1 GB; the configuration of s2 is 1Mbit/s, 2CPU, 2 GB; the configuration of s3 is 2Mbit/s, 2CPU, 2 GB; the configuration of s4 is 2Mbit/s, 4CPU, 4 GB; the configuration of s5 is 5Mbit/s, 4CPU, 4 GB; the configuration of s6 is 5Mbit/s, 8CPU, 8 GB; the configuration of s7 is 1Mbit/s, 8CPU, 8 GB; the configuration of s8 is 2Mbit/s, 8CPU, 8 GB; the configuration of s9 is 5Mbit/s, 1CPU, 1 GB; the configuration of s10 is 5Mbit/s, 16CPU, 16 GB. The operating system of all servers is Ubuntu 16.04. We use Hyperridge fabric V2.0 as the underlying blockchain platform and deploy the consensus mechanism of this scheme on it. Each server simultaneously enables 50 different ports to simulate up to 500 nodes. In order to simulate a real network environment, the information transmission delay of each node on the same server ranges from 100ms to 200 ms. The present embodiment uses 90 million real transactions from the etherhouse to test the performance of the present solution. Each client sends requests by batching transactions into 12KB chunks (on average about 50 transactions per batch).
In a preferred embodiment, this experiment tested the effect of scoring different nodes. We randomly took four nodes from this system. The corresponding information of each node is shown in the table, and the attributes and scoring criteria of the node are described in fig. 6. Scoreprimary denotes the score of a node that wants to become the master node, and Scoreack denotes the score of a node that wants to become the confirmation node.
As can be seen from fig. 6, scorepliary, Scoreack for Node1, Node2, Node3, Node4 are 69.300, 54.870, 70.180, 71.440 and 60.225, 51.988, 63.694, 65.890, respectively. Since the attribute (number of error messages) has a large weight, the Node1 has a better attribute (network speed, network bandwidth, number of master nodes) than the Node3, but the Node3 has a higher score than the Node 1. If a node sends an error message, it is declared that the node is likely to be a malicious node, and therefore the node is lower in score than a node that does not send an error message. This ensures that both the master node and the confirmation node are good nodes as much as possible. Through the evaluation of the node network, the node with high network speed is selected, and the efficiency of the system is improved. Since the attribute (number of error messages) values of Node3 and Node4 are the same, but the network condition of Node4 is better than that of Node3, the final Scoreprimary and Scoreack values of Node4 are both higher than Node 3. The experimental result of node scoring accords with the actual situation, so the analytic hierarchy process is effective in the node scoring mechanism.
(1) Probability of malicious node becoming master node
The scheme is developed on the basis of PBFT and SBFT, so the experiment tests the probability that the malicious nodes in the scheme, the PBFT and the SBFT are the main nodes. As can be seen from FIG. 7, the probabilities of PBFT and SBFT fluctuate around 0.5. The reason is that there is no good mechanism to select which node is the master node. But the node is selected as the main node according to the scheme through the grade of the node. And calculating the node score through the node comprehensive condition. The score reflects whether the node is good or not and whether the network of nodes is fast or not. The probability of this scheme is less than 0.5. Moreover, as the system operates, the probability of the scheme gradually decreases to 0, but the probabilities of the PBFT and SBFT still fluctuate around 0.5. From experimental results, it can be seen that the scheme reduces the time for view change.
(2) Relationship between number of nodes and throughput
The performance of the PBFT is greatly affected by the number of nodes, and when the number of nodes exceeds a threshold, the system performance is significantly degraded. SBFT provides almost twice the throughput as PBFT protocol. This experiment evaluated the relationship between the number of nodes and throughput. We evaluated two cases, one without malicious nodes in the system and the other with 32 malicious nodes in the system.
In fig. 8, the left sub-graph is a relationship in the case of no malicious node, and the right sub-graph is a relationship in the case of 32 malicious nodes. As can be seen from fig. 8, the maximum throughput of the PBFT, SBFT and the present scheme is around 720, 2130 and 2800, respectively, in the absence of malicious nodes. The maximum throughput of the SBFT is more than 3 times of that of the PBFT, and the maximum throughput of the scheme is more than 4 times of that of the PBFT. With 32 malicious nodes, the maximum throughput for the PBFT, SBFT and the present scheme is around 320, 1900 and 2700, respectively. The maximum throughput of the SBFT is more than 6 times that of the PBFT, and the maximum throughput of the scheme is more than 8 times that of the PBFT. In both cases, the PBFT throughput is less than the SBFT throughput, and the SBFT throughput is less than the scheme. The throughput of this scheme is significantly greater than PBFT due to the presence of the subset of acknowledgement nodes. And due to the existence of a node scoring mechanism, the throughput of the scheme is greater than SBFT. As the number of malicious nodes increases to 32, the maximum throughput of the PBFT and SBFT decreases by 400 and 230, respectively. But the maximum throughput of the scheme remains substantially constant. Therefore, the scheme can work well in a system in which malicious nodes are easy to appear. The throughput of the PBFT, the SBFT and the scheme is maximum when the number of nodes is 150, 350 and 500 respectively, which shows that the scheme is suitable for operating in a system with the number of nodes larger than the PBFT and the SBFT.
(3) Relationship between runtime and throughput
This experiment evaluated the throughput over time. As can be seen in FIG. 9, the throughput of the PBFT fluctuates around 700 and the throughput of the SBFT fluctuates around 2030. Neither PBFT nor SBFT have a good mechanism for selecting nodes as master nodes, so their throughput remains stable. According to the scheme, the nodes are selected as the main nodes according to the scores of the nodes. The throughput of the present scheme is increasing over time. Since the communication between the nodes in the scheme is all-to-c, and the communication between the nodes in the PBFT is all-to-all, the throughput of the scheme is obviously higher than that of the PBFT. According to the scheme, the network and the computing power of the nodes are considered, and the nodes with high network speed and high computing power are selected as the main nodes. Therefore, the throughput of the scheme is also higher than the SBFT.
(4) Relationship between throughput and delay
FIG. 10 may yield the maximum throughput for this scheme, PBFT and SBFT. This experiment tested the delay in throughput from 0 to maximum throughput in the present scheme, PBFT and SBFT. As can be seen from fig. 10, the delay of the present scheme is lower than both PBFT and SBFT in both cases. As the number of malicious nodes in the system increases to 32, the delay of PBFT and SBFT increases significantly. The delay of the solution increases only slightly. Experimental results show that the consensus efficiency of the scheme is obviously higher than that of PBFT and SBFT.
Fig. 11 illustrates a block diagram of a byzantine fault-tolerant consensus system based on node scoring, according to an embodiment of the present invention. The system comprises a node scoring module 1101, a system initialization module 1102, a score-based node selection module 1103, a score-based consistency protocol module 1104 and a score-based view switching protocol module 1105.
In a specific embodiment, the node scoring module 1101 is configured to use information including networks, attributes, and transactions on nodes as scoring criteria, set corresponding weights for the scoring criteria, and calculate a total score of each node according to the weight of the scoring criteria of each node;
the system initialization module 1102 is configured to initialize a system key and initialize node selection, where initializing node selection includes selecting a master node and a plurality of acknowledgement nodes through a verifiable random function, and the plurality of acknowledgement nodes form an acknowledgement node subset;
the score-based node selection module 1103 is configured to select a certain number of nodes ranked in the front after ranking the total scores of the nodes from large to small when any node has a view change, and reselect a master node and a confirmation node among the certain number of nodes ranked in the front by running a verifiable random function;
the score-based consistency protocol module 1104 is configured to process the request sent by the client by constructing a consistency protocol between the reselected master node and the confirmation node, wherein the consistency protocol verifies the correctness of all transactions based on verifying the root of a Merkle tree in the request sent by the client;
the score-based view switching protocol module 1105 is configured to establish a master node view switching protocol and a confirmation node subset view switching protocol, and when the consensus of the master node or/and the confirmation node is abnormal, the master node or/and the confirmation node generating the abnormality is replaced according to the master node view switching protocol and the confirmation node subset view switching protocol.
Embodiments of the present invention also relate to a computer-readable storage medium having stored thereon a computer program which, when executed by a computer processor, implements the method above. The computer program comprises program code for performing the method illustrated in the flow chart. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable medium or any combination of the two.
According to the method, relevant important information of the nodes is used as a grading standard, each node is graded through an analytic hierarchy process, then on the basis of PBFT and SBFT, the communication complexity of the nodes is changed from all-to-all to all-to-c (c is a small constant) according to the node grading, a confirmed node subset is selected through the node grading, the communication complexity is reduced, the speed of achieving consensus is improved, and meanwhile more nodes can be supported to participate in consensus; in addition, a view change mechanism for the confirmation node subset is established, the purpose of confirming the view change of the node subset is to switch in time when the confirmation node subset has errors, and the scheme can work well in a network with more malicious nodes by combining a node scoring mechanism, so that resources are utilized well, and the communication complexity is reduced. The scheme can work well in a complex network which accords with reality, and also can work well in a network with more nodes.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (9)

1. A Byzantine fault-tolerant consensus method based on node scoring is characterized by comprising the following steps:
s1, taking information including network, attribute and transaction on the nodes as scoring standards, setting corresponding weight for the scoring standards, and calculating the total score of each node according to the weight of the scoring standards of each node;
the step of calculating the total score of each node according to the weight of the scoring standard of each node comprises the following steps:
step 1: for a certain node, constructing a hierarchical structure model of the node by taking the scoring standard as an element in a hierarchy based on a hierarchical analysis method, wherein the hierarchical structure model comprises the following components from high to low:
the first hierarchy represents a target layer, the target layer containing an element X;
the second level represents a standard layer comprising n elements, wherein n is a positive integer;
the third level represents a sub-standard layer, which comprises p elements, wherein p is a positive integer;
step 2: performing element formation on the elements in the standard layer according to the importance of the elements in the standard layer to the elements in the target layerFor comparison, quantizing the comparison result into numerical values and carrying out normalization processing to obtain the weight of each element in the standard layer relative to the target layer
Figure 483517DEST_PATH_IMAGE001
Wherein
Figure 964439DEST_PATH_IMAGE002
Representing n elements in the standard layer;
and step 3: according to the importance of the elements in the sub-standard layer to the elements in the standard layer, the elements in the sub-standard layer are compared in pairs, the comparison result is quantized into a numerical value, and normalization processing is carried out to obtain the weight of each element in the sub-standard layer relative to the standard layer
Figure 72072DEST_PATH_IMAGE003
Wherein
Figure 795178DEST_PATH_IMAGE004
Representing p elements in the sub-standard layer;
and 4, step 4: total weight of each element in the sub-standard layer
Figure 812812DEST_PATH_IMAGE005
Comprises the following steps:
Figure 963171DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 71284DEST_PATH_IMAGE007
represents the second of the sub-standard layers
Figure 739026DEST_PATH_IMAGE008
The number of the elements is one,
Figure 735800DEST_PATH_IMAGE009
represents the second in the standard layer
Figure 57060DEST_PATH_IMAGE010
The number of the elements is one,
Figure 139286DEST_PATH_IMAGE011
to represent
Figure 79560DEST_PATH_IMAGE007
The weight of the previous level element of (1);
and 5: node pointkTotal score of (2)
Figure 432306DEST_PATH_IMAGE012
The following were used:
Figure 190047DEST_PATH_IMAGE013
wherein the content of the first and second substances,
Figure 493989DEST_PATH_IMAGE014
representing nodeskIn the elements
Figure 831429DEST_PATH_IMAGE015
The score obtained in the above-mentioned manner,
Figure 773103DEST_PATH_IMAGE016
presentation element
Figure 436165DEST_PATH_IMAGE015
The weight of (c);
s2, initializing a system key and initializing node selection, wherein the initializing node selection comprises selecting a main node and a plurality of confirmation nodes through a verifiable random function, and the confirmation nodes form a confirmation node subset;
s3, when any node has view change, sorting the total scores of the nodes from big to small, then selecting a certain number of nodes in the front of the order, and reselecting the main node and the confirmation node among the certain number of nodes in the front of the order by running a verifiable random function;
s4, processing the request sent by the client by constructing a consistency protocol between the reselected main node and the confirmation node, wherein the consistency protocol verifies the correctness of all transactions based on the root of the Merkle tree in the request sent by the verification client;
and S5, establishing a main node view switching protocol and a confirmation node subset view switching protocol, and when the consensus of the main node or/and the confirmation node is abnormal, replacing the main node or/and the confirmation node which generates the abnormality according to the main node view switching protocol and the confirmation node subset view switching protocol.
2. The method of claim 1, wherein the elements in the sub-standard layer comprise: network speed, number of failed messages, network bandwidth, number of error messages, number of times to become master, number of times to become a confirming node, computing power, number of sent transactions, and number of completed transactions.
3. The method according to claim 1, wherein the initializing the system key in S2 specifically uses a threshold signature algorithm, and the specific steps include:
the nodes in the system are numbered, and a master key (MSK) and a Master Public Key (MPK) of the system and a public key and a private key corresponding to each node are generated through a BLS threshold signature algorithm, wherein each node stores the Master Public Key (MPK) of the system and public keys of other nodes.
4. The method according to claim 1, wherein the S3 specifically includes:
reselecting the master node by running an authenticatable random function:
when the view of the master node is changed, sorting the total scores of all the nodes from large to small, selecting five nodes with the maximum total scores, confirming that the node subset runs a verifiable random function in the five nodes, and finally obtaining one node as the master node;
reselecting the confirmation node by running a verifiable random function:
when the view of the confirmation node subset changes, the total scores of all the nodes are sorted from large to small, the master node runs a verifiable random function on 2c nodes with the largest scores to finally obtain c nodes, and the c nodes are used as c confirmation nodes to form the confirmation node subset, wherein c is a positive integer.
5. The method according to claim 1, wherein the coherence protocol in S4 specifically includes:
the master node is one, the backup nodes are M, the confirmation nodes are c, and 1+ M + c = N = 3f +1 is satisfied, wherein M, c, N are positive integers, N represents the total number of nodes, f represents the number of problematic nodes, the adversary model of the consistency protocol is N = 3f +1, and the consistency protocol is realized through four processes of requesting, preparing, submitting and replying:
requesting:
the client packs the transaction information into a request in a Merkle tree form, and then sends the request to the main node;
preparing:
after receiving the request, the main node numbers the request, then carries out Hash processing, signs the request by using the private key of the main node, and finally, sends the request to the main node<prepare, v, q, P1, d(m), σP1(d(m)), m>Sending the request as a preparation message to all other nodes, wherein v is a view number, q is a sequence number of the request, d (m) is a summary of the request, and sigma P1(d (m)) is the signature of the request by the master node by means of a private key, m is the content of the request, P1The serial number of the master node;
submitting:
after receiving the preparation message, the backup node and the confirmation node respectively perform the following checks:
checking whether the digest of the request and the signature are correct;
checking whether the view v in the request is the same as the current view;
checking whether the current node receives other requests with the sequence number q;
checking whether the received request is within a current receive window;
if the above-mentioned check results are all yes, then will<submit, v, q, P1, σi(m), i>Sending to the subset of validation nodes as a commit message, where σi(m) for the threshold signature of node i on the request, when the subset of validation nodes receives 2f +1 commit messages with the same request sequence number, the subset of validation nodes obtains all signatures (σ) of the 2f +1 commit messages with the same request sequence numberi(m) | 1 ≦ i ≦ q) and combined into the final signature σ (m), and finally the confirmation node subset sends the signature σ (m) to all other nodes<reply, v, q, σ(m)>As a reply message;
and (3) recovering:
when receiving at least
Figure 227404DEST_PATH_IMAGE017
After the reply message is received, all nodes verify the signature sigma (m) by using a system Master Public Key (MPK), if the verification is successful, the reply message is written into a local log, and the state of the request with the sequence number q is set to be successful.
6. The method according to claim 5, wherein the master node view switching protocol in S5 specifically includes:
when the consensus of the main node is abnormal, the timer of the backup node i is overtime in the current view v, the backup node i triggers the view switching operation of the main node and switches the current view to the view v +1, and the method comprises the following four steps of requesting, distributing, converting and confirming:
requesting: when the timer in the backup node times out, the backup node sends a requestSwitching the message of the main node view to the confirmation node subset, wherein the format of the message requesting to switch the main node view is<primary-view-change-request,v+1,i, σi(P2)>Where i is the serial number of the backup node, σi(P2) Is the threshold signature of the backup node i on the message, where P2Is the new master node's serial number;
allocating, after confirming that the node subset receives at least f +1 messages requesting to switch the main node view, synthesizing the threshold signatures of f +1 nodes corresponding to the messages into a complete signature sigma (P)2) The confirmation node subset reselects a new master node through S3, and then the confirmation node subset sends a view distribution message to the backup node, wherein the view distribution message is in the format of<primary-view-assign, v+1, P2,σ(P2)>In which P is2Is the new master node's serial number;
conversion: when the backup node receives a message greater than or equal to
Figure 368535DEST_PATH_IMAGE018
Using the system public key pair sigma (P) when the same distribution view message is transmitted2) Verifying, if the verification is successful, changing the serial number of the main node into P2And sending a confirmation message to the confirmation node subset, the confirmation message indicating that the new master node is successfully verified;
confirming that all backup nodes have received the allocation view message and successfully change the sequence number of the master node to P when the confirming node subset receives 2f confirmation messages2
7. The method according to claim 5, wherein the confirming of the node subset view switching protocol in S5 specifically includes:
when the backup node does not receive enough messages sent by the confirmation node subset within the designated time, the view of the confirmation node subset is changed, and the specific process comprises the following steps of requesting, allocating, converting, confirming, reconfirming and restarting:
requesting: when the timer in the backup node is overtime, the backup nodeSending a message requesting to switch the view of the confirmation node subset to the main node, wherein the format of the message requesting to switch the view of the confirmation node subset is<confirmed-node-view-change-request,v+1,i,σi(r)>Where i is the serial number of the backup node, σi(r) is the threshold signature of backup node i on the message;
when the master node receives the messages of requesting to switch the view of the subset of the confirmation nodes, which are more than or equal to f +1, the master node synthesizes the threshold signatures of the f +1 nodes corresponding to the messages into a complete signature sigma (R), the master node reselects a new subset of the confirmation nodes through S3, and then the master node sends a view distribution message to the backup nodes, wherein the view distribution message has a format of < fixed-node-view-assign, v +1, R, sigma (R) >, and R is the serial number of the new subset of the confirmation nodes;
conversion: after receiving the distribution view message sent by the main node, the backup node verifies sigma (r) by using a system public key, and if the verification is successful, a confirmation message representing that the new confirmation node subset is verified successfully is sent to the main node;
confirming that the master node indicates that the backup nodes all receive the sent view distribution message and successfully change the sequence number of the confirmed node subset into R when receiving 2f confirmation messages, and at the moment, the master node sends the preparation message which is not successfully executed in the previous view to the backup nodes and the new confirmed node subset;
and (4) confirming: after receiving the message containing the preparation message sent by the main node, the backup node and the new confirmation node subset send a re-confirmation message to the main node to indicate that the message sent by the main node is received;
restarting: and after receiving the reconfirmation messages of which the number is more than or equal to 2f, the main node sends an execution message to the new confirming node subset to start a new round of consensus.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a computer processor, carries out the method of any one of claims 1 to 7.
9. A byzantine fault-tolerant consensus system based on node scoring, comprising:
a node scoring module: the method comprises the steps that information including networks, attributes and transactions on nodes is used as scoring standards, corresponding weights are set for the scoring standards, and then the total score of each node is calculated according to the weight of the scoring standards of each node;
the step of calculating the total score of each node according to the weight of the scoring standard of each node comprises the following steps:
step 1: for a certain node, constructing a hierarchical structure model of the node by taking the scoring standard as an element in a hierarchy based on a hierarchical analysis method, wherein the hierarchical structure model comprises the following components from high to low:
the first hierarchy represents a target layer, the target layer containing an element X;
the second level represents a standard layer comprising n elements, wherein n is a positive integer;
the third level represents a sub-standard layer, which comprises p elements, wherein p is a positive integer;
step 2: according to the importance of the elements in the standard layer to the elements in the target layer, the elements in the standard layer are compared in pairs, the comparison result is quantized into a numerical value, and normalization processing is carried out to obtain the weight of each element in the standard layer relative to the target layer
Figure 695874DEST_PATH_IMAGE019
Wherein
Figure 670783DEST_PATH_IMAGE020
Representing n elements in the standard layer;
and step 3: according to the importance of the elements in the sub-standard layer to the elements in the standard layer, the elements in the sub-standard layer are compared in pairs, the comparison result is quantized into a numerical value, and normalization processing is carried out to obtain the relative ratio of each element in the sub-standard layer to each element in the standard layerWeights of the standard layer
Figure 683738DEST_PATH_IMAGE021
Wherein
Figure 487615DEST_PATH_IMAGE022
Representing p elements in the sub-standard layer;
and 4, step 4: total weight of each element in the sub-standard layer
Figure 403881DEST_PATH_IMAGE023
Comprises the following steps:
Figure 408746DEST_PATH_IMAGE024
wherein the content of the first and second substances,
Figure 908997DEST_PATH_IMAGE007
represents the second of the sub-standard layers
Figure 391931DEST_PATH_IMAGE008
The number of the elements is one,
Figure 428283DEST_PATH_IMAGE025
represents the second in the standard layer
Figure 604049DEST_PATH_IMAGE010
The number of the elements is one,
Figure 732542DEST_PATH_IMAGE026
to represent
Figure 550325DEST_PATH_IMAGE007
The weight of the previous level element of (1);
and 5: node pointkTotal score of (2)
Figure 408560DEST_PATH_IMAGE027
The following were used:
Figure 256693DEST_PATH_IMAGE028
wherein the content of the first and second substances,
Figure 731536DEST_PATH_IMAGE029
representing nodeskIn the elements
Figure 821852DEST_PATH_IMAGE015
The score obtained in the above-mentioned manner,
Figure 800172DEST_PATH_IMAGE016
presentation element
Figure 819206DEST_PATH_IMAGE015
The weight of (c);
a system initialization module: the method comprises the steps that configuration is used for initializing a system key and initializing node selection, wherein the initialization of the node selection comprises the steps that a main node and a plurality of confirmation nodes are selected through a verifiable random function, and the confirmation nodes form a confirmation node subset;
a node selection module based on scoring: when any node is subjected to view change, sorting the total scores of the nodes from large to small, and then selecting a certain number of nodes in the front sorting, and reselecting a master node and a confirmation node by running a verifiable random function from the certain number of nodes in the front sorting;
a score-based consistency protocol module: the method comprises the steps that a consistency protocol is constructed between the reselected main node and the confirmation node, so that a request sent by a client is processed, and the consistency protocol is used for verifying the correctness of all transactions based on the root of a Merkle tree in the request sent by the verification client;
score-based view switching protocol module: the method is configured for establishing a master node view switching protocol and a confirmation node subset view switching protocol, and when the consensus of the master node or/and the confirmation node is abnormal, the master node or/and the confirmation node generating the abnormity is replaced according to the master node view switching protocol and the confirmation node subset view switching protocol.
CN202110677787.5A 2021-06-18 2021-06-18 Byzantine fault-tolerant consensus method and system based on node scoring Active CN113259179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110677787.5A CN113259179B (en) 2021-06-18 2021-06-18 Byzantine fault-tolerant consensus method and system based on node scoring

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110677787.5A CN113259179B (en) 2021-06-18 2021-06-18 Byzantine fault-tolerant consensus method and system based on node scoring

Publications (2)

Publication Number Publication Date
CN113259179A CN113259179A (en) 2021-08-13
CN113259179B true CN113259179B (en) 2021-10-19

Family

ID=77188781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110677787.5A Active CN113259179B (en) 2021-06-18 2021-06-18 Byzantine fault-tolerant consensus method and system based on node scoring

Country Status (1)

Country Link
CN (1) CN113259179B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114218612B (en) * 2021-12-14 2023-10-20 河北省科学院应用数学研究所 Consensus method suitable for alliance chain high-frequency transaction scene
CN114938292B (en) * 2022-04-26 2023-05-23 重庆邮电大学 Multi-level optimization PBFT consensus method based on node credibility
CN116546499B (en) * 2023-07-06 2023-09-15 北京航空航天大学 Mobile terminal identity authentication method based on lightweight Bayesian fault tolerance

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677485A (en) * 2019-09-30 2020-01-10 大连理工大学 Dynamic layered Byzantine fault-tolerant consensus method based on credit
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 Power consumption information protection-oriented Byzantine fault-tolerant alliance chain consensus method, system and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10586210B2 (en) * 2016-11-30 2020-03-10 International Business Machines Corporation Blockchain checkpoints and certified checkpoints
CN108667614B (en) * 2018-04-19 2021-02-02 上海分布信息科技有限公司 Byzantine fault-tolerant method and implementation system thereof
CN110417833B (en) * 2018-04-27 2022-05-20 百度在线网络技术(北京)有限公司 Data processing method and device based on block chain and storage medium
CN109639413B (en) * 2018-12-10 2020-04-24 四川大学 Block chain system based on mobile ad hoc network
CN111414420B (en) * 2020-03-17 2023-05-26 重庆邮电大学 Improved PBFT block chain consensus method
CN111432014B (en) * 2020-03-30 2023-05-05 上海玳鸽信息技术有限公司 Method and device for selecting main node in block chain consensus algorithm
CN112532581A (en) * 2020-10-26 2021-03-19 南京辰阔网络科技有限公司 Improved PBFT consensus method based on consensus participation and transaction activity

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677485A (en) * 2019-09-30 2020-01-10 大连理工大学 Dynamic layered Byzantine fault-tolerant consensus method based on credit
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 Power consumption information protection-oriented Byzantine fault-tolerant alliance chain consensus method, system and storage medium

Also Published As

Publication number Publication date
CN113259179A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN113259179B (en) Byzantine fault-tolerant consensus method and system based on node scoring
US11778024B2 (en) Decentralized computation system architecture based on node specialization
CN111988203B (en) Node election method, device and storage medium
WO2022048357A1 (en) Transaction endorsement method and apparatus, and storage medium
CN112101942B (en) Transaction request processing method, system, device and equipment based on block chain
AU2021316961B2 (en) Systems and methods providing specialized proof of confidential knowledge
CN112163856A (en) Consensus method and system for block chain and Internet of things fusion scene
US11531982B2 (en) Optimal transactions sharding for scalable blockchain
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
KR20200081533A (en) Blockchain Consensus Method based Improved Dynamic Blind Voting for Internet of Things Environment
CN111414420A (en) Improved PBFT block chain consensus method
CN111414589B (en) Method, device and equipment for checking original works based on block chain
CN112395113A (en) Practical Byzantine fault-tolerant consensus method and device and readable storage medium
CN114938292B (en) Multi-level optimization PBFT consensus method based on node credibility
CN115633035A (en) Improved PBFT (physical layer transmission) based block chain consensus algorithm for Internet of things
CN112766560B (en) Alliance blockchain network optimization method, device, system and electronic equipment
CN107276914B (en) Self-service resource allocation scheduling method based on CMDB
CN112699414B (en) Machine learning data evidence-storing method and system based on blockchain
WO2023179056A1 (en) Consensus processing method and apparatus of block chain network, device, storage medium, and program product
CN114862397B (en) Double-decoupling block chain distributed method based on double-chain structure
CN116980281A (en) Node selection method, node selection device, first node, storage medium and program product
Nezhadsistani et al. Blockchain consensus algorithms: Past, present, and future trends
CN115102899B (en) Block link point tree form fragmentation method based on load balancing
Liu et al. Monitory Consensus Mechanism of Blockchain for Internet of Things
CN116506333B (en) Transaction system production inversion detection method and equipment

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220825

Address after: Room 303, No. 30, Gaoji Street, Xihu District, Hangzhou City, Zhejiang Province, 310012

Patentee after: Hangzhou Jinyu Technology Co.,Ltd.

Address before: 311400 room 605, 6th floor, building 12, Fuchun Park, Zhongguo Zhigu, Yinhu street, Fuyang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou yunzhisheng Intelligent Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221130

Address after: 211800 No. 22-119, Dangui Road, Pukou Economic Development Zone, Pukou District, Nanjing, Jiangsu

Patentee after: Nanjing Shaoyan Intelligent Technology Co.,Ltd.

Address before: Room 303, No. 30, Gaoji Street, Xihu District, Hangzhou City, Zhejiang Province, 310012

Patentee before: Hangzhou Jinyu Technology Co.,Ltd.

TR01 Transfer of patent right