Method for electing nodes in a blockchain network and related products

By using a verifiable random function and a proof set of block proposal information in the blockchain network, the proposal node of the next block is calculated, which solves the problem of security risks in the node election process in the existing technology and improves the efficiency of the block. Security of chain consensus algorithm.

CN114389815BInactive Publication Date: 2024-09-06BEIJING ZHONGXIANG BIT TECH +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111511719.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing election-type blockchain consensus algorithm has security risks during the node election process, and malicious nodes can easily predict the nodes to be elected in the next round.

Method used

By introducing a verifiable random function into the blockchain network and using the proof set in the current block proposal information to calculate the proposal node for the next block, the node election process is made more random and secure.

Benefits of technology

It effectively improves the security of the blockchain consensus algorithm, avoids predictions of proposal nodes by malicious nodes, and enhances the network's anti-attack capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114389815B
    Figure CN114389815B
Patent Text Reader

Abstract

The present invention relates to a method, device, blockchain system and computer program product for electing nodes in a blockchain network, wherein the blockchain network includes multiple consensus nodes, wherein the multiple consensus nodes include a proposal node responsible for block proposals and other nodes, wherein the method includes performing the following operations at other nodes: receiving the i-th block proposal information sent by the proposal node of the i-th block, wherein the i-th block proposal information includes a proof set of the i+1-th block; extracting the proof set of the i+1-th block from the i-th block proposal information; and determining the proposal node of the i+1-th block based on the proof set of the i+1-th block and the attribute information of the multiple consensus nodes, wherein i is an integer greater than zero, and the i+1-th block is the next adjacent block of the i-th block. Through the technical solution of the present invention, the security of the blockchain consensus algorithm can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of blockchain technology. More specifically, the present invention relates to a method, device, blockchain system and computer program product for electing nodes in a blockchain network. Background Art

[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The descriptions herein may include concepts that may be explored, but not necessarily concepts that have been previously thought of or explored. Therefore, unless otherwise noted herein, the content described in this section is not prior art with respect to the specification and claims of this application, and is not admitted to be prior art by inclusion in this section.

[0003] The blockchain system is a decentralized distributed accounting system, and the blockchain consensus algorithm is the core part of the blockchain system. Generally, blockchain consensus algorithms can be divided into multiple types according to the master election strategy, among which the more common type is the election consensus algorithm. The election consensus algorithm mainly refers to the selection of the current round of accounting nodes in each round of consensus. The specific election process involves each node predicting the nodes of the next round (that is, the proposal nodes) based on the current round information and the weight value of the node. It can be seen that this election method has a strong regularity in the election of nodes, making it easy for malicious nodes to predict and attack the nodes elected in the next round, which poses certain security risks. Summary of the invention

[0004] In order to at least solve the technical problems described in the above background technology section, the present invention proposes a solution for electing nodes in a blockchain network. Using the solution of the present invention, the consensus node in the blockchain network can calculate the proposal node of the next block based on the proof set in the current block proposal information, thereby realizing the random election of the proposal node. It can be seen that the solution of the present invention can effectively improve the security of the blockchain consensus algorithm. In view of this, the present invention provides solutions in the following aspects.

[0005] A first aspect of the present invention provides a method for electing nodes in a blockchain network, wherein the blockchain network includes multiple consensus nodes, wherein the multiple consensus nodes include a proposal node responsible for block proposals and other nodes, and the method includes performing the following operations at other nodes: receiving the i-th block proposal information sent by the proposal node of the i-th block, wherein the i-th block proposal information includes a proof set of the i+1-th block; extracting the proof set of the i+1-th block from the i-th block proposal information; and determining the proposal node of the i+1-th block based on the proof set of the i+1-th block and the attribute information of the multiple consensus nodes, wherein i is an integer greater than zero, and the i+1-th block is the next adjacent block of the i-th block.

[0006] In one embodiment, it also includes: generating a certificate for the i+2th block; and sending the certificate for the i+2th block to the proposal node of the i+1th block, wherein the i+2th block is the next adjacent block of the i+1th block.

[0007] In one embodiment, each consensus node is configured with a key, wherein generating a proof of the i+2th block includes: obtaining the height value of the i+2th block; using a verifiable random function to process the private key in the local key and the height value of the i+2th block to obtain the proof of the i+2th block.

[0008] In one embodiment, extracting the proof set of the i+1th block from the i-th block proposal information includes: performing a legitimacy verification on the source of the i-th block proposal information; and in response to passing the legitimacy verification on the source of the i-th block proposal information, executing an operation of extracting the proof set of the i+1th block.

[0009] In one embodiment, determining the proposal node of the i+1th block includes: using a predetermined function to process the proof set of the i+1th block and the attribute information of the multiple consensus nodes, so as to determine the proposal node of the i+1th block based on the processing result.

[0010] In one embodiment, the method further includes: when i=1, determining the proposal node of the first block according to the genesis block information of the multiple consensus nodes; generating a certificate of the second block; and sending the certificate of the second block to the proposal node of the first block.

[0011] A second aspect of the present invention provides a method for electing nodes in a blockchain network, wherein the blockchain network includes multiple consensus nodes, wherein the multiple consensus nodes include a proposal node responsible for block proposals and other nodes. The method includes performing the following operations at the proposal node responsible for block proposals: receiving the proof of the i+1th block sent by the other nodes; determining the proof set of the i+1th block based on all the received proofs of the i+1th block; generating i-th block proposal information containing the proof set of the i+1th block; broadcasting the i-th block proposal information to the other nodes, so that the other nodes determine the proposal node of the i+1th block based on the i-th block proposal information, wherein i is an integer greater than zero, and the i+1th block is the next adjacent block of the i-th block.

[0012] In one embodiment, determining the proof set of the i+1th block includes: verifying the legitimacy of all received proofs of the i+1th block; and collecting the proofs of the i+1th block that pass the legitimacy verification into the proof set of the i+1th block.

[0013] In one embodiment, the proof of each i+1th block is determined based on the private key of the sending node and the height value of the i+1th block, which includes the proof content encrypted by the private key, wherein the legitimacy verification of all received proofs of the i+1th block includes: obtaining the public key of the sending node of the proof of each i+1th block; using a verifiable random function to verify the public key of the sending node, the proof content encrypted by the private key and the height value of the i+1th block, so as to achieve legitimacy verification of the proof of each i+1th block.

[0014] The third aspect of the present invention provides a device, comprising: a processor; and a memory storing computer instructions for electing nodes in a blockchain network, wherein when the computer instructions are executed by the processor, the device executes the method described in the first aspect above and in multiple embodiments below, or executes the method described in the second aspect above and in multiple embodiments below.

[0015] The fourth aspect of the present invention provides a computer program product, comprising program instructions for electing nodes in a blockchain network. When the program instructions are executed by a processor, the method described in the first aspect above and in multiple embodiments below is implemented, or the method described in the second aspect above and in multiple embodiments below is executed.

[0016] The fifth aspect of the present invention proposes a blockchain system, comprising: multiple consensus nodes, wherein the multiple consensus nodes include a proposal node responsible for block proposals and other nodes, the proposal node is configured to broadcast current block proposal information to other nodes according to the method described in the second aspect of the above text and in multiple embodiments below, and the other nodes are configured to execute the method described in the first aspect of the above text and in multiple embodiments below to determine the proposal node of the next block based on the current block proposal information.

[0017] Using the solution provided by the present invention, the consensus node in the blockchain can calculate the proposal node of the next block based on the proof set in the current block proposal information. Specifically, the proof set in the current block proposal information contains proofs of the next block from multiple consensus nodes, and each consensus node cannot predict the proof of the next block from nodes outside itself. In particular, a verifiable random function is introduced in the process of generating proofs, making the proof generation process safer and the generated proof more random and confidential. Based on this, the proposal node calculated by the proof set in the present invention is random, which can effectively avoid the prediction of the proposal node by malicious nodes, thereby improving the security of the blockchain consensus algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0019] Figure 1 is an architectural diagram showing a blockchain network according to an embodiment of the present invention;

[0020] Figure 2 is a flow chart showing a method for electing a node in a blockchain network according to an embodiment of the present invention;

[0021] Figure 3 is a flowchart illustrating another method for electing a node in a blockchain network according to an embodiment of the present invention; and

[0022] Figure 4 is a structural diagram showing a consensus node according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0024] It should be understood that the terms "first", "second", "third" and "fourth" etc. in the claims, specifications and drawings of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0025] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the claims, the singular forms of "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in the specification of the present invention and the claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0026] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0028] In order to better understand the solution of the present invention, the following Figure 1 A brief description of the blockchain network.

[0029] Figure 1 1 is an architecture diagram 100 showing a blockchain network according to an embodiment of the present invention. The blockchain network may include multiple consensus nodes, where the consensus nodes may be understood as nodes in the blockchain network that can share blockchain data and participate in the block consensus process.

[0030] like Figure 1 As shown, the blockchain network may include four consensus nodes A, B, C, and D, and is formed by the networking of nodes A, B, C, and D. It is understandable that the blockchain network is described here using four consensus nodes as an example for the purpose of illustration only, and the number of consensus nodes in the blockchain network is not limited. In one embodiment, each time there is a demand for "block generation", a proposal node needs to be elected from the consensus nodes of the blockchain network to propose the block. As for the election of proposal nodes, the background technology of the present invention mentions that the use of round information and node weight information to elect nodes is prone to prediction and attack by malicious nodes. In order to solve this technical problem, the present invention proposes the following Figure 2 The technical solution shown in .

[0031] Figure 2 2 is a flowchart showing a method 200 for electing a node in a blockchain network according to an embodiment of the present invention. The blockchain network may include multiple consensus nodes, wherein the multiple consensus nodes may include other nodes and a proposal node responsible for block proposals, and each other node may execute Figure 2 It is understood that the blockchain network and consensus nodes here can have the same structure as the previous one. Figure 1 The described blockchain network has the same general properties as the consensus node, and is further optimized and improved in performance through the solution of the present invention.

[0032] For each of the aforementioned other nodes, at step S201, the i-th block proposal information sent by the proposal node of the i-th block may be received. In some implementation scenarios, the i-th block proposal information may include a proof set of the i+1th block. In this scenario, the proof set of the i+1th block may include the proof of the i+1th block by each of the aforementioned other nodes, and the generation process of each proof may involve the height value of the block and the private key of the node. Here, i is an integer greater than zero, and the i+1th block is the next adjacent block of the i-th block.

[0033] In one embodiment, each of the aforementioned consensus nodes is configured with a key, and the proof of each other node for the i+1th block can be obtained by processing the private key in the local key and the height value of the i+1th block using a verifiable random function. For example, the proof can be obtained by proof = VRF.CreateProof (KeyPair.PrivateKey, Block.Height). Among them, KeyPair.PrivateKey represents the private key, and Block.Height represents the block height value. The Verifiable Random Function (VRF) is an encryption scheme that maps the input to a verifiable pseudo-random output, and the result is a random number, and has the advantages of verifiability, uniqueness and randomness. Based on this, the proof in the aforementioned proof set also has the advantages of verifiability, uniqueness and randomness. It can be understood that the description of the proof set and the proofs therein here is only an exemplary description and does not limit the scheme of the present invention.

[0034] Next, at step S202, the proof set of the i+1 block can be extracted from the aforementioned i-th block proposal information. In some implementation scenarios, the source of the i-th block proposal information can be verified for legitimacy, and the proof set extraction operation can be performed after the legitimacy verification passes, thereby effectively avoiding interference information from malicious nodes. In this scenario, a predetermined function can be used to implement the legitimacy verification of the source of the i-th block proposal information. Specifically, when i=1, the function ProposerSeekByGenesis(genesis,[A,B,C,D]) can be used to verify the source of the 1st block proposal information. When i≥2, the function ProposerSeek(ProofSet ,[A,B,C,D]) to verify the source of the proposal information of the i-th block. represents the proof set of the i-th block, and A, B, C, and D represent the consensus nodes in the blockchain. Here, the predetermined function is described by taking four consensus nodes as an example for the purpose of illustration only, and the number of consensus nodes in the blockchain network is not limited. It can be understood that the description of the legitimacy verification of the source of the proposal information here is only an exemplary description, and the solution of the present invention is not limited thereto.

[0035] Next, at step S203, the proposal node of the i+1th block can be determined based on the proof set of the i+1th block and the attribute information of multiple consensus nodes. In one embodiment, the function ProposerSeek(ProofSet<i+1> ,[A,B,C,D]) to determine the proposal node of the i+1th block.<i+1> is the proof set of the i+1th block, and A, B, C, and D represent the consensus nodes in the blockchain. The attribute information of each consensus node may include but is not limited to network address information. Here, four consensus nodes are used as an example to illustrate the determination process of the proposal node, and the number of consensus nodes in the blockchain network is not limited. Furthermore, the various functions cited in the above and below discussions are merely exemplary and non-restrictive. Those skilled in the art can also conceive of using other suitable functions or algorithms to perform operations such as generating proofs or determining proposal nodes based on the teachings of the present invention, and these still fall within the scope of protection of the present invention.

[0036] In one embodiment, the determination of the proposal node of block 1 may specifically involve the genesis block information of each consensus node in the blockchain network. In this scenario, in the initial operation stage of each consensus node in the blockchain network, the genesis block information of each consensus node is consistent, and the function ProposerSeekByGenesis(genesis,[A,B,C,D]) may be used to determine the proposal node of block 1. The specific calculation process may involve performing a hash operation on the genesis block of each consensus node to obtain a hash value. Then, the hash value is used to modulo the number of nodes to obtain the proposal node of block 1.

[0037] In one embodiment, after each time the proposal node of a block is determined, a proof of the next adjacent block of the block can be generated, and the proof of the next adjacent block can be sent to the block. For example, during the life cycle of the entire blockchain network, after the proposal node of block 1 is determined, a proof of block 2 can be generated, and the proof of block 2 can be sent to the proposal node of block 1. After the proposal node of block 2 is determined, a proof of block 3 can be generated, and the proof of block 3 can be sent to the proposal node of block 2, and so on.

[0038] Figure 3 3 is a flowchart showing another method 300 for electing a node in a blockchain network according to an embodiment of the present invention. The blockchain network may include multiple consensus nodes, wherein the multiple consensus nodes may include other nodes and a proposal node responsible for block proposals, and the proposal node may execute Figure 3 It is understood that the blockchain network and consensus nodes here can have the same structure as the previous one. Figure 1 The blockchain network described has the same general properties as the consensus nodes and can be combined with Figure 2 The described blockchain network and consensus nodes.

[0039] At step S301, the proof of the i+1th block sent by other nodes can be received. In one embodiment, as described above, the proof of the i+1th block can be determined by the aforementioned other nodes using a verifiable random function to process the local private key and the height value of the i+1th block. Then, at step S302, the proof set of the i+1th block can be determined based on the proofs of all i+1th blocks received. In one embodiment, the proof of each i+1th block includes the proof content encrypted by the aforementioned private key, and the public key of each of the aforementioned other nodes, the aforementioned proof content and the height value of the i+1th block can be verified using a verifiable random function (e.g., function VRF.VerfiyProof) to verify the legitimacy of each proof in the proof set, and collect the proof of the i+1th block that has passed the legitimacy verification into the proof set of the i+1th block. The size of the proof set needs to be greater than the threshold, for example, it can be greater than or equal to more than half of the number of nodes in the blockchain network. It is understandable that the description of the proof set here is only an exemplary description and does not limit the technical solution of the present invention.

[0040] Then, at step S303, the i-th block proposal information including the proof set of the aforementioned i+1-th block may be generated. In one embodiment, the proposal node of the i-th block may generate the i-th block proposal information after the legitimacy of the proof set of the i+1-th block is verified. The i-th block proposal information may include relevant information of the i-th block and the proof set of the i+1-th block, where i is an integer greater than zero, and the i+1-th block is the next adjacent block of the i-th block. Then, at step S304, the i-th block proposal information may be broadcast to the aforementioned other nodes. Based on this, other nodes may determine the proposal node of the i+1-th block based on the aforementioned i-th block proposal information. The specific process of determining the proposal node may refer to Figure 2 The process of determining the proposal node of the first block and the proposal node of the i-th block (i≥2) described in .

[0041] In order to better understand the technical solution of the present invention, Figure 1 The technical solution of the present invention is further explained by taking the consensus nodes A, B, C and D in the example.

[0042] Initialization startup phase: Set the four consensus nodes A, B, C and D in the blockchain network to be in the initial running state. In some implementation scenarios, each consensus node is configured with a bunch of public and private key pairs (KeyPair) and an instantiated VRF object. The VRF object can support the generation and legitimacy verification of proofs. For example, the proof can be generated by the function proof = VRF.CreateProof (KeyPair.PrivateKey, Block.Height), where KeyPair.PrivateKey represents the private key and Block.Height represents the block height value. In addition, the legitimacy of the proof can be verified by the function VRF.VerfiyProof (proof.PublicKey, proof.Data, Block.Height), where PublicKey represents the public key corresponding to KeyPair.PrivateKey, Data represents the proof content signed by the private key, and Block.Height represents the block height value. When VRF.VerfiyProof returns true, it means that the proof is legal and valid.

[0043] When the consensus node in the blockchain network is just started, it is necessary to determine which consensus node is responsible for the proposal of block 1 (i.e. Block.Height = 1). Since the information of the genesis block of each consensus node is consistent in the initial state of the system, the information of the genesis block can be used to derive the proposal node of block 1. In one embodiment, the function ProposerSeekByGenesis can be used for derivation. Specifically, the genesis block can be hashed, and then the hash value obtained can be used to modulo the number of nodes to get the proposal node of block 1.

[0044] Assume that after the above calculation, node A is determined to be the proposal node of block 1, that is, A = ProposerSeekByGenesis (genesis, [A, B, C, D]). Then, nodes B, C, and D can create proofs for block 2 respectively:

[0045] proof_b <2> =B.VRF.CreateProof(B.KeyPair.PrivateKey,2);

[0046] proof_c <2> =C.VRF.CreateProof(C.KeyPair.PrivateKey,2);

[0047] proof_d <2> =D.VRF.CreateProof(D.KeyPair.PrivateKey,2).

[0048] Next, nodes B, C, and D send their own proofs to node A. After node A receives proof_b of block 2, <2> 、proof_c <2> and proof_d <2> After that, it sends responses back to nodes B, C and D respectively. When nodes B, C and D receive the responses sent back by node A in sequence, the startup phase of the system is completed.

[0049] Running phase: When node A receives the proof of block 2, it needs to use a function (such as VRF.VerfiyProof) to verify the legitimacy of the proof, and when it is determined that the proof is legal and valid, it is collected into the proof set of block 2. In one embodiment, the legitimacy verification process of the proof of block 2 may include the proof_b <2> 、proof_c <2> and proof_d <2> For example, using A.VRF.VerifyProof(proof_b <2> .PublicKey,proof_b.Data,2)Verify proof_b <2> The legitimacy of the <2> .PublicKey,proof_c.Data,2)Verify proof_c <2> The legitimacy of the proof and the use of the function A.VRF.VerifyProof(proof_d <2> .PublicKey,proof_d.Data,2) Verify proof_d <2> the legitimacy of.

[0050] Node A can not only obtain the proof set ProofSet of block 2 <2> , and also need to be responsible for the proposal of block 1. Next, Proposal_1 (where Proposal_1 contains ProofSet <2> ) is broadcast to nodes B, C, and D. Then, after receiving Proposal_1, nodes B, C, and D can use the function ProposerSeekByGenesis(genesis,[A,B,C,D]) to verify the legitimacy of Proposal_1. Then, after completing the legitimacy verification, each consensus node will generate a vote Vote_1 for Proposal_1 and send the vote Vote_1 to the proposal node of block 2. In one embodiment, the specific process of generating a vote Vote_1 for Proposal_1 may involve creating a proof of block 3, attaching the proof of block 3 to the vote, and calculating the proposal node of block 2.

[0051] The following will further explain the voting process using node B as an example. <3> =B.VRF.CreateProof(B.KeyPair.PrivateKey,3) to create proof_b <3> = B.VRF.CreateProof(B.KeyPair.PrivateKey,3). Then, the proof can be attached to Vote_b_1 (e.g. Vote_b_1.Assgin(proof_b <3> )). Then, we can use the function C = ProposerSeek (ProofSet <2> ,[A,B,C,D]) calculates the proposal node of block 2 (assuming that the proposal node of block 2 is C). Then, Vote_b_1 is sent to node C. Similarly, nodes A and D can refer to the voting process of node B to send Vote_a_1 and Vote_d_1 to node C.

[0052] When node C receives voting information such as Vote_a_1, Vote_b_1, and Vote_d_1, it parses proof_a of block 3 in the voting information respectively. <3> 、proof_b <3> and proof_d <3> A function (such as VRF.VerfiyProof) is needed to verify the legitimacy of the proof, and when the proof is determined to be valid, it is collected into the proof set of block 3. In one embodiment, the legitimacy verification process of the proof of block 3 may include verifying the proof_a <3> 、proof_b <3> and proof_d <3> For example, you can use the function A.VRF.VerifyProof(proof_a <3> .PublicKey,proof_a.Data,3) Verify proof_a <3> The legitimacy of the <3> .PublicKey,proof_b.Data,3)Verify proof_b <3> The legitimacy of the proof can be verified using the function A.VRF.VerifyProof(proof_d <3> .PublicKey,proof_d.Data,3) Verify proof_d <3> the legitimacy of.

[0053] Node C can not only obtain the proof set ProofSet of block 3 <3> , and also need to be responsible for the proposal of block 2. Next, Proposal_2 (where Proposal_2 contains ProofSet <3> ) is broadcast to nodes A, B, and D. Then, after receiving Proposal_2, nodes A, B, and D can use the function ProposerSeek(ProofSet <2> ,[A,B,C,D]) verifies the legitimacy of Proposal_2. Then, after completing the legitimacy verification, each consensus node will generate a vote Vote_2 for Proposal_2 and send the vote Vote_2 to the proposal node of block 3. In one embodiment, the specific process of generating a vote Vote_2 for Proposal_2 may involve creating a proof of block 4, attaching the proof of block 4 to the vote, and calculating the proposal node of block 3.

[0054] The following will take node D as an example to further explain the voting process. <4> =D.VRF.CreateProof(D.KeyPair.PrivateKey,4) to create proof_d <4> = D.VRF.CreateProof(D.KeyPair.PrivateKey,4). Then, the proof can be attached to Vote_d_2 (e.g. Vote_d_2.Assgin(proof_d <4> )). Then, we can use the function A=ProposerSeek(ProofSet <3> ,[A,B,C,D]) calculates the proposal node of block 3 (assuming that the proposal node of block 3 is A). Then, Vote_d_2 is sent to node A. Similarly, nodes B and C can refer to the voting process of node D to send Vote_b_2 and Vote_c_2 to node A.

[0055] When node A receives voting information such as Vote_b_2, Vote_c_2, and Vote_d_2, it parses proof_b of block 4 in the voting information respectively. <4> 、proof_c <4> and proof_d <4> It is necessary to use a function (such as VRF.VerfiyProof) to verify the legitimacy of the proof, and when the proof is determined to be valid, collect it into the proof set of block 4. In one embodiment, the legitimacy verification process of the proof of block 4 may include the proof_b <4> 、proof_c <4> and proof_d <4> For example, you can use the function A.VRF.VerifyProof(proof_b <4> .PublicKey,proof_a.Data,4)Verify proof_b <4> The legitimacy of the <4> .PublicKey,proof_c.Data,4)Verify proof_c <4> The legitimacy of the proof can be verified using the function A.VRF.VerifyProof(proof_d <4> .PublicKey,proof_d.Data,4) Verify proof_d <4> the legitimacy of.

[0056] The above process will continue to cycle as new blocks appear in the blockchain network. When determining the proposal node of a block in each cycle, each consensus node cannot predict the proof created by nodes other than itself, that is, the proof created by each consensus node is random relative to other nodes. Based on this, the proposal node calculated in real time by the proof set is random, which can effectively avoid malicious nodes from predicting the proposal node, thereby improving the security of the blockchain consensus algorithm.

[0057] Figure 4 4 is a schematic block diagram showing a consensus node 400 according to an embodiment of the present invention. The consensus node 400 may include a device 401 according to an embodiment of the present invention and its peripheral devices and external networks. As described above, the consensus node (for example, through the device 401) implements operations such as generating block proposal information including a proof set of a block or using the block proposal information to determine a proposal node of a block, so as to implement the aforementioned combination Figure 2 or Figure 3 The scheme of the present invention.

[0058] like Figure 4 As shown in , the device 401 may include a CPU 4011, which may be a general-purpose CPU, a dedicated CPU, or other information processing and program execution unit. Further, the device 401 may also include a large-capacity memory 4012 and a read-only memory ROM 4013, wherein the large-capacity memory 4012 may be configured to store various types of data, including block information, proofs, proposal information, etc. and various programs required for the blockchain network, and the ROM 4013 may be configured to store the power-on self-test of the device 401, the initialization of each functional module in the system, the basic input / output driver of the system, and the data required to boot the operating system.

[0059] Further, the device 401 also includes other hardware platforms or components, such as the TPU (Tensor Processing Unit) 4014, GPU (Graphic Processing Unit) 4015, FPGA (Field Programmable Gate Array) 4016 and MLU (Memory Logic Unit) 4017 shown. It is understood that although a variety of hardware platforms or components are shown in the device 401, this is merely exemplary and not restrictive, and those skilled in the art can add or remove corresponding hardware according to actual needs. For example, the device 401 may include only a CPU as a known hardware platform and another hardware platform as a test hardware platform of the present invention.

[0060] The device 401 of the present invention further includes a communication interface 4018, so that it can be connected to a local area network / wireless local area network (LAN / WLAN) 405 through the communication interface 4018, and then connected to a local server 406 through the LAN / WLAN or to the Internet ("Internet") 407 and remote servers 408 and 409. Alternatively or additionally, the device 401 of the present invention can also be directly connected to the Internet or a cellular network through the communication interface 4018 based on wireless communication technology, such as wireless communication technology based on the third generation ("3G"), the fourth generation ("4G") or the fifth generation ("5G")

[0061] The peripheral devices of the device 401 may include a display device 402, an input device 403, and a data transmission interface 404. In one embodiment, the display device 402 may include, for example, one or more speakers and / or one or more visual displays 4. The input device 403 may include, for example, a keyboard, a mouse, a microphone, a gesture capture camera, or other input buttons or controls, which are configured to receive input of data or user instructions. The data transmission interface 404 may include, for example, a serial interface, a parallel interface or a universal serial bus interface ("USB"), a small computer system interface ("SCSI"), a serial ATA, a FireWire ("FireWire"), a PCI Express, and a high-definition multimedia interface ("HDMI"), etc., which are configured for data transmission and interaction with other devices or systems.

[0062] The CPU 4011, the mass storage 4012, the read-only memory ROM 4013, the TPU 4014, the GPU 4015, the FPGA 4016, the MLU 4017 and the communication interface 4018 of the device 401 of the present invention can be connected to each other through a bus 4019, and data interaction with peripheral devices can be achieved through the bus. In one embodiment, through the bus 4019, the CPU 4011 can control other hardware components in the device 401 and its peripheral devices.

[0063] During operation, the processor CPU 4011 of the device 401 of the present invention can obtain the block proposal information of the proposal node or the block proof of other nodes through the input device 403 or the data transmission interface 404, and call the computer program instructions or codes stored in the memory 4012 to process the obtained information so as to determine the proposal node of the block.

[0064] As can be seen from the above description of the modular design of the present invention, the system of the present invention can be flexibly arranged according to the application scenario or demand without being limited to the architecture shown in the accompanying drawings. Further, it should also be understood that any module, unit, component, server, computer or device that performs the operation of the example of the present invention may include or otherwise access a computer-readable medium, such as a storage medium, a computer storage medium or a data storage device (removable) and / or non-removable) such as a disk, an optical disk or a tape. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data. Based on this, the present invention also discloses a computer-readable storage medium on which computer-readable instructions for electing nodes in a blockchain network are stored, and when the computer-readable instructions are executed by one or more processors, the methods and operations described in conjunction with the accompanying drawings are implemented.

[0065] Although this specification has shown and described a plurality of embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will appreciate many changes, modifications and alternatives without departing from the thought and spirit of the present invention. It should be understood that in the process of practicing the present invention, various alternatives to the embodiments of the present invention described herein may be adopted. The attached claims are intended to define the scope of protection of the present invention, and therefore cover the modular compositions, equivalents or alternatives within the scope of these claims.

Claims

1. A method for electing nodes in a blockchain network, wherein the blockchain network includes a plurality of consensus nodes, wherein the plurality of consensus nodes include a proposal node responsible for block proposals and other nodes, the method comprising performing the following operations at the other nodes: Receive the i-th block proposal information sent by the proposal node of the i-th block, wherein the i-th block proposal information includes the proof set of the i+1-th block; Extracting the proof set of the i+1 block from the i-th block proposal information; as well as Determine the proposal node of the i+1th block based on the proof set of the i+1th block and the attribute information of the multiple consensus nodes, where i is an integer greater than zero, and the i+1th block is the next adjacent block of the i-th block; The proof set of the i+1th block includes: The proof of block i+1 by each other node in the plurality of consensus nodes; The process of generating the proof of the i+1th block by each other node includes: Each other node is configured with a key, and uses a verifiable random function to process the private key in the local key and the height value of the i+1th block to obtain the proof of the i+1th block.

2. The method according to claim 1, further comprising: Generate proof of block i+2; as well as The proof of the i+2th block is sent to the proposal node of the i+1th block, wherein the i+2th block is the next adjacent block of the i+1th block.

3. The method according to claim 2, wherein each consensus node is configured with a key, wherein generating a proof of the i+2th block comprises: Get the height value of the i+2th block; The private key in the local key and the height value of the i+2th block are processed using a verifiable random function to obtain the proof of the i+2th block.

4. The method according to claim 1, wherein extracting the proof set of the (i+1)th block from the proposal information of the (i)th block comprises: Verify the legitimacy of the source of the i-th block proposal information; as well as In response to the legitimacy verification of the source of the proposal information of the i-th block being passed, an operation of extracting the proof set of the i+1-th block is performed.

5. The method according to any one of claims 1 to 4, wherein determining the proposal node of the (i+1)th block comprises: The proof set of the i+1th block and the attribute information of the multiple consensus nodes are processed using a predetermined function to determine the proposal node of the i+1th block based on the processing result.

6. The method according to claim 5, wherein the method further comprises: When i=1, the proposal node of block 1 is determined according to the genesis block information of the multiple consensus nodes; Generate proof of block 2; as well as Send the proof of the second block to the proposing node of the first block.

7. A method for electing a node in a blockchain network, wherein the blockchain network includes a plurality of consensus nodes, wherein the plurality of consensus nodes include a proposal node responsible for block proposals and other nodes, the method comprising performing the following operations at the proposal node responsible for block proposals: Receive the proof of the i+1th block sent by the other node; Determine a set of certificates for the (i+1)th block based on all received certificates for the (i+1)th block; Generate the i-th block proposal information including the proof set of the i+1-th block; Broadcast the i-th block proposal information to the other nodes, so that the other nodes determine the proposal node of the i+1-th block based on the i-th block proposal information, where i is an integer greater than zero, and the i+1-th block is the next adjacent block of the i-th block.

8. The method of claim 7, wherein determining the proof set of the (i+1)th block comprises: Verify the legitimacy of all received proofs for the i+1th block; The proofs of the (i+1)th block that have passed the legitimacy verification are collected into the proof set of the (i+1)th block.

9. The method according to claim 8, wherein the proof of each i+1th block is determined based on the private key of the sending node and the height value of the i+1th block, and includes the proof content encrypted by the private key, wherein the legitimacy verification of all received proofs of the i+1th block comprises: Get the public key of the sending node of the proof of each i+1th block; The public key of the sending node, the proof content encrypted by the private key and the height value of the i+1th block are verified using a verifiable random function to verify the legitimacy of the proof of each i+1th block.

10. A device, characterized in that: include: processor; as well as A memory storing computer instructions for electing nodes in a blockchain network, wherein when the computer instructions are executed by the processor, the device executes the method according to any one of claims 1 to 6 or the method according to any one of claims 7 to 9.

11. A computer program product, characterized in that Contains program instructions for electing nodes in a blockchain network. When the program instructions are executed by a processor, the method according to any one of claims 1 to 6 or the method according to any one of claims 7 to 9 is implemented.

12. A blockchain system, comprising: A plurality of consensus nodes, wherein the plurality of consensus nodes include a proposal node responsible for block proposal and other nodes, the proposal node is configured to broadcast current block proposal information to other nodes according to the method described in any one of claims 7-9, and the other nodes are configured to execute the method described in any one of claims 1-6 to determine the proposal node of the next block based on the current block proposal information.

Citation Information

Patent Citations

  • Byzantium fault tolerance method and implementation system thereof

    CN108667614A

  • Block outputting method and implementation system thereof

    CN108717630A

  • Block chain consensus method, electronic device and storage medium

    CN110995439A

  • System and method for bootstrapping a separate proof of work chain

    US11157899B1