Asynchronous dual-output multi-consensus method and device
By setting the first and second local variables, sending scattered and echo messages, and performing revoting binary consensus, the problem of lack of dual output multivariate consensus in asynchronous consensus is solved, and the effectiveness and robustness of asynchronous dual output multivariate consensus is achieved.
Patent Information
- Application Number
- CN202310252817.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-03-07
AI Technical Summary
The existing asynchronous consensus protocols mainly focus on consensus of single values, lack multivariate consensus schemes for two values, especially in the most robust asynchronous protocols, which lack effective dual output multivariate consensus methods.
Each node is used to set the first local variable and send a scattered message, update the second local variable according to the received message, send an echo message, determine the output and the third local variable through the revoting binary consensus, and finally realize asynchronous dual output multivariate consensus.
Under the premise of information theory security, under the condition that the total number of nodes is 3 times greater than the number of wrong nodes, it can reach asynchronous multivariate consensus on the two values to ensure the consensus and ending of the correct nodes.
Smart Images

Figure CN116318973B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to an asynchronous dual-output multi-consensus method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.
[0003] The Byzantine consensus protocol is the foundation of blockchain and the core technology that ensures blockchain security. In traditional distributed systems, Byzantine consensus protocols can be constructed using various system components. Two of the more classic types are called multi-Byzantine consensus. As the name suggests, in multi-Byzantine consensus (MBA), each node can propose any value (a deterministic value), ensuring that all correct nodes ultimately reach consensus on the same value.
[0004] Based on different network assumptions, Byzantine agreements can be categorized as synchronous, asynchronous, and semi-synchronous. All protocols targeted by this invention are asynchronous, which is the most robust protocol type. Current asynchronous consensus methods typically reach consensus on a single value, and there is currently a lack of a solution for achieving multi-value consensus on two values. Summary of the Invention
[0005] An embodiment of the present invention provides an asynchronous dual-output multi-consensus method for achieving asynchronous multi-consensus on two values, and provides an asynchronous dual-output multi-consensus protocol. The method includes:
[0006] Each node has an input, sets the first local variable of the node to the input, and sends a decentralized message for the input to all nodes;
[0007] After receiving a message from another node for the first time, the node sets the second local variable to be plus 1;
[0008] If the node receives n-2f consistent decentralized messages, and the input in the received decentralized message is not equal to the value proposed by the node itself, it sends an echo message for the input of the node to all nodes;
[0009] After the node receives the echo message from other nodes for the first time, the second local variable is set to plus 1;
[0010] For the distributed messages and recovered messages, the first local variable, and the second local variable received by the node, the re-voting binary consensus is started and voted on to determine the output of the re-voting binary consensus and the third local variable;
[0011] Obtain an asynchronous dual-output multi-element array based on the output of the revoting binary consensus and the third local variable, and determine that an asynchronous dual-output multi-element consensus is reached on the asynchronous dual-output multi-element array;
[0012] Among them, in the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
[0013] The embodiment of the present invention further provides an asynchronous dual-output multi-consensus device for implementing asynchronous dual-output multi-consensus and an asynchronous dual-output multi-consensus protocol. The device includes:
[0014] A decentralized message sending module, configured to set each node having an input, to set the first local variable of the node to the input, and to send a decentralized message for the input to all nodes;
[0015] A second local variable setting module, configured to set the second local variable to plus 1 after the node receives a message from another node for the first time;
[0016] An echo message sending module is used to send an echo message of the input of the node to all nodes if the node receives n-2f consistent scattered messages and the input in the received scattered messages is not equal to the value proposed by the node itself;
[0017] A second local variable setting module, configured to set the second local variable to be plus 1 after the node receives an echo message from another node for the first time;
[0018] The revoting binary consensus module is used to start the revoting binary consensus based on the distributed messages and recovered messages received by the node, the first local variable, and the second local variable, and to vote to determine the output of the revoting binary consensus and the third local variable;
[0019] an asynchronous dual-output multi-element consensus module, configured to obtain an asynchronous dual-output multi-element array based on the output of the revotable binary consensus and a third local variable, and to determine whether an asynchronous dual-output multi-element consensus is reached on the asynchronous dual-output multi-element array;
[0020] Among them, in the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
[0021] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned asynchronous dual-output multi-consensus method when executing the computer program.
[0022] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned asynchronous dual-output multi-consensus method.
[0023] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the above-mentioned asynchronous dual-output multi-consensus method.
[0024] In an embodiment of the present invention, each node has an input, and the first local variable of the node is set to the input, and a decentralized message for the input is sent to all nodes; after the node receives a message from other nodes for the first time, the second local variable is set to plus 1; if the node receives n-2f consistent decentralized messages, and the input in the received decentralized message is not equal to the value proposed by the node itself, an echo message for the input of the node is sent to all nodes; after the node receives an echo message from other nodes for the first time, the second local variable is set to plus 1; for the decentralized messages and recycled messages received by the node, the first local variable, and the second local variable, a re-voting binary consensus is started, and voting is performed to determine the output and third local variable of the re-voting binary consensus; based on the output and the third local variable of the re-voting binary consensus, an asynchronous dual-output multi-array is obtained, and it is determined that an asynchronous dual-output multi-array consensus is reached on the asynchronous dual-output multi-array; wherein, in the asynchronous dual-output multi-array consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1. Through the above process, an information-theoretically secure asynchronous dual-output multi-consensus protocol is provided, which can achieve multi-consensus on two values. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0026] Figure 1 This is a flowchart of the asynchronous dual-output multi-consensus method in an embodiment of the present invention;
[0027] Figure 2 This is a flow chart of a binary consensus with re-voting in an embodiment of the present invention;
[0028] Figure 3 This is a flow chart of enabling binary consensus with re-voting and voting to 0 in an embodiment of the present invention;
[0029] Figure 4This is a flow chart of enabling re-voting binary consensus and voting 1 in an embodiment of the present invention;
[0030] Figure 5 A flowchart of obtaining an asynchronous dual-output multi-element array according to an embodiment of the present invention;
[0031] Figure 6 A flowchart of obtaining an asynchronous dual-output multi-element array according to a relationship between the value pf proposed by the node and a third local variable in an embodiment of the present invention;
[0032] Figure 7 This is the pseudo code for the dual-output multi-consensus in an embodiment of the present invention;
[0033] Figure 8 Schematic diagram of an asynchronous dual-output multi-consensus device in an embodiment of the present invention;
[0034] Figure 9 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0036] First, the concepts involved in the embodiments of the present invention are explained.
[0037] Assume that the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
[0038] (1) Multi-valued Byzantine agreement (MBA)
[0039] Multi-consensus: Each node proposes a value v∈{0,1}*, and all correct nodes reach a consensus on the same value. MBA has the following properties:
[0040] Validity: If all nodes (correct or incorrect) propose the same value v, then all correct nodes reach consensus on v.
[0041] Consensus: If a correct node reaches a consensus on v, any correct node will eventually reach a consensus on v
[0042] Finality: All correct nodes eventually reach consensus.
[0043] Integrity: All nodes reach consensus on only one value.
[0044] (2) Repsoposable asynchronous binary agreement (RABA)
[0045] In a binary asynchronous revoting consensus, each node proposes a binary value v∈{0,1}, and all correct nodes reach consensus on the same value. RABA has a bias towards a certain value, defaulting to 1. If a correct node votes for 0, it is allowed to revote for 1. If a correct node has already voted for 1, it will not vote for 0 again.
[0046] The definition of binary asynchronous re-voting consensus is as follows.
[0047] Validity: If all correct nodes propose the same value v and do not re-vote 1-v, then all correct nodes reach consensus on v.
[0048] Consensus finality: If all correct nodes propose the same value v and do not re-vote 1-v, then all correct nodes can reach a consensus.
[0049] Consensus: If a correct node reaches a consensus on v, any correct node will eventually reach a consensus on v
[0050] Biased finality: Define Q as the set of all correct nodes, Q1 is the set of correct nodes that voted for 1, and Q2 is the set of correct nodes that voted for 0 but later voted for 1. If the union of Q1 and Q2 is equal to Q, all correct nodes can eventually reach a consensus.
[0051] Integrity: All nodes reach consensus on only one value.
[0052] The present invention uses threshold signature, which is a technology of aggregate signature. When each node performs threshold signature, signature fragments can be formed. Only when the signature fragments that reach a certain threshold are aggregated can a threshold signature be formed.
[0053] Figure 1 This is a flowchart of the asynchronous dual-output multi-consensus method according to an embodiment of the present invention, including:
[0054] Step 101: Each node p_i has an input v. The first local variable pv of the node is set to the input v, and a disperse message disperse(v) for the input v is sent to all nodes.
[0055] Step 102: After receiving a message from another node p_j for the first time, the node p_i sets the second local variable rd[v] to rd[v] plus 1;
[0056] Step 103: If the node p_i receives n-2f consistent dispersed messages disperse(v'), and the input v' in the received dispersed message is not equal to the value pf proposed by the node itself, it sends an echo message echo(v) for the input v of the node to all nodes.
[0057] Step 104, after the node p_i receives the echo message echo(v) from the other node p_j for the first time, the second local variable rd[v] is set to rd[v] plus 1;
[0058] Step 105: Based on the distributed message and recovered message received by the node p_i, the first local variable pv, and the second local variable rd[v], start the re-voting binary consensus and vote to determine the output of the re-voting binary consensus and the third local variable;
[0059] Step 106: Obtain an asynchronous dual-output multi-element array based on the output of the revoting binary consensus and the local variables, and determine whether an asynchronous dual-output multi-element consensus has been reached on the asynchronous dual-output multi-element array;
[0060] In the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f plus 1.
[0061] In an embodiment of the present invention, an information-theoretically secure asynchronous dual-output multi-consensus protocol is provided, which can achieve multi-consensus on two values.
[0062] Figure 2 This is a flow chart of the re-voting binary consensus in an embodiment of the present invention. In one embodiment, for the distributed messages and recycled messages received by the node p_i, the first local variable pv, and the second local variable rd[v], the re-voting binary consensus is started and voted on to determine the output of the re-voting binary consensus and the third local variable, including:
[0063] Step 201: For the distributed messages and recycled messages received by the node p_i, the first local variable pv, and the second local variable rd[v], enable the re-voting binary consensus and vote to 0;
[0064] Step 202: For the distributed messages and recovered messages received by the node p_i, enable the re-voting binary consensus and vote as 1;
[0065] Step 203: Determine the output of the re-voting binary consensus based on the votes of the re-voting binary consensus.
[0066] Figure 3 This is a flow chart for enabling a binary consensus with re-voting and voting to 0 in an embodiment of the present invention. In one embodiment, it includes:
[0067] Step 301: If the node receives f+1 dispersed messages (disperse()) or echo messages (echo()) from different other nodes, where the input contained in the dispersed messages (disperse()) from different other nodes is different from the first local variable pv of the node, or the input contained in the echo messages (echo(v)) from different other nodes is different from the first local variable pv of the node, then the re-voting binary consensus is enabled and the vote is 0;
[0068] In step 302, the node determines that it has received the value w with the most votes. If the total number of the second local variable rd[v] is not less than f+1 for any input v different from the value w with the most votes, the node starts the binary consensus with re-voting and votes to 0.
[0069] Figure 4 This is a flowchart for enabling a binary consensus with re-voting and voting to 1 in an embodiment of the present invention, including:
[0070] Step 401: If the node receives nf identical dispersed messages disperse(v) and echo messages echo(v), and the second local variable rd[v] is greater than or equal to nf, then threshold signature is performed on the input v in the echo message echo(v) to form a threshold signature fragment pi, and a forward message forward(v,pi) is sent to all nodes. The forward message is formed based on the input and the threshold signature fragment.
[0071] Step 402: If the node p_i receives nf forward messages forward(v,pi), the node aggregates the threshold signature fragments in the forward message into a threshold signature and sets the third local variable rv to the input v in the forward message. If the re-voting binary consensus is not enabled at this time, the vote is 1; if the re-voting binary consensus is enabled at this time, the re-vote is 1. If the distribute message distribute() is not sent at this time, the distribute message distribute(v,threshold signature) is sent. The distribute message is formed based on the input v and the threshold signature.
[0072] Step 403: If the node receives the distribution message distribute(v, threshold signature), and the threshold signature is valid, if the binary consensus for re-voting is not enabled at this time, the vote is 1; if the binary consensus for re-voting is enabled at this time, the re-vote is 1;
[0073] Step 404: Set the third local variable rv to the input v, and then vote to 1.
[0074] Figure 5 A flowchart for obtaining an asynchronous dual-output multi-element array according to an embodiment of the present invention includes:
[0075] Step 501: If the output of the revoting binary consensus is 1, wait for the third local variable to be non-empty, obtain an asynchronous dual-output multi-element array based on the relationship between the value pf proposed by the node and the third local variable, and determine whether an asynchronous dual-output multi-element consensus has been reached on the asynchronous dual-output multi-element array;
[0076] Step 502: If the revoting binary consensus output is 0, determine that the asynchronous dual-output multi-element array includes two arbitrary values.
[0077] Figure 6 This is a flowchart of obtaining an asynchronous dual-output multi-element array based on the relationship between the value pf proposed by the node and the third local variable in an embodiment of the present invention, including:
[0078] Step 601 , if the value pf proposed by the node is equal to the local variable, determining that the asynchronous dual-output multi-element array includes two third local variables;
[0079] Step 602: If the value pf proposed by the node is not equal to the local variable, determine that the asynchronous dual-output multi-element array includes a third local variable and an arbitrary value.
[0080] Figure 7 is the pseudo code of the dual-output multi-consensus in the embodiment of the present invention, and Figures 1-6 correspond.
[0081] In summary, the dual-output multi-member consensus (DO-MBA) proposed in the embodiment of the present invention has the following characteristics:
[0082] Each node proposes a value v∈{0,1}*, and all correct nodes reach a consensus on two values (v1,v2), where v1 is called the first output and v2 is called the second output. DO-MBA has the following properties:
[0083] Non-invasiveness: If the correct nodes reach a consensus on (v1, -), then v1 is proposed by a correct node.
[0084] Validity: If all nodes (correct or incorrect) propose the same value v1, then all correct nodes reach consensus on (v1, -).
[0085] First-output consensus: If one correct node reaches consensus on (v1, v2) and another correct node reaches consensus on (v1', v2'), then v1 = v1'.
[0086] Secondary output consensus: If a correct node reaches consensus on (v1, v2) and another correct node reaches consensus on (v1', v2'), then v2 = v2' or any value of v2 or v2' is ⊥.
[0087] Finality: If all correct nodes start the protocol, all correct nodes will eventually reach consensus.
[0088] Completeness: All correct nodes reach consensus at most once.
[0089] The embodiment of the present invention also proposes an asynchronous dual-output multi-consensus device, the principle of which is similar to the asynchronous dual-output multi-consensus method and will not be repeated here.
[0090] Figure 8 This is a schematic diagram of an asynchronous dual-output multi-consensus device according to an embodiment of the present invention, comprising:
[0091] A dispersed message sending module 801 is configured to set the first local variable pv of each node p_i to the input v and send a dispersed message disperse(v) for the input v to all nodes.
[0092] A second local variable setting module 802 is configured to set the second local variable rd[v] to rd[v] plus 1 after the node p_i receives a message from another node p_j for the first time;
[0093] The echo message sending module 803 is configured to send an echo message echo(v) for the input v of the node to all nodes when the node p_i receives n-2f consistent disperse messages disperse(v') and the input v' in the received disperse messages is not equal to the value pf proposed by the node itself.
[0094] A second local variable setting module 804 is configured to set a second local variable rd[v] to rd[v] plus 1 after the node p_i receives the echo message echo(v) from the other node p_j for the first time;
[0095] The revoting binary consensus module 805 is used to start the revoting binary consensus based on the distributed message and recovered message received by the node p_i, the first local variable pv, and the second local variable rd[v], and vote to determine the output of the revoting binary consensus and the third local variable;
[0096] an asynchronous dual-output multi-element consensus module 806 for obtaining an asynchronous dual-output multi-element array based on the output of the revoting binary consensus and a third local variable, and determining that an asynchronous dual-output multi-element consensus is reached on the asynchronous dual-output multi-element array;
[0097] Among them, in the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
[0098] In one embodiment, the re-voting binary consensus module is specifically used to:
[0099] For the distributed messages and recovered messages received by the node p_i, the first local variable pv, and the second local variable rd[v], the re-voting binary consensus is enabled and voted to 0;
[0100] For the distributed messages and recovered messages received by the node p_i, the re-voting binary consensus is enabled and voted to 1;
[0101] Based on the votes of the re-voting binary consensus, the output of the re-voting binary consensus is determined.
[0102] In one embodiment, the re-voting binary consensus module is specifically used to:
[0103] If the node receives f+1 dispersed messages (disperse()) or echo messages (echo()) from different other nodes, where the input contained in the dispersed messages (disperse()) from different other nodes is different from the first local variable pv of the node, or the input contained in the echo messages (echo(v)) from different other nodes is different from the first local variable pv of the node, the re-voting binary consensus is enabled and the vote is 0;
[0104] The node determines that it has received the value w with the most votes. If the total number of the second local variable rd[v] for any input v different from the value w with the most votes is not less than f+1, the binary consensus with re-voting is enabled and the vote is 0.
[0105] In one embodiment, the re-voting binary consensus module is specifically used to:
[0106] If the node receives nf identical dispersed messages disperse(v) and echo messages echo(v), and the second local variable rd[v] is greater than or equal to nf, then it performs a threshold signature on the input v in the echo message echo(v) to form a threshold signature fragment pi, and sends a forward message forward(v,pi) to all nodes. The forward message is formed based on the input and the threshold signature fragment.
[0107] If the node p_i receives nf forward messages forward(v,pi), the node aggregates the threshold signature fragments in the forward message into a threshold signature, and sets the third local variable rv to the input v in the forward message; if the binary consensus with re-voting is not enabled at this time, the vote is 1; if the binary consensus with re-voting is enabled at this time, the re-vote is 1; if the distribute message distribute() is not sent at this time, the distribute message distribute(v,threshold signature) is sent, and the distribute message is formed according to the input v and the threshold signature;
[0108] If the node receives the distribution message distribute(v, threshold signature), and the threshold signature is valid, if the binary consensus for re-voting is not enabled at this time, the vote is 1; if the binary consensus for re-voting is enabled at this time, the re-vote is 1;
[0109] A third local variable rv is set to the input v.
[0110] In one embodiment, the asynchronous dual-output multi-consensus module is specifically used to:
[0111] If the output of the revoting binary consensus is 1, wait for the third local variable to be non-empty, obtain the asynchronous dual-output multi-array based on the relationship between the value pf proposed by the node and the third local variable, and determine whether an asynchronous dual-output multi-array consensus has been reached;
[0112] If the binary consensus output of the revoting function is 0, the asynchronous dual-output multi-array is determined to include two arbitrary values.
[0113] In one embodiment, the asynchronous dual-output multi-consensus module is specifically used to:
[0114] If the value pf proposed by the node is equal to the local variable, determine that the asynchronous dual-output multi-element array includes two third local variables;
[0115] If the value pf proposed by the node is not equal to the local variable, determine that the asynchronous dual-output multi-element array includes a third local variable and an arbitrary value.
[0116] In summary, in the method and apparatus proposed in the embodiment of the present invention, each node p_i has an input v, sets the first local variable pv of the node to the input v, and sends a dispersed message disperse(v) for the input v to all nodes; after the node p_i receives a message from another node p_j for the first time, it sets the second local variable rd[v] to rd[v] plus 1; if the node p_i receives n-2f consistent dispersed messages disperse(v'), and the input v' in the received dispersed message is not equal to the value pf proposed by the node itself, it sends an echo message echo(v) for the input v of the node to all nodes; in the After node p_i receives the first echo message echo(v) from node p_j, it sets its second local variable rd[v] to rd[v] plus 1. It then initiates a revoting binary consensus based on the distributed and recycled messages received by node p_i, the first local variable pv, and the second local variable rd[v]. A vote is then performed to determine the output of the revoting binary consensus and the third local variable. Based on the output of the revoting binary consensus and the local variables, an asynchronous dual-output multi-array is obtained, and an asynchronous dual-output multi-array consensus is reached on the asynchronous dual-output multi-array. In the asynchronous dual-output multi-array consensus protocol, the total number of nodes is n, the number of faulty nodes is f, and n ≥ 3f + 1. Through the above process, an information-theoretically secure asynchronous dual-output multi-array consensus protocol is provided, capable of reaching multi-array consensus on two values.
[0117] An embodiment of the present invention further provides a computer device, Figure 9 This is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 900 includes a memory 910, a processor 920, and a computer program 930 stored in the memory 910 and executable on the processor 920. When the processor 920 executes the computer program 930, the above-mentioned asynchronous dual-output multi-consensus method is implemented.
[0118] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned asynchronous dual-output multi-consensus method.
[0119] An embodiment of the present invention also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the above-mentioned asynchronous dual-output multi-consensus method.
[0120] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0121] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0122] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0124] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An asynchronous dual-output multi-consensus method, characterized in that: include: Each node has an input, sets the first local variable of the node to the input, and sends a decentralized message for the input to all nodes; After receiving a message from another node for the first time, the node sets the second local variable to be plus 1; If the node receives n-2f consistent decentralized messages, and the input in the received decentralized message is not equal to the value proposed by the node itself, it sends an echo message for the input of the node to all nodes; After the node receives the echo message from other nodes for the first time, the second local variable is set to plus 1; For the distributed messages and recovered messages, the first local variable, and the second local variable received by the node, the re-voting binary consensus is started and voted on to determine the output of the re-voting binary consensus and the third local variable; Obtain an asynchronous dual-output multi-element array based on the output of the revoting binary consensus and the third local variable, and determine that an asynchronous dual-output multi-element consensus is reached on the asynchronous dual-output multi-element array; Among them, in the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
2. The method according to claim 1, wherein For the distributed messages and recovered messages, the first local variable, and the second local variable received by the node, the re-voting binary consensus is started and voted on to determine the output of the re-voting binary consensus and the third local variable, including: For the distributed messages and recovered messages, the first local variable, and the second local variable received by the node, the re-voting binary consensus is enabled and voted to 0; For the distributed messages and recycled messages received by the node, enable the binary consensus with re-voting and vote as 1; Based on the votes of the re-voting binary consensus, the output of the re-voting binary consensus is determined.
3. The method according to claim 2, wherein For the distributed messages and recovered messages, the first local variable, and the second local variable received by the node, the re-voting binary consensus is enabled and voted to 0, including: If the node receives f+1 decentralized messages or echo messages from different other nodes, where the input contained in the decentralized messages from different other nodes is different from the first local variable of the node, or the input contained in the echo messages from different other nodes is different from the first local variable of the node, the re-voting binary consensus is enabled and the vote is 0; The node determines that it has received the value with the most votes. If the total number of the second local variable is not less than f+1 for any input different from the value with the most votes, the node starts the binary consensus with re-voting and votes to 0.
4. The method according to claim 2, wherein For the distributed messages and recycled messages received by the node, the re-voting binary consensus is enabled and voted to 1, including: If the node receives nf identical scattered messages and echo messages, and the second local variable is greater than or equal to nf, then it performs a threshold signature on the input in the echo message to form a threshold signature fragment, and sends a forward message to all nodes. The forward message is formed based on the input and the threshold signature fragment. If the node receives nf forward messages, the node aggregates the threshold signature fragments in the forward message into a threshold signature, and sets the third local variable to the input in the forward message; if the binary consensus with re-voting is not enabled at this time, the vote is 1; if the binary consensus with re-voting is enabled at this time, the re-vote is 1; if a distribution message is not sent at this time, a distribution message is sent, and the distribution message is formed according to the input and the threshold signature; If the node receives the distribution message and the threshold signature is valid, if the binary consensus is not enabled at this time, the vote is 1; if the binary consensus is enabled at this time, the vote is 1; Set a third local variable to the input.
5. The method according to claim 1, wherein According to the output of the re-voting binary consensus and the third local variable, an asynchronous dual-output multi-array is obtained, including: If the output of the revoting binary consensus is 1, wait for the third local variable to be non-empty, obtain the asynchronous dual-output multi-array based on the relationship between the value proposed by the node and the third local variable, and determine whether an asynchronous dual-output multi-array consensus has been reached; If the binary consensus output of the revoting function is 0, the asynchronous dual-output multi-array is determined to include two arbitrary values.
6. The method according to claim 5, wherein According to the relationship between the value proposed by the node and the third local variable, an asynchronous dual-output multi-element array is obtained, including: If the value proposed by the node is equal to the local variable, determining that the asynchronous dual-output multi-element array includes two third local variables; If the value proposed by the node is not equal to the local variable, an asynchronous dual-output multi-element array is determined to include a third local variable and an arbitrary value.
7. An asynchronous dual-output multi-consensus device, characterized in that: include: A decentralized message sending module, configured to set each node having an input, to set the first local variable of the node to the input, and to send a decentralized message for the input to all nodes; A second local variable setting module, configured to set the second local variable to plus 1 after the node receives a message from another node for the first time; An echo message sending module is used to send an echo message of the input of the node to all nodes if the node receives n-2f consistent scattered messages and the input in the received scattered messages is not equal to the value proposed by the node itself; A second local variable setting module, configured to set the second local variable to be plus 1 after the node receives an echo message from another node for the first time; The revoting binary consensus module is used to start the revoting binary consensus based on the distributed messages and recovered messages received by the node, the first local variable, and the second local variable, and to vote to determine the output of the revoting binary consensus and the third local variable; an asynchronous dual-output multi-element consensus module, configured to obtain an asynchronous dual-output multi-element array based on the output of the revotable binary consensus and a third local variable, and to determine whether an asynchronous dual-output multi-element consensus is reached on the asynchronous dual-output multi-element array; Among them, in the asynchronous dual-output multi-consensus protocol, the total number of nodes is n, the number of error nodes is f, and n≥3f+1.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Asynchronous consensus method and device for resisting Byzantineranking
CN113660272A
Byzantine fault tolerance method and device
CN113783935A