A method and system for byzantine fault tolerance consensus based on bls threshold signature and weight model
By employing the Byzantine fault-tolerant consensus method based on BLS threshold signatures and a weighted model, the Byzantine node problem in consortium blockchain node consensus is solved, achieving efficient signature verification and high availability of the leader node, thus optimizing consensus efficiency and performance.
Patent Information
- Application Number
- CN202411102050.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-08-12
AI Technical Summary
Existing consensus mechanisms for consortium blockchain nodes, such as the PBFT and Raft algorithms, suffer from problems such as high network communication overhead, leader nodes becoming performance bottlenecks, malicious nodes deceiving and disrupting consensus, and high computational overhead for signature verification when dealing with Byzantine nodes.
We adopt a Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model. By reducing signature verification overhead through BLS signature verification, introducing a weight model to prevent malicious nodes from becoming leaders, and introducing active and passive retirement mechanisms to optimize the leader node load, we improve system performance and availability.
It effectively prevents malicious nodes from affecting consensus, reduces signature verification overhead, improves system performance, ensures high availability of leader nodes, and optimizes consensus efficiency.
Smart Images

Figure CN118890149B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of blockchains, and particularly relates to a Byzantine fault-tolerant consensus method and system based on BLS threshold signature and weight model. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.
[0003] The current consensus method of alliance blockchain nodes mainly includes PBFT algorithm and Raft algorithm, and the existing problems mainly include:
[0004] 1. The PBFT algorithm can handle Byzantine nodes but has a large network communication overhead.
[0005] 2. The Raft algorithm is simple to implement and easy to understand, but the leader node is easy to become the performance bottleneck of the entire cluster, and the Raft algorithm cannot handle the malicious behavior of Byzantine nodes, and the Byzantine nodes can cheat other nodes to destroy normal consensus.
[0006] There is a large amount of calculation overhead when signing and verifying the signature of the request sent by the client, which affects the performance of the entire system.
[0007] In addition, when becoming a leader node, there is a possibility that a malicious node becomes a leader node, and the leader node has a large load, which affects the consensus efficiency and in turn affects the leader node to have high availability. SUMMARY
[0008] To overcome the above shortcomings of the prior art, the present application provides a Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model, which can improve the performance of the system.
[0009] To achieve the above object, one or more embodiments of the present application provide the following technical solutions:
[0010] In a first aspect, a Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model is disclosed, comprising:
[0011] Obtaining the number of current nodes in the blockchain, and the key center generates a corresponding number of BLS public keys, private keys and master public keys according to the number of nodes, and distributes the BLS public keys and the master public keys to each node, and the private keys are sent to the corresponding nodes separately;
[0012] The nodes with high weight values in the current nodes of the blockchain calculate random timeout time according to their weights, and become candidate nodes after reaching the timeout time;
[0013] The candidate node sends a voting request to the follower node, the follower node receives the voting request and performs a multi-step verification process, if all verifications pass, the follower node uses a private key to vote for the request and performs a BLS signature, and sends the signed vote to the candidate node;
[0014] When the candidate node collects a certain number of votes, it aggregates the votes and verifies them using the master public key. If the verification is successful, the candidate node becomes the leader node and attaches the aggregated signature to the heartbeat sent to the follower node. The follower node also verifies the correctness of the aggregated signature using the master public key to determine whether the candidate node has collected enough votes.
[0015] After the candidate node becomes the leader node, it appends the request received from the client to the log and attaches the request to the heartbeat sent to the follower node. The follower node verifies the request and appends it to the log, and returns the signed request to the leader node. The leader node receives a certain number of correct signatures, aggregates the signatures, and returns them to the client, indicating that the request has been successfully applied.
[0016] As a further technical solution, it also includes: when the candidate node becomes the leader node, the leader node triggers the active retirement mechanism when the load is too large and the consensus efficiency is low.
[0017] As a further technical solution, the leader node triggers the active retirement mechanism, specifically: the leader node broadcasts an active retirement request to high-weight nodes, high-weight follower nodes evaluate their performance indicators, and if the load is small, they generate a random number using a verifiable random function and send it to the leader node. The leader node selects the node with the smallest random number as the backup leader node, synchronizes the latest log of the leader node to the backup leader node, and becomes a follower node. The high-weight follower node completes the log synchronization and becomes a candidate node, and initiates a new round of voting request. When a certain number of votes are collected, it becomes a leader node.
[0018] As a further technical solution, when a high-weight follower node receives a delayed leader heartbeat multiple times, it considers that the load of the leader node is too large and affects the consensus efficiency, triggering the passive retirement mechanism.
[0019] As a further technical solution, when the passive retirement mechanism is triggered: the high-weight follower node aggregates its term number, log, and passive retirement request into a message and broadcasts it to the remaining follower nodes. When a certain number of follower nodes consider that the leader node is not suitable to continue as a leader and the high-weight follower node meets the conditions to become a leader, the leader node becomes a follower node, and the high-weight follower node becomes a leader node.
[0020] As a further technical solution, the candidate node sends a voting request to the follower node, and the follower node performs a multi-step verification process after receiving the voting request, specifically including:
[0021] The follower node checks whether the term number of the candidate node is greater than its own term number after receiving the voting request, confirms whether its log is the latest, and verifies whether its weight value is greater than the threshold.
[0022] In a second aspect, a Byzantine fault-tolerant consensus system based on BLS threshold signature and weight model is disclosed, comprising:
[0023] A key center distribution module is configured to: obtain the number of current nodes in the blockchain, and the key center generates a corresponding number of BLS public keys, private keys, and master public keys according to the number of nodes, distributes the BLS public keys and the master public keys to each node, and sends the private keys to the corresponding nodes separately;
[0024] A candidate node determination module is configured to: the nodes with high weight values in the current nodes of the blockchain calculate a random timeout time according to their weights, and become candidate nodes after reaching the timeout time;
[0025] A BLS signature module is configured to: the candidate node sends a voting request to the follower node, and the follower node performs a multi-step verification process after receiving the voting request, and if all verifications are passed, the follower node uses the private key to sign the voting request using BLS, and sends the signed vote to the candidate node;
[0026] A verification module is configured to: when the candidate node collects a set number of votes, the votes are aggregated, verified using the master public key, and verified to become a leader node and send the aggregated signature to the follower node in the heartbeat, and the follower node also uses the master public key to verify the correctness of the aggregated signature to determine whether the candidate node has collected enough votes;
[0027] A leader node request processing module is configured to: after the candidate node becomes a leader node, the leader node appends the request received from the client to the log and sends the request to the follower node in the heartbeat, the follower node verifies the request and appends it to the log, and returns the request to the leader node after signing it using BLS, and the leader node returns the signature to the client after aggregating a set number of correct signatures, and feeds back that the request has been successfully applied.
[0028] The Raft algorithm in the prior art itself consists of a leader, a candidate, and a follower, and the technical solution of the present application improves the state transition of each node and reduces the overhead of signature verification by adding BLS signature.
[0029] The above one or more technical solutions have the following beneficial effects:
[0030] The Byzantine fault-tolerant mechanism is realized by introducing the BLS threshold signature mechanism and the weight model on the basis of the Raft consensus algorithm. Through the threshold signature, only when the threshold number of nodes agree to vote can the leader node be elected, thereby preventing a malicious candidate node from being elected as the leader after claiming to have obtained enough votes. The weight model calculates a score according to the behavior of the node based on different parameters of the node, and the node with a higher weight is more likely to become a leader node and has the right to trigger the active retirement and passive retirement mechanism. In addition, the follower node signs the request sent by the client through the BLS threshold signature, and the client can verify the BLS aggregate signature to prove that the majority of nodes have appended the request, thereby reducing the calculation overhead of signature verification and improving the performance of the system. Secondly, the algorithm integrates the weight model, and the follower node with a high weight value is more likely to become a leader node, and the follower node will also join the weight value judgment when voting, thereby reducing the possibility of a malicious node becoming a leader node. In view of the scenario that the leader node has too large a load to affect the consensus efficiency, the active retirement mechanism and the passive retirement mechanism are proposed to ensure the high availability of the leader node.
[0031] Advantages of the additional aspects of the application will be partially given in the following description, partially will become apparent from the following description, or will be learned by the practice of the application. BRIEF DESCRIPTION OF DRAWINGS
[0032] The accompanying drawings, which form a part of the specification, are included to provide a further understanding of the application and are incorporated herein in conjunction with the description of the application. The drawings should not be used to construe the specification. The embodiments of the application will be described and explained with additional specificity and detail with the accompanying drawings.
[0033] Figure 1 A method flowchart of an embodiment of the application. DETAILED DESCRIPTION
[0034] It should be noted that the following detailed description is merely exemplary and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs.
[0035] It should be noted that the terms used herein are merely intended to describe specific embodiments and are not intended to limit the exemplary embodiments according to the application.
[0036] In the case of no conflict, the embodiments in the application and the features in the embodiments can be combined with each other.
[0037] Embodiment one
[0038] The embodiment discloses a Byzantine fault-tolerant consensus method based on a BLS threshold signature and a weight model, including the following steps:
[0039] Step one: system initialization, each node maintains the same weight value table Weight_Table = {Weight i ∣i∈{1,2,…,n}}, the system obtains the current number of nodes n, and the key center generates a corresponding number of BLS public keys Pk i , private keys Sk i and master public keys MPk according to the number of cluster nodes n, and the public keys Pk i and master public keys MPk are publicly distributed to each node, and the private keys Sk i are sent to the corresponding node separately, wherein the i-th node in the 1-n nodes receives Sk i .
[0040] Step two: the node Q with high weight value will calculate the random timeout time according to its weight, which has a higher probability of detecting the failure of the leader node earlier, and becomes a candidate node after reaching the timeout time.
[0041] Step three: the candidate node Q sends a voting request to the follower node, and the follower node checks whether the term number of the node Q is greater than its own term number after receiving the voting request, confirms whether its log is the latest, and verifies whether its weight value is greater than the threshold value. If all verifications are passed, the follower node uses the private key Sk i to BLS sign the voting request, and sends the signed vote to the node Q.
[0042] In this step, the candidate node Q sends a voting request to the follower node, which contains the term number and the latest log log of the node Q and its digital signature Sig from the client. After receiving the voting request, the follower node checks whether the term number of the node Q is greater than its own term number, confirms whether its log is from the client and at least as new as itself, and verifies whether its weight value is greater than the threshold value, which is usually the median of the weight list.
[0043] If Term Q >Term follower
[0044] If Weight Q >Threshold
[0045] verifySignature(Sig,log,Pk client )
[0046]
[0047] Term Q and Term followerThe term, weight, and threshold Q refer to the weight of Q, the threshold is usually the median of the weight list; Result is a judgment process, which returns true when the follower node has the latest log from the candidate and the latest log of the follower node is the latest log of the candidate; or returns true when the follower node does not contain the latest log of the candidate. Otherwise, it returns false.
[0048] If all verifications are passed, the follower node uses the private key Sk i to perform BLS signature on the vote request vote i , and sends the signed vote to node Q.
[0049] Step four: after collecting votes, the candidate node Q aggregates the votes, performs fast verification vote using the master public key MPk, and becomes the leader node after verification, and attaches the aggregated signature vote to the heartbeat sent to the follower node. The follower node can also use the master public key MPk to verify the correctness of the aggregated signature to determine whether Q has collected enough votes, thereby preventing false vote problems and vote reuse problems.
[0050] It should be noted that the existing Raft algorithm receives votes, and in the present embodiment, the number is selected to improve security, so that even if there are Byzantine nodes, the consensus will not be affected.
[0051] vote is the aggregated signature of the votes received by the candidate node. The candidate node sends a vote request to multiple follower nodes, and when the ith node agrees to vote, it sends vote i to the candidate node, and vote is the aggregated signature of vote i .
[0052] In the present embodiment, λ i is the Lagrange interpolation coefficient.
[0053] Step five: the leader node Q receives a request M from the client, appends the request to the log, and sends the request to the follower node in the heartbeat. The follower node appends the request M to the log after verification, and returns the request M to the leader node after BLS signature. The leader node can use the aggregated signature to prove to the client that it has correctly consensused the request. The leader node receives correct signatures, aggregates the signatures, and returns them to the client to prove that the request M has been successfully applied.
[0054] BLS threshold signature is a threshold signature algorithm constructed by Shamir secret sharing method on the basis of BLS signature scheme, and the principle is based on Lagrange difference method. The key center selects a large prime number p, a bilinear mapping e:G1xG2→G T (where G1, G2 are two multiplicative cyclic groups of order p, G T is the target group) and a hash function H:{0,1} * →G1 responsible for mapping the message m to the group G1.
[0055] In the system initialization phase, the key center randomly selects a master private key MSk∈Z p , and obtains the master public key MSk∈Z p , selects a polynomial F of order Z p on Z , which satisfies F(0)=MSk, Sk i =F(i), public the master public key MPk and the public keys Pk i of all nodes. P is a large prime number, and Z p represents a finite field, that is, the set of integers modulo p.
[0056] After receiving the message m, the node i performs BLS signature After receiving the correct signature of different nodes, the leader node uses the Lagrange interpolation polynomial to aggregate these partial signatures into a complete signature σ:
[0057]
[0058] Where λ i is the Lagrange interpolation coefficient, and the calculation method is as follows:
[0059]
[0060] Whether enough votes are received and whether the majority of nodes apply the client command can be determined by verifying e(σ,g2)?=e(H(m),MPk). The meaning of the above formula is to determine whether the master public key Mpk can be used to verify the aggregated signature σ. If the equation is established, it indicates that the verification is passed.
[0061] Step six: When the node Q is overloaded and the consensus efficiency is low, Q triggers the active retirement mechanism, Q broadcasts an active retirement request R to high-weight nodes, high-weight follower nodes evaluate their performance indicators, if the load is small, a random number is generated according to the verifiable random function VRF and sent to the leader node, the leader node Q selects the node P with the smallest random number as the backup leader node, Q synchronizes the latest log to the backup leader node P and becomes a follower node, P node completes the log synchronization and becomes a candidate node, initiates a new round of voting request, and becomes a leader node when collecting votes. Wherein R i = VRF (HighWeightFolloweri i ); P = min i (R i ). The formula indicates that the i-th node in the high-weight node generates a random value R i according to the verifiable random function, and P is the minimum value of the random number generated by the i nodes.
[0062] The verifiable random function VRF is used for the leader to trigger the active retirement mechanism to randomly select the backup leader node. The verifiable random function can generate a random value and provide a proof, so that any node can verify that the random value is generated by a specific input, while ensuring that the input value will not be leaked. The verifiable random function of the scheme can randomly select a node from the high-weight value node to become a leader node, and the randomness can prevent the Byzantine node from targeted attack.
[0063] VRF relies on a pair of public and private keys to ensure its security: private key x: used to generate random values and corresponding proofs. Public key p: used to verify the correctness of random values and proofs. Each node generates a public and private key pair (p, x) on an elliptic curve according to the specified elliptic curve parameters. The scheme uses Curve25519 elliptic curve to generate public and private key pairs, where g is the generator of the elliptic curve.
[0064] Step seven: Node Q is a leader node, when a high-weight follower node P receives a delayed leader heartbeat multiple times, it will think that the load of the leader node Q is too large to affect the consensus efficiency, and trigger the passive retirement mechanism. Node P aggregates its term number and log and passive retirement request into a message S and broadcasts it to the remaining follower nodes, when follower nodes think that node Q is not suitable to continue to be elected as a leader node and node P meets the conditions to become a leader node, node Q becomes a follower node and node P becomes a leader node.
[0065] Leader node Q is overloaded to trigger the active retirement mechanism. The purpose of active retirement is to switch the leader node, which can make the node state better node to process the client's request and improve the processing capacity. Q broadcasts the active retirement request R to the high weight node, and the high weight follower node evaluates its performance indicators. If the load is small, it is considered to be capable of taking over the leader node. If the follower node intends to campaign for the preparatory leader node, the steps are as follows:
[0066] 1. The follower node hashes the active retirement request R to a point on the curve, where h is the SHA512 hash function, f is the Elligator mapping function, H is the mapping of bytes to points on the curve, and the order of the group is 8l, l is a prime number. f(h(R)) 8 Map this hash value to the elliptic curve. Raise it to the 8th power to ensure that it is in a subgroup of order l.
[0067] H(R) = f(h(R)) 8
[0068] 2. The follower node generates a VRF random value, where H(R) x is the scalar multiplication of point H(R).
[0069] VRF x (R) = h(R, H(R) x )
[0070] 3. The follower node generates proof
[0071] r = h(x, n): a deterministic random source r derived from the private key x.
[0072] Calculate c = h(R, g r , H(R) r t = r - c · x ii = H(R) x
[0073] Generated proof: proof = (c, t, ii)
[0074] 4. The follower node sends the random number VRF and the proof proof to the leader node, and the leader node verifies the proof
[0075] Calculate the point: A = g t · p c , B = H(R) t · ii c
[0076] Calculate: x' = h(R, A, B)
[0077] Verify: VRF == h(n, ii), c' == c
[0078] If the above two equations are established, the proof and the random number VRF are valid, the leader node selects the node with the smallest random number as the backup leader node, broadcasts the random number and the proof, and the remaining follower nodes can determine whether the process is fair and reasonable by verifying whether the proof and the random number are correct. The leader node synchronizes its latest log to the backup leader and becomes a follower, and then the backup leader becomes a candidate node to start a new election.
[0079] When a high-weight follower node P receives a heartbeat delay from a leader node Q multiple times, it considers that the leader node Q has too large a load to affect the consensus efficiency and is not suitable to continue to serve as the leader, and the node P triggers the passive retirement mechanism of the leader. The passive retirement mechanism is a supplement to the active retirement mechanism. There may be a Byzantine node that becomes a leader node but does not trigger the active retirement, intentionally processes client requests slowly, and reduces the performance of the entire cluster. The passive retirement mechanism enables the remaining follower nodes to have a supervisory effect.
[0080] The specific steps are as follows:
[0081] 1. The node P aggregates the self-vote request and the passive retirement request into a message S and broadcasts it to the remaining follower nodes.
[0082] 2. After receiving the message S, the follower node first checks whether there are multiple delays in the heartbeat request sent by the leader node Q to itself. If not, the passive retirement vote is rejected. If there are heartbeat delays in the leader node Q, the term number and the log in the message S are checked, and the steps are consistent with the verification of the candidate node vote request.
[0083] 3. When When the above follower node considers that the node Q has a heartbeat delay and is not suitable to continue to serve as the leader and the node P meets the conditions for becoming a leader node, the node Q passively gives up the identity of the leader node and becomes a follower node, and the node P becomes a leader node.
[0084] The weight model can be designed individually according to different application scenarios. For example, in an application scenario with high requirements for network delay, the calculation weight of the node response time can be increased. The system mainly calculates the weight value according to the total number of honest feedbacks F h , the total number of error feedbacks F e , the number of Byzantine behaviors B, and the average response time R t of the node.
[0085] The weight value calculation reference is as follows:
[0086] 1. Set the initial weight value W0 of each node.
[0087] 2. Set the feedback ratio Rf , update weight value W1 = W0 x R f .
[0088]
[0089] 3. Set the Byzantine behavior penalty coefficient k b ∈(0,1), update weight value Reward = W1 - W2, divide Reward equally to other non-Byzantine nodes. If there is no Byzantine behavior B = 0, update weight value
[0090] 4. Set the node average response time coefficient k t ∈(0,1), update weight value
[0091]
[0092] 5. The weight value of each node is mapped to the [0,1] interval to obtain the weight Weight through the maximum and minimum normalization method.
[0093]
[0094] The specific role of the weight model is as follows:
[0095] Optimize leader node selection: The timeout time of the node is based on the original random timeout time plus the weight index, so that the node with high weight is more likely to become the leader node. High weight indicates that the node has high availability and high credit, and making high weight node become the leader can enhance the robustness of the system. Set T min = 150 ms, T max = 300 ms.
[0096] Generate the basic random timeout time T base :
[0097] T base = T min + rand(0,1) x (T max -T min )
[0098] Adjust the timeout time T final based on weight:
[0099] T final = T base -W x (T base -T min ).
[0100] Prevent vote split: the timeout time is affected by the weight index, so that the timeout time of each node has difference. This mechanism can prevent the occurrence of vote split, thereby avoiding the situation that the leader node cannot be elected.
[0101] Ensure the authority and stability of the leader: the follower node checks whether the weight value of the candidate node is higher than the preset threshold when voting. Only the node with high weight can be elected as the leader, thereby ensuring the high availability of the leader.
[0102] Application in retirement mechanism: in the retirement mechanism of the system, the follower node with high weight can select a new leader node through the weight model and the verifiable random function.
[0103] Embodiment two
[0104] The purpose of this embodiment is to provide a computer device, including a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0105] Embodiment three
[0106] The purpose of this embodiment is to provide a computer readable storage medium.
[0107] A computer readable storage medium, having a computer program stored thereon, the program being executed by a processor to perform the steps of the above method.
[0108] Embodiment four
[0109] The purpose of this embodiment is to provide a Byzantine fault-tolerant consensus system based on BLS threshold signature and weight model, including:
[0110] A key center distribution module is configured to: obtain the number of current nodes in the blockchain, and the key center generates a corresponding number of BLS public keys, private keys and master public keys according to the number of nodes, distributes the BLS public keys and the master public keys to each node publicly, and sends the private keys to the corresponding nodes separately;
[0111] A candidate node determination module is configured to: the node with high weight value in the current nodes of the blockchain calculates a random timeout time according to its weight, and becomes a candidate node after reaching the timeout time;
[0112] A BLS signature module is configured to: the candidate node sends a voting request to the follower node, the follower node performs multi-step verification processing after receiving the voting request, and if all verifications are passed, the follower node uses the private key to perform BLS signature on the voting request, and sends the signed vote to the candidate node;
[0113] The verification module is configured to aggregate the votes when the candidate node collects a set number of votes, verify using the master public key, and become a leader node upon verification and send the aggregated signature to the follower nodes in the heartbeat, and the follower nodes verify the correctness of the aggregated signature using the master public key to determine whether the candidate node has collected enough votes.
[0114] The leader node request processing module is configured to, after the candidate node becomes the leader node, append the request received from the client to the log as the leader node and send the request to the follower nodes in the heartbeat, append the request to the log after the follower nodes verify the request, and return the request to the leader node after the request is BLS signed, and return the signature to the client after the leader node receives a set number of correct signatures, and feed back that the request has been successfully applied.
[0115] Embodiment five
[0116] The purpose of the present embodiment is to provide a computer program product containing instructions which, when run on a computer, cause the computer to perform the method and functions involved in any of the above embodiments.
[0117] The steps and method embodiments involved in the above embodiments correspond to embodiment one, and the specific implementation can refer to the relevant description part of embodiment one. The term "computer readable storage medium" should be understood to include a single medium or multiple media containing one or more instruction sets; it should also be understood to include any medium capable of storing, encoding, or carrying instruction sets for execution by a processor and causing the processor to perform any of the methods in the present application.
[0118] Those skilled in the art should understand that the above-mentioned modules or steps of the present application can be realized by a general computer device, alternatively, they can be realized by program codes executable by a computing device, so that they can be stored in a storage device for execution by a computing device, or they can be made into individual integrated circuit modules, or a plurality of modules or steps among them can be made into a single integrated circuit module. The present application is not limited to any specific combination of hardware and software.
[0119] The above describes the specific embodiments of the present application in combination with the accompanying drawings, but is not a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications or variations made by those skilled in the art on the basis of the technical solutions of the present application without creative labor are still within the scope of protection of the present application.
Claims
1. A Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model, characterized in that, The application comprises the following steps: Obtain the number of current nodes in the blockchain, and the key center generates a corresponding number of BLS public keys, private keys and master public keys according to the number of nodes, and distributes the BLS public keys and master public keys to each node, and sends the private keys to the corresponding nodes respectively; The nodes with high weight values in the current nodes of the blockchain calculate random timeout time according to their weights, and become candidate nodes after reaching the timeout time; The candidate nodes send a voting request to the follower nodes, and the follower nodes perform multi-step verification processing after receiving the voting request, and if all verifications are passed, the follower nodes use the private key to perform BLS signature on the voting request, and send the signed vote to the candidate node; When the candidate node collects a certain number of votes, it aggregates the votes, verifies them using the master public key, and becomes a leader node if the verification is passed, and sends the aggregated signature to the follower nodes in the heartbeat, and the follower nodes also use the master public key to verify the correctness of the aggregated signature to determine whether the candidate node has collected enough votes; After the candidate node becomes the leader node, the leader node appends the request received from the client to the log and sends the request to the follower nodes in the heartbeat, and the follower nodes append the request to the log after verifying the request, and return the request to the leader node after signing the request with BLS, and the leader node returns the signature aggregation to the client after receiving a certain number of correct signatures, and feeds back that the request has been successfully applied; Further comprising: when the candidate node becomes the leader node, the leader node triggers the active retirement mechanism when the load is too large and the consensus efficiency is low; Further comprising: when a high-weight follower node receives a delayed leader heartbeat for multiple times, it is considered that the load of the leader node is too large to affect the consensus efficiency, and the passive retirement mechanism is triggered.
2. The Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model according to claim 1, characterized in that, The leader node triggers the active retirement mechanism, specifically: the leader node broadcasts an active retirement request to the nodes with high weights, the follower nodes with high weights evaluate their performance indicators, and if the load is small, they generate a random number according to a verifiable random function and send it to the leader node, the leader node selects the node with the smallest random number as the backup leader node, the leader node synchronizes its latest log to the backup leader node and becomes a follower node, the high-weight follower node becomes a candidate node after completing log synchronization, and initiates a new round of voting request, and becomes a leader node after collecting a certain number of votes.
3. The Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model according to claim 1, characterized in that, When the passive retirement mechanism is triggered: the high-weight follower node aggregates its term number, log and passive retirement request into a message and broadcasts it to the remaining follower nodes, and when a certain number of follower nodes think that the leader node is not suitable to continue to be elected as the leader and the high-weight follower node meets the conditions to become the leader, the leader node becomes a follower node, and the high-weight follower node becomes a leader node.
4. The Byzantine fault-tolerant consensus method based on BLS threshold signature and weight model according to claim 1, wherein the candidate The node sends a voting request to the follower node, and the follower node performs multi-step verification processing after receiving the voting request, specifically including: The follower node checks whether the term number of the candidate node is greater than its own term number, confirms whether its log is the latest, and verifies whether its weight value is greater than a threshold value.
5. A Byzantine fault-tolerant consensus system based on BLS threshold signature and weight model, characterized in that, The application comprises the following steps: A key center distribution module is configured to: obtain the number of current nodes in the blockchain, and generate a corresponding number of BLS public keys, private keys and master public keys according to the number of nodes, distribute the BLS public keys and the master public keys to each node, and send the private keys to the corresponding nodes separately; A candidate node determination module is configured to: the node with a high weight value in the current nodes of the blockchain calculates a random timeout time according to the weight, and becomes a candidate node after reaching the timeout time; A BLS signature module is configured to: the candidate node sends a voting request to a follower node, the follower node performs multi-step verification processing after receiving the voting request, if all verifications are passed, the follower node performs BLS signature on the voting request using the private key, and sends the signed vote to the candidate node; A verification module is configured to: when the candidate node collects a set number of votes, the votes are aggregated, verified using the master public key, and verified to become a leader node and send the aggregated signature to the follower node in the heartbeat, and the follower node verifies the correctness of the aggregated signature using the master public key to determine whether the candidate node has collected enough votes; A leader node request processing module is configured to: after the candidate node becomes the leader node, the leader node appends the request received from the client to the log and sends the request to the follower node in the heartbeat, the follower node appends the request to the log after verifying the request, and returns the request to the leader node after performing BLS signature on the request, the leader node receives a set number of correct signatures, aggregates the signatures, and returns the signatures to the client, and feeds back that the request has been successfully applied; Further comprising: when the leader node triggers the active retirement mechanism when the leader node is overloaded and the consensus efficiency is low; Further comprising: when a high-weight follower node receives a delayed leader heartbeat for multiple times, it is considered that the leader node is overloaded and affects the consensus efficiency, and the passive retirement mechanism is triggered.
6. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-4.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the steps of the method of any one of claims 1-4.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to perform the steps of the method of any one of claims 1-4.
Citation Information
Patent Citations
Anti-Byzantine error node consensus method based on threshold signature
CN116015674A
Enterprise-level-oriented composite block chain double-layer consensus method
CN118400086A