POA consensus algorithm based on ELASTICO protocol and window rotation mechanism collaborative optimization

The POA consensus algorithm optimizes node grouping in the ELASTICO protocol with Maglev hashing and a window rotation mechanism, addressing uneven sharding and cloning attacks, ensuring fair and secure node selection and income distribution.

CN119094523APending Publication Date: 2024-12-06SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411352022.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The Elastico protocol suffers from uneven sharding due to random Hash operation results, leading to inefficiencies, while the Proof of Authority (PoA) algorithm is vulnerable to cloning attacks and centralization, exposing leader node selection orders and making it susceptible to malicious attacks.

Method used

A POA consensus algorithm is developed using the ELASTICO protocol optimized with Maglev consistent hashing for balanced node grouping, combined with a window rotation mechanism and a reputation model to ensure fair and secure node selection, incorporating a Shapley value for income distribution.

Benefits of technology

The solution enhances node grouping efficiency, ensures fair income distribution, and improves security by making node selection more objective and unpredictable, reducing vulnerabilities to malicious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094523A_ABST
    Figure CN119094523A_ABST
Patent Text Reader

Abstract

The invention aims to provide a POA consensus algorithm based on an optimized packet protocol and a window rotation mechanism. The consensus algorithm comprises a double-layer network structure, a first-layer network structure and a second-layer network structure, wherein the double-layer network structure comprises a lower-layer group and an upper-layer monitoring organization; a reputation model and an incentive mechanism of a benefit distribution scheme based on a Shapley value are included; the method comprises the following steps: uniformly distributing nodes in a block chain network by adopting an ELASTICO protocol improved based on a Maglev consistent Hash algorithm to form a lower layer group; the lower group selects Candidate nodes by using a general consensus algorithm to form an upper supervision organization, and the upper supervision organization divides all the Candidate nodes into on-duty nodes, supervision nodes and verification nodes by using a window round-valuing mechanism based on a ticket selection mechanism to carry out window round-valuing. According to the method, the consensus efficiency can be improved, node grouping is more efficient and balanced, compared with a classic POA algorithm, the node prediction accuracy of an attacker can be remarkably reduced, and higher safety is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a POA consensus algorithm based on collaborative optimization of an ELASTICO protocol and a window rotation mechanism. Background Art

[0002] The Elastico protocol is the first secure sharding protocol for blockchain proposed by Loi Luu et al. in 2016. The key idea of ​​the protocol is to divide the network into smaller committees, each of which processes a set of disjoint transactions to achieve parallel computing power. The protocol is carried out in epochs, where an epoch can be understood as the time to generate each block. For example, Bitcoin generates a block every 10 minutes, which means that the network has reached an agreement. This period of time is called an epoch. In each epoch, the protocol performs the following five steps in sequence: establishment of identity and establishment of committee; committee coverage setting; committee internal consensus; final consensus broadcast; random generation of epochs. However, the Elastico protocol currently has the problem of using the Hash operation results for grouping, which is relatively random and leads to uneven sharding.

[0003] The Proof of Authority (PoA) algorithm provides fast transactions through trusted identity authorization and has attracted attention for its high performance and high fault tolerance. However, it has a cloning attack, which is to attack the PoA algorithm by cloning an authority node. The reason for this attack is that the leader node remainder method in PoA easily exposes the selection order of the leader node, resulting in the process of selecting the next round of authority nodes being completely public in the network. The disclosure of authority nodes may lead to security and third-party manipulation, making them vulnerable to denial of service attacks (DDos) and censorship attacks, that is, attackers can cause dishonest behavior of authority nodes through malicious attacks. In addition, there are also problems such as centralization. Summary of the invention

[0004] The purpose of the present invention is to provide a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, which can improve the consensus efficiency and solve the delay problem. A two-layer architecture is proposed. When grouping, the ELASTICO protocol uses the Hash operation results for grouping, which is relatively random and leads to uneven sharding. The Maglev hash consistency algorithm is used to improve and optimize the grouping of the ELASTICO protocol, so that the node grouping is more efficient and balanced.

[0005] A POA consensus algorithm based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, including: The ELASTICO protocol based on the improved Maglev consistent hashing algorithm is used to evenly distribute the nodes in the blockchain network to form the lower-level group; The lower-level group uses a general consensus algorithm to select candidate nodes to form an upper-level supervisory organization; The upper-level supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

[0006] Preferably, the ELASTICO protocol improved based on the Maglev consistent hashing algorithm is used to evenly distribute the nodes in the blockchain network, and the lower-level groups include: Build a reputation model to evaluate the reputation value of each node: Calculate the historical trust value of the previous era: ; Calculate the initial trust value for each era: ; Calculate the global trust value for each round: ; ; in, is the global trust value of node j in this round, is the historical trust value of the ith node, m rounds, is the initial trust value of the i-th node, is the local trust value of node j to node i, is the historical trust value of node i in the previous era, and n is the number of nodes in the group.

[0007] Preferably, the contribution of the computing node includes: The historical trust value and global trust value are used as elements that affect node benefits to construct the rewards allocated to nodes, which can be expressed as: ; Among them, R represents the reward to be distributed, is the Shapley value of the ith node, is the global trust value of the i-th node in the current round.

[0008] Preferably, the ELASTICO protocol improved based on the Maglev consistent hashing algorithm includes: After the identities of the nodes on the blockchain are established, the system determines the number of groups based on the principle that the number of people in each group is as close as possible, and randomly names each group; The system generates an empty lookup table of size M, where the size of M is the total number of nodes on the chain, and generates a permutation of length M for each group, and then fills the lookup table in turn according to the order of the numbers in the permutation; If the node represented by the current position already has a group, continue searching for a fill in the permutation order; If no group is assigned, the current position is filled directly; After all nodes are assigned, point-to-point connections are established between the nodes of each group, and the group consensus begins; After the upper-level supervisory organization reaches consensus, it agrees on the final result and broadcasts it to the network. At the same time, the upper-level supervisory organization runs a distributed "commit-XOR" scheme to generate a random value, which is broadcast in the network and used in the next era.

[0009] Preferably, it also includes forming a lower-level group to run the group consensus to select candidate nodes, specifically: The upper supervisory organization uses the list proportional representation system combined with the San Lagu calculation method to allocate seats to the lower-level groups; At the beginning of each era, the number of on-duty nodes and supervisory nodes required for this era is determined based on the load of the previous era, and seats are allocated to the lower-level groups according to the Saint Lagu calculation method; The votes of each lower-level group are distributed in proportion to the total contribution value of the group. The total number of votes of each group is a% of the total number of votes, and the votes of each group are redistributed in a descending manner; Before Contribution The total number of votes of the group is b% of the total number of votes, and the contribution value is The total number of votes cast by the group is c% of the total number of votes, where ,The total number of votes is the total number of nodes; The initial number of votes obtained by each group is divided by 1.4 for the first round of comparison, and the group with the most votes wins the first seat; The original number of votes of the group that won the first seat is divided by 3, and the votes of other groups remain unchanged. A second round of comparison is conducted, and the group with the most votes wins the second seat; The original number of votes for the group with the most votes in the second round is divided by 5. The other groups remain unchanged. A third round of comparison is conducted. The group with the most votes gets the third seat, and so on, until all seats are allocated.

[0010] Preferably, the lower-level group uses a general consensus algorithm to select candidate nodes to form an upper-level supervisory organization, including: When the system is initialized, an information table is created to store the contribution values, historical trust values, era information, and round number information of all nodes in all eras; In each epoch, the lower-level groups select candidate nodes through group consensus to form a new upper-level supervisory organization. There are m rounds in an epoch, and the upper-level supervisory organization is not re-elected in each round. Leader nodes are selected in each round within the upper-level supervisory organization. At the beginning of the era: the lower-level groups select candidates through group consensus to form the upper-level supervisory organization; Selection of node roles: In each round, the upper-level supervisory organization adopts a voting mechanism to divide candidate nodes into three roles according to the support ranking: on-duty nodes, supervisory nodes, and verification nodes, and enter the corresponding node pools. On-duty nodes and supervisory nodes are randomly selected from the on-duty node pool and the supervisory node pool. On-duty nodes are responsible for proposing blocks and packaging blocks, supervisory nodes are responsible for monitoring the behavior of on-duty nodes and verification nodes, and verification nodes are responsible for verifying and confirming blocks. Propose a new block: The node on duty will construct a new block, sign the block data and block hash accordingly, and broadcast the block and signature to all candidate nodes in the consensus network; Block reception: The verification node will check the validity of the block header, then sign the block accordingly and send the signature information to the on-duty node of the current round; Block packaging confirmation: The on-duty node must wait for valid signatures from at least N / 2+1 verification nodes before submitting the block and broadcasting the new block to the entire blockchain network; End of the era: When the number of rounds is m, the current era ends and a new era begins.

[0011] Preferably, the upper supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes and verification nodes for window rotation, including: Combined with the node's own contribution value , global trust value Calculate the support, expressed as: ; in, is the contribution value of the i-th node, is the sum of the contribution values ​​of the nodes participating in the voting. is the number of votes received by the ith node, is the total number of votes in the node group, is the global trust value of the i-th node, and N is the number of nodes participating in the voting; The system divides candidate nodes into three roles according to the ranking of support: on-duty nodes, monitoring nodes, and verification nodes, and each node enters the corresponding node pool.

[0012] A POA consensus system based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, including: The lower-level group generation module is used to evenly distribute the nodes in the blockchain network using the ELASTICO protocol improved based on the Maglev consistent hashing algorithm to form the lower-level groups; The upper-level supervisory organization generation module is used to select candidate nodes from the lower-level groups using a general consensus algorithm to form an upper-level supervisory organization; The node selection module is used by the upper-level supervisory organization to adopt a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

[0013] An electronic device comprises: a processor and a memory, wherein the memory is used to store computer program code, the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism.

[0014] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism.

[0015] The beneficial effects of the present invention are as follows: 1. The present invention uses the Maglev hash consistency algorithm to improve the grouping mechanism of the ELASTICO protocol. Compared with the prior art, the grouping of nodes is more efficient and balanced; 2. The present invention designs a new voting mechanism and a window rotation mechanism by combining the global trust value and the contribution value, which well solves the problem that the leader node remainder method in PoA is easy to expose the selection order of the leader node, resulting in the process of selecting the next round of authoritative nodes being completely open in the network and vulnerable to malicious attacks, making the election of the leader node more objective, scientific, fair and unpredictable; 3. The present invention sets an incentive mechanism, introduces the Shapley value for distributing income, and uses the node contribution value as an important calculation parameter. Compared with the prior art, the income distribution of the node work is more fair, and the node work enthusiasm is higher; 4. All calculation formulas of the present invention are closely linked, for example: the reputation of the node will affect the income, and the contribution value and reputation will affect the support of the node. Compared with the prior art, it can better constrain the behavior of the node, so that it can maintain its enthusiasm and good reputation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] Figure 1 This is a flow chart of the POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism of the present invention; Figure 2 The figure is a schematic diagram of the hardware structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0021] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0022] The Elastico protocol currently has the problem of using the Hash calculation results for grouping, which is relatively random and leads to uneven sharding. The Proof of Authority (PoA) algorithm has a cloning attack, that is, the PoA algorithm can be attacked by cloning an authority node. The reason for this attack is that the leader node remainder method in PoA easily exposes the selection order of the leader node, resulting in the next round of authority node selection process being completely public in the network. The disclosure of the authority node may lead to security and third-party manipulation, making it vulnerable to denial of service attacks (Distributed Denial-of-service attacks, DDos) and censorship attacks, that is, attackers can cause dishonest behavior of the authority node through malicious attacks. In addition, there are also problems such as centralization.

[0023] The present invention uses the Maglev hash consistency algorithm to improve the grouping mechanism of the ELASTICO protocol. Compared with the prior art, the grouping of nodes is more efficient and balanced. The present invention designs a new voting mechanism and a window rotation mechanism by combining the global trust value and the contribution value, which well solves the problem that the leader node remainder method in PoA is easy to expose the selection order of the leader node, resulting in the process of selecting the next round of authoritative nodes being completely open in the network and vulnerable to malicious attacks, making the election of the leader node more objective, scientific, fair and unpredictable. The present invention sets an incentive mechanism, introduces the Shapley value for distributing income, and uses the node contribution value as an important calculation parameter. Compared with the prior art, the income distribution of the node work is more fair, and the node work enthusiasm is higher. All calculation formulas of the present invention are closely linked, for example: the reputation of the node will affect the income, and the contribution value and reputation will affect the support of the node. Compared with the prior art, the behavior of the node can be better constrained to keep its enthusiasm and good reputation.

[0024] Example 1 A POA consensus algorithm based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, reference Figure 1 ,include: S100, uses the ELASTICO protocol improved based on the Maglev consistent hashing algorithm to evenly distribute the nodes in the blockchain network to form the lower-level group; S200, the lower-level group uses the general consensus algorithm to select candidate nodes to form the upper-level supervisory organization; S300, the upper-level supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

[0025] The technical solution of the present invention has two layers of consensus network: the consensus of the lower group and the consensus of the upper supervisory organization; the lower group is composed of a certain number of supervisory nodes and a number of ordinary nodes, and the number of supervisory nodes per round and per group is allocated by the upper supervisory organization. The supervisory nodes of all lower groups constitute the upper supervisory organization.

[0026] The ER-POA consensus algorithm consists of four parts: incentive mechanism, node grouping, window rotation, and consensus process. The reputation model is used in the incentive mechanism to evaluate the reliability of nodes, and the Shapley value is introduced to ensure that the benefits of nodes in cooperation are fairly distributed; the Maglev consistent hashing algorithm is used to improve the ELASTICO protocol, making node grouping more efficient and balanced. At the same time, in order to improve the efficiency of the system, the concept of rounds is proposed. An era is divided into n rounds, and each round will no longer be reorganized. After n rounds, the grouping will be re-grouped; the window rotation scheme uses a voting mechanism to rotate the roles of nodes in the upper-level supervisory organization to achieve decentralization.

[0027] At the beginning of each era, the nodes in the blockchain network are evenly grouped using the ELASTICO protocol modified based on the Maglev consistent hashing algorithm. Each group is numbered 1.2.3...n in sequence. The goal of each group is to use a simpler consensus algorithm to select Candidates nodes to form the upper supervisory organization. At this time, the round number is 0. The upper supervisory organization adopts a window rotation scheme based on a voting mechanism to divide all nodes of the upper supervisory organization into supervisory nodes and on-duty nodes. On-duty nodes are responsible for proposing new blocks and packaging blocks, etc. Supervisory nodes are responsible for supervising the behavior of nodes in the blockchain network. After each round of consensus, the round number is increased by 1. When the round number is , the era ends and the next era begins.

[0028] In order to improve consensus efficiency and solve latency problems, the present invention proposes a two-layer architecture. In grouping, the ELASTICO protocol uses the Hash calculation results for grouping, which is highly random and leads to uneven sharding. The Maglev hash consistency algorithm is used to improve and optimize the grouping of the ELASTICO protocol, making the node grouping more efficient and balanced. In order to solve the problem that the leader node remainder method in PoA easily exposes the selection order of the leader node, resulting in the process of selecting the next round of authoritative nodes being completely public in the network and vulnerable to malicious attacks, the present invention proposes a window rotation mechanism based on voting, which takes the node contribution value and trust value as important parameters for election. At the same time, in order to solve the reward distribution problem in node cooperation, the Shapley value is introduced, and the profit distribution formula is designed for reasonable distribution, which solves the centralization problem and improves the work enthusiasm of the nodes. In addition, a reputation model is designed to urge nodes to maintain a good reputation.

[0029] Preferably, the ELASTICO protocol improved based on the Maglev consistent hashing algorithm is used to evenly distribute the nodes in the blockchain network, and the lower-level groups include: Build a reputation model to evaluate the reputation value of each node: Calculate the historical trust value of the previous era: ; Calculate the initial trust value for each era: ; Calculate the global trust value for each round: ; ; in, is the global trust value of node j in this round, is the historical trust value of the ith node, m rounds, is the initial trust value of the i-th node, is the local trust value of node j to node i, is the historical trust value of node i in the previous era, and n is the number of nodes in the group.

[0030] The contribution of nodes directly affects the security and stability of the entire blockchain network. It is also a very important decision-making basis in the voting mechanism, which is measured by some indicators, such as: the online time of the node, the degree of consensus participation of the node, the service participation of the node, etc.

[0031] The main body of the reputation model is the trust evaluation mechanism. The trust evaluation mechanism calculates the direct trust value and recommended trust value of each node through the consensus process between nodes, and further calculates the global trust value of each node. The global trust value is used as an important basis for evaluating the reliability of nodes, and is also an important parameter for nodes in obtaining profit distribution.

[0032] In addition, the reputation model introduces a new definition, the historical trust value. The initial trust value of all nodes in each era is equal to the historical trust value of the node at the end of the previous era. In addition, historical trust value is an important weight factor in calculating the global trust value of the node in the current round. This can better motivate each node to maintain a high credit value for a long time and better maintain the security and stability of the blockchain network.

[0033] Preferably, the contribution of the computing node includes: The historical trust value and global trust value are used as elements that affect node benefits to construct the rewards allocated to nodes, which can be expressed as: ; Among them, R represents the reward to be distributed, is the Shapley value of the ith node, is the global trust value of the i-th node in the current round.

[0034] The Shapley value is a method used to measure the contribution of participants to the final revenue in cooperative game theory. It can help evaluate the role of each node in a work on the chain, thereby ensuring that the distribution results are fair to each node.

[0035] The present invention takes historical trust value and global trust value as elements affecting node benefits, and designs a reward calculation formula for node allocation to encourage nodes to participate in work more actively and maintain a good reputation.

[0036] Preferably, the improved ELASTICO protocol based on the Maglev consistent hashing algorithm includes: After the identities of the nodes on the blockchain are established, the system determines the number of groups based on the principle that the number of people in each group is as close as possible, and randomly names each group; The system generates an empty lookup table of size M, where the size of M is the total number of nodes on the chain, and generates a permutation of length M for each group, and then fills the lookup table in turn according to the order of the numbers in the permutation; If the node represented by the current position already has a group, continue searching for a fill in the permutation order; If no group is assigned, the current position is filled directly; After all nodes are assigned, point-to-point connections are established between the nodes of each group, and the group consensus begins; After the upper-level supervisory organization reaches consensus, it agrees on the final result and broadcasts it to the network. At the same time, the upper-level supervisory organization runs a distributed "commit-XOR" scheme to generate a random value, which is broadcast in the network and used in the next era.

[0037] In an era, after the identities of the nodes on the chain are established, they are divided into multiple groups according to the total number of nodes, and the total number of nodes in each group is M. Then the system will generate an empty lookup table of size M, and generate a preference sequence of length M for each group, and then fill the lookup table in turn according to the order of the numbers in the sequence. If the position is already occupied, it will be filled in the order of the sequence. If it is not occupied, it will be filled directly. After all nodes are evenly distributed, a group becomes a committee. Subsequently, point-to-point connections are established between the nodes of the unified committee, and consensus within the group begins. Finally, the upper-level supervisory organization runs the upper-level supervisory organization consensus, reaches an agreement on the final result and broadcasts it to the network. At the same time, the upper-level supervisory organization runs a distributed "commit-and-xor" scheme to generate a random value, which is broadcast in the network and used in the next era.

[0038] Preferably, it also includes forming a lower-level group to run the group consensus to select candidate nodes, specifically: The upper supervisory organization uses the list proportional representation system combined with the San Lagu calculation method to allocate seats to the lower-level groups; At the beginning of each era, the number of on-duty nodes and supervisory nodes required for this era is determined based on the load of the previous era, and seats are allocated to the lower-level groups according to the Saint Lagu calculation method; The votes of each lower-level group are distributed in proportion to the total contribution value of the group. The total number of votes of the group with % is a% of the total number of votes, and the votes of each group are redistributed in descending order; Before Contribution The total number of votes of the group is b% of the total number of votes, and the contribution value is The total number of votes cast by the group is c% of the total number of votes, where ,The total number of votes is the total number of nodes; The initial number of votes obtained by each group is divided by 1.4 for the first round of comparison, and the group with the most votes wins the first seat; The original number of votes of the group that won the first seat is divided by 3, and the votes of other groups remain unchanged. A second round of comparison is conducted, and the group with the most votes wins the second seat; The original number of votes for the group with the most votes in the second round is divided by 5. The other groups remain unchanged. A third round of comparison is conducted. The group with the most votes gets the third seat, and so on, until all seats are allocated.

[0039] The purpose of the intra-group consensus is to select candidates who have the same number of seats as the upper supervisory organization. Therefore, any consensus algorithm that can meet this requirement is acceptable while ensuring the security of the system. The upper supervisory organization uses a list proportional representation system combined with the Saint-Lagu calculation method to allocate seats to the lower-level groups.

[0040] The Saint Lagu Calculation Method is also translated as the Saint Lagu Calculation Method. It is one of the highest mean method election forms of proportional representation. At the beginning of each era, the system determines the number of on-duty nodes and supervisory nodes required for this era based on the load of the previous era, and allocates seats to the lower-level groups according to the Saint Lagu Calculation Method. The votes of each lower-level group are allocated in proportion to the total contribution value of the group. The total number of votes of the group is a% of the total number of votes, and the votes of each group are redistributed in descending order; The total number of votes of the group is b% of the total number of votes, and the contribution value is The total number of votes cast by the group is c% of the total number of votes (where , the total number of votes is the total number of nodes) The initial number of votes obtained by each group is divided by 1.4 for the first round of comparison, and the group with the most votes wins the first seat.

[0041] Second round: The original number of votes for the group that gets the first seat will be divided by 3. The votes for other groups remain unchanged. A second round of comparison will be conducted and the group with the most votes will get the second seat.

[0042] Round 3: Divide the original number of votes of the group with the most votes in the second round by 5, and keep the other groups unchanged. Then conduct the third round of comparison, and the group with the most votes will get the 3rd seat. And so on, until all seats are allocated.

[0043] Preferably, the lower-level group uses a general consensus algorithm to select candidate nodes to form an upper-level supervisory organization including: When the system is initialized, an information table is created to store the contribution values, historical trust values, era information, and round number information of all nodes in all eras; In each epoch, the lower-level groups select candidate nodes through group consensus to form a new upper-level supervisory organization. There are m rounds in an epoch, and the upper-level supervisory organization is not re-elected in each round. Leader nodes are selected in each round within the upper-level supervisory organization. At the beginning of the era: the lower-level groups select candidates through group consensus to form the upper-level supervisory organization; Selection of node roles: In each round, the upper-level supervisory organization adopts a voting mechanism to divide candidate nodes into three roles according to the support ranking: on-duty nodes, supervisory nodes, and verification nodes, and enter the corresponding node pools. On-duty nodes and supervisory nodes are randomly selected from the on-duty node pool and the supervisory node pool. On-duty nodes are responsible for proposing blocks and packaging blocks, supervisory nodes are responsible for monitoring the behavior of on-duty nodes and verification nodes, and verification nodes are responsible for verifying and confirming blocks. Propose a new block: The node on duty will construct a new block, sign the block data and block hash accordingly, and broadcast the block and signature to all candidate nodes in the consensus network; Block reception: The verification node will check the validity of the block header, then sign the block accordingly and send the signature information to the on-duty node of the current round; Block packaging confirmation: The on-duty node of the current round must wait for valid signatures from at least N / 2+1 verification nodes before submitting the block and broadcasting the new block to the entire blockchain network; End of the era: When the number of rounds is m, the current era ends and a new era begins.

[0044] Preferably, the upper-level supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation, including: Combined with the node's own contribution value , global trust value Calculate the support, expressed as: ; in, is the contribution value of the i-th node, is the sum of the contribution values ​​of the nodes participating in the voting. is the number of votes received by the ith node, is the total number of votes in the node group, is the global trust value of the i-th node, and N is the number of nodes participating in the voting; The system divides candidate nodes into three roles according to the ranking of support: on-duty nodes, monitoring nodes, and verification nodes, and each node enters the corresponding node pool.

[0045] The upper-level supervisory organization has adopted a vote-based window rotation mechanism. In an era, the top supervisors will be ranked according to their support. The nodes of will enter the on-duty node pool, and the rest will enter the supervisory node pool. Each round of rotation will only be randomly selected from the pool. The two pools will be reset at the beginning of the next era.

[0046] Example 2 A POA consensus system based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, including: The lower-level group generation module is used to evenly distribute the nodes in the blockchain network using the ELASTICO protocol improved based on the Maglev consistent hashing algorithm to form the lower-level groups; The upper-level supervisory organization generation module is used to select candidate nodes from the lower-level groups using a general consensus algorithm to form an upper-level supervisory organization; The node selection module is used by the upper-level supervisory organization to adopt a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

[0047] Example 3 An electronic device includes: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism.

[0048] refer to Figure 2, the electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

[0049] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

[0050] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0051] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The output device 24 and the input device 23 may be independent devices or an integrated device.

[0052] Example 4 A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a POA consensus algorithm based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism.

[0053] The present invention uses the Maglev hash consistency algorithm to improve the grouping mechanism of the ELASTICO protocol. Compared with the prior art, the grouping of nodes is more efficient and balanced. The present invention designs a new voting mechanism and a window rotation mechanism by combining the global trust value and the contribution value, which well solves the problem that the leader node remainder method in PoA is easy to expose the selection order of the leader node, resulting in the process of selecting the next round of authoritative nodes being completely open in the network and vulnerable to malicious attacks, making the election of the leader node more objective, scientific, fair and unpredictable. The present invention sets an incentive mechanism, introduces the Shapley value for distributing income, and uses the node contribution value as an important calculation parameter. Compared with the prior art, the income distribution of the node work is more fair, and the node work enthusiasm is higher. All calculation formulas of the present invention are closely linked, for example: the reputation of the node will affect the income, and the contribution value and reputation will affect the support of the node. Compared with the prior art, the behavior of the node can be better constrained to keep its enthusiasm and good reputation.

[0054] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A POA consensus algorithm based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that include: The ELASTICO protocol based on the improved Maglev consistent hashing algorithm is used to evenly distribute the nodes in the blockchain network to form the lower-level group; The lower-level group uses a general consensus algorithm to select candidate nodes to form an upper-level supervisory organization; The upper-level supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

2. According to claim 1, a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that The reputation model includes: Build a reputation model to evaluate the reputation value of each node: Calculate the historical trust value of the previous era: ; Calculate the initial trust value for each era: ; Calculate the global trust value for each round: ; ; in, is the global trust value of node j in this round, is the historical trust value of the ith node, m rounds, is the initial trust value of the i-th node, is the local trust value of node j to node i, is the historical trust value of node i in the previous era, and n is the number of nodes in the group.

3. According to claim 2, a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that The revenue distribution of the computing nodes includes: The historical trust value and global trust value are used as elements that affect node benefits to construct the rewards allocated to nodes, which can be expressed as: ; Among them, R represents the reward to be distributed, is the Shapley value of the ith node, is the global trust value of the i-th node in the current round.

4. According to claim 1, a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that The ELASTICO protocol improved based on the Maglev consistent hashing algorithm includes: After the identities of the nodes on the blockchain are established, the system determines the number of groups based on the principle that the number of people in each group is as close as possible, and randomly names each group; The system generates an empty lookup table of size M, where the size of M is the total number of nodes on the chain, and generates a permutation of length M for each group, and then fills the lookup table in turn according to the order of the numbers in the permutation; If the node represented by the current position already has a group, continue searching for a fill in the permutation order; If no group is assigned, the current position is filled directly; After all nodes are assigned, point-to-point connections are established between the nodes of each group, and the group consensus begins; After the upper-level supervisory organization reaches consensus, it reaches agreement on the final result and broadcasts it to the network. At the same time, the upper-level supervisory organization runs a distributed "commit-XOR" scheme to generate a random value, which is broadcast in the network and used in the next era.

5. According to claim 4, a POA consensus algorithm based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that It also includes forming a lower-level group to run the group consensus to select candidate nodes, specifically: The upper supervisory organization uses the list proportional representation system combined with the San Lagu calculation method to allocate seats to the lower-level groups; At the beginning of each era, the number of on-duty nodes and supervisory nodes required for this era is determined based on the load of the previous era, and seats are allocated to the lower-level groups according to the Saint Lagu calculation method; The votes of each lower-level group are distributed in proportion to the total contribution value of the group. The total number of votes of each group is a% of the total number of votes, and the votes of each group are redistributed in a descending manner; Before Contribution The total number of votes of the group is b% of the total number of votes, and the contribution value is The total number of votes cast by the group is c% of the total number of votes, where , ,The total number of votes is the total number of nodes; The initial number of votes obtained by each group is divided by 1.4 for the first round of comparison, and the group with the most votes wins the first seat; The original number of votes of the group that won the first seat is divided by 3, and the votes of other groups remain unchanged. A second round of comparison is conducted, and the group with the most votes wins the second seat; The original number of votes for the group with the most votes in the second round is divided by 5. The other groups remain unchanged. A third round of comparison is conducted. The group with the most votes gets the third seat, and so on, until all seats are allocated.

6. According to claim 1, a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that The lower-level group uses a general consensus algorithm to select candidate nodes to form an upper-level supervisory organization, including: When the system is initialized, an information table is created to store the contribution values, historical trust values, era information, and round number information of all nodes in all eras; In each epoch, the lower-level groups select candidate nodes through group consensus to form a new upper-level supervisory organization. There are m rounds in an epoch, and the upper-level supervisory organization is not re-elected in each round. Leader nodes are selected in each round within the upper-level supervisory organization. At the beginning of the era: the lower-level groups select candidates through group consensus to form the upper-level supervisory organization; Selection of node roles: In each round, the upper-level supervisory organization adopts a voting mechanism to divide candidate nodes into three roles according to the support ranking: on-duty nodes, supervisory nodes, and verification nodes, and enter the corresponding node pools. On-duty nodes and supervisory nodes are randomly selected from the on-duty node pool and the supervisory node pool. On-duty nodes are responsible for proposing blocks and packaging blocks, supervisory nodes are responsible for monitoring the behavior of on-duty nodes and verification nodes, and verification nodes are responsible for verifying and confirming blocks. Propose a new block: The node on duty will construct a new block, sign the block data and block hash accordingly, and broadcast the block and signature to all candidate nodes in the consensus network; Block reception: The verification node will check the validity of the block header, then sign the block accordingly and send the signature information to the on-duty node of the current round; Block packaging confirmation: The on-duty node of the current round must wait for valid signatures from at least N / 2+1 verification nodes before submitting the block and broadcasting the new block to the entire blockchain network; End of the era: When the number of rounds is m, the current era ends and a new era begins.

7. According to claim 1, a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that The upper-level supervisory organization adopts a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation, including: Combined with the node's own contribution value , global trust value Calculate the support, expressed as: ; in, is the contribution value of the i-th node, is the sum of the contribution values ​​of the nodes participating in the voting. is the number of votes received by the ith node, is the total number of votes in the node group, is the global trust value of the i-th node, and N is the number of nodes participating in the voting; The system divides candidate nodes into three roles according to the ranking of support: on-duty nodes, monitoring nodes, and verification nodes, and each node enters the corresponding node pool.

8. A POA consensus system based on the coordinated optimization of the ELASTICO protocol and the window rotation mechanism, It is characterized in that include: The lower-level group generation module is used to evenly distribute the nodes in the blockchain network using the ELASTICO protocol improved based on the Maglev consistent hashing algorithm to form the lower-level groups; The upper-level supervisory organization generation module is used to select candidate nodes from the lower-level groups using a general consensus algorithm to form an upper-level supervisory organization; The node selection module is used by the upper-level supervisory organization to adopt a window rotation mechanism based on a voting mechanism to divide all candidate nodes into on-duty nodes, supervisory nodes, and verification nodes for window rotation.

9. An electronic device, It is characterized in that include: A processor and a memory, the memory being used to store computer program codes, the computer program codes comprising computer instructions, and when the processor executes the computer instructions, the electronic device executes a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a POA consensus algorithm based on the collaborative optimization of the ELASTICO protocol and the window rotation mechanism as described in any one of claims 1 to 7.