A blockchain consensus algorithm with high performance
By employing a pre-defined clustering algorithm and reputation mechanism in the blockchain network to dynamically adjust node roles, and utilizing BLS aggregated signatures and a coin-toss protocol for verifiable key sharing, the inefficiency and poor security of existing blockchain consensus algorithms are solved, achieving efficient and secure blockchain consensus.
Patent Information
- Application Number
- CN202111153250.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2041-09-29
AI Technical Summary
Existing blockchain consensus algorithms suffer from low consensus efficiency, poor scalability, low block generation efficiency, and poor chain quality. They are also difficult to defend against bribery and polishing attacks, resulting in poor security.
A high-performance blockchain consensus algorithm is adopted, which divides nodes into high-level and low-level consensus nodes through a preset clustering algorithm. The leader node is elected by using BLS aggregate signature and a coin-toss protocol with verifiable key sharing, and the node role is dynamically adjusted based on the reputation mechanism to achieve dual randomness and fault tolerance.
It improves the efficiency and scalability of the consensus algorithm, enhances its resistance to attacks, and ensures the security and reliability of the blockchain network.
Smart Images

Figure CN115905888B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of blockchains, and particularly relates to a blockchain consensus algorithm with high performance. BACKGROUND
[0002] At present, the blockchain technology develops rapidly, and the consensus algorithm, as a core technology in the blockchain technology, occupies a very important position. The consensus is a process of reaching a unified agreement on the state of the network in a decentralized manner, aiming to ensure the security, scalability, decentralization degree and many other characteristics of the blockchain.
[0003] The excellence of a consensus algorithm can determine the transaction verification delay and fault tolerance, however, the consensus algorithms in the prior art, such as the Practical Byzantine Fault Tolerance (PBFT) based practical Byzantine consensus algorithm and its variants, generally have problems of low consensus efficiency, low block rate and low fault tolerance; the blockchain consensus algorithms based on the weighted consensus algorithm, such as ourobros, have problems of insufficient randomness, and are difficult to prevent bribery attacks and polishing attacks, resulting in poor security and other problems. The above problems will further limit the application range of the consensus algorithm. SUMMARY
[0004] In order to solve the above problems in the prior art, the application provides a blockchain consensus algorithm with high performance. The technical problems to be solved by the application are solved by the following technical scheme:
[0005] A blockchain consensus algorithm with high performance is applied to a blockchain network, the blockchain network includes N nodes, and the method comprises the following steps: step 1: in a current block period, all high-level consensus nodes in a to-be-clustered high-level consensus group are clustered based on a preset clustering algorithm to obtain m signature groups; step 2: based on a BLS aggregated signature, two deputy leader nodes in each signature group and a group signature block corresponding to each deputy leader node are determined, that is, 2m deputy leader nodes and 2m group signature blocks are obtained; step 3: based on a verifiable key sharing coin protocol, a leader node and a block corresponding to each leader node are elected from the deputy leader nodes, that is, m leader nodes and m blocks are obtained; and step 4: the reputation value of each node in the blockchain network is obtained, a new to-be-clustered high-level consensus group is determined based on the reputation value, and steps 1 to 4 are continuously executed to realize blockchain consensus.
[0006] In an embodiment of the present application, the step 1 comprises: step 1-1: when the current block cycle is the first block cycle, assigning the same reputation value to each node based on the reputation mechanism; step 1-2: selecting m high-level consensus nodes from N nodes according to a preset group selection rule; step 1-3: determining the m high-level consensus nodes as m cluster nodes; step 1-4: dividing the nodes into m signature groups based on a preset clustering algorithm with the cluster nodes as cluster centers; step 1-5: determining the m signature groups as high-level consensus groups to be clustered, wherein the number of high-level consensus group nodes is not more than M, M << N, and dividing other nodes into low-level consensus nodes.
[0007] In an embodiment of the present application, the step 1-4 comprises: step 1-41: calculating the similarity between the non-cluster nodes in the high-level consensus nodes and each cluster node based on a preset clustering algorithm; and step 1-42: clustering each non-cluster center node to each signature group in turn according to the similarity.
[0008] Advantages of the present application:
[0009] The consensus algorithm of the present application can overcome the problems of low consensus efficiency, poor scalability, low block efficiency, poor chain quality and the like in the prior art.
[0010] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 is a high-performance blockchain consensus algorithm process schematic diagram provided by an embodiment of the present application;
[0012] Figure 2 is a node relationship schematic diagram provided by an embodiment of the present application;
[0013] Figure 3 is a consensus process schematic diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0014] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0015] EMBODIMENT
[0016] Blockchain is derived from the underlying technology of Bitcoin. In 2008, a scholar under the pseudonym "Satoshi Nakamoto" proposed a digital currency called Bitcoin, and people who do not trust each other can directly pay with Bitcoin without the coordination of any authoritative intermediary. Blockchain is a new application mode of distributed data storage, point-to-point transmission, consensus algorithm, encryption algorithm and other computer technologies. Simply put, blockchain is a decentralized, tamper-proof, traceable, and multi-party maintained distributed database that can integrate multiple isolated databases related to its own business into a single database and store it in multiple nodes maintained by multiple parties. No one can completely control these data, and they can only be updated according to strict rules and consensus, thereby achieving trusted information sharing and supervision between multiple parties, avoiding tedious manual reconciliation, improving business processing efficiency, and reducing transaction costs. Blockchain solves the problem of data credibility by integrating P2P protocol, asymmetric encryption, consensus algorithm, and block chain structure. Through the application of blockchain technology, multiple parties who do not know and trust each other can achieve trusted and equal value transmission without the help of any third-party trusted agency.
[0017] Blockchain can be abstracted into a five-layer technical architecture according to its core technology, namely data layer, incentive layer, contract layer, consensus layer, and application layer. The data layer stores underlying data, asymmetric data encryption, and timestamp, and other basic data. The incentive layer contains economic means used in the blockchain technology system, including the issuance and distribution of economic incentives. The contract layer encapsulates script code, algorithms, and smart contracts in the blockchain system, helping the blockchain to flexibly process data. The consensus layer encapsulates various consensus algorithms to determine the accounting decision method, which is related to the security and reliability of the entire system. The application layer encapsulates various application scenarios and cases.
[0018] The blockchain can be divided into three types according to application scenarios, namely public blockchain, alliance blockchain and private blockchain. The public blockchain refers to that any individual or group in the world can send a transaction, and the transaction can obtain effective confirmation of the blockchain, and anyone can participate in the consensus process. The public blockchain is the earliest blockchain and the most widely used blockchain. Various bitcoins series of virtual digital currency are based on the public blockchain, and there is only one blockchain corresponding to the currency in the world. The alliance blockchain refers to that a group internally specifies multiple pre-selected nodes as accountants, and the generation of each block is determined by all pre-selected nodes (pre-selected nodes participate in the consensus process). Other access nodes can participate in transactions, but do not interfere with the accounting process (essentially still managed accounting, but becomes distributed accounting, the number of pre-selected nodes and how to determine the accountant of each block become the main risk point of the blockchain). Anyone can make limited queries through the open API of the blockchain. The private blockchain refers to that only the total accounting technology of the blockchain is used for accounting, which can be a company or an individual, and the private blockchain has exclusive write access. There is no big difference between the private blockchain and other distributed storage solutions. Traditional finance is trying to experiment with private blockchains, while public chain applications such as bitcoin have been industrialized, and private chain application products are still being explored.
[0019] The consensus algorithm of the blockchain originates from the traditional distributed consensus. The traditional distributed consensus is a process in which all nodes reach an agreement on a certain state under the condition that multiple nodes can independently operate or record. The traditional distributed consensus algorithm can be divided into two categories. One category is represented by the Paxos algorithm, the Raft algorithm and their variants. The other category is represented by the PBFT algorithm, the POW algorithm, the XFT algorithm and related variant algorithms. For CFT, the goal is to reach consensus in a distributed system that may have node downtime or network anomalies but has real node information. For BFT, it is believed that the node information may be false, i.e. the node may lie, and the goal is to reach consensus on the message in a distributed system with enemy nodes. The classical distributed consensus mainly completes state machine replication between nodes to achieve consistency and activity. The distributed consensus algorithm and the blockchain consensus algorithm together form the consensus algorithm system today.
[0020] Since Nakamoto proposed Bitcoin in 2008, consensus algorithm has entered the era of blockchain consensus. At present, blockchain consensus can be divided into two categories: one is permissioned consensus mechanism, in which nodes in the permissioned network generally complete identity authentication through public key infrastructure (PKI) before participating in subsequent consensus algorithm; the other is permissionless consensus mechanism represented by Bitcoin. In the permissionless network, nodes join and exit at any time, the number of nodes changes dynamically and unpredictably, and the permissionless consensus completes the processes of block proposer election, block generation and node verification and updating of blockchain through specific algorithms. According to the function and implementation background, the blockchain consensus algorithm can be divided into the following five kinds. 1) Proof of work (PoW) based consensus algorithm, in which nodes use their own computing power to find the original image of the hash function to complete the election of block proposer. Such as Bitcoin, Ethereum, FruitChains, etc. 2) Permissioned consensus algorithm, in which nodes complete the generation and maintenance of blocks through distributed consensus algorithm after identity authentication. Such as Hyperledger, DFINITY and PaLa, etc. 3) Proof of stake (PoS) based consensus algorithm, in which nodes are randomly selected as block proposers from all legal coin holders. Such as PP-Coin, Casper FFG, Ouroboros, Snow White and DPoS, etc. 4) Hybrid consensus algorithm using single committee, which mainly uses PoW or PoS to select part of the nodes as the consensus committee, and runs the distributed consensus algorithm similar to PBFT in the committee to complete the generation of blocks. Such as PeerCensus, ByzCoin, Solida, hybridconsensus and Algorand, etc. 5) Hybrid consensus using multiple committees, which divides the network into multiple regions, and each region runs a parallel committee to process transactions respectively. Such as ELASTICO, Omniledger, Chainspace and RapidChain, etc.
[0021] It can be seen that consensus algorithm exists as a core technology in both traditional distributed systems and blockchain today, aiming to ensure the security, scalability, decentralization and many other characteristics of blockchain. At the same time, the high and low of the excellent performance of a consensus algorithm also determines the high and low of transaction verification delay and fault tolerance. The application of consensus algorithm mainly depends on the demand of business and performance.
[0022] Please refer to Figure 1 , Figure 1 is a high-performance blockchain consensus algorithm process provided by an embodiment of the application. Applied to a blockchain network, the blockchain network includes N nodes, and the method comprises:
[0023] Step 1: In the current block cycle, all high-level consensus nodes in the high-level consensus group to be clustered are clustered based on a preset clustering algorithm to obtain m signature groups.
[0024] It should be noted that steps 1 to 4 of the present application are a period. The preset clustering algorithm is set by a person skilled in the art according to business needs, and the present application does not limit this. For example, the preset clustering algorithm is a k-means algorithm.
[0025] Optionally, the step 1 comprises:
[0026] Step 1-1: When the current block cycle is the first block cycle, each node is assigned the same reputation value based on a reputation mechanism.
[0027] For example, the reputation range is specified as [0, 1], and each node is assigned the same reputation value 0.6 based on the reputation mechanism, wherein the maximum reputation value is 1.
[0028] Step 1-2: m high-level consensus nodes are selected from N nodes according to a preset group selection rule.
[0029] In the early stage of the first block cycle, since each node has the same reputation value, m high-level consensus nodes can be pre-selected from N nodes according to a preset group selection rule. For example, the preset group selection rule is random selection, and the present application can randomly select m high-level consensus nodes from N nodes in the first block cycle.
[0030] Step 1-3: The m high-level consensus nodes are determined as m clustering nodes.
[0031] Step 1-4: The nodes are divided into m signature groups based on the preset clustering algorithm with the clustering nodes as clustering centers.
[0032] Step 1-5: The m signature groups are determined as high-level consensus groups to be clustered, wherein the number of high-level consensus group nodes is not more than M, M << N, and other nodes are divided into low-level consensus nodes.
[0033] Optionally, the step 4 comprises:
[0034] Step 1-41: The similarity between the non-clustering nodes in the high-level consensus nodes and each of the clustering nodes is calculated based on the preset clustering algorithm.
[0035] The working process of the k-means algorithm is described as follows: firstly, k objects are randomly selected from n data objects as initial cluster centers; and for the remaining other objects, they are respectively assigned to the cluster (represented by the cluster center) most similar to them according to their similarity (distance) with the cluster centers; then the cluster center of each obtained new cluster (the mean of all objects in the cluster) is calculated; this process is repeatedly until the standard measure function starts to converge. The mean square error is generally used as the standard measure function, and the k clusters have the following characteristics: each cluster itself is as compact as possible, and each cluster is as far apart as possible.
[0036] Step 1-42: According to the similarity, each non-cluster center node is clustered into each signature group in turn.
[0037] Step 2: Based on the BLS aggregated signature, two deputy leader nodes and the corresponding group signature block of each deputy leader node are determined in each signature group, that is, 2m deputy leader nodes and 2m group signature blocks are obtained.
[0038] Optionally, the step 2 comprises:
[0039] Step 2-1: Based on the BLS aggregated signature, the internal randomness r corresponding to each signature group is obtained, wherein the BLS aggregated signature corresponds to a threshold (n, t), the n indicates the number of nodes participating in the BLS aggregated signature, and the t indicates the minimum number of signatures required to generate the aggregated signature.
[0040] The minimum number of signatures required for the aggregated signature is also called the threshold.
[0041] Under the threshold setting of (n, t), t signature shares generated by any t nodes exist in the group G1, and the group signature is calculated by the Lagrange interpolation method. The correctness of the group signature can be verified by the group public key. The present application can improve the consensus efficiency of the consensus algorithm based on the threshold BLS aggregated signature, and further improve the block efficiency.
[0042] In addition, BLS has excellent non-interactive properties, which can solve the "last participant" problem (that is, the last person can choose to interrupt the randomness generation process after obtaining all the secrets) in the consensus algorithm based on the coin protocol in the prior art; compared with interactive randomness generation, it can also save time; and can realize non-interactive randomness and interactive randomness generation.
[0043] Step 2-2: Put the internal randomness r into the pseudo-random number generator to generate a pseudo-random sequence.
[0044] Step 2-3: Based on a pre-set random algorithm, the pseudo-random sequence is randomly sorted.
[0045] The pre-set scrambling algorithm, such as the Fisher-Yates random scrambling algorithm, is also known as the Gartner scrambling algorithm. This algorithm can generate a random permutation of a finite set.
[0046] The Fisher-Yates random scrambling algorithm is unbiased, so each permutation is equally likely. The time required by Fisher-Yates is proportional to the number of numbers to be randomly scrambled, and it does not require additional storage space overhead.
[0047] Steps 2-4: Determine the node corresponding to the first pseudo-random sequence after random sorting as the first deputy leader node, and determine the node corresponding to the second pseudo-random sequence as the second deputy leader node.
[0048] Steps 2-5: Obtain the block signature of the first deputy leader node for itself, and obtain the block signature of the second deputy leader node for itself.
[0049] Steps 2-6: The first and second deputy leader nodes broadcast their corresponding block signatures to other nodes in the current signature group.
[0050] Steps 2-7: Verify the block corresponding to the deputy leader node through other nodes in the current signature group, and sign the block when the verification is successful.
[0051] Steps 2-8: When each block obtains T+1 signatures, it is determined that the block has reached the consensus of the current signature group, and a group signature block corresponding to each deputy leader node is generated, where T is half the number of advanced consensus nodes.
[0052] Step 3: Based on the verifiable key sharing coin-operated protocol, elect a leader node and a block corresponding to each leader node from the deputy leader nodes, that is, obtain m leader nodes and m blocks.
[0053] Optionally, step 3 includes:
[0054] Step 3-1: Implement share allocation based on a verifiable key sharing coin-operated protocol.
[0055] Optionally, the verifiable key-sharing coin-operated protocol has a commitment period and a disclosure period.
[0056] In the verifiable key-sharing coin-operated protocol, p and q are both large prime numbers, q is a large prime factor of p-1, G_q is a unique q-order subgroup of Z_p^*, g and h are generators of G_q, and no one knows the discrete logarithm. Let D be the distributor, n be the number of participants, and p_i be the representative of each participant. The threshold value is t, and 1≤t≤n≤q is satisfied. The specific steps are as follows:
[0057] A. Shared distribution
[0058] For a secret s∈z_p^*, the distributor D publishes the commitment E_0=E(s,t)=g^s h^t to s, where t∈z_p^* is a secret value randomly selected by D. The distributor D continues to select a random number a_i∈z_p^*, Constructing a polynomial Calculate s_i=f(i). The distributor D selects a random number b_i∈z_p^*, Public commitment E_I=E(a_i,b_i)=g^(a_i)·h^(b_i) to the polynomial a_i, Then another Calculate γ_i=g(i), and the distributor D sends p_i the secret (s_i, γ_i),
[0059] B. Shared verification
[0060] When p_i receives his key share (s_i, γ_i), he performs E(s_i,r_i)=∏_(j=0)^(t-1)E_j^(i^j) to check whether his key share is valid.
[0061] C. Key recovery
[0062] When t or more than t correct shared key shares are obtained, the secret can be recovered using Lagrange polynomial interpolation. The specific key recovery calculation method is Π_(1≤J≤t,j≠i)i / (i-j).
[0063] Optionally, the step 3-1 includes:
[0064] Step 3-11: During the commitment period, each node in the blockchain network generates randomness r i and a random sequence s i , and divides the randomness into N shares.
[0065] Step 3-12: Encrypt the share by the public key corresponding to the assigned node, and sign the share by the private key corresponding to the current node.
[0066] Step 3-13: Each node distributes its share to other nodes.
[0067] Step 3-14: Each node commits Com(r i , s i) to the blockchain network, wherein all nodes of the blockchain network include high-level consensus nodes and low-level consensus nodes.
[0068] By using the public key corresponding to the assigned node to encrypt the share, it can be ensured that the share can only be shared by the assigned node. Each share is a part of the reveal period content, and it is stipulated for each share that the recovery of the random sequence can be completed when the collection of shares reaches t+1, wherein 2t<=N.
[0069] Com(ri, si) is the result of encrypting the randomness generated by each node in the blockchain network and the random sequence (the encryption method is recognized by all nodes in the entire blockchain network, and when Com(ri, si) is broadcast to the blockchain network, the nodes in the network can only see the encrypted result of ri, si, that is, the commitment Com(ri, si), to ensure that the value of the randomness generated by each node and the random sequence cannot be seen before the reveal period.
[0070] The coin protocol of the verifiable key sharing can strengthen the randomness of the random degree while enabling the low-level consensus nodes to join the consensus process and obtain a certain reputation value. Compared with the randomness generation of the consensus algorithm in the prior art, the consensus algorithm proposed in the present application can better resist the "polishing attack", "static adversary", "mild adversary" and adaptive adversary in the blockchain.
[0071] Step 3-2: Obtain the external randomness corresponding to the randomness R, and determine the leader node from the first deputy leader node and the second deputy leader node based on the external randomness.
[0072] Optionally, the step 3-2 includes:
[0073] Step 3-21: During the reveal period, if the deputy leader node discloses its randomness, step 3-22 is continued to be executed; or if the deputy leader node does not disclose its randomness, other non-deputy leader nodes will restore the randomness of the deputy leader node according to the randomness share of the deputy leader node obtained in the commitment period, and step 3-22 is continued to be executed.
[0074] When all nodes complete the share allocation, each node discloses its commitment to send Open(ri, si) to the blockchain network. i i Open(ri, si) is the result obtained by decrypting Com(ri, si), that is, the value of the randomness generated by each node and the random sequence. Open is a decryption process, and Com is an encryption process, both of which are recognized by all nodes in the blockchain network.
[0075] If the vice leader node does not disclose its random sequence, other nodes will restore the randomness of the vice leader node from the randomness share of the vice leader node obtained in the commitment period, preventing the problem that the vice leader node cannot timely disclose its randomness due to the Byzantine error and the crash error of the vice leader node, and the subsequent consensus process cannot proceed.
[0076] The case of not disclosing the randomness is, for example, that the vice leader node is a malicious node, or the vice leader node is a crashed node. Step 3-22 can improve the fault tolerance of the consensus algorithm.
[0077] Step 3-22: XOR calculation is performed on the randomness r i of the vice leader node to obtain the random seed R.
[0078] The node is denoted as node i .
[0079] Step 3-23: The random seed R is put into a pseudo-random number generator to generate a pseudo-random sequence of the random seed.
[0080] Step 3-24: The pursuit of the algorithm is performed on the pseudo-random sequence, and the reputation ratio of the 2m vice leader nodes is taken as the probability element to generate a sequence of the 2m vice leader nodes, wherein the reputation ratio is equal to the reputation of the target node / the maximum reputation.
[0081] Step 3-25: The first m nodes in the sequence of the vice leader node are selected as the leader nodes, and the block corresponding to the leader node is selected as the next period of the on-chain block.
[0082] Optionally, the pursuit of the algorithm can also be performed on the current period leader node (block node) for viewing.
[0083] The present application can obtain the internal randomness and the external randomness of the node. Compared with the prior art which only obtains one kind of randomness, the present application obtains double randomness to improve the security of the consensus algorithm and can more effectively resist attacks.
[0084] Step 4: Obtain the reputation value of each node in the blockchain network, and determine a new high-level consensus group to be clustered based on the reputation value, and continue to perform steps 1 to 4 to realize the blockchain consensus.
[0085] Optionally, the obtaining of the reputation value of each node in the blockchain network and the determination of a new high-level consensus group to be clustered based on the reputation value comprise:
[0086] Step 4-1: Based on the reputation mechanism, a new reputation value is given to each node.
[0087] While the external randomness is obtained, the reputation mechanism or the reputation of the computing node, also known as the reputation system, divides each node next time the advanced consensus group by the distance from the random seed R (true random number) Di=Ci / Cmax ads (R-ρi), wherein Di represents the distance, C represents the reputation value, ads represents the absolute value, and ρi represents any external randomness. Each node can check its reputation value before the next period.
[0088] Optionally, the application can set the increase and decrease of the corresponding reputation of the node behavior in advance:
[0089] (A. The node growth reputation behavior includes: a. Low-level consensus nodes actively participate in group block generation outside randomness; b. Deputy nodes publish their own randomness on time; c. High-level consensus nodes actively participate in group signature block generation; d. The high-level consensus group completes the specified completion of 2m group signature blocks and the subsequent external randomness process);
[0090] (B. The node decreases the reputation behavior, including: a. Deputy nodes do not publish their own randomness at the specified time; b. The high-level consensus group does not complete the generation of group randomness on time and delays the generation of group signature blocks; c. The high-level consensus group does not complete 2 signature blocks per group according to the regulation.
[0091] The overall purpose is to make the fault tolerance of the high-level consensus node lower, and the low-level consensus group has more opportunities to become a high-level consensus group node, so that the overall benign node has the opportunity to become a leader node.
[0092] The application can improve the scalability of the consensus algorithm based on the reputation mechanism.
[0093] Step 4-2: Determine the size relationship between the new reputation value and the preset reputation threshold.
[0094] Step 4-3: Determine the node whose new reputation value is greater than or equal to the preset reputation threshold as a high-level consensus node, or determine the node whose new reputation threshold is less than the preset reputation threshold as a low-level consensus node, to obtain a new to-be-clustered high-level consensus group.
[0095] The preset reputation threshold is set by a person skilled in the art according to business needs, and the application does not make specific limitations. For example, the preset reputation threshold is 0.6.
[0096] Optionally, the to-be-clustered high-level consensus group corresponds to a preset number threshold.
[0097] Optionally, after the node with the new reputation value greater than or equal to the preset reputation threshold is determined as a high-level consensus node, the method further comprises: when the number of the high-level consensus nodes exceeds the preset number threshold, dividing the high-level consensus nodes exceeding the number threshold into low-level consensus nodes.
[0098] Optionally, the high-level consensus nodes include cluster center nodes and non-cluster center nodes, and the step 2 further comprises: in a current block period which is not a first block period, determining the non-cluster center node in a previous block period as a leader node in the current block period.
[0099] Optionally, the leader node in the previous block period is determined as a cluster node in the current block period, so that the high-level consensus group grouping is continued based on the cluster node to obtain a signature group.
[0100] The consensus algorithm of the application allocates each node into four roles, names the block node in the high-level consensus group as a leader node, makes the high-level consensus group node with the right to become a leader node as a Deputy leader node, makes the high-level consensus group node with the initial cluster center of the preset cluster algorithm as a cluster node, names the other nodes in the high-level consensus group as ordinary high-level consensus group nodes, and names the remaining nodes outside the high-level consensus group as low-level consensus nodes. Due to the randomness of the consensus algorithm and the low fault tolerance mechanism of the high-level consensus node, there is a probability that the high-level consensus node becomes a leader node in the next period, which ensures the relative fairness to each benign node.
[0101] Referring to Figure 2 , Figure 2 is a node relationship schematic diagram provided by an embodiment of the application. The consensus algorithm of the application has the following characteristics: 1) only in the first period, the cluster center node has a chance to become a Deputy leader node in the sequence; 2) the Deputy leader node has a probability to become a leader node through external randomness; 3) the leader node becomes a cluster node in the next period after the end of the current period; 4) the ordinary high-level consensus node has a probability to become a Deputy leader node every period, wherein the ordinary high-level consensus node refers to a node which is not a cluster node, not a leader node, and not a leader node in the high-level consensus node; 4) the cluster node is definitely an ordinary high-level consensus group node in the next period; 5) the ordinary high-level consensus group node is only randomly selected as a cluster node in the first period, and becomes a cluster node after becoming a leader node in the second period and thereafter; 6) the low-level consensus node enters the high-level consensus group when participating in external randomness generation reaches a target reputation; 7) the high-level consensus node is removed from the high-level consensus group due to a decrease in reputation caused by some behaviors.
[0102] Figure 3 is a consensus flow schematic diagram provided by an embodiment of the application.
[0103] In summary, the consensus algorithm of the present application can overcome the problems of low consensus efficiency, poor scalability, low block efficiency, poor chain quality and the like in the prior art.
[0104] The terms "first", "second", "third", etc. are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.
[0105] Although the present application is described herein in conjunction with various embodiments, other variations of the disclosed embodiments can be understood and effected by those skilled in the art in the practice of the claimed application, from the description, the drawings and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and the indefinite article "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. Measures recited in mutually different dependent claims do not preclude their combination in a single claim.
[0106] The above is a further detailed description of the present application in conjunction with specific preferred embodiments, and cannot be considered as limiting the specific implementation of the present application to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or substitutions can be made, which should be considered as falling within the protection scope of the present application.
Claims
1. A blockchain consensus method with high performance, characterized in that, The application is applied to a blockchain network including N nodes, and the method comprises the following steps: step 1: in the current block period, all high-level consensus nodes in the last block period are clustered based on a preset clustering algorithm to obtain m signature groups; step 2: based on the BLS aggregate signature, two deputy leader nodes in each signature group and the group signature block corresponding to each deputy leader node are determined, that is, 2m deputy leader nodes and 2m group signature blocks are obtained; step 3: based on the coin protocol of the verifiable key sharing, the leader nodes are elected from the deputy leader nodes, and the block corresponding to each leader node is obtained, that is, m leader nodes and m blocks are obtained; step 4: the credit value of each node in the blockchain network is obtained, and the new high-level consensus group to be clustered is determined based on the credit value, and steps 1-4 are continuously executed to realize the blockchain consensus. The step 1 comprises the following steps: Step 1-1: when the current block period is the first block period, the same credit value is given to each node based on the credit mechanism; 2. The method of claim 1, wherein, Step 1-2: the high-level consensus nodes are selected from the N nodes according to the preset group selection rule; the high-level consensus nodes comprise m cluster nodes and other non-cluster nodes; Step 1-3: the non-cluster nodes are divided into m signature groups based on the preset clustering algorithm with the cluster nodes as the clustering center; The step 1-4 comprises the following steps: Step 1-41: the similarity between the non-cluster nodes in the high-level consensus nodes and each cluster node is calculated based on the preset clustering algorithm; Step 1-4: Determine the m signature groups as high-level consensus groups to be clustered, wherein the number of high-level consensus group nodes does not exceed M, and divide other nodes into low-level consensus nodes.
3. The method of claim 2, wherein, Step 1-42: each non-cluster center node is clustered into each signature group in turn according to the similarity. The step 2 comprises the following steps: Step 2-1: the internal randomness r corresponding to each signature group is obtained based on the BLS aggregate signature, wherein the BLS aggregate signature corresponds to a threshold (n, t), the n represents the number of nodes participating in the BLS aggregate signature, and the t represents the minimum number of signatures required to generate the aggregate signature; 4. The method of claim 1, wherein, Step 2-2: the internal randomness r is put into the pseudo-random number generator to generate a pseudo-random sequence; Step 2-3: the pseudo-random sequence is randomly sorted based on the preset random algorithm; Step 2-4: the node corresponding to the first pseudo-random sequence after the random sorting processing is determined as the first deputy leader node, and the node corresponding to the second pseudo-random sequence is determined as the second deputy leader node; Step 2-5: the block signature of the first deputy leader node to itself is obtained, and the block signature of the second deputy leader node to itself is obtained; Step 2-6: the first deputy leader node and the second deputy leader node broadcast the corresponding block signature to other nodes in the current signature group; Step 2-7: the block corresponding to the deputy leader node is verified by other nodes in the current signature group, and the block is signed when the verification is passed. Step 2-8: When each block obtains T+1 signatures, it is determined that the block obtains the current signature group consensus, and a group signature block corresponding to each deputy leader node is generated, wherein T is half of the number of high-level consensus nodes.
5. The method of claim 1, wherein, The step 3 includes: Step 3-1: based on the verifiable key sharing coin protocol, the share allocation is realized; Step 3-2: the external randomness corresponding to the randomness R is obtained, and the leader node is determined from the first deputy leader node and the second deputy leader node based on the external randomness.
6. The method of claim 5, wherein, The verifiable key sharing coin protocol corresponds to a commitment period and a disclosure period; the step 3-1 includes: Step 3-11: During the commitment phase, each of the nodes in the blockchain network generates randomness and a random sequence and splits the randomness into N shares; Step 3-12: the share is encrypted by the public key corresponding to the allocated node, and the share is signed by the private key corresponding to the current node; Step 3-13: each node distributes its share to other nodes; Step 3-14: Each node will commit to the blockchain network, wherein the blockchain network all nodes include high-level consensus nodes and low-level consensus nodes.
7. The method of claim 6, wherein, The step 3-2 includes: Step 3-21: in the disclosure period, if the deputy leader node discloses its randomness, step 3-22 is continued to be executed; or if the deputy leader node does not disclose its randomness, other non-deputy leader nodes will restore the randomness of the deputy leader node according to the randomness share of the deputy leader node obtained in the commitment period, and step 3-22 is continued to be executed; Step 3-22: performing XOR calculation on the randomness corresponding to the deputy leader node to obtain a random seed R Step 3-22: performing XOR calculation on the randomness corresponding to the deputy leader node to obtain a random seed R Step 3-23: the random seed R is put into a pseudo-random number generator to generate a random seed pseudo-random sequence; Step 3-24: the pursuit of the pseudo-random sequence is executed to generate a sequence of 2m deputy leader nodes, taking the reputation ratio of 2m deputy leader nodes as a probability element, wherein the reputation ratio is equal to the target node reputation / the maximum reputation; Step 3-25: the first m nodes in the sequence of deputy leader nodes are selected as leader nodes, and the block corresponding to the leader node is selected as the next period of on-chain block.
8. The method of claim 1, wherein, The reputation value of each node in the blockchain network is obtained, and the new high-level consensus group to be clustered is determined based on the reputation value, which includes: Step 4-1: based on the reputation mechanism, a new reputation value is given to each node; Step 4-2: the size relationship between the new reputation value and the preset reputation threshold is judged; Step 4-3: the nodes with the new reputation value greater than or equal to the preset reputation threshold are determined as high-level consensus nodes, or the nodes with the new reputation threshold less than the preset reputation threshold are determined as low-level consensus nodes, to obtain a new high-level consensus group to be clustered.
9. The method of claim 8, wherein, The high-level consensus group to be clustered corresponds to a preset number threshold, and after the nodes with the new reputation value greater than or equal to the preset reputation threshold are determined as high-level consensus nodes, the method further includes: When the number of high-level consensus nodes exceeds the preset number threshold, the high-level consensus nodes exceeding the number threshold are divided into low-level consensus nodes.
10. The method of claim 8, wherein, The high-level consensus nodes include cluster center nodes and non-cluster center nodes, and the step 2 further includes: In the current block period which is not the first block period, the non-cluster center nodes in the last block period are determined as the leader nodes in the current block period.
Citation Information
Patent Citations
Smart grid device security diagnosis service system based on block chain technology
CN108880863A
Regional consensus method, system and device
CN109547530A