Dynamic PBFT consensus method based on user preference and reputation value
By introducing reputation value mechanism and user preference model, dynamic scoring and grouping mechanism, the PBFT method solves the problem of inconsistent performance bottlenecks of Byzantine nodes, master nodes and consensus nodes, and improves the security and efficiency of the consortium chain.
Patent Information
- Application Number
- CN202411839456.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The PBFT method has limitations in dealing with the problems of performance bottlenecks of Byzantine nodes, master nodes, and consensus nodes, resulting in the impact of system security and efficiency.
A reputation value mechanism is introduced to evaluate the reputation of nodes, dynamic scoring and grouping mechanisms, select nodes with a reputation value above 30 and the score is the main node, and customize the consensus node selection rules through the user preference model, and nodes with excellent grouping and election performance are used as core nodes to participate in consensus.
It significantly improves the security, adaptability and consensus efficiency of the alliance chain, reduces the impact of Byzantine nodes, and enhances the system's fault tolerance and high availability.
Smart Images

Figure CN119760773A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain consensus, and in particular to a dynamic PBFT consensus method based on user preferences and reputation values. Background Art
[0002] Blockchain is a shared, immutable, distributed transaction ledger that can be replicated and distributed across the network. Blockchain is well-known for its immutability and has been widely used in government, healthcare and other fields in recent years. The consensus algorithm is the core component of the blockchain system, ensuring that all nodes reach a consensus on the specific details of the transaction in a non-centralized network. The PBFT method is a classic consensus method among many consensus methods. It solves the famous Byzantine Generals Problem and performs well in fault tolerance and latency performance, so it is widely used.
[0003] However, the PBFT method also has its limitations, which are mainly reflected in the following aspects:
[0004] 1. Byzantine node problem: Although the PBFT method can identify Byzantine nodes, it does not take measures to deal with these Byzantine nodes, which is intolerable for the system. The PBFT method simply elects the master node by view number, and there is a probability that a Byzantine node will be elected as the master node, and the election of a Byzantine node as the master node will cause great harm to the system.
[0005] 2. Master node performance bottleneck: In the PBFT method, the master node needs to receive client requests and broadcast these requests to other replica nodes in the system. In addition, it needs to verify the legitimacy of the transaction. If the master node performance is insufficient, it will have a serious impact on the entire consensus process and efficiency.
[0006] 3. Inconsistent performance of consensus nodes: The PBFT algorithm regards all nodes except the master node as slave nodes, and all slave nodes participate in the consensus. The poor performance of some nodes may cause delays in the entire consensus process, which is intolerable for blockchain systems with high performance requirements.
[0007] In order to overcome the above shortcomings and improve the efficiency and security of the PBFT method, the present invention proposes a dynamic PBFT consensus method based on user preferences and reputation values. Summary of the invention
[0008] The present invention introduces a reputation value mechanism to evaluate the reputation of nodes, processes Byzantine nodes with low reputation values, and introduces a user preference model to allow users to customize consensus node selection rules. On this basis, the master node is selected to reduce the performance bottleneck problem of the master node, and then the top 50% of the nodes in performance are selected as core nodes to participate in the consensus through a grouping mechanism to improve the consensus efficiency.
[0009] The present invention proposes a dynamic PBFT consensus method based on user preference and reputation value, the steps are as follows:
[0010] S1. Authentication is performed on nodes joining the alliance chain, and an initial reputation value is given after passing.
[0011] S2. Build a user preference scoring model based on the user's personalized needs and score all nodes in the alliance chain;
[0012] S3, divide the nodes into core nodes and auxiliary nodes according to the scores;
[0013] S4. Elect the master node with the highest score and the credibility that meets the requirements among the core nodes;
[0014] S5. The client sends a request to the master node. After receiving the request, the master node verifies it. If the transaction and signature are correct, a PRE-PREPARE message is generated and broadcast to the core node.
[0015] S6. After receiving the PRE-PREPARE message, the core node verifies it and discards it if it is inconsistent. Otherwise, it generates a PREPARE message and broadcasts it to other core nodes.
[0016] S7. If a Byzantine node is found during the consensus process, the SCLEAN protocol will be executed to blacklist the Byzantine node.
[0017] S8. If a core node receives 2f+1 or more verified PREPARE messages, it generates a COMMIT message and broadcasts it to other core nodes and the master node;
[0018] S9. If the core node receives 2f+1 or more valid COMMIT messages, a consensus is reached and the client is eventually replied.
[0019] The specific working principle of the present invention is as follows:
[0020] (1) The traditional PBFT method elects the master node simply by view number, which may cause the probability of electing a Byzantine node as the master node. The present invention introduces a reputation value mechanism to evaluate each node. Only nodes with a reputation score higher than 30 are eligible to participate in the election of the master node, thereby greatly reducing the probability of a Byzantine node being elected as the master node through election.
[0021] In addition, the traditional PBFT method does not perform any subsequent processing on the Byzantine nodes, which will reduce the security of the system and cause the system performance to degrade. The present invention introduces a reputation value mechanism. When a node's reputation value is equal to 0, the node is considered to be a Byzantine node. We define participation in consensus as the message submitted by the node is consistent with the message of the majority (more than 2f nodes). When a Byzantine node is detected, the SCLEAN protocol will be activated to remove the Byzantine node from the blockchain system.
[0022] (2) In order to meet the different requirements of consensus efficiency, security and other requirements of different application scenarios, for example, in financial scenarios, we will pay more attention to security, while in IoT scenarios, we will need a low-latency and high-efficiency consensus process. The present invention introduces a user preference model to enhance the selection process by allowing a more customized and dynamic consensus node selection method. The user preference model proposed in the present invention is a numerical preference model and a priority preference model. The specific user preference model strategy is as follows:
[0023] Numerical preference model: This model uses a scoring function, takes the node parameters (a) and the assigned value (f) as input, and returns the score of the node. All scores are finally summarized to get the total score (Σ). The scoring function used by the numerical preference model is:
[0024] f(s)=a×f
[0025] Algorithm execution steps:
[0026]
[0027] The numerical preference model works as follows: the variable Σ=0 is initialized in the first line, and the user-defined parameter list Π is traversed in turn from the second line to the fifteenth line to determine the current Π i It is computing power or disk size or latency or cost, then let Σ plus the value of the parameter corresponding to the current node multiplied by the score assigned to the current parameter, and finally return the total score Σ to compare the size of Σ.
[0028] Priority Preference Model: This model is different from the numerical preference model. It takes the order of the parameters given by the user as the priority and compares the parameters of the user's favorite nodes to calculate the score. If the scores are equal, the parameters of other nodes will be considered.
[0029] The parameters required by the algorithm are consistent with the numerical preference model. The specific execution steps are as follows:
[0030]
[0031]
[0032] The priority model works as follows: in the first line, the variable Σ is initialized to 0, and in the second to fifteenth lines, the user-defined parameter list Π is traversed in turn to determine the current Π i It is computing power or disk size or latency or cost, then let Σ add the value of the parameter corresponding to the current node, and finally return Σ.
[0033] (3) In order to improve the consensus efficiency, solve the delay and security issues that may be caused by low-performance nodes and master nodes in the consensus process of PBFT. The present invention divides the nodes into two groups after the user preference model is sorted. The top 50% of the nodes are core nodes, and the bottom 50% are auxiliary nodes. In addition, we elect the master node as the node with a reputation value higher than 30 and the highest score among the core nodes, which is responsible for organizing the consensus process. The auxiliary node can undertake tasks such as detecting Byzantine behavior and state synchronization.
[0034] The beneficial effects of the present invention are as follows: the present invention introduces a reputation value mechanism, a user preference model and a grouping mechanism, which greatly improves the security, adaptability and consensus efficiency of the alliance chain. The present invention can generate a reputation value for each node after each round of consensus by dynamically scoring the reputation value of the node, ensuring that nodes with low reputation values are not elected as master nodes, and that Byzantine nodes can be dynamically removed during each consensus process to ensure the security of the system. The user preference model is also introduced, and different parameters can be selected for different scenarios to select consensus nodes, which significantly improves the adaptability of the system and better meets the diverse application requirements. At the same time, it also solves the security problems caused by the simplicity of the master node election algorithm of the traditional PBFT method. In addition, we also group the nodes sorted by the user preference model, which further improves the consensus efficiency and enhances the fault tolerance of the system. The above innovations enable the alliance chain system to more efficiently handle large-scale transaction requests in different complex scenarios, while maintaining security and high availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Designed for a dynamic PBFT consensus solution based on user preferences and reputation.
[0036] Figure 2 It is a flow chart of the present invention.
[0037] Figure 3 This is the dynamic PBFT consensus process based on user preferences and reputation values of the present invention. DETAILED DESCRIPTION
[0038] The following is a further description of the dynamic PBFT consensus method based on user preference and reputation value of the present invention in conjunction with specific embodiments.
[0039] The embodiments of the present invention and their implementation process are described as follows:
[0040] The specific design of the dynamic PBFT consensus method based on user preferences and reputation is as follows: Figure 1 As shown, the specific execution process of the method is as follows Figure 2 As shown, the specific steps are as follows:
[0041] S1. The newly joined node in the alliance chain submits its detailed identity information to the CA. After the CA verifies the authenticity of the submitted information, it issues a digital certificate to the node and assigns a reputation value of 50 to each newly joined node. The following steps are included:
[0042] S11. Definition of reputation value;
[0043] (1) In the kth round of consensus, if the message submitted by the node is consistent with the message of the majority (more than 2f nodes), the reputation value of the node will increase;
[0044] (2) If the message submitted by a node is inconsistent with the message of the majority (more than 2f nodes) or the node does not participate in the vote, the node’s reputation value will be reduced;
[0045] (3) Define the reputation value C of node x x Initial value is 50, and the range is [0,100];
[0046] (4) According to the above rules, we define the node reputation value C after participating in the consensus for the k+1th time x (k+1) is:
[0047] ① The message submitted by the node is consistent with the majority message:
[0048] C x (k+1)= α· C x (k)+β (0.8<α<1, 10<β<20) (1)
[0049] ②The message submitted by the node is inconsistent with the majority:
[0050] C x (k+1)= α· C x (k)-β (0.8<α<1, 10<β<20) (2)
[0051] ③Nodes do not participate in voting:
[0052] C x (k+1)= C x (k)-β (10<β<20) (3)
[0053] S12, broadcast the reputation value and update the reputation value list of each node;
[0054] S2. The system builds a user preference scoring model based on user personalization requirements and scores all nodes in the alliance chain, which includes the following steps:
[0055] S21, the user selects a numerical preference model or a priority preference model;
[0056] S22. The user inputs an array Π and an array Γ, where Π contains the user-defined parameter requirements and the corresponding score values, and Γ contains the node parameters and their corresponding values. The user-defined parameter requirements are computing power, network speed, disk size, etc., and the score value is the corresponding weight of the requirement;
[0057] S23. Calculate the score Σ of each node according to the user input.
[0058] S3. Use the quick sort algorithm to sort nodes according to their scores, and select the top 50% of the nodes as core nodes, and the bottom 50% as auxiliary nodes. The core nodes are mainly responsible for organizing consensus processes and executing smart contracts, while the auxiliary nodes are mainly responsible for detecting Byzantine behavior and state synchronization.
[0059] S4. In the core node, the reputation value of the node is determined from high to low according to the score size. If the reputation value is greater than 30, the node is selected as the master node, which is responsible for organizing and broadcasting requests in the consensus process.
[0060] S5. The client initiates a request to the master node<REQUEST,o,t,c> σc , where o is the specific operation requested, t is the timestamp, c is the client's unique ID, σ c Sign for the client. The master node verifies it after receiving it, and generates a PRE-PREPARE message if it is correct.<PRE-PREPARE,v,n,d> σp And broadcast to the core nodes, where v is the view number, n is the sequence number, d is the message content summary, σ p Sign for the master node.
[0061] S6. The core node receives the PRE-PREPARE message and performs verification. If it passes, it generates a PREPARE message<PREPARE,v,n,d,i> σx Broadcast to other core nodes, i is the current node ID, σ x is the signature of node x.
[0062] S7. If a Byzantine node is found during the consensus process, the SCLEAN protocol will be executed to blacklist the Byzantine node and prohibit it from joining. The steps are as follows:
[0063] S71: When it is detected that the reputation value of node x is 0, a SCLEAN message is sent to other core nodes.<SCLEAN,v+1,h,e,i> σx , where v is the current attempt number, h is the current block summary, e is the Byzantine node ID, and i is the node ID that sends the message;
[0064] S72. When the master node receives 2f+1 or more valid SCLEAN messages, it will broadcast a NEW-VIEW to all core nodes except the Byzantine node x.<NEW-VIEW,v+1,h,e,i> information;
[0065] S73. When all core nodes except node x reach a consensus and confirm that node x is a Byzantine node, they will mark node x as a Byzantine node and record it in their own node information list. At the same time, the node sends a message SCLEAN-REPLY to the node authentication center.<SCLEAN-REPLY,v+1,z,i> σx ;
[0066] S74. When the node authentication center receives valid messages from 2f+1 different nodes, it will add node x to the blacklist and prohibit node x from joining the system.
[0067] S8. When the core node receives 2f+1 or more valid PREPARE messages, it enters the submission phase and generates a COMMIT<COMMIT,v,n,d,i> σx The message is then broadcast to other core nodes.
[0068] S9. If the core node receives 2f+1 or more valid COMMIT messages, it reaches a consensus, executes the request operation, and replies REPLY to the client.<REPLY,v,t,c,r,i> σx , where r is the execution result.
[0069] The present invention introduces the shortcomings of the PBFT method, and then proposes a dynamic PBFT consensus method based on user preferences and reputation values to address its shortcomings. The method introduces a user preference model, allowing users to customize parameters to elect consensus nodes. In addition, the reputation values of nodes are dynamically calculated. Only nodes with qualified reputation values can be elected as master nodes, and Byzantine nodes can be discovered and processed in a timely manner during the consensus process, reducing the impact of Byzantine nodes. The user preference model introduced in the present invention significantly improves the adaptability of the system, better meets the diverse application requirements, and also greatly reduces the probability of the master node being a Byzantine node in combination with the reputation value mechanism, and can dynamically process Byzantine nodes, improving the security and robustness of the system. In addition, by grouping the consensus nodes, the consensus efficiency of the system is significantly improved.
[0070] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A dynamic PBFT consensus method based on user preferences and reputation, characterized by: The following steps are involved: S1. Authentication is performed on nodes that join the alliance chain, and an initial reputation value is given after passing the authentication; S2. Build a user preference scoring model based on the user's personalized needs and score all nodes in the alliance chain; S3. Divide the nodes into core nodes and auxiliary nodes according to the scores; S4. Elect the node with the highest score and the credibility that meets the requirements among the core nodes as the master node; S5. The client sends a request to the master node. After receiving the request, the master node verifies it. If the transaction and signature are correct, a PRE-PREPARE message is generated and broadcast to the core node. S6. After receiving the PRE-PREPARE message, the core node verifies it and discards it if it is inconsistent. Otherwise, it generates a PREPARE message and broadcasts it to other core nodes. S7. If a Byzantine node is found during the consensus process, the SCLEAN protocol is executed to blacklist the Byzantine node. S8. If a core node receives 2f+1 or more verified PREPARE messages, it generates a COMMIT message and broadcasts it to other core nodes and the master node; S9. If the core node receives 2f+1 or more valid COMMIT messages, it reaches a consensus and responds to the client.
2. According to claim 1, a dynamic PBFT consensus method based on user preference and reputation value is characterized in that: In step S1, when a node joins the consortium chain, it submits its detailed identity information to the CA. After the CA verifies the authenticity of the submitted information, it issues a digital certificate to the node and assigns a reputation value of 50 to each newly joined node. The following steps are included: S11. Definition of reputation value; (1) In the kth round of consensus, if the message submitted by the node is consistent with the message of the majority (more than 2f nodes), the reputation value of the node will increase; (2) If the message submitted by a node is inconsistent with the message of the majority (more than 2f nodes) or the node does not participate in the vote, the node’s reputation value will be reduced; (3) Define the reputation value C of node x x Initial value is 50, and the range is [0,100]; (4) According to the above rules, we define the node reputation value C after participating in the consensus for the k+1th time x (k+1) is: ① The message submitted by the node is consistent with the majority message: C x (k+1)= α· C x (k)+β (0.8<α<1, 10<β<20) (1) ②The message submitted by the node is inconsistent with the majority: C x (k+1)= α· C x (k)-β (0.8<α<1, 10<β<20) (2) ③Nodes do not participate in voting: C x (k+1)= C x (k)-β (10<β<20) (3) S12. Broadcast the reputation value and update the reputation value list of each node.
3. According to claim 1, a dynamic PBFT consensus method based on user preference and reputation value is characterized in that: In step S2, the system builds a user preference scoring model based on the user's personalized requirements and scores all nodes in the alliance chain, which includes the following steps: S21. The user selects a numerical preference model or a priority preference model; S22. The user inputs array Π and array Γ, where Π contains the user-defined parameter requirements and the corresponding score values, and Γ contains the node parameters and their corresponding values. The user-defined parameter requirements are computing power, network speed, disk size, etc., and the score value is the corresponding weight of the parameter requirement; S23. Calculate the score Σ of each node according to the user input.
4. According to claim 1, a dynamic PBFT consensus method based on user preference and reputation value is characterized in that: In step S3, the quick sort algorithm is used to sort the nodes according to their scores, and the top 50% of the nodes are selected as core nodes, and the bottom 50% are selected as auxiliary nodes. The core nodes are mainly responsible for organizing consensus processes and executing smart contracts, while the auxiliary nodes are mainly responsible for detecting Byzantine behavior and state synchronization.
5. According to claim 1, a dynamic PBFT consensus method based on user preference and reputation value is characterized in that: In step S4, the core node determines whether the node's reputation value is greater than 30 according to the score size, from high to low. If the result reputation value is greater than 30, the node is selected as the master node, which is responsible for organizing and broadcasting requests in the consensus process.
6. A dynamic PBFT consensus method based on user preference and reputation value according to claim 1, characterized in that: In step S5, the client initiates a request to the master node<REQUEST,o,t,c> σc , where o is the specific operation requested, t is the timestamp, c is the client's unique ID, σ c Sign for the client. The master node verifies it after receiving it, and generates a PRE-PREPARE message if it is correct.<PRE-PREPARE,v,n,d> σp And broadcast to the core nodes, where v is the view number, n is the sequence number, d is the message content summary, σ p Sign for the master node.
7. A dynamic PBFT consensus method based on user preference and reputation value according to claim 1, characterized in that: In step S6, the core node receives the PRE-PREPARE message and performs verification. If it passes, it generates a PREPARE message.<PREPARE,v,n,d,i> σx Broadcast to other core nodes, i is the current node ID, σ x is the signature of node x.
8. According to claim 1, a dynamic PBFT consensus method based on user preference and reputation value is characterized in that: In step S7, if a Byzantine node is found during the consensus process, the SCLEAN protocol will be executed to blacklist the Byzantine node and prohibit it from joining. The steps are as follows: S71. When detecting that the reputation value of node x is 0, send a SCLEAN message to other core nodes<SCLEAN,v+1,h,e,i> σx , where v is the current attempt number, h is the current block summary, e is the Byzantine node ID, and i is the node ID that sends the message; S72. When the master node receives 2f+1 or more valid SCLEAN messages, it will broadcast a NEW-VIEW to all core nodes except the Byzantine node x.<NEW-VIEW,v+1,h,e,i> information; S73. When all core nodes except node x reach a consensus and confirm that node x is a Byzantine node, they will mark node x as a Byzantine node and record it in their own node information list. At the same time, the node sends a message SCLEAN-REPLY to the node authentication center.<SCLEAN-REPLY,v+1,z,i> σx ; S74. When the node authentication center receives valid messages from 2f+1 different nodes, it will add node x to the blacklist and prohibit node x from joining the system.
9. A dynamic PBFT consensus method based on user preference and reputation value according to claim 1, characterized in that: In step S8, when the core node receives 2f+1 or more valid PREPARE messages, it enters the commit phase and generates a COMMIT<COMMIT,v,n,d,i> σx The message is then broadcast to other core nodes.
10. A dynamic PBFT consensus method based on user preference and reputation value according to claim 1, characterized in that: In step S9, if the core node receives more than 2f valid COMMIT messages, it reaches a consensus, executes the request operation, and replies REPLY to the client.<REPLY,v,t,c,r,i> σx , where r is the execution result.
Citation Information
Patent Citations
Byzantine fault-tolerant consensus method and system based on node score
CN113259179A
Packet Byzantine fault-tolerant algorithm based on dynamic trust model
CN115271724A
PBFT consensus mechanism based on reputation model
CN116015672A
Improved and optimized PBFT consensus method and system applied to alliance chain
CN116405502A
PBFT improved algorithm based on contribution value model and verifiable random function
CN117749383A
Cited By
Payment order full-process intelligent processing method, device and equipment and storage medium
CN121010362A