Improved alliance chain consensus method and system based on contribution degree and grouping
By introducing contribution and grouping strategies into the consortium chain, the node with the highest contribution is selected as the main node, and combining PoC and PBFT algorithms, the performance and scalability problems of the consortium chain consensus algorithm in large-scale networks are solved, achieving high efficiency, A security consensus process.
Patent Information
- Application Number
- CN202411224185.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Existing alliance chain consensus algorithms such as Byzantine fault-tolerant consensus algorithm (PBFT) have problems such as unbalanced performance, large communication overhead, increased latency and poor system scalability, which limits its application in large-scale networks.
A comprehensive alliance chain consensus method (CG-PBFT) based on contribution degree and packet is proposed to reduce communication complexity between nodes through grouping strategy, and introduce a primary node election mechanism based on contribution degree, select the node with the highest contribution degree as the main Node, combining PoC and PBFT algorithms to ensure consistency and security.
It improves network throughput and efficiency, reduces system overhead, enhances security and fault tolerance, is suitable for large-scale networks, and improves the scalability and robustness of the system.
Smart Images

Figure CN119254773A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to but is not limited to the field of alliance chain consensus technology, and in particular to an improved alliance chain consensus method and system based on contribution and grouping. Background Art
[0002] In the consortium chain, Byzantine Fault Tolerance (BFT) and Practical Byzantine Fault Tolerance (PBFT) are widely regarded as representative consensus algorithms. Both are committed to solving the Byzantine Generals' Problem. The Byzantine Fault Tolerance consensus algorithm is a key distributed system design technology that solves the problem of node failure or malicious behavior by providing complex algorithms and protocol mechanisms to ensure the stability, reliability and security of the system. However, the Byzantine Fault Tolerance consensus algorithm also faces some challenges, including the relatively complex implementation of the algorithm, involving multiple rounds of message exchanges and complex protocol mechanisms; in terms of performance overhead, due to the need for multiple rounds of message exchanges and complex calculation processes, Byzantine Fault Tolerance will cause the performance and efficiency of the system to decline; and as the number of participating nodes increases, the communication overhead and computational complexity of the Byzantine Fault Tolerance algorithm will also increase, thereby limiting the scalability of the system. The Practical Byzantine Fault Tolerance algorithm is developed based on the basic theory of Byzantine Fault Tolerance, but it introduces some specific optimizations and mechanisms to make it more suitable for solving the Byzantine Generals' Problem in actual distributed systems. The Practical Byzantine Fault Tolerance consensus algorithm is fault-tolerant, which means that the system is resistant to attacks and errors to a certain extent, thereby maintaining normal operation. However, the algorithm still has problems such as high communication complexity, lack of support for master node selection, and low scalability, which bring many obstacles to industrial applications.
[0003] These problems are common in the practice of alliance chains, and researchers are actively conducting relevant research on this. Existing optimization schemes can be roughly divided into two categories: controlling the number of nodes and optimizing the consensus process. In 2019, Gan's team proposed an ePBFT consensus protocol, which allows nodes to dynamically join and exit by setting the node life cycle, and improves the selection method of the PBFT master node by using the longest chain principle, but it can only be applied to scenarios with a small number of nodes. In the same year, the LIQ team proposed the use of the K-medoids clustering algorithm, which judges the similarity between nodes by selecting appropriate clustering characteristics. It is suitable for large-scale network nodes and reduces communication overhead, but it is always based on certain characteristics, which is not conducive to promotion and application. In 2021, Zheng's team proposed a hybrid consensus algorithm of PoS+PBFT. Compared with the traditional PBFT algorithm, the throughput, latency and network communication time have been significantly improved, but the communication overhead is relatively large, and it is not suitable for scenarios with large-scale node participation. In 2022, Xu's team optimized the PBFT consensus process and adopted a scoring grouping mechanism to improve the consensus efficiency and the robustness of the Internet of Vehicles, but it has the problem of arbitrary master node selection.
[0004] In view of the above analysis, the technical problems that need to be solved urgently in the existing technology are: the existing consensus research mainly pursues the optimization of consistency and ignores performance. In addition, the message mechanism and communication protocol between nodes lead to increased communication overhead and increased latency, which reduces system performance. At the same time, as the number of nodes increases, the system scalability and performance are limited, making it unsuitable for large-scale networks and unfavorable for the development and implementation of the blockchain industry. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides an improved consortium chain (CG-PBFT) consensus method and system based on contribution and grouping.
[0006] The present invention is implemented as follows: an improved alliance chain consensus method based on contribution and grouping, comprising:
[0007] S1, Grouping strategy: By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency;
[0008] S2, management master node selection phase: In the blockchain network, a consensus mechanism based on contribution (PoC) is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase to solve the problems of PBFT in terms of performance imbalance, security issues and resource consumption;
[0009] S3, node contribution calculation: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption;
[0010] S4, CG-PBFT optimized consistency protocol based on contribution and grouping: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, retains the PBFT algorithm stage, adds the master node election stage, solves the problem of arbitrary selection of the master node, and reduces the number of communications;
[0011] S5, Correctness Analysis: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm;
[0012] S6, Defense against Byzantine attacks: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0013] S7, resilience against other attacks: In the CG-PBFT algorithm, consensus nodes are reasonably grouped to reduce the possibility of attackers controlling enough nodes to tamper with the consensus.
[0014] Further, the grouping steps in S1 are as follows:
[0015] (1) System initialization: Before the blockchain network is started, the system is initialized, including authenticating newly joined nodes and selecting F of them as candidate management nodes. This step ensures that the network has a set of recognized master node candidates at the beginning.
[0016] (2) Isolation status confirmation: Confirm that the nodes in the network have not yet established a connection and are in an isolated state. This is to ensure that all nodes are in a fair and isolated state before conducting a response speed test to avoid the influence of external factors.
[0017] (3) Group detection message: Prepare the master node a∈(1, 2, ...N), assuming that node 1(a) sends a group detection message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1, and its digital signature is S_a. These messages are used to solicit other nodes’ willingness to join the consensus cluster and initiate communication and information transmission between nodes.
[0018] (4) Request to join the consensus set: When node x (x∈1, 2, ...n) receives this message, it first proves the signature of node 1 (a) to ensure that the message is authentic and valid. If correct, then node x decides to join the consensus cluster of node 1 and sends a join request <subset request, t2, S_x> to node 1, where t2 is the current timestamp of node x and S_x is the digital signature of the current round.
[0019] (5) Processing the join request: After receiving the join request, node a first checks whether the number of its consensus cluster members has reached the upper limit Nmax. If the group is not full and the information verification of node x is passed, node 1 agrees to node x's join request and adds node x to its consensus set member list. If the number of node 1's consensus cluster members is full or the information verification of node x is not passed, node 1 will send a rejection message to node x, and node x can try to send a join request to other reserve master nodes.
[0020] (6) Find the next candidate master node: If node 2 sends a rejection message to node x, then node x requests another candidate master node to join its consensus cluster. This step ensures that the node can find a consensus cluster that suits it through multiple attempts. Repeat the above steps.
[0021] (7) Grouping end and information broadcast: After all nodes attempt to join the consensus cluster, each node that is ready to manage will broadcast their consensus cluster member list for verification, and then send this information to their respective group members to complete the group confirmation, such as Figure 2This ensures that each node can eventually find the consensus cluster to which it belongs, and that the membership list of each consensus cluster is up-to-date and accurate.
[0022] Furthermore, S2 specifically includes: in the management master node selection stage, when the grouping of the consensus set is completed, the flag enters the master node election based on contribution. First, the nodes in each group will be comprehensively evaluated based on their contribution to the network. This contribution evaluation can be based on a variety of indicators, including the online time of the node, the data volume contribution of the node, and the online resource consumption factor of the node; based on these indicators, the contribution of each node is calculated; then each node will be assigned a corresponding contribution score, and according to the contribution score of the node, the node with the highest contribution in the group will be selected as the master node. This election process can be completed by voting, ranking or other mechanisms; the node will broadcast its contribution score to other nodes in the network, and other nodes will be ranked based on this information, and finally the node with the highest contribution will be selected as the master node; once each group selects the master node, it will enter the out-of-group consensus.
[0023] Furthermore, S3 specifically includes:
[0024] First, the node contribution is affected by the data volume contribution and data information entropy. The large amount of high-quality data provided by the node can effectively support the normal operation and transaction processing of the blockchain network, thereby improving the node contribution. Online resource consumption is affected by the computing power, bandwidth and storage space resources consumed by the node when maintaining the blockchain network. The node needs to consume a lot of resources to verify and confirm transactions, maintain the integrity of the network, and provide services to other nodes. The greater the resource overhead, the higher the node contribution. Then, the node contribution in a contribution model evaluation is defined as follows:
[0025] C(i)=C D (i)+C R (i) (1)
[0026] Among them, C(i) represents the node contribution, C D (i) represents the data contribution, C R (i) represents online resource overhead;
[0027] The online resource consumption of nodes is mainly estimated through CPU usage. Assuming that the amount of message data sent and received by the nodes is the same each time, and the CPU frequency is set to A, the CPU resource consumption of node i for a consensus is defined as follows:
[0028] C R (i) = τa i v i f i 2 (2)
[0029] Where τ represents the charge storage capability of the node computing chipset, a i represents the CPU cycle of a consensus of node i, v i Indicates the size of data required for consensus.
[0030] Furthermore, S4 specifically includes:
[0031] (1) Request phase
[0032] Multiple transaction requests <REQUEST,t,c,t x ,S c >Sent by the client to the consensus node of each consensus set;
[0033] (2) Primary node selection stage within the group
[0034] Calculate the contribution of each node in the consensus set and sort them, and select the node with the highest contribution as the master node The master node then pre-processes transactions related to the current state of the blockchain network and transactions to participate in consensus. The verified and processed transactions will be combined into pre-prepared messages.<WITHIN-PREPREPARE,t,Vd,Nd,H(m)> p ,j>;The pre-prepare message contains detailed information of the proposal, such as the proposal number, the message digest of the client request, and the timestamp. When a node receives a message from the master node, it first verifies its legitimacy, including the signature and sequence number of the message to ensure the source and integrity of the message; if the message verification passes, the node will put the proposal into its own proposal queue and wait for subsequent preparation messages; if the message verification fails, the node will ignore the message and continue to wait for other messages or process other tasks;
[0035] (3) In-group preparation stage
[0036] If the node verification is passed, the pre-prepared message is considered legal and valid. Then the information interaction is broadcast to all nodes. The consensus node will verify the received interaction information. When a sufficient number of consistent interaction information is received from different nodes, the next step can be taken. Otherwise, the consensus process is terminated, the node problem is replaced, and the consensus process is restarted. If the node approves the proposal and generates a preparation message containing its own approval information <WITHIN-PREPARE,Nd,vd,B,d(m),S F ,t>;
[0037] (4) Intra-group submission phase
[0038] The master node conducts a comprehensive check on the prepared message it receives, including verifying the consistency of the message and confirming whether a sufficient number of nodes support the proposal to form a majority opinion. Once the legitimacy and consistency of the message are confirmed and consensus is reached, the node initiates a response to the proposal.<WITHIN-COMMIT,vd,B,t,d(m),proofc> ; At the same time, these messages can be directly broadcast to other nodes in the entire network, allowing other nodes to understand and verify these confirmation information; in this way, the entire system can gradually reach a consensus;
[0039] (5) Preparation phase exceeds consensus setting
[0040] After confirming receipt of a message from a team member, the master node verifies the legitimacy of the message. If it is valid, it means that a consensus has been reached within the consensus set. Then each master node participates in the consensus as a representative of its own group and broadcasts it to other master nodes except itself. <WITHOUT-PREPARE,Nd,vd,B,d(m),S F ,t>, and also accepts the broadcast from its master node and enters the preparation stage.
[0041] (6) Commitment phase without consensus set
[0042] At this stage, the node will verify the received broadcast message; if no problems are found, the node will continue to process the message; if there are any objections, the node will reject the message. In addition, if the node receives the same message from more than 2f nodes, it will consider it an acceptable message and will <WITHOUT-COMMIT,vd,B,t,d(m),S F > Broadcast;
[0043] (7) Group reply stage
[0044] The node will verify the received confirmation message to ensure the legitimacy and consistency of the message. In addition, the node determines the status of the proposal based on the received message and its own status. If the node determines that the proposal is legitimate and has received enough confirmation, it will generate a reply message containing its final approval information for the proposal. <WITHIN-REPLY,vd,B,t,d(m),S F >, the node notifies other members of the group of the generated reply message;
[0045] (8) Response phase beyond consensus
[0046] The master node replies to the client <WITHOUT-REPLY,vd,B,t,d(m),S c >, consensus completed;
[0047] At this time, in a consensus set, there is only one master node initiating a consensus request during the entire consensus process (in the absence of a Byzantine node). Other nodes only need to verify the transaction hash and signature, and do not need to initiate a consensus request. The master node is selected based on the contribution, and then the consensus within the group is performed. This model is similar to the implementation mechanism of having a leader node, which can easily control the initiation of consensus, and can also effectively avoid repeated consensus and competition between nodes, and improve the efficiency of the entire consensus process.
[0048] Furthermore, S5 specifically includes: the CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of nodes through the PBFT algorithm; in the first consensus stage, the PoC algorithm mainly uses the contribution proof mechanism and the randomness mechanism to realize the selection of the master node and control the number of malicious nodes, that is, it agrees to determine a master node and coordinate other nodes to act together. The maximum number of faulty nodes f allowed by the PoC algorithm should be controlled within 30% of the total number of nodes N to ensure consensus consistency; in the second consensus stage, the PBFT algorithm ensures that the nodes can reach a consensus while avoiding errors or deceptions between nodes, ensuring the final consistency, that is, when the number of faulty nodes f≤(N-1) / 3 in the PBFT algorithm, the fault tolerance of the consensus stage can be ensured.
[0049] Furthermore, S6 specifically includes: the PBFT algorithm is fault-tolerant. Assuming that the number of summary points is N, there are at most f Byzantine nodes. When f≤(N-1) / 3, even if a small number of nodes fail, honest nodes can still continue to communicate and maintain consistency, thereby ensuring security; in addition, during the consensus process, the view switching mechanism of PBFT solves the consensus failure problem caused by the failure of the master node or other reasons, allowing it to quickly restore the consensus process and ensure the continuity and security of the consensus. Moreover, through the message signing mechanism, the PBFT algorithm can prevent malicious behaviors such as forgery, replay attacks, and tampering, ensuring the security of the consensus.
[0050] Another object of the present invention is to provide an improved alliance chain consensus system based on contribution and grouping for realizing the improved alliance chain consensus method based on contribution and grouping, comprising:
[0051] Grouping strategy module: By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency;
[0052] Management master node selection module: In the blockchain network, a consensus mechanism based on contribution is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase to solve the problems of PBFT in terms of performance imbalance, security issues and resource consumption;
[0053] Node contribution calculation module: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption;
[0054] CG-PBFT optimizes the consistency protocol module: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, retains the PBFT algorithm stage, adds the master node election stage, solves the problem of arbitrary selection of the master node, and reduces the number of communications;
[0055] Correctness analysis module: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm;
[0056] Byzantine attack defense module: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0057] Resilience module to resist other attacks: In the CG-PBFT algorithm, by reasonably grouping the consensus nodes, it reduces the possibility of attackers controlling enough nodes to tamper with the consensus.
[0058] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved alliance chain consensus method based on contribution and grouping.
[0059] Another object of the present invention is to provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the improved alliance chain consensus method based on contribution and grouping.
[0060] Another object of the present invention is to provide an information data processing terminal, which includes the improved alliance chain consensus system based on contribution and grouping.
[0061] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0062] First, the present invention proposes a new practical Byzantine fault-tolerant blockchain consensus algorithm based on contribution and grouping. The algorithm is based on the contribution consensus algorithm, proposes a new contribution model to apply to the contribution evaluation of nodes, and sorts them according to the calculated contribution to select the node with the highest contribution as the master node for consensus. This solves the problem of arbitrary selection of master nodes, while improving the fairness of node selection, reducing the possibility of malicious nodes becoming master nodes and attacking the system, optimizing system performance, improving the system's adaptability, and promoting active participation and healthy competition within the network, ultimately achieving a more robust and efficient distributed system.
[0063] The present invention groups the consensus set according to the response speed. First, after the consensus set is grouped, the contribution model is used to select the master node in the group to participate in the consensus, and then the results in the consensus set are taken to participate in the consensus between groups. It not only brings performance improvement, which is specifically reflected in enhancing the security and fault tolerance of the system, but also provides good structure, parallel processing capabilities, fault isolation and network governance capabilities. The most important thing is that it can effectively reduce system overhead, thereby improving the robustness and adaptability of the entire network.
[0064] The present invention simplifies the consensus protocol, reduces the communication burden within the protocol, and enhances the efficiency of the system. In addition, selecting nodes with high contribution as master nodes ensures the stability of the system. Through these improvements, the system can handle a large number of operations and transactions more flexibly and reliably while maintaining security and efficiency.
[0065] Second, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:
[0066] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:
[0067] Cost-effectiveness and efficiency improvement: Alliance chain technology reduces the labor and time costs in the transaction and cooperation process through the application of automation and smart contracts. In addition, through grouping and contribution evaluation, it can ensure that high-value nodes play a greater role in the consensus process, thereby reducing the time and resource costs required to reach consensus.
[0068] Security and trust building: The decentralized and tamper-proof nature of blockchain ensures data security and transaction credibility. Participants can safely share sensitive data and participate in complex business processes without worrying about the risk of information being tampered with or leaked, thereby establishing a more solid cooperative trust relationship. In addition, the grouping mechanism can reduce the impact of malicious nodes on the entire system, while the contribution evaluation can ensure that high-quality nodes dominate the system, thereby improving the security and stability of the system.
[0069] Flexibility and adaptability: Alliance chain technology allows the scale and functionality of the network to be flexibly adjusted and expanded according to business needs. Different industries and organizations can customize alliance chain solutions according to their own characteristics to meet specific business processes and security requirements, enhancing the adaptability and scalability of the system.
[0070] Innovation and competitive advantage: Enterprises and organizations that adopt alliance chain technology can launch innovative products and services more quickly. Alliance chain promotes cross-organizational collaborative innovation and helps enterprises gain greater competitive advantage and market share in the market.
[0071] Compliance and audit convenience: The transparency and traceability of blockchain make compliance supervision and auditing simpler and more effective. All transaction records and data modifications are recorded on the tamper-proof blockchain, providing reliable basis and evidence for compliance audits.
[0072] Globalization and cross-border cooperation: Alliance blockchain technology supports cross-border cooperation and data sharing among organizations and enterprises around the world. The fact that it is not restricted by geographical location enables participants to easily cooperate across borders and promote the development of global business.
[0073] Promoting ecological development: This consensus mechanism can motivate nodes to actively participate in the construction and operation of the alliance chain, forming a virtuous ecological cycle. At the same time, through contribution evaluation and grouping mechanisms, it can also provide strong support for the expansion and upgrading of the alliance chain.
[0074] Third. Solved existing technical problems:
[0075] 1. Node communication complexity and network efficiency issues:
[0076] In the existing technology, the communication between nodes in the blockchain network is complicated, resulting in low network throughput and efficiency.
[0077] 2. Performance imbalance and security issues of the PBFT consensus mechanism:
[0078] The PBFT (Practical Byzantine Fault Tolerance) consensus mechanism has problems with uneven performance, security issues, and resource consumption.
[0079] 3. The randomness of the master node selection and the number of communications are too many:
[0080] In PBFT, the selection of the master node is usually random, which leads to improper selection of the master node, thereby increasing the number of communications and affecting efficiency.
[0081] 4. Insufficient defense capabilities against Byzantine attacks and other attacks:
[0082] Existing technologies have limited defense capabilities against Byzantine attacks and other types of attacks.
[0083] Significant technological advancements:
[0084] 1. Grouping strategy and network efficiency improvement:
[0085] By grouping the consensus set, the complexity of communication between nodes is significantly reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency.
[0086] 2. Masternode selection mechanism based on contribution:
[0087] A contribution-based consensus mechanism is introduced, and the node with the highest contribution is selected as the master node by managing the master node election phase, which effectively solves the problems of uneven performance, security issues and resource consumption in PBFT.
[0088] 3. Node contribution calculation and fairness:
[0089] Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. It is mainly composed of two aspects: node data contribution and online resource consumption. This method is more fair and reasonable.
[0090] 4. CG-PBFT optimizes the consistency protocol:
[0091] CG-PBFT groups the consensus set, introduces the PoC (Proof of Contribution) contribution algorithm to select the master node, retains the stages of the PBFT algorithm, and adds a master node election stage, which solves the problem of arbitrary selection of the master node and reduces the number of communications.
[0092] 5. Guarantee of consistency and final consistency:
[0093] The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of nodes through the PBFT algorithm, which improves the reliability and stability of the consensus.
[0094] 6. Enhanced ability to defend against Byzantine attacks:
[0095] The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT, which enhances the defense capability against Byzantine attacks.
[0096] 7. Improved resilience against other attacks:
[0097] In the CG-PBFT algorithm, by reasonably grouping consensus nodes, the possibility of attackers controlling enough nodes to tamper with the consensus is reduced, thereby improving the resilience and security of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] Figure 1 It is a flow chart of an improved alliance chain consensus method based on contribution and grouping provided by an embodiment of the present invention;
[0099] Figure 2 is a schematic diagram of a grouping process provided by an embodiment of the present invention;
[0100] Figure 3 It is a schematic diagram of an optimized consistency protocol of CG-PBFT provided in an embodiment of the present invention;
[0101] Figure 4 It is a schematic diagram of the communication times of three consensus algorithms provided by the embodiments of the present invention;
[0102] Figure 5 Schematic diagram of communication overload of five consensus algorithms provided by embodiments of the present invention;
[0103] Figure 6 is a schematic diagram of flux comparison between CG-PBFT and PBFT provided in an embodiment of the present invention;
[0104] Figure 7 Schematic diagram of throughput of five consensus algorithms provided by embodiments of the present invention;
[0105] Figure 8 Schematic diagram of transaction delays of five consensus algorithms provided by embodiments of the present invention;
[0106] Fig. 9 It is a schematic diagram of the number of Byzantine nodes accommodated by CG-PBFT and PBFT provided in an embodiment of the present invention;
[0107] Fig.10 Schematic diagram of performance results of the algorithm provided by the embodiment of the present invention under different performance indicators; in the figure, (a) throughput evaluation result, (b) fault tolerance evaluation result, (c) transaction delay evaluation result, (d) communication overhead evaluation result;
[0108] Fig.11 This is a structural diagram of an improved alliance chain consensus system based on contribution and grouping provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0109] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0110] The present invention aims to design a consensus algorithm with excellent performance and suitable for large-scale alliance chain scenarios. To this end, a practical Byzantine fault-tolerant algorithm using contribution and grouping mechanism is proposed.
[0111] CG-PBFT adds a grouping phase and a master node selection phase. CG-PBFT first proposes a method of grouping based on response speed, such as Figure 2 As shown in the figure, grouping large-scale network nodes can reduce the load of a single consensus set, improve network performance and throughput, and each sub-network can independently execute the consensus algorithm, thereby reducing the delay and congestion of the entire network, and can improve fault tolerance and privacy protection levels, and allow customized governance mechanisms to better meet the needs of different users and applications. At the same time, a contribution algorithm is introduced. The design focus is to use PoC to sort the contribution to improve the problems of high PBFT communication overhead and low throughput. In particular, the proof of contribution is mainly related to the three aspects of the node's online time contribution, data volume contribution, and data contribution. For example, the online time of the node can be selected as the cumulative online time or the continuous online time. After the consensus process, the blockchain ledger data and other data are read to calculate the current contribution of each node. In the CG-PBFT algorithm, nodes are divided into master nodes, candidate nodes, and consensus nodes according to their different functions. The selection of the master node is based on the node with the highest contribution. Generally, the candidate node refers to the remaining excellent nodes after the master node is selected. The consensus node needs to receive and respond to messages from the master node and participate in the consensus. Among them, the candidate node that meets specific qualification criteria is a component element of the consensus node. Under normal circumstances, the master node is responsible for executing the consensus mechanism, verifying transactions, and packaging blocks. At this time, the candidate nodes participate in the consensus process and propagate transaction information and block data. When the master node cannot operate normally, the candidate node will become the new master node through the contribution ranking and start a new round of consensus process. Assume that the total number of blockchain network nodes is N (N≥12), the number of groups satisfies F≥4, and the number of nodes in each group is U≥3. The flowchart of the improved algorithm is as follows Figure 1 shown.
[0112] 1.1 Grouping strategy
[0113] By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency. Secondly, grouping also helps to optimize the utilization of network resources. It can reasonably allocate resources according to node performance and characteristics, so that nodes in each group can make full use of their own characteristics and improve the work efficiency of each node, thereby comprehensively improving the efficiency and performance of the entire blockchain network. In addition, the intra-group consensus can be used as an error isolation mechanism, because even if a node in a group is attacked, the nodes in other groups can continue to operate normally without affecting the consensus of the entire network. At the same time, the intra-group consensus result is used for the extra-group consensus, which adds an extra layer of verification, improves the system's fault tolerance, and reduces the risk of the entire network. At the same time, the consensus set grouping strategy can achieve horizontal expansion of the network, that is, when the network scale needs to be expanded, new consensus set groups can be dynamically added without affecting the entire network. In general, in the consensus set division stage, the consensus set is grouped to improve network efficiency, enhance network security, improve network scalability, and optimize resource utilization, so as to provide users with more stable and reliable services.
[0114] In addition, grouping the consensus set can help solve the problems of performance expansion, attack risk and network congestion in PBFT. In the traditional PBFT consensus algorithm, nodes communicate with each other. When the number of nodes increases, the communication overhead increases, affecting network performance. By grouping the consensus set, the complexity of communication between nodes can be reduced, the network efficiency can be improved, and the performance expansion problem can be solved. In addition, if there are malicious nodes in the consensus set, problems will occur in the consensus process. By grouping the consensus set, even if there are malicious nodes in a group, the nodes in other groups can continue to work normally, thereby reducing the risk of the entire network being attacked. In addition, all nodes in the traditional PBFT need to participate in the consensus process. When the consensus set is too large, it will cause network congestion. By grouping and dispersing the consensus set into different subsets, the network congestion problem can be effectively alleviated and the normal operation of the network can be maintained.
[0115] As mentioned above, the consensus set is divided according to the response speed during the grouping stage. The core idea of this method is to divide the nodes into different groups according to the response speed of each node, so as to better utilize the performance of each node in the consensus process, thereby improving the processing capacity and response speed of the entire network. First, it is necessary to introduce a measurement mechanism for the communication delay or response time between nodes in the network, and regularly send heartbeat packets or perform ping tests between nodes to monitor the response speed of each node in real time. Based on these data, the response speed index of each node can be obtained as the basis for dividing the consensus set. Then, according to the response speed data of the node, all nodes are sorted from fast to slow according to the response speed to obtain a sorted list. Then, in order to ensure the fairness and effectiveness of the division of the consensus set, the grouping rules are determined. The maximum and minimum number of nodes for each consensus set are set to avoid a consensus set being too large or too sparse, thereby improving the fault tolerance and anti-attack ability of the network. It is particularly critical to regularly monitor the response speed of the nodes and the network performance, and dynamically adjust the composition of the consensus set according to the actual situation to maintain the stability and efficiency of the network. Next, the execution process is described by taking the node's response speed to the "preparatory master node" as an example to assign nodes to different consensus sets.
[0116] Assume that in a blockchain network, the total number of nodes is N (N≥4), and we want to divide them into F (F≥4) groups centered around different "preparatory master nodes". Imagine that at the beginning of the activation of the blockchain system, all participating nodes on the network do not communicate with each other, that is, they are in an isolated state. By implementing the certification procedure of the alliance chain members, F nodes are selected to serve as the initial master node team. Based on the speed of each node's response to the F preparatory master nodes, the nodes will be assigned to F different consensus sets. The grouping steps are as follows:
[0117] (1) System initialization: Before the blockchain network is started, the system is initialized, including authenticating newly joined nodes and selecting F of them as candidate management nodes. This step ensures that the network has a set of recognized master node candidates at the beginning.
[0118] (2) Isolation status confirmation: Confirm that the nodes in the network have not yet established a connection and are in an isolated state. This is to ensure that all nodes are in a fair and isolated state before conducting a response speed test to avoid the influence of external factors.
[0119] (3) Group detection message: Prepare the master node a∈(1, 2, ...N), assuming that node 1(a) sends a group detection message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1, and its digital signature is S_a. These messages are used to solicit other nodes’ willingness to join the consensus cluster and initiate communication and information transmission between nodes.
[0120] (4) Request to join the consensus set: When node x (x∈1, 2, ...n) receives this message, it first proves the signature of node 1 (a) to ensure that the message is authentic and valid. If correct, then node x decides to join the consensus cluster of node 1 and sends a join request <subset request, t2, S_x> to node 1, where t2 is the current timestamp of node x and S_x is the digital signature of the current round.
[0121] (5) Processing the join request: After receiving the join request, node a first checks whether the number of its consensus cluster members has reached the upper limit Nmax. If the group is not full and the information verification of node x is passed, node 1 agrees to node x's join request and adds node x to its consensus set member list. If the number of node 1's consensus cluster members is full or the information verification of node x is not passed, node 1 will send a rejection message to node x, and node x can try to send a join request to other reserve master nodes.
[0122] (6) Find the next candidate master node: If node 2 sends a rejection message to node x, then node x requests another candidate master node to join its consensus cluster. This step ensures that the node can find a consensus cluster that suits it through multiple attempts. Repeat the above steps.
[0123] (7) Grouping end and information broadcast: After all nodes attempt to join the consensus cluster, each node that is ready to manage will broadcast their consensus cluster member list for verification, and then send this information to their respective group members to complete the group confirmation, such as Figure 2 This ensures that each node can eventually find the consensus cluster to which it belongs, and that the membership list of each consensus cluster is up-to-date and accurate.
[0124] These steps are closely linked and constitute the whole process of nodes joining the consensus set according to their response speed. Each step has specific tasks and responsibilities, ensuring the smooth progress of the grouping process and the effective realization of the final result.
[0125] 1.2 Management Master Node Selection Phase
[0126] In the blockchain network, the introduction of a consensus mechanism based on contribution and the selection of the node with the highest contribution as the master node by managing the master node election phase can solve the problems of PBFT in terms of uneven performance, security issues and resource consumption. First, the management of the master node election phase optimizes network performance by evaluating the contribution of the nodes and selecting the node with the highest contribution as the master node. In the traditional PBFT method of randomly or rotating master node selection, each node has the same chance to become the master node, but the performance and contribution of the nodes vary. Some nodes with excellent performance contribute more to the stability and efficiency of the network, while the random selection of master nodes leads to uneven performance, affecting the performance of the entire network. Compared with the traditional PBFT method of selecting master nodes, the election mechanism based on contribution can ensure that the master node has better performance and stability, and improves the performance of the entire blockchain network. In this way, the network can process transactions more efficiently, improve throughput and response speed, and also reduce congestion and delay caused by uneven performance.
[0127] In addition, the management of the master node election phase enhances the security of the network. The traditional random selection of master nodes has the risk of master nodes being attacked, while the contribution-based election mechanism can reduce this risk. Because nodes with high contribution usually have better performance and reliability, electing these nodes as master nodes can increase the network's ability to resist attacks and improve the security and stability of the network. What is particularly critical is that the management of the master node election phase optimizes resource utilization. In the traditional way, resources will be wasted on nodes that do not meet the conditions to become master nodes, but network resources will still be consumed for master node elections, which will affect the efficiency and resource utilization of the entire network. The contribution-based election mechanism can make the network use resources more efficiently. Only nodes with the highest contribution have the opportunity to become master nodes, avoiding the waste of resources on unnecessary nodes and improving the resource utilization of the network. In general, the management of the master node election phase and the contribution-based consensus mechanism have largely solved the problems existing in PBFT, thereby optimizing the performance of the blockchain network, improving the security of the network, and optimizing resource utilization. At the same time, it also encourages nodes to actively participate and contribute, providing a more reliable and efficient foundation for the development and application of blockchain networks. Since the management master node selection stage has such a great impact on traditional PBFT, its implementation process will be introduced in detail below.
[0128] In the management master node selection phase, when the consensus set is grouped, the flag enters the master node election based on contribution. First, the nodes in each group will be comprehensively evaluated based on their contribution to the network. This contribution evaluation can be based on a variety of indicators, such as the online time of the node, the data volume contribution of the node, the online resource consumption of the node, and other factors. Based on these indicators, the contribution of each node is calculated. Then each node will be assigned a corresponding contribution score. According to the contribution score of the node, the node with the highest contribution in the group will be selected as the master node. This election process can be completed by voting, ranking or other mechanisms, and we use ranking here. Usually, the node will broadcast its contribution score to other nodes in the network, and other nodes will rank according to this information, and finally select the node with the highest contribution as the master node. Once each group selects the master node, it can enter the out-of-group consensus.
[0129] 1.3 Node Contribution Calculation
[0130] Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption. First, node contribution is affected by data volume contribution and data information entropy. The large amount of high-quality data provided by the node can effectively support the normal operation and transaction processing of the blockchain network, thereby improving the node's contribution. In addition, online resource consumption is affected by the computing power, bandwidth, storage space and other resources consumed by the node when maintaining the blockchain network. The node needs to consume a lot of resources to verify and confirm transactions, maintain the integrity of the network, and provide services to other nodes. The greater the resource overhead, the higher the node's contribution. Then, the node's contribution in a contribution model evaluation is defined as follows.
[0131] C(i)=C D (i)+C R (i) (1)
[0132] Among them, C(i) represents the node contribution, C D (i) represents the data contribution, C R (i) represents the online resource overhead.
[0133] The online resource consumption of nodes is mainly estimated through CPU usage. Assuming that the amount of message data sent and received by the node is the same each time, and the CPU frequency is set to A, the CPU resource consumption of node i for a consensus is defined as follows.
[0134] C R (i) = τa i v i f i 2 (2)
[0135] Where τ represents the ability of the node computing chipset to store charge. i represents the CPU cycle of a consensus of node i, v i Indicates the size of data required for consensus.
[0136] Referring to the classical information theory principle, data information entropy can reflect the quality and importance of the data provided by the data provider. The higher the information entropy, the higher the uncertainty and complexity of the data, and vice versa. Therefore, it can be used as a basis for evaluating its contribution in the consensus process. In short, the more information contained in the data set provided by the data provider, the greater its contribution. Because such data is more important to the consensus process or the normal operation of the network, the contribution is greater. Judging the contribution of data providers by information entropy can help the network better identify and reward those participant nodes that provide valuable information. Next, we define the relevant concepts of information entropy.
[0137] Definition 1. Data tuple. For a given dataset D, a tuple t is defined as a non-empty subset of a record r in D, i.e. and
[0138] Definition 2. Tuple Set. A tuple set is a set of tuples. A set of tuples. Each tuple can contain different types of data, and each tuple is unique in the set. Tuple sets are often used to store objects or data records with different attributes. Tuple sets can be part of or the entirety of a dataset. Therefore, a tuple set is a non-empty part of a dataset D, that is, Tup∈D and
[0139] Definition 3. Data information entropy. Data information entropy is an important indicator to measure the uncertainty or confusion in a data set. It indicates the degree of confusion or uncertainty of the data when the probability distribution of different elements appears in the data set. It can be used to measure the amount of information contained in a single tuple set, and the tuple set is the smallest unit of information entropy measurement. The higher the information entropy, the more uncertain the data is or the more evenly distributed it is. For a tuple set with n tuples, its information entropy H is ind The definition is
[0140]
[0141] The PoC consensus algorithm competes for the right to record the blockchain account based on three aspects: node online time, node data volume contribution, and node data contribution. When a blockchain transaction request is received, it is sorted according to the contribution, and the node with the largest contribution is selected as the master node to accept the transaction request and return the transaction hash value and block status and other parameters. The initial contribution of all nodes is represented by CT.
[0142] The initial contribution of a node is closely related to its online time. This is because continuous online time makes it easier for other nodes to trust the node, as it shows the node's commitment to the stability and reliability of the network. That is, the longer the node is online, the more likely it is to provide continuous services and resources, thereby enhancing the stability of the entire network; at the same time, it encourages nodes to remain active and participate in the network for a long time. The calculation formula for the online time contribution (CT) of this algorithm is as follows.
[0143] CT = λlog(T l -T j -T u ) (4)
[0144] In Formula 4, CT represents the online contribution of the node, λ represents the online time coefficient, and T l Indicates the timestamp of the last block added to the current blockchain network, T j Indicates the timestamp of each node's first joining, T u Indicates the time interval for node offline.
[0145] Cross entropy is used to measure the deviation between the amount of message data sent by the node and the actual result. Assume that all participating nodes in the blockchain network transmit transaction data set d n ={(x1,y1),(x2,y2),...,(x i ,y i ),…,(x n ,y n )}, then the data (x i ,y i )’s cross entropy H(f(x i ),y i )The calculation formula is as follows.
[0146]
[0147] where x i represents the number of transactions received by node i, y i Represents the number of transactions sent by node i. f(x i ) represents the prediction result of the node. i ),yi ) is smaller, indicating that the predicted probability distribution is closer to the actual situation. In short, the consensus effect is better.
[0148] Data volume contribution refers to the degree and quality of a node's storage, transmission or processing of data in the network. The node's performance in data storage, transmission and processing directly determines its role and contribution in the blockchain. The node's data contribution is mainly determined by the data information entropy H. ind (d i ) and the proportion of data volume contribution to the total data volume C i The increase of data contribution means the increase of importance and value of nodes in the network, so it is one of the indispensable factors for evaluating node contribution. i It indicates that its value is determined by the ratio of the data volume of participating node i to other participating nodes.
[0149]
[0150] Therefore, the data contribution of the node C D It can be defined as
[0151]
[0152] It can also be expressed as
[0153]
[0154] According to the above formula, formula 1 can be rewritten, and the contribution of the node C(i) is
[0155]
[0156] In addition, during the consensus process, the proof of contribution of the node can be calculated based on the non-negative property of the data information entropy, where ε is the adjustment coefficient.
[0157]
[0158] After the consensus process begins, the node with the highest contribution is selected as the master node to process transaction requests and package them into blocks, usually described as B i ={ <H i-1, H M ,t i >,T x [d i ,H(f(x i ),y i )],proofc}. The specific meaning is as follows: the content of <> is the block header, where H i-1 Represents the hash value of the previous block, H MRefers to the hash value of the Merkle root in the block body, t i Represents the timestamp, T x Refers to the transaction content, i Represents transaction data, H(f(x i ),y i ) represents cross entropy, which can be recorded on the chain in the form of transactions, and proofc refers to the proof of contribution of the node.
[0159] Based on the PoC consensus algorithm, the contribution of each node is calculated and ranked in descending order, where the timeout threshold is represented by Tt, and the node with the highest contribution is P i Then the master node P i Make consensus and broadcast block B i . Other consensus nodes verify block information such as participating nodes P k Verify the generated block B i If the verification is successful, the ownership of the bookkeeping rights is determined, and a signature block is usually returned. k , indicating that the new block or transaction is accepted and added to the blockchain. The PoC algorithm is described in Algorithm 1.
[0160] Algorithm 1 helps in the selection of the master node
[0161]
[0162]
[0163] As the ranking of node contribution decreases, the corresponding probability of accounting and generating blocks also decreases. When it is necessary to decide the accounting rights of a new block, the blockchain system will give priority to the nodes with the highest contribution for a period of time, which will optimize the consensus process and be simpler and more efficient than the single PBFT algorithm. At the same time, it ensures the fairness of node selection and improves the processing efficiency and throughput of the network. At the same time, when the network topology or the hardware performance of the node changes, the contribution of the node will change accordingly, which is more suitable for the application needs of large-scale distributed systems.
[0164] 1.4CG-PBFT Optimized Consistency Protocol
[0165] CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, and retains the PBFT algorithm stage, adding the master node election stage, solving the problem of random selection of the master node, thereby reducing the number of communications. Figure 3 shown.
[0166] (1) Request phase
[0167] Multiple transaction requests <REQUEST,t,c,t x ,S c >Sent by the client to each consensus node in the consensus set.
[0168] (2) Primary node selection stage within the group
[0169] Calculate the contribution of each node in the consensus set and sort them, and select the node with the highest contribution as the master node The master node then pre-processes transactions related to the current state of the blockchain network and transactions to participate in consensus. The verified and processed transactions will be combined into pre-prepared messages.<WITHIN-PREPREPARE,t,Vd,Nd,H(m)> p ,j>. The pre-prepare message contains detailed information about the proposal, such as the proposal number, the message digest of the client request, and the timestamp. When a node receives a message from the master node, it first verifies its legitimacy, including verifying the signature and sequence number of the message to ensure the source and integrity of the message. If the message verification passes, the node will put the proposal into its own proposal queue and wait for subsequent prepare messages. If the message verification fails, the node will ignore the message and continue to wait for other messages or process other tasks.
[0170] (3) In-group preparation stage
[0171] If the node verification is passed, the pre-prepared message is considered legal and valid. Then the information interaction is broadcast to all nodes. The consensus node will verify the received interaction information. When a sufficient number of consistent interaction information is received from different nodes, the next step can be taken. Otherwise, the consensus process is terminated, the node problem is replaced, and the consensus process is restarted. If the node approves the proposal and generates a preparation message containing its own approval information <WITHIN-PREPARE,Nd,vd,B,d(m),S F ,t>.
[0172] (4) Intra-group submission phase
[0173] The master node conducts a comprehensive check on the prepared message it receives, which includes verifying the consistency of the message and confirming whether a sufficient number of nodes support the proposal to form a majority opinion. Once the legitimacy and consistency of the message are confirmed and consensus is reached, the node initiates a response to the proposal.<WITHIN-COMMIT,vd,B,t,d(m),proofc> At the same time, these messages can be directly broadcast to other nodes in the entire network, allowing other nodes to understand and verify these confirmation information. In this way, the entire system can gradually reach a consensus.
[0174] (5) Preparation phase exceeds consensus setting
[0175] After confirming receipt of the message from the team member, the master node verifies the legitimacy of the message. If it is valid, it means that a consensus has been reached within the consensus set. Then each master node participates in the consensus as a representative of its own group and broadcasts WITHOUT-PREPARE,Nd,vd,B,d(m),S to other master nodes except itself. F ,t>, and also accepts the broadcast from its master node and enters the preparation stage.
[0176] (6) Commitment phase without consensus set
[0177] At this stage, the node verifies the received broadcast message. If no problems are found, the node will continue to process the message. If there are any objections, the node will reject the message. In addition, if the node receives the same message from more than 2f nodes, it will consider it an acceptable message and send it to the node. <WITHOUT-COMMIT,vd,B,t,d(m),S F > Broadcast.
[0178] (7) Group reply stage
[0179] The node will verify the received confirmation message to ensure the legitimacy and consistency of the message. In addition, the node determines the status of the proposal based on the received message and its own status. If the node determines that the proposal is legitimate and has received enough confirmation, it will generate a reply message containing its final approval information for the proposal. <WITHIN-REPLY,vd,B,t,d(m),S F >, the node notifies the other members of the group of the generated reply message.
[0180] (8) Response phase beyond consensus
[0181] The master node replies to the client <WITHOUT-REPLY,vd,B,t,d(m),S c >, consensus is achieved.
[0182] At this time, in a consensus set, there is only one master node initiating a consensus request during the entire consensus process (in the absence of a Byzantine node). Other nodes only need to verify the transaction hash and signature, and do not need to initiate a consensus request. The master node is selected based on the contribution, and then the consensus within the group is performed. This model is similar to the implementation mechanism of having a leader node, which can easily control the initiation of consensus, and can also effectively avoid repeated consensus and competition between nodes, and improve the efficiency of the entire consensus process.
[0183] Request(m) means sending a request message, the current view number is vd, the request number is Nd, the PBFT master node number is p, the slave node number is j, B represents the block number, t represents the timestamp, the client request message is m, H(m) represents the hash value of the message, the summary of the request message m is d(m), and the consensus set signature on the message m is S F , the number of Byzantine nodes is represented by f, the client is represented by Client, and the client's signature on the message is represented by S c The partial intra-group consensus description of CG-PBFT is shown in Algorithm 2.
[0184]
[0185]
[0186] 1.5 Correctness Analysis
[0187] Aldin et al. proposed that a distributed system can only meet at most two of the three requirements of consistency, availability and partition tolerance at the same time, namely the CAP principle. Consistency means that all nodes in a distributed system can see the same data state at the same time, and even if some nodes in the system face failures or network partitions, the data consistency state must be achieved. Here, it refers to theoretical strong consistency. Achieving strong consistency usually requires high performance cost and complexity cost, which is not common. Therefore, based on actual needs and requirements, it is usually based on the "BASE theory" and combined with replication mechanisms, consistency protocols, distributed transactions and other mechanisms to alleviate this problem to a certain extent and achieve data consistency. Availability is the ability of the system to provide services continuously, that is, the system can respond to requests and return valid results at any time. Partition tolerance means that the system can continue to operate normally in the face of network partitions, and the overall system will not fail due to network partitions. That is, the system can continue to work after the network partition, and the operation of the entire system will not be affected by the failure of some nodes or communication links. According to the CAP principle, if there is a problem with the network, the distributed system needs to make a trade-off between ensuring data consistency, availability and partition tolerance. The system can choose to ensure data consistency, but at the expense of some availability or partition tolerance; or vice versa. This trade-off is one of the important factors to consider when designing a distributed system.
[0188] The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of nodes through the PBFT algorithm. In the first consensus stage, the PoC algorithm mainly uses the contribution proof mechanism and randomness mechanism to realize the selection of the master node and control the number of malicious nodes, that is, to determine a master node by agreement and coordinate other nodes to act together. The PoC algorithm allows the maximum number of faulty nodes f to be controlled within 30% of the total number of nodes N to ensure the consistency of consensus; in the second consensus stage, the PBFT algorithm ensures that the nodes can reach a consensus while avoiding errors or deceptions between nodes, ensuring the final consistency, that is, when the number of faulty nodes in the PBFT algorithm f≤(N-1) / 3, the fault tolerance of the consensus stage can be ensured.
[0189] 1.6 Defense against Byzantine attacks
[0190] The first phase of the CG-PBFT algorithm uses the PoC algorithm to ensure the security of the consensus, and the PoC algorithm uses multiple mechanisms to ensure the security of the consensus process.
[44] For example, the deposit mechanism enables participants to invest sufficient resources in the competition for block production rights, ensuring that participants have the necessary economic motivation and enthusiasm to ensure the normal operation and security of the network. At the same time, the deposit mechanism requires attackers to pay a higher cost to carry out malicious behavior, thereby increasing the security of the system; the problem-solving mechanism usually sets some complex problems or puzzles, and nodes need to solve these problems through calculations and generate corresponding proofs. This mechanism can prevent attackers from easily generating storage space; the introduction of random factors makes it impossible for nodes to predict the generator of the next block, which increases the difficulty of attacks on the one hand and ensures the fairness of competition between nodes on the other.
[0191] Secondly, the block legitimacy verification and hash chain structure. During the PoC algorithm consensus process, each node must participate in verifying the legitimacy of the block. The verification is completed through a hardware encryption mechanism to avoid malicious attacks and encryption vulnerabilities. In addition, the hash chain structure can prevent malicious transactions and operations.
[45] . In addition, the block distribution is relatively uniform. In the POC consensus algorithm, all nodes participate in the production of fast, reducing the risk of inequality between nodes, thereby enhancing the security of the system. In addition, the malicious behavior of any node will not affect the consensus of other nodes, ensuring the high fault tolerance and stability of the system; moreover, the PoC algorithm ensures the reliability and fairness of the consensus by dynamically changing the master node.
[0192] The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT
[46] . The PBFT algorithm is fault-tolerant. Assuming that the number of summary points is N, there are at most f Byzantine nodes. When f≤(N-1) / 3, even if a small number of nodes fail, honest nodes can still continue to communicate and maintain consistency, thereby ensuring security. In addition, during the consensus process, the view switching mechanism of PBFT can solve the problem of consensus failure caused by master node failure or other reasons, and can quickly restore the consensus process to ensure the continuity and security of consensus. Moreover, through the message signing mechanism, the PBFT algorithm can prevent malicious behaviors such as forgery, replay attacks, and tampering to ensure the security of consensus.
[0193] 1.7 Resilience against other attacks
[0194] In the consortium chain, it is necessary to strictly review the identity of the participants and take measures to prevent identity forgery and replay attacks, such as using unique timestamps and random numbers, to ensure the security and reliability of blockchain transactions. These measures play a key role in transaction interactions, effectively preventing malicious participants from broadcasting verified transactions or blocks, thereby protecting the system from attacks by untrusted and unauthorized third parties.
[0195] Moreover, when each user signs the transaction information with a private key and publishes it on the blockchain, this ensures the uniqueness and immutability of the transaction, as only the private key holder can effectively sign the transaction. If there is a denial of the transaction, confirming the identity of the signer through the public key associated with it can ensure the authenticity and accountability of the transaction, as the public key corresponds to the private key one by one.
[0196] The application of secure hash functions can further enhance the system's resistance to tampering attacks, because these functions generate a unique summary, converting transaction information into a fixed-length string, ensuring data integrity and security.
[47] In addition, the access and token mortgage mechanism links tokens to economic incentives, which means that users need to pay tokens to participate in the system. This mechanism is effective in resisting distributed denial of service (DDoS) attacks because token payments and economic benefits limit the motivation and potential of malicious users to launch attacks.
[0197] In the CG-PBFT algorithm, by reasonably grouping consensus nodes, the possibility of attackers controlling enough nodes to tamper with the consensus can be reduced. The grouped nodes are more likely to supervise and proofread each other during the consensus process, increasing the difficulty and cost of attacks and improving the security of the overall network. At the same time, the node selection process is optimized to ensure that the master nodes selected each time are nodes with high contribution, thereby improving the security of the consensus. The above measures can effectively improve its ability to resist 51% attacks.
[0198] 2. Experiment and results analysis
[0199] 2.1 Experimental Environment
[0200] In order to further verify the performance of the CG-PBFT algorithm, we used Intel(R) Core(TM) i7-12700H 2.30GHz, memory 16.0GB, a win10 operating environment, and virtualized multiple operating system instances on a computer, allowing each instance to represent a node, and each node running the same Byzantine fault-tolerant consensus algorithm software, and completed the consensus process through mutual communication to simulate the multi-node environment and then simulate the construction of the blockchain system environment. We compared CG-PBFT with traditional PBFT, G-PBFT, WBFT and RBFT, and evaluated them from four indicators: communication load, throughput, latency and fault tolerance. After the system ran for 5 minutes, the client initiated 200 groups of requests. The experiment was repeated 30 times, and the average of the 30 experimental results was taken as the final result of the test. The detailed experimental parameters are shown in Table 1.
[0201] Table 1 Experimental setup
[0202]
[0203]
[0204] 2.2 Communication Overhead
[0205] The communication resources consumed by each node when performing operations such as information transmission, verification, and data synchronization with other nodes constitute the communication overhead. These communication overheads play a vital role in the consensus process, but they also bring additional resource consumption. For example, in a public chain, it can ensure the reliability and security of transactions and blocks. In a private chain or consortium chain, communication overhead can be reduced by adopting more efficient algorithms and protocols
[52] . Lower communication overhead can reduce network congestion and transmission delay, and can also reduce the burden and resource consumption of nodes. Therefore, in general, lower communication overhead is an important goal of blockchain network optimization and improvement. The size of the communication overhead is related to factors such as the number of nodes and the frequency of communication. By reducing communication overhead, the efficiency and performance of the blockchain network can be improved.
[0206] This section analyzes the single consensus communication of the PBFT algorithm, PoC algorithm, and CG-PBFT algorithm, and compares the differences in communication complexity of the three algorithms.
[0207] (1) Number of transmissions of a single consensus
[0208] PBFT consists of the pre-preparation phase, preparation phase, and submission phase. The communication overhead is mainly concentrated in the latter four phases. In the pre-preparation phase, the master node sends messages to other consensus nodes. The network communication consensus in this phase is N-1 (N refers to the number of nodes). Entering the preparation phase, messages are sent to all nodes except the node itself to exchange information with each other. The number of communications in this phase is N*(N-1). In the submission phase, all nodes verify the received preparation information with other nodes. In this phase, the communication consensus is N*(N-1). In the reply phase, each node sends a confirmation message to the client. The number of communications is N times
[53] . In summary, the number of communications to achieve a PBFT consensus algorithm is T1.
[0209]
[0210] (2)Analysis of PoC algorithm network communication interaction
[0211] The PoC consensus process is mainly divided into four stages: proposal stage, voting stage, calculation stage, and announcement stage. In the proposal stage, each node needs to send a broadcast to other nodes. The number of communications at this time is N-1 times. In the voting stage, each node needs to send a voting message to other nodes. Therefore, the number of communications is M-1 times. Entering the calculation stage, the node needs to calculate the contribution of the winning proposal based on the received voting results. In this stage, each node needs to send the calculation result to other nodes once, and the number of communications at this time is N-1 times. In the announcement stage, each node needs to receive an announcement message from other nodes once, and the number of communications in this stage is N-1 times. Therefore, the formula for the total number of communications required in a consensus process of the contribution-based consensus algorithm is as follows.
[0212] T2=4(N-1) (12)
[0213] (3) Analysis of CG-PBFT algorithm network communication interaction
[0214] Compared with the traditional PBFT algorithm, the improved CG-PBFT consensus algorithm adds a consensus set grouping stage and introduces a contribution consensus mechanism to select the master node. In the algorithm's consensus set division stage, the N nodes in the network need to be divided into F different consensus sets. The number of communications in this process is F (F refers to the number of consensus sets). After the consensus sets are divided, a contribution mechanism is introduced to elect the master node within each consensus set. The total number of communications in this process is (N / F-1)*F. For the internal consensus set preparation stage, the master node selected by each consensus set broadcasts a message to the members within the consensus set. At this time, the number of communications is (N / F-1)*F. In the internal consensus set submission stage, each member of the consensus set submits a message to the master node. The number of communications is (N / F-1)*F. In the preparation stage outside the consensus set, the master node broadcasts messages to other nodes except itself. The number of communications is (F-1)*F. For the submission stage outside the consensus set, each master node verifies the received message and then sends it to other master nodes. The number of communications is (F-1)*F
[31] Then the total number of CG-PBFT communications T3 is
[0215]
[0216] Assuming N / F is an integer, let F = N / U, where U is the number of members in the consensus set and its value is an arbitrary constant greater than 3, then Formula 10 can also be simplified to:
[0217]
[0218] In addition, in the CG-PBFT algorithm, the consensus set is first divided, and then each consensus set selects a master node before consensus is reached. At this time, only the master node communicates with other nodes, that is, the total communication complexity can be regarded as the communication complexity of the master node. According to the analysis and calculation, the communication complexity of the CG-PBFT algorithm is O(F 2 ), while the communication complexity of the PBFT consensus mechanism is O(N 2 ), the communication complexity of the PoC consensus mechanism is O(N). Compared with PBFT, the CG-PBFT algorithm reduces the communication complexity and shortens the communication time. The comparison between the three algorithms is shown in Table 2.
[0219] Table 2 Comparison of three algorithms
[0220]
[0221] According to the above calculation formula, the traditional PBFT algorithm, PoC algorithm and the CG-PBFT algorithm proposed in this paper are evaluated and demonstrated from the two aspects of communication times and time complexity.
[0222] When N≥4,F≥4,
[0223] 2N 2 -1>3N+2N*(N-2)≥3N+2F*(F-2) (15)
[0224] From formula (12), it can be seen that T1>T3, that is, CG-PBFT requires fewer communications than traditional PBFT, and the number of communications decreases as the number of nodes increases.
[0225] Demonstrate the communication complexity. The communication time complexity of traditional PBFT is O(N 2 ), the communication time complexity of CG-PBFT proposed in this invention is O(F 2 ).
[0226] When N≥4,F≥4,
[0227] O(N 2 )>O(F 2 ) (16)
[0228] It can be seen from formula (13) that the algorithm complexity of PBFT is greater than that of CG-PBFT, that is, the CG-PBFT proposed in this paper is better than the traditional PBFT algorithm.
[0229] Experiment 1: Assume that the consensus set group F=4 in the simulation test, and the total number of nodes is set to 20-44. The comparison of the number of communications required for PoC, CG-PBFT, and PBFT consensus algorithms to complete a single consensus is as follows: Figure 4 shown.
[0230] from Figure 6 It can be seen that the number of communications required by the PBFT algorithm to complete a consensus is much higher than that of PoC and CG-PBFT, and the number of communications between the CG-PBFT algorithm and the PoC algorithm is relatively close. And as the number of nodes gradually increases, the gap in the number of communications between the PBFT algorithm and the PoC and CG-PBFT algorithms gradually widens. For example, when the PBFT and CG-PBFT networks each have 28 nodes, the number of communication interactions of PBFT is 1567 times, while the number of communications of CG-PBFT is 100 times. When the number of nodes is 44, the number of communications of the PBFT algorithm is nearly 4000 times. These figures show that the number of communication interaction rounds is significantly reduced in the CG-PBFT consensus process.
[0231] Experiment 2: In order to more intuitively evaluate the communication load performance of the CG-PBFT algorithm, a series of experiments are conducted to measure the communication load of PBFT, G-PBFT, RBFT, WBFT and CG-PBFT under different scenario nodes. Figure 5 Shown are the experimental results of the communication load performance of five consensus algorithms.
[0232] Figure 7 It indicates that the communication overhead of the five algorithms increases with the increase of nodes. However, when the number of nodes in the network is less than 300, the communication overhead of all consensus algorithms is relatively low. After the number of nodes exceeds 400, as the number of nodes continues to increase, the communication overhead increases faster. When the nodes are fixed, the communication overhead of CG-PBFT is relatively the smallest. In addition, by observing the chart, the communication overhead of PBFT increases the fastest, while the increase of CG-PBFT is the smallest. For example, when the number of nodes is 800, it can be seen that compared with PBFT, the communication overhead performance of the other four consensus algorithms is better, especially CG-PBFT performs more prominently, indicating that the algorithm proposed in this article can reduce communication overhead and effectively reduce the amount of message transmission between nodes.
[0233] The experimental results confirm the superiority and effectiveness of CG-PBFT in reducing communication load, making it more promising in applications that require efficient use of network resources. Grouping consensus sets and introducing contribution mechanisms are the main reasons for CG-PBFT to reduce communication costs, making communication between different nodes more efficient and targeted, reducing unnecessary communication overhead, and improving the performance and efficiency of the algorithm. This means that CG-PBFT can not only ensure security, but also improve the efficiency and performance of the system, thereby better meeting the needs of actual applications.
[0234] CG-PBFT proposes a node contribution model, which can make the PBFT algorithm more efficient and reliable in node elections. By reasonably evaluating the contribution of nodes and electing nodes with better quality as master nodes, an efficient consensus mechanism can be maintained. At the same time, CG-PBFT introduces consensus set grouping, and each group can perform independent consensus verification during the consensus process, thereby increasing the fault tolerance of the system and effectively preventing Byzantine nodes from maliciously interfering with the entire system.
[0235] 2.3 Throughput
[0236] Throughput usually refers to the amount of data or transactions that pass through a system in a certain period of time. In blockchain, transactions per second (TPS) is a measure of throughput. TPS is usually defined as the number of transactions that can be processed per unit time, i.e.
[0237]
[0238] Transactions Δt It represents the number of transactions processed within Δt, where Δt represents the time taken to process the corresponding transaction. A high TPS usually means that the system has higher throughput and processing power, and can confirm transactions and generate blocks faster.
[0239] Experiment 1: In the simulation experiment, it is assumed that there are 16-28 nodes participating in the consensus, the client is set to send a request every 40ms, a maximum of 25N requests are processed per second, and a block operation is set to be performed every 10s. After the test runs for 5 minutes, the average value of multiple sets of stable data is taken as the throughput result of the test. The throughput test results of CG-PBFT and PBFT are as follows: Figure 6 shown.
[0240] like Figure 6 As shown in the figure, the throughput of PBFT decreases as the number of nodes increases. For the CG-PBFT algorithm, when the consensus set is divided into 4 groups, the throughput increases as the number of nodes increases. When the number of nodes in the group is fixed to 3, the throughput decreases as the number of nodes increases. More importantly, no matter how the number of nodes changes, CG-PBFT outperforms PBFT. When the grouping is fixed, the number of nodes in the group gradually increases, and the throughput continues to increase; when the number of nodes in the group is fixed, the number of groups continues to increase, but the throughput gradually decreases. In addition, when the number of system nodes remains unchanged, the more nodes in the group, the greater the throughput. Node concurrency is the main factor affecting TPS.
[0241] Experiment 2: Set the number of nodes to 200-800, and then measure the average throughput of the five algorithms under different nodes.
[0242] Figure 7 It shows that the throughput of the five consensus algorithms changes accordingly as the number of nodes increases. Figure 7 The horizontal axis value represents the number of nodes, and the vertical axis value represents the throughput. From the experimental results, the throughput of the CG-PBFT proposed in this paper is better than other algorithms. As the number of nodes increases, the throughput of all algorithms decreases, but the throughput of the PBFT algorithm decreases the most. When the number of nodes is 500, the throughput values of WBFT and G-PBFT are similar, about 226, and the throughput of other algorithms is in the range of 160-420. In addition, it can be seen from the figure that the throughput of CG-PBFT is higher than that of the comparison algorithm under different node conditions, and the decline is lower than that of the comparison algorithm. This shows that the throughput performance of CG-PBFT is higher than that of the comparison algorithm. As the number of nodes continues to increase, the advantage becomes more obvious, indicating that CG-PBFT is suitable for large-scale node scenarios, can process transactions more efficiently, and improve consensus speed.
[0243] 2.4 Consensus Delay
[0244] Consensus Delay can be used to evaluate the performance and efficiency of blockchain systems. Consensus Delay refers to the time from when a transaction is initiated by a client to when it is finally confirmed on the chain. Usually, lower consensus delay is generally considered a key indicator of good system performance, which means that nodes can reach consensus faster, and processes such as transaction verification, block generation and confirmation can be completed faster. This indicates that the entire system is more efficient and responsive, has stronger transaction processing capabilities, and has a higher throughput. The consensus delay formula is expressed as follows:
[0245] Δt=t complete -t start (18)
[0246] Where Δt represents the consensus delay, t complete Indicates the time when the client receives the PBFT reply message, that is, the time when the transaction is confirmed. start Indicates the time when the client consensus starts. Record the data and take the average of multiple experimental results as the consensus delay of the algorithm. The consensus delay comparison test results of the proposed CG-PBFT algorithm and PBFT, WBFT, and G-PBFT are as follows: Figure 8 shown.
[0247] pass Fig.10 It can be clearly seen that the horizontal axis represents nodes and the vertical axis represents transaction delay. And as the number of nodes increases, the consensus delay of all algorithms shows an upward trend. Among them, WBFT and G-PBFT have similar increasing trends and rise slowly, but the PBFT algorithm rises more rapidly. When the number of nodes exceeds 400, the transaction delay of PBFT increases the fastest, while CG-PBFT grows the slowest. In other words, under the same nodes and scenarios, CG-PBFT has the shortest transaction delay and the best performance. For example, when there are 600 nodes in the network, the PBFT delay is 11.38ms, the RBFT delay is 10.61ms, and the CG-PBFT delay is 4.51ms, which is 60.37% lower than PBFT and 57.49% lower than RBFT. The CG-PBFT reference contribution model selects nodes with high contribution as the main node, and nodes with high contribution can usually process and transmit messages faster, thereby speeding up the consensus and reducing delays. The experimental results confirm that the proposed CG-PBFT algorithm can effectively reduce delays.
[0248] 2.5 Fault Tolerance
[0249] In order to judge the security of the proposed algorithm CG-PBFT, the node fault tolerance is tested below. Usually, the alliance chain has a strict access mechanism. For example, identity verification is required to join the alliance chain to ensure that the identity of the participants is legal and meets specific access standards. However, the access mechanism can improve the security of the network to a certain extent, but it cannot completely prevent the existence of malicious nodes.
[0250] Fault tolerance is usually represented by f. For easy distinction, the fault tolerance of traditional PBFT is represented by f. p Indicates that the fault tolerance of the CG-PBFT algorithm is expressed by f cg In general, the number of Byzantine nodes allowed in traditional PBFT is f. p ≤(N-1) / 3. However, CG-PBFT adopts consensus set grouping operation, so its fault tolerance consists of two parts. One part is that all the nodes in the group are Byzantine nodes f cg1 One third of the nodes in the consensus set are non-Byzantine nodes f cg2 Two-thirds of the number of nodes.
[0251] f cg =f cg1 +f cg2 (19)
[0252]
[0253]
[0254] Then the fault tolerance of the proposed algorithm system is:
[0255]
[0256] Simplify formula 20:
[0257]
[0258] In particular, N represents the total number of nodes (N≥12), U (U≥3) represents the number of nodes in the consensus set, and F (F≥4) represents the number of groups.
[0259] from Fig. 9 It can be seen that the number of Byzantine nodes accommodated by PBFT and CG-PBFT increases with the number of nodes, especially after the number of nodes exceeds 200, CG-PBFT shows a more rapid upward trend than PBFT. In addition, under the set conditions, the larger the U value of the CG-PBFT algorithm, the stronger the system fault tolerance. Therefore, compared with PBFT, CG-PBFT shows better fault tolerance.
[0260] We have conducted a comparative experiment on five algorithms. In order to more accurately distinguish the performance of CG-PBFT and PBFT algorithms, we will simplify the experiment to compare the performance indicators of CG-PBFT and PBFT algorithms. This method can explore the differences between CG-PBFT and PBFT in various performance indicators in more detail, so as to more accurately evaluate the differences between them. The test results are as follows: Fig.10 shown.
[0261] from Fig.10 It is clear to see the evaluation results of the proposed algorithm CG-PBFT and traditional PBFT under different performance indicators. The horizontal axis represents the nodes, and the vertical axis represents different performance indicators. Fig.10 (a) shows that as the number of nodes increases, the throughput of both CG-PBFT and PBFT decreases. However, compared with CG-PBFT, the impact of the number of nodes on PBFT is more significant because its throughput decreases significantly faster. Fig.10 (b) The more common nodes there are in the system, the more Byzantine nodes PBFT and CG-PBFT can include. Relatively speaking, the growth trend of PBFT is slightly slower than that of CG-PBFT. Fig.10 (c) and (d) show that the transaction delay and communication overhead of the CG-PBFT algorithm and the PBFT algorithm increase with the increase in the number of nodes. Obviously, PBFT shows a higher growth rate than CG-PBFT. In other words, in the same scenario, PBFT consumes higher communication overhead than CG-PBFT, and the transaction delay of PBFT is longer than that of CG-PBFT. Most importantly, CG-PBFT outperforms PBFT.
[0262] like Fig.11 As shown, the improved alliance chain consensus system based on contribution and grouping provided by the embodiment of the present invention includes:
[0263] Grouping strategy module: By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency;
[0264] Management master node selection module: In the blockchain network, a consensus mechanism based on contribution is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase to solve the problems of PBFT in terms of performance imbalance, security issues and resource consumption;
[0265] Node contribution calculation module: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption;
[0266] CG-PBFT optimizes the consistency protocol module: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, retains the PBFT algorithm stage, adds the master node election stage, solves the problem of arbitrary selection of the master node, and reduces the number of communications;
[0267] Correctness analysis module: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm;
[0268] Byzantine attack defense module: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0269] Resilience module to resist other attacks: In the CG-PBFT algorithm, by reasonably grouping the consensus nodes, it reduces the possibility of attackers controlling enough nodes to tamper with the consensus.
[0270] An application embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of an improved alliance chain consensus method based on contribution and grouping.
[0271] An application embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of an improved alliance chain consensus method based on contribution and grouping.
[0272] An application embodiment of the present invention provides an information data processing terminal, which includes an improved alliance chain consensus system based on contribution and grouping.
[0273] The specific application fields or related products of the present invention.
[0274] 1. Financial sector
[0275] In the financial field, blockchain technology has broad application prospects. By optimizing contribution calculation and grouping algorithms, we can further improve the application efficiency of blockchain in the financial field. For example, in the field of cross-border payments, we can use blockchain technology to achieve fast, secure, and low-cost cross-border payments. By optimizing the grouping algorithm, we can distribute payment requests to nodes with high contribution and high performance for processing, thereby improving payment speed and security.
[0276] Related products include blockchain-based cross-border payment platforms, digital currency trading platforms, etc. These platforms can use optimized contribution calculation and grouping algorithms to provide users with more efficient and secure financial services.
[0277] 2. Internet of Things
[0278] The field of Internet of Things is another important field where the improved PBFT algorithm can be applied. In the Internet of Things, there are a large number of devices and sensor nodes that need to collaborate with each other to complete various tasks. Since the resources of IoT nodes are limited, an efficient and lightweight consensus algorithm is needed to support collaboration between nodes. The improved PBFT algorithm can reduce communication overhead and improve efficiency through contribution and grouping strategies, making it suitable for the field of Internet of Things. For example, an IoT data sharing platform based on the improved PBFT algorithm can be built to collect, process and share various IoT data. The platform can support efficient data sharing and collaborative processing while ensuring data security and reliability.
[0279] 3. Supply Chain Management
[0280] In the field of supply chain management, blockchain technology can help enterprises achieve transparent and traceable supply chain management. By optimizing contribution calculation and grouping algorithms, we can further improve the application efficiency of blockchain in the field of supply chain management. In the supply chain, there are multiple participants and complex business processes, and the authenticity and traceability of information need to be guaranteed. At the same time, the supply chain also has high requirements for the real-time and accuracy of information transmission. The blockchain system using the improved PBFT algorithm can ensure the authenticity and traceability of information in the supply chain, while improving the efficiency and accuracy of information transmission. For example, a supply chain management platform based on the improved PBFT algorithm can be built to track and manage various links and participants in the supply chain. The platform can record and process various business data and information in real time, while providing efficient query and verification functions. It can also be applied in the field of logistics tracking. We can use blockchain technology to achieve real-time and accurate logistics information tracking. By optimizing the grouping algorithm, we can distribute logistics information to nodes with high contribution and high performance for processing, thereby improving the accuracy and real-time performance of logistics tracking.
[0281] Related products include blockchain-based logistics tracking platforms, supply chain management platforms, etc. These platforms can use optimized contribution calculation and grouping algorithms to provide enterprises with more efficient and transparent supply chain management services.
[0282] 4. Other fields
[0283] In addition to finance and supply chain management, blockchain technology can also be applied to many other fields. For example, in the field of copyright protection, we can use blockchain technology to protect the copyright of digital works; in the medical field, we can use blockchain technology to share and safely store medical data. In these fields, the optimized contribution calculation and grouping algorithms can also improve the application efficiency and service quality of blockchain technology.
[0284] Relevant evidence of the technical effects achieved by the embodiments of the present invention.
[0285] 1. Performance Improvement
[0286] In order to verify the performance improvement of CG-PBFT, we conducted a series of experiments and compared it with the traditional PBFT algorithm. The experimental results show that CG-PBFT has achieved significant advantages in transaction throughput, consensus latency, etc. Specifically, when there are 28 nodes, the number of communications of CG-PBFT is 100 times, and the number of communications of the traditional PBFT algorithm is 1567 times; when there are 600 nodes in the network, the consensus latency of CG-PBFT is reduced by about 60% compared with the traditional PBFT. This is mainly due to the application of contribution mechanism and grouping strategy.
[0287] (1) Contribution mechanism: In CG-PBFT, we introduce a contribution index for each node, which comprehensively reflects the node's historical performance, resource input and other factors. By calculating the contribution of the node, we can assign different weights to different nodes, so that in the consensus process, nodes with high contribution have greater influence. This mechanism effectively avoids the resource waste and inefficiency caused by equal participation of nodes in the traditional PBFT algorithm.
[0288] (2) Grouping strategy: In order to reduce communication overhead and improve consensus efficiency, we group nodes in the network according to their contribution. Nodes in each group communicate with each other to form a local consensus, and then submit the local consensus results to the global consensus node for verification and confirmation. This grouping strategy effectively reduces the amount of communication between nodes and reduces network congestion, thereby improving the overall performance of the system.
[0289] 2. Enhanced security
[0290] Security is one of the most core performance indicators of blockchain systems. We verified the security advantages of CG-PBFT by simulating malicious attack scenarios. The experimental results show that CG-PBFT can effectively resist common malicious attacks such as Byzantine attacks and double payment attacks. This is mainly due to the following two aspects:
[0291] (1) Byzantine fault tolerance: CG-PBFT inherits the Byzantine fault tolerance of the traditional PBFT algorithm, that is, even when there are some malicious nodes in the network, it can still ensure that honest nodes reach consensus. By introducing the contribution mechanism and grouping strategy, we further enhance the system's Byzantine fault tolerance, allowing the system to maintain stable operation in the face of larger-scale malicious attacks.
[0292] (2) Node contribution mechanism: In CG-PBFT, we establish a contribution record for each node, recording the node’s contribution information and behavior. By analyzing the node’s contribution record, we can promptly detect and isolate malicious nodes to prevent them from causing damage to the system.
[0293] 3. Reduced system overhead
[0294] In the traditional PBFT algorithm, the communication overhead and computational overhead between nodes are important factors that restrict system performance. In order to reduce system overhead, we adopted the following measures in CG-PBFT:
[0295] (1) Grouping strategy: By grouping nodes, we effectively reduce the amount of communication between nodes and reduce communication overhead. At the same time, since the number of nodes in each group is small, the amount of computation required to reach consensus is also reduced accordingly, further reducing computational overhead.
[0296] (2) Contribution mechanism: In the traditional PBFT (Practical Byzantine Fault Tolerance) algorithm, the selection of the master node usually adopts a simple rotation mechanism. This method does not take into account the performance and contribution of the node, resulting in an increase in system overhead. In order to optimize this problem, we introduced a contribution algorithm, which dynamically selects the master node based on the actual contribution of the node. Specifically, the contribution algorithm first defines a formula for calculating the contribution, which comprehensively considers factors such as the node's resource input, efficiency and correctness of processing requests. By regularly calculating and updating the contribution of each node, the system can identify the node with the highest contribution. Subsequently, in the view (view)
[0297] When switching, the node with the highest contribution is selected as the new master node. This method effectively avoids the blindness of master node selection in traditional PBFT and ensures that the master node has high performance and reliability. By dynamically adjusting the master node, the system can process requests more efficiently, reduce the overhead of network transmission and computing resources, and thus improve the performance and stability of the entire system.
[0298] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0299] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. An improved alliance chain consensus method based on contribution and grouping, characterized in that: include: S1, Grouping strategy: By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency; S2, management master node selection phase: In the blockchain network, a consensus mechanism based on contribution is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase to solve the problems of PBFT in terms of performance imbalance, security issues and resource consumption; S3, node contribution calculation: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption; S4, CG-PBFT optimizes the consistency protocol: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, retains the PBFT algorithm stage, adds the master node election stage, solves the problem of arbitrary selection of the master node, and reduces the number of communications; S5, Correctness Analysis: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm; S6, Defense against Byzantine attacks: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT; S7, resilience against other attacks: In the CG-PBFT algorithm, consensus nodes are reasonably grouped to reduce the possibility of attackers controlling enough nodes to tamper with the consensus.
2. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: The grouping steps in S1 are as follows: System initialization: Before the blockchain network is started, the system is initialized, including authenticating newly joined nodes and selecting F of them as candidate management nodes; this step ensures that the network has a set of recognized master node candidates at the beginning; Isolation status confirmation: confirm that the nodes in the network have not yet established contact and are in an isolated state. This is to ensure that all nodes are in a fair and isolated state before the response speed test is carried out to avoid the influence of external factors; Group detection message: Prepare the master node a∈(1, 2, ...N), assuming that node 1(a) sends a group detection message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1, and its digital signature is S_a. These messages are used to solicit other nodes' willingness to join the consensus cluster and initiate communication and information transmission between nodes; Request to join the consensus set: When node x, x∈1,2,...n receives this message, it first proves the signature of node 1 (a) to ensure that the message is authentic and valid; if correct, then node x decides to join the consensus cluster of node 1 and sends a join request <subset request, t2, S_x> to node 1, where t2 is the current timestamp of node x and S_x is the digital signature of the current round; Processing joining request: After receiving the joining request, node a first checks whether the number of its consensus cluster members has reached the upper limit Nmax. If the group is not full and the information verification of node x is passed, node 1 agrees to node x's joining request and adds node x to its consensus set member list; if the number of node 1's consensus cluster members is full or the information verification of node x is not passed, node 1 will send a rejection message to node x, and node x can try to send a joining request to other reserve master nodes; Find the next candidate master node: If node 2 sends a rejection message to node x, then node x requests another candidate master node to join its consensus cluster. This step ensures that the node can find a consensus cluster suitable for itself through multiple attempts and repeat the above steps. End of grouping and information broadcast: After all nodes have attempted to join the consensus cluster, each node that is ready to manage will broadcast their consensus cluster member list for verification, and then send this information down to their respective group members to complete the group confirmation; this ensures that each node can eventually find the consensus cluster to which it belongs, and that the member list of each consensus cluster is up-to-date and accurate.
3. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: S2 specifically includes: In the management master node selection phase, when the consensus set is grouped, the flag enters the master node election based on contribution. First, the nodes in each group will be comprehensively evaluated based on their contribution to the network. This contribution evaluation can be based on a variety of indicators, including the online time of the node, the data volume contribution of the node, and the online resource consumption factor of the node. Based on these indicators, the contribution of each node is calculated. Then each node will be assigned a corresponding contribution score. According to the contribution score of the node, the node with the highest contribution in the group will be selected as the master node. This election process can be completed by voting, ranking or other mechanisms. The node will broadcast its contribution score to other nodes in the network, and other nodes will be ranked based on this information, and finally the node with the highest contribution will be selected as the master node. Once each group selects the master node, it will enter the out-of-group consensus.
4. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: S3 specifically includes: First, the node contribution is affected by the data volume contribution and data information entropy. The large amount of high-quality data provided by the node can effectively support the normal operation and transaction processing of the blockchain network, thereby improving the node contribution; online resource consumption is affected by the computing power, bandwidth and storage space resources consumed by the node when maintaining the blockchain network. The node needs to consume a lot of resources to verify and confirm transactions, maintain the integrity of the network, and provide services to other nodes. The greater the resource overhead, the higher the node contribution.
5. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: S4 specifically includes: Request phase: multiple transaction requests are sent by the client to the consensus nodes of each consensus set; In-group master node selection phase: Calculate the contribution of nodes in each consensus set and sort them, select the node with the highest contribution as the master node, and then pre-process the transactions related to the current state of the blockchain network and the transactions to be involved in the consensus. The verified and processed transactions will be combined into pre-prepared messages; the pre-prepared messages contain detailed information about the proposal, such as the proposal number, the message digest of the client request, and the timestamp; the node receives the message from the master node and first verifies its legitimacy, including the signature and sequence number information of the verification message to ensure the source and integrity of the message; if the message verification passes, the node will put the proposal into its own proposal queue and wait for subsequent preparation messages; if the message verification fails, the node will ignore the message and continue to wait for other messages or process other tasks; In-group preparation phase: If the node verification is passed, the pre-preparation message is considered to be legal and valid. Then the information interaction is broadcast to all nodes. The consensus node will verify the received interaction information. When a sufficient number of consistent interaction information is received from different nodes, the next step can be taken. Otherwise, the consensus process is terminated, the node problem is replaced, and the consensus process is restarted. If the node approves the proposal, it will generate a preparation message containing its own approval information. Intra-group submission phase: The master node conducts a comprehensive check on the received preparation message, including verifying the consistency of the message and confirming whether a sufficient number of nodes support the proposal to form a majority opinion; once the legitimacy and consistency of the message are confirmed and consensus is reached, the node initiates a response to the proposal; at the same time, these messages can be directly broadcast to other nodes in the entire network, allowing other nodes to understand and verify these confirmation information; in this way, the entire system can gradually reach a consensus; Beyond consensus setting: Among the members of the intra-group consensus cluster, the master node verifies the member's information and confirms its consensus within the group, and then conducts inter-group consensus. The master node broadcasts the message to other master nodes and enters the preparation stage; No consensus set submission phase: Verify the received broadcast message. If the verification passes, the node processes the message. If the node finds that the message is inconsistent, it rejects the message. If multiple nodes receive the same message, the message is considered acceptable and broadcast. Group reply phase: Verify the received confirmation messages to confirm their legitimacy and consistency, and determine whether the proposal is accepted or rejected based on these messages and the current state of the node; if the confirmation message is legal and valid, the node generates a final confirmation message and notifies other nodes in the group; Beyond the consensus reply phase: The master node sends a reply to the client, marking the completion of a complete consensus process. There is only one master node in the consensus cluster that initiates the consensus request, and other nodes are responsible for verifying the transaction hash and signature, avoiding duplicate consensus and competition problems and improving efficiency.
6. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: S5 specifically includes: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm. In the first consensus phase, the PoC algorithm selects the master node through contribution proof and randomness, and controls the malicious nodes within 30% of the total number of nodes, thereby ensuring consistency. In the second phase, PBFT ensures that the nodes reach consensus through message interaction, while avoiding errors or deception, ensuring final consistency, and having fault tolerance when the number of faulty nodes does not exceed f.
7. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1, characterized in that: S6 specifically includes: PBFT is fault-tolerant. Assuming there are N nodes, there are always f Byzantine nodes. When the number of faulty nodes is less than or equal to f, honest nodes can maintain consistency through communication to ensure security. The PBFT view replacement mechanism can deal with the failure of the master node or other problems, quickly restore the consensus process, and ensure continuity and security. The message signature mechanism prevents forgery, replay attacks and tampering, ensuring consensus security. The technical solution of the present invention solves the technical problems of the prior art and achieves significant technical progress.
8. An improved alliance chain consensus system based on contribution and grouping that implements the improved alliance chain consensus method based on contribution and grouping as claimed in any one of claims 1 to 7, comprising: Grouping strategy module: By grouping the consensus set, the complexity of communication between nodes can be reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency; Management master node selection module: In the blockchain network, a consensus mechanism based on contribution is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase to solve the problems of PBFT in terms of performance imbalance, security issues and resource consumption; Node contribution calculation module: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption; CG-PBFT optimizes the consistency protocol module: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, retains the PBFT algorithm stage, adds the master node election stage, solves the problem of arbitrary selection of the master node, and reduces the number of communications; Correctness analysis module: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm; Byzantine attack defense module: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT; Resilience module to resist other attacks: In the CG-PBFT algorithm, by reasonably grouping the consensus nodes, it reduces the possibility of attackers controlling enough nodes to tamper with the consensus.
9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved alliance chain consensus method based on contribution and grouping as described in any one of claims 1 to 7.
10. An information data processing terminal, comprising the improved alliance chain consensus system based on contribution and grouping as described in claim 8.
Citation Information
Patent Citations
Blockchain node contribution proving consensus method for crowd-sourcing service
CN113347162A
Consensus device and method for file block chain based on contribution value proof
CN114741721A
PBFT consensus optimization method based on packet reputation value
CN115065468A
PBFT improved algorithm based on contribution value model and verifiable random function
CN117749383A
Method and system for multi-block mining by a single node, in (a) single round(s), under different consensus schemes
US20230224176A1
Cited By
Product supply method and system based on block chain technology
CN120410278A
Vehicle transportation data storage method and system based on block chain
CN120675694A
Byzantine fault-tolerant consensus method, block chain system, electronic equipment and storage medium
CN120812070A
Byzantine fault-tolerant consensus method, blockchain system, electronic device and storage medium
CN120812070B
