A consensus method and device for blockchain system

By using reference relationships instead of signature messages in the blockchain system, verification nodes establish block reference relationships between different consensus rounds, solving the problem of high cost of signature message transmission and verification, and improving the efficiency and performance of the system.

CN118400095BActive Publication Date: 2024-09-27HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410844017.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-27
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

In the blockchain system, as the number of verification nodes increases, the cost of transmission and verification of signature messages becomes huge and difficult to control. How to reduce the cost of transmission and verification of signature messages during the consensus process has become an urgent problem that needs to be solved.

Method used

By replacing the signature message in the traditional consensus method with a reference relationship, the verification node references the pre-proposal block to generate a post-proposal block, and uses the post-proposal block as the certificate of the pre-proposal block to consensus on the pre-proposal block. , reducing the transmission and verification of signed messages.

Benefits of technology

It effectively reduces the overhead of transmitting and verifying signature messages during the consensus process, and improves the throughput and performance of the blockchain system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118400095B
    Figure CN118400095B
Patent Text Reader

Abstract

The present application is applicable to the field of blockchain technology, and provides a consensus method and device for a blockchain system, wherein the consensus method includes: in the n+x2th consensus round, multiple proposal blocks are referenced, and a post-proposal block is generated in combination with the current transaction of the client; wherein the multiple proposal blocks are generated by multiple verification nodes in the nth consensus round, corresponding to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round; the post-proposal block is used as a certificate of the pre-proposal block to reach a consensus on the pre-proposal block. Using the consensus method provided by the present application, it is no longer necessary to transmit a large number of signature messages during the consensus process, but a reference relationship is established between blocks generated in different consensus rounds to reach a consensus on a certain block. In this way, the overhead of transmitting and verifying signature messages during the consensus process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a consensus method and device for a blockchain system. Background Art

[0002] In the blockchain, the consensus mechanism is used to ensure that all nodes on the network agree on the current state of the network and the authenticity of transactions, which is essential to maintaining the security and integrity of the blockchain. The verification nodes participating in the consensus need to verify the blocks and sign and vote on them. According to the principle of Byzantine fault tolerance, only blocks with a legal number of 2f+1 signature votes can pass the verification and be correctly submitted and recorded in the blockchain. The legal number of signatures 2f+1 is proportional to the total number of verification nodes in the system 3f+1. When the number of verification nodes in the system increases dramatically, the number of signatures required for each block will also increase dramatically. At this time, the transmission and verification overhead of the signed message will become very large and difficult to control. Therefore, how to reduce the transmission and verification cost of the signed message during the consensus process has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide a consensus method and device for a blockchain system, which can solve the problem of high transmission and verification costs of signed messages during the consensus process.

[0004] In a first aspect, an embodiment of the present application provides a consensus method of a blockchain system, wherein the blockchain system includes multiple verification nodes, the consensus method is executed by a verification node, and the consensus method includes:

[0005] In the n+x2th consensus round, multiple proposal blocks are referenced and combined with the client's current transaction to generate a post-proposal block; wherein the multiple proposal blocks are generated in the nth consensus round by multiple verification nodes referring to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round;

[0006] The post-proposal block is used as the certificate of the pre-proposal block to reach a consensus on the pre-proposal block.

[0007] In a possible implementation, x1 and x2 are the same or different, and x1 and x2 are each equal to 1 or each not equal to 1.

[0008] In a possible implementation, multiple verification nodes reference a previous proposal block to generate a corresponding proposal block, including:

[0009] This verification node, together with other verification nodes, references a previous proposal block to generate a corresponding proposal block.

[0010] In a possible implementation, the step of referencing any one proposal block includes: referencing a hash index of the any one proposal block, wherein the any one proposal block is one of the proposal block and the preceding proposal block.

[0011] In a possible implementation, the preceding proposal block is generated by the current verification node, or the preceding proposal block is generated by other verification nodes.

[0012] In a possible implementation, using the post-proposal block as a certificate of the pre-proposal block includes:

[0013] Together with the post-proposal block generated by at least one other verification node, each of the post-proposal blocks is independently used as a certificate of the pre-proposal block, wherein if the number of certificates is greater than a preset threshold, the pre-proposal block is verified to have passed.

[0014] In one possible implementation, the number of proposal blocks is not less than 2f+1, where f is the number of dishonest verification nodes in the nth consensus round, and 3f+1 is the total number of verification nodes in the nth consensus round.

[0015] In a second aspect, an embodiment of the present application provides a consensus device of a blockchain system, including:

[0016] The post-proposal block generation module is used to refer to multiple proposal blocks in the n+x2th consensus round and generate a post-proposal block in combination with the current transaction of the client; wherein the multiple proposal blocks are generated in the nth consensus round by multiple verification nodes referring to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round;

[0017] The consensus module is used to use the post-proposal block as the certificate of the pre-proposal block to reach a consensus on the pre-proposal block.

[0018] In a possible implementation, x1 and x2 are the same or different, and x1 and x2 are each equal to 1 or each not equal to 1.

[0019] In a possible implementation, this verification node is used together with other verification nodes to reference a previous proposal block to generate a corresponding proposal block.

[0020] In a possible implementation, the post-proposal block generation module is specifically used to reference the hash index of any one of the proposal blocks, where the any one of the proposal blocks is one of the proposal block and the pre-proposal block.

[0021] In a possible implementation, the preceding proposal block is generated by the current verification node, or the preceding proposal block is generated by other verification nodes.

[0022] In one possible implementation, the consensus module is specifically used to independently use the post-proposal block as a certificate of the pre-proposal block together with the post-proposal block generated by at least one other verification node, wherein if the number of certificates is greater than a preset threshold, the pre-proposal block is verified to have passed.

[0023] In one possible implementation, the number of proposal blocks is not less than 2f+1, where f is the number of dishonest verification nodes in the nth consensus round, and 3f+1 is the total number of verification nodes in the nth consensus round.

[0024] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0026] Beneficial effects of this application

[0027] The present application provides a consensus method, apparatus, terminal device and storage medium, which replaces the signature message in the traditional consensus method with a reference relationship, that is, if the verification node references a proposal block, it means that the verification node has verified and passed the proposal block. Therefore, using the consensus method provided by the present application, it is no longer necessary to transmit a large number of signature messages during the consensus process, but to establish a reference relationship between blocks generated in different consensus rounds to reach a consensus on a certain block. In this way, the overhead of transmitting and verifying signature messages during the consensus process is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0029] Figure 1 It is a flowchart of a consensus method provided by an embodiment of the present application;

[0030] Figure 2 is a schematic diagram of Example 1 of the present application;

[0031] Figure 3 is a schematic diagram of Example 2 of the present application;

[0032] Figure 4 is a schematic diagram of Example 3 of the present application;

[0033] Figure 5 It is a reference relationship diagram provided in the embodiment of the present application;

[0034] Figure 6 is a schematic diagram of Example 4 of the present application;

[0035] Figure 7 is a schematic diagram of Example 5 of the present application;

[0036] Figure 8 is a schematic diagram of Example 6 of the present application;

[0037] Fig. 9 is a schematic diagram of Example 7 of the present application;

[0038] Fig.10 is a schematic diagram of Example 8 of the present application;

[0039] Fig.11 is a schematic diagram of Example 9 of the present application;

[0040] Fig.12 is a schematic diagram of Example 10 of the present application;

[0041] Fig.13 is a schematic diagram of Example 11 of the present application;

[0042] Fig.14 It is a schematic diagram of the structure of the consensus device provided in the embodiment of the present application;

[0043] Fig.15 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0045] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0046] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0047] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" 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" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0050] In the blockchain system, the consensus protocol must be used to ensure the consistency of the distributed nodes in the system. Each verification node in the consensus protocol is also called a consensus node, which needs to verify the block and sign and vote on it. According to the principle of Byzantine fault tolerance, only blocks with a legal number of 2f+1 signature votes can pass the verification and can be correctly submitted and recorded in the blockchain. The legal number of signatures 2f+1 is proportional to the total number of verification nodes in the system 3f+1. When the number of verification nodes in the system increases dramatically, the number of signatures required for each block will also increase dramatically. At this time, the transmission and verification overhead of the signed message will become very large and difficult to control. Therefore, how to reduce the transmission and verification cost of the signed message during the consensus process has become a technical problem that needs to be solved urgently.

[0051] The present application provides a consensus method, apparatus, terminal device and storage medium, which replaces the signature message in the traditional consensus method with a reference relationship, that is, if the verification node references a proposal block, it means that the verification node has verified the proposal block. Therefore, using the consensus method provided by the present application, it is no longer necessary to transmit a large number of signature messages during the consensus process, but by checking the reference relationship, it is determined whether a proposal block has been verified by a sufficient number of verification nodes. In this way, the overhead of transmitting and verifying signature messages during the consensus process is reduced.

[0052] In order to illustrate the technical solution of the present application, specific embodiments are provided below.

[0053] See also Figure 1 The process of an embodiment of the consensus method of the blockchain system shown, as an example but not a limitation, includes the following steps:

[0054] Step S100: In the n+x2th consensus round, multiple proposal blocks are referenced, and combined with the current transaction of the client, a post-proposal block is generated; wherein, the multiple proposal blocks are generated in the nth consensus round by multiple verification nodes referring to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round;

[0055] Step S200: Use the post-proposal block as the certificate of the pre-proposal block to reach consensus on the pre-proposal block.

[0056] It should be noted that the blockchain system of the present application includes multiple verification nodes, and the consensus method provided in the embodiment of the present application is executed by the verification node. The verification node is a node that has been specifically authenticated and authorized in the blockchain network, and they have the authority to participate in the consensus process, verify transactions and package blocks. Specifically, the tasks that the verification node is responsible for include executing the consensus algorithm, as described in the above scheme, they will reference the proposal block in a specific consensus round, generate the post-proposal block, and participate in the consensus on the pre-proposal block. The verification node will also verify the transaction to ensure the legality, validity and compliance with the protocol rules of the blockchain. In addition, the verification node will also package legal transactions to generate new blocks based on the results of the consensus algorithm, and try to add these blocks to the blockchain.

[0057] It is understandable that blockchain systems usually set a threshold that requires a certain number of verification nodes to verify the same proposal block before the proposal block can be added to the blockchain. This process ensures that most verification nodes in the network have reached a consensus on the content of the new block. In the traditional consensus process, if a verification node verifies a proposal block, it needs to sign it and broadcast it to other verification nodes in the system. Other verification nodes need to verify the signature. Therefore, a large amount of signature information needs to be transmitted and verified during the consensus process.

[0058] In the consensus method provided by this application, if the verification node references the proposal block generated in the previous consensus round, it means that the verification node has verified the proposal block. That is, in this application, the reference relationship replaces the signature message in the traditional consensus method, so the consensus process no longer needs to transmit a large number of signature messages, but checks the reference relationship to determine whether a proposal block has been verified by a sufficient number of verification nodes.

[0059] It should be noted that in this application, the determination of the reference relationship is based on verification, that is, a certain block needs to be verified to ensure that the content of the proposal block complies with the rules of the blockchain and the security requirements of the network. Only after the verification is passed can a reference relationship be established with it.

[0060] Exemplarily, the verification node can verify the correctness of the proposal block by checking the proposal block signature, block data content, block hash, and block timestamp. For example, the verification node can check whether the transaction data in the block is valid and legal, including checking whether the transaction fields are complete and whether the format complies with the protocol rules of the blockchain. For each transaction, the verification node may also need to check whether the input and output of the transaction are balanced. For another example, the verification node can also calculate the hash value of the proposal block and compare it with the hash value stored in the block header to ensure that the block has not been tampered with during transmission. Alternatively, the verification node can check whether the timestamp in the proposal block is reasonable. The timestamp is used to record the time when the block was created, which can help the verification node detect potential double payments or repeated transactions.

[0061] Therefore, it can also be understood that citing a proposal block means the recognition of the proposal block. In the subsequent consensus process, the reference relationship between proposal blocks can be checked to determine whether a proposal block is referenced by a sufficient number of verification nodes. If the number of verification nodes that reference the proposal block meets certain requirements, it can be considered that the proposal block has been recognized by enough people, that is, the proposal block is credible.

[0062] Compared with the traditional consensus method, each proposal block needs to carry at least 2f+1 signatures. When the number of verification nodes in the system increases dramatically, the number of signatures required for each block will also increase dramatically. The consensus method provided by this application expresses the recognition of a proposal block through a reference relationship, rather than consensus on a proposal block through signatures. Therefore, it is no longer necessary to transmit a large number of signature messages during the consensus process. In this way, the overhead of transmitting and verifying signature messages during the consensus process is reduced.

[0063] It should be noted that in step S100, when the verification node generates the post-proposal block, it also needs to combine the current transaction of the client. Among them, transactions refer to a series of operations or requests initiated by the user (i.e., the client) on the blockchain network, which will change the status or data on the blockchain. These transactions may involve the call of smart contracts, the writing or updating of data, etc.

[0064] It should be noted that the implementation process of referencing proposal blocks is based on a directed acyclic graph (DAG), that is, the blockchain system is not just a simple linear structure, but uses a more complex graph structure to organize and reference proposal blocks.

[0065] In order to better understand this application, we first briefly introduce the directed acyclic graph (DAG), which is a graph containing directional edges and no cycles. In the blockchain system, the directed acyclic graph can be used to represent the reference relationship between proposal blocks, where each proposal block can point to one or more previous proposal blocks, forming a complex network structure.

[0066] Specifically, the blockchain system maintains a pre-stored directed acyclic graph that records all proposal blocks and the reference relationships between them. When a verification node wants to reference a previous proposal block, it will query this pre-stored DAG to find a suitable block for reference. The basis for the reference may be the age of the block (i.e., generation time), the number of transactions contained, the quality of the block, or other custom strategies.

[0067] When constructing a new proposal block, the verification node will select one or more previous proposal blocks for reference based on the current transaction data and the reference relationship in the DAG. When the new proposal block is successfully added to the DAG and confirmed by other verification nodes in the network, the structure of the DAG will be updated accordingly to reflect the new reference relationship and the addition of the block.

[0068] The consensus method of referencing proposal blocks through directed acyclic graphs can make the blockchain system more flexible and efficient in processing large amounts of transactions and quickly generating blocks. Verification nodes can reach consensus by processing multiple proposal blocks in parallel and finding the appropriate path in the DAG, thereby improving the throughput and performance of the entire system.

[0069] In a possible implementation, x1 and x2 are the same or different, and x1 and x2 are each equal to 1 or each not equal to 1.

[0070] It should be noted that x1 can be a positive integer of 1 or greater than 1. If x1 is 1, it means that the round of generating the proposal block is adjacent to the round of generating the preceding proposal block. If x1 is not 1, it means that the round of generating the proposal block is not adjacent to the round of generating the preceding proposal block. Similarly, x2 can also be a positive integer of 1 or greater than 1. If x2 is 1, it means that the round of generating the proposal block is adjacent to the round of generating the succeeding proposal block. If x2 is not 1, it means that the round of generating the proposal block is not adjacent to the round of generating the succeeding proposal block.

[0071] The above contents are explained below with reference to specific embodiments.

[0072] Example 1: See Figure 2 In this embodiment, x1=1, x2=1, that is, in the n+1th consensus round, the proposal block A generated in the nth consensus round is referenced. n , Bn , C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block B generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block B n-1 The certificate is used to pre-propose block B for consensus n-1 .

[0073] Example 2: See Figure 3 In this embodiment, x1=1, x2≠1. Specifically, taking x2 equal to 2 as an example, in the n+2th consensus round, the proposal block A generated in the nth consensus round is referenced by indirect reference. n , B n , C n To generate post-proposal block B n+2 , where A n , B n , C n All three proposal blocks reference the previous proposal block B generated in the n-1th consensus round. n-1 , so the post-proposal block B n+2 As a pre-proposal block B n-1 The certificate is used to pre-propose block B for consensus n-1 .

[0074] It should be noted that since the block generated in the n+1th consensus round has a reference relationship with the proposal block generated in the nth consensus round, the post-proposal block B n+2 The proposal block generated in the nth consensus round can be indirectly referenced by referencing the block generated in the n+1th consensus round.

[0075] For example, due to block A n+1 With proposal block A n There is a reference relationship, so the proposal block B is placed later n+2 By referencing block A n+1 To implement the proposal block A n Similarly, due to block C n+1 With proposal block B n There is a reference relationship, so the proposal block B is placed later n+2 By referencing block C n+1 To implement the proposal block B n Similarly, due to block D n+1 With proposal block C nThere is a reference relationship, so the proposal block B is placed later n+2 By referencing block D n+1 To implement the proposal block C n citations.

[0076] Example 3: See Figure 4 In this embodiment, x1≠1, x2=1. Specifically, taking x1 equal to 2 as an example, in the n+1th consensus round, the proposal block A generated in the nth consensus round is referenced. n , B n , C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks indirectly reference the previous proposal block B generated in the n-2 consensus round. n-2 , so the post-proposal block B n+1 As a pre-proposal block B n-2 The certificate is used to make consensus on the proposed block B n-2 .

[0077] It should be noted that since there is a reference relationship between the block generated in the n-1th consensus round and the previous proposal block generated in the n-2th consensus round, the proposal block can indirectly reference the previous proposal block generated in the n-2th consensus round by referencing the block generated in the n-1th consensus round.

[0078] For example, due to block A n-1 With proposal block B n-2 There is a reference relationship, so the proposal block A n By referencing block A n-1 To implement the previous proposal block B n-2 Similarly, due to block B n-1 With the previous proposal block B n-2 There is a reference relationship, so the proposal block C n By referencing block B n-1 To implement the previous proposal block B n-2 Similarly, due to block C n-1 With the previous proposal block B n-2 There is a reference relationship, so the proposal block D n By referencing block C n-1 To implement the previous proposal block B n-2 citations.

[0079] It should be noted that, from the above embodiments, it can be seen that reference includes direct reference and indirect reference. Direct reference is to reference a block generated in the previous round. For example, Figure 3 Middle Block A n Quote Block B n-1 、Block B n+2 Quote Block C n+1 Or Block A n+1 Quote Block A n , indirect reference refers to the proposal blocks generated in non-adjacent rounds, for example, Figure 3 Middle Block B n+2 Quote Block A n , which is block B n+2 Through Block A n+1 Indirect reference block A n .

[0080] In a possible implementation, multiple verification nodes reference a previous proposal block to generate a corresponding proposal block, including:

[0081] This verification node, together with other verification nodes, references a previous proposal block to generate a corresponding proposal block.

[0082] It should be noted that in the nth consensus round, there is a process of referencing a previous proposal block to generate a proposal block. The execution subject of this process may include the current verification node or not.

[0083] This is explained with reference to the above-mentioned Embodiment 1 and Embodiment 3. Figure 2 As shown in the schematic diagram of Example 1, in the nth consensus round, the current verification node (Validator B) participated in the generation process of the proposal block, that is, Validator B referenced the previous proposal block B in the nth consensus round. n-1 Generate proposal block B n . And in Figure 4 In the embodiment 3 shown, in the nth consensus round, the current verification node (Validator B) did not participate in the generation process of the proposal block, that is, Validator B did not reference the previous proposal block to generate the proposal block B in the nth consensus round. n .

[0084] Therefore, in the embodiment of the present application, the execution entity of the process of referencing a previous proposal block to generate a proposal block may include this verification node or may not include it.

[0085] In a possible implementation, the step of referencing any one proposal block includes: referencing a hash index of the any one proposal block, wherein the any one proposal block is one of the proposal block and the preceding proposal block.

[0086] It should be noted that the proposal block contains: transaction list, current consensus round, proposal signatory, proposal signature, and reference relationship with the proposal block generated in the previous round. Figure 5 Each proposal block contains the transaction list transactions, the current consensus round round, the proposal signatory author, the proposal signature signature, and the reference relationship parents to the proposal block of the previous round.

[0087] In one possible implementation, a hash index can be generated based on the current consensus round, proposal signatories, transaction list, and reference relationships. Figure 5 In the illustrated case, the hash indexes include h1, h2 and h3, where h1 is calculated by the hash function based on the current consensus round r, the proposal signer v1, the transaction list txs1 and the reference relationship p1; h2 is calculated by the hash function based on the current consensus round r, the proposal signer v2, the transaction list txs2 and the reference relationship p2; h3 is calculated by the hash function based on the current consensus round r, the proposal signer v3, the transaction list txs3 and the reference relationship p3.

[0088] It should be noted that the basis of the reference is that the proposal block has been verified, including the verification of the correspondence between the signatory and the signature of the proposal block, as well as the verification of the correctness of the reference relationship.

[0089] Specifically, it is necessary to verify the correspondence between the signatory of the proposal block and the signature. This application reaches consensus through multiple consensus rounds. Each honest verification node will sign its only proposal block in this round and broadcast it to other verification nodes in each consensus round to prove that the block was indeed generated by it. The verification node will check whether the signature matches the signatory and whether the signature is valid (not tampered or forged). In this way, malicious nodes can be prevented from forging blocks or tampering with transactions.

[0090] In addition, the correctness of the reference relationship needs to be verified. Since each proposal block will reference several (not less than the legal number) proposal blocks, the verification node needs to check whether the hash value of the referenced proposal block is correct to ensure the integrity and continuity of the blockchain.

[0091] In addition, when generating the post-proposal block, it is also necessary to combine the current transaction of the client, and the transaction also needs to be verified. Specifically, the transaction list of the current transaction can be verified, including verifying the validity of each transaction, the identity of the sender and receiver, and whether the transaction amount is correct, etc., to ensure that only legal and valid transactions can be added to the blockchain.

[0092] In a possible implementation, the preceding proposal block is generated by the current verification node, or the preceding proposal block is generated by other verification nodes.

[0093] It should be noted that in the above-mentioned embodiments 1, 2 and 3, the pre-proposal block and the post-proposal block are generated by the same verifier. In some possible implementations, corresponding to the above-mentioned three situations, the pre-proposal block and the post-proposal block may also be generated by different verifiers. This is explained below with a specific embodiment.

[0094] Example 4: See Figure 6 , in this embodiment, x1=1, x2=1, and the pre-proposal block and the post-proposal block are generated by different verification nodes.

[0095] It should be noted that the difference between this embodiment and embodiment 1 is that the pre-proposal block and the post-proposal block are generated by different verification nodes. n-1 With the post-proposal block B n+1 are all generated by the verification node Validator B, and in Example 4, the previous proposal block D n-1 Generated by Validator D, and then proposed block B n+1 Generated by verification node Validator B.

[0096] Specifically, in the n+1th consensus round, the proposal block A generated in the nth consensus round is referenced. n , B n , C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block D generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block D n-1 The certificate is used to make consensus on the proposed block D n-1 .

[0097] Example 5: See Figure 7, in this embodiment, x1=1, x2≠1, and the previous proposal block and the subsequent proposal block are generated by different verification nodes.

[0098] It should be noted that the difference between this embodiment and embodiment 2 is that the pre-proposal block and the post-proposal block are generated by different verification nodes. n-1 With the post-proposal block B n+1 are all generated by the verification node Validator B, and in Example 5, the previous proposal block C n-1 Generated by Validator C, and then proposed block B n+2 Generated by verification node Validator B.

[0099] Specifically, in the n+2th consensus round, the proposal block A generated in the nth consensus round is referenced indirectly. n , B n , C n To generate post-proposal block B n+2 , where A n , B n , C n All three proposal blocks reference the previous proposal block C generated in the n-1th consensus round. n-1 , so the post-proposal block B n+2 As a pre-proposal block C n-1 The certificate is used to make consensus on the pre-proposed block C n-1 .

[0100] Example 6: See Figure 8 , in this embodiment, x1≠1, x2=1, and the previous proposal block and the subsequent proposal block are generated by different verification nodes.

[0101] It should be noted that the difference between this embodiment and embodiment 3 is that the pre-proposal block and the post-proposal block are generated by different verification nodes. n-2 With the post-proposal block B n+1 are all generated by the verification node Validator B, and in Example 6, the previous proposal block D n-2 Generated by Validator D, and then proposed block B n+1 Generated by verification node Validator B.

[0102] Specifically, in the n+1th consensus round, the proposal block A generated in the nth consensus round is referenced. n , B n , C n To generate post-proposal block Bn+1 , where A n , B n , C n All three proposal blocks indirectly reference the previous proposal block D generated in the n-2 consensus round. n-2 , so the post-proposal block B n+1 As a pre-proposal block D n-2 The certificate is used to make consensus on the proposed block D n-2 .

[0103] In one possible implementation, the post-proposal block is used as a certificate of the pre-proposal block, including: together with the post-proposal block generated by at least one other verification node, each of the post-proposal blocks is independently used as a certificate of the pre-proposal block, wherein if the number of certificates is greater than a preset threshold, the pre-proposal block is verified to have passed.

[0104] It should be noted that the certificate represents the verification node's confirmation and acceptance of the proposed block to be submitted. Each verification node can generate certificates for one or more proposed blocks to be submitted. These certificates are accumulated to form a quantitative indicator of the acceptance degree of a proposed block. In order to ensure the stability and security of the blockchain, only when the number of certificates for a proposed block to be submitted reaches or exceeds the preset value, the proposed block will be deemed to have sufficient support and thus be submitted to the target blockchain.

[0105] It should also be noted that the preset number of certificates can be adjusted according to the specific situation of the blockchain network. For example, if the blockchain network is small or the number of verification nodes is small, the preset number of certificates can be appropriately reduced; while if the blockchain network is large or the number of verification nodes is large, the preset number of certificates can be appropriately increased.

[0106] In the embodiment of the present application, for the same pre-proposal block, there can be multiple post-proposal blocks as its certificates, and the multiple certificates can be generated by different verification nodes in the same consensus round, or by the same verification node in different rounds. This is explained below through a specific embodiment.

[0107] Example 7: See Fig. 9 In this embodiment, for the pre-proposal block B generated by Validator B in the n-1th consensus round n-1 , there are two certificates, generated by Validator B and Validator D in the n+1th consensus round respectively.

[0108] Specifically, in the n+1th consensus round, the verification node Validator B references the proposal block A generated in the nth consensus round. n , B n , C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block B generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block B n-1 The certificate is used to pre-propose block B for consensus n-1 At the same time, the verification node Validator D also referenced the proposal block A generated in the nth consensus round in the n+1th consensus round. n , B n , C n To generate the post-proposal block D n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block B generated in the n-1th consensus round. n-1 , so the post-proposal block D n+1 As a pre-proposal block B n-1 The certificate is used to pre-propose block B for consensus n-1 .

[0109] It should be noted that in Example 7, the post-proposal block D generated by Validator D n+1 and the post-proposal block B generated by ValidatorB n+1 , can all be used as pre-proposal block B n-1 The certificate of consensus pre-proposed block B n-1 .

[0110] In the above embodiment, a pre-proposal block has multiple post-proposal blocks as its certificates, and the multiple post-proposal blocks as certificates are all generated in the same consensus round. It should be noted that in some possible embodiments, multiple post-proposal blocks as certificates may be generated in different consensus rounds, and this situation is explained below through Example 8.

[0111] Example 8: See Fig.10 In this embodiment, the verification node Validator B references the proposal block A generated in the nth consensus round in the n+1th consensus round. n , B n , Cn To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block C generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block C n-1 The certificate is used to make consensus on the proposed block B n-1 .

[0112] At the same time, in the n+2th consensus round, the verification node Validator B indirectly references the proposal block A generated in the nth consensus round. n , B n , C n To generate post-proposal block B n+2 , where A n , B n , C n All three proposal blocks reference the previous proposal block C generated in the n-1th consensus round. n-1 , so we can also put the post-proposal block B n+2 As a pre-proposal block C n-1 Certificate for consensus pre-proposal block C n-1 .

[0113] Therefore, in this embodiment, the post-proposal block B n+1 and post-proposal block B n+2 Both are used as pre-proposal block C n-1 Certificate, and then propose block B n+1 and post-proposal block B n+2 Generated in different consensus rounds.

[0114] In the above-mentioned Example 8, two post-proposal blocks as certificates are generated in different rounds, but are both generated by the same verification node Validator B. It should be noted that, in some possible embodiments, multiple post-proposal blocks as certificates may also be generated by different verification nodes in different consensus rounds. This is explained below through Example 9.

[0115] See also Fig.11 In Example 9, the verification node Validator D, in the n+1th consensus round, references the proposal block A generated in the nth consensus round. n , B n , C n To generate the post-proposal block D n+1 , where A n , Bn , C n All three proposal blocks reference the previous proposal block C generated in the n-1th consensus round. n-1 , so the post-proposal block D n+1 As a pre-proposal block C n-1 Certificate for consensus pre-proposal block C n-1 .

[0116] At the same time, in the n+2th consensus round, the verification node Validator B indirectly references the proposal block A generated in the nth consensus round. n , B n , C n To generate post-proposal block B n+2 , where A n , B n , C n All three proposal blocks reference the previous proposal block C generated in the n-1th consensus round. n-1 , so we can also put the post-proposal block B n+2 As a pre-proposal block C n-1 Certificate for consensus pre-proposal block C n-1 .

[0117] Therefore, in this embodiment, the post-proposal block D n+1 and post-proposal block B n+2 Both are used as pre-proposal block C n-1 Certificate, and then the proposal block D n+1 and post-proposal block B n+2 Generated by different verification nodes in different consensus rounds.

[0118] It should also be noted that, in some possible embodiments, the same post-proposal block may also serve as the certificate of multiple pre-proposal blocks at the same time. This situation is described below through Example 10.

[0119] See also Fig.12 In Example 10, the pre-proposal block includes B n-1 and D n-1 According to the reference relationship in the diagram, the post-proposal block B n+1 It can be used as a pre-proposal block including B n-1 The certificate can also be used as a pre-proposal block including D n-1 of the certificate.

[0120] Specifically, in the n+1th consensus round, the verification node Validator B references the proposal block A generated in the nth consensus round. n , B n, C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block D generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block D n-1 The certificate is used to make consensus on the proposed block D n-1 And, the proposed block A n , B n , C n Both reference the previous proposal block B generated in the n-1th consensus round n-1 , so the post-proposal block B n+1 Can also be used as a pre-proposal block B n-1 The certificate is used to make consensus on the proposed block B n-1 Therefore, in this embodiment, the post-proposal block B n+1 At the same time, it serves as the pre-proposal block B n-1 and the previous proposal block D n-1 of the certificate.

[0121] It should be noted that, in the case where the same post-proposal block is used as multiple pre-proposal blocks, there is still no restriction that the pre-proposal block and the post-proposal block must be generated by the same verification node. This situation is described below with Example 11.

[0122] See also Fig.13 , in the n+1th consensus round, the verification node Validator B references the proposal block A generated in the nth consensus round n , B n , C n To generate post-proposal block B n+1 , where A n , B n , C n All three proposal blocks reference the previous proposal block D generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 As a pre-proposal block D n-1 The certificate is used to make consensus on the proposed block D n-1 And, the proposed block A n , B n , C n All referenced the previous proposal block A generated in the n-1th consensus round. n-1 , so the post-proposal block B n+1 Can also be used as a pre-proposal block A n-1Certificate for consensus pre-proposal block A n-1 Therefore, in this embodiment, the post-proposal block B n+1 At the same time, it serves as the pre-proposal block A n-1 and the previous proposal block D n-1 of the certificate.

[0123] In one possible implementation, the number of proposal blocks is not less than 2f+1, where f is the number of dishonest verification nodes in the nth consensus round, and 3f+1 is the total number of verification nodes in the nth consensus round.

[0124] It should be noted that the use of the post-proposal block as the certificate of the pre-proposal block needs to meet certain conditions, that is, the number of proposal blocks referenced by the post-proposal block needs to meet the condition of 2f+1, which is based on the Byzantine Fault Tolerant algorithm. The Byzantine Fault Tolerant algorithm is a fault-tolerant algorithm for the Byzantine problem, which solves the problem of how to reach a consensus when the network communication is reliable but the nodes may fail and act maliciously. Its core theory is that the total number of nodes in the system is greater than or equal to 3f+1, and f is the number of nodes that are allowed to fail. In other words, for a certain proposal block, only a statutory number (not less than 2f+1) of verification nodes have verified and passed the block to ensure the correctness of the proposal block. Therefore, the embodiment of the present application requires that for the pre-proposal block, the number of proposal blocks referenced by it shall not be less than 2f+1.

[0125] In addition, for checking the reference relationship, a depth-first traversal method can be used, taking a post-proposal block of the n+x2th consensus round as the starting point, and preferentially traversing the proposal blocks with which it has a reference relationship, so as to determine whether a pre-proposal block is supported by enough verification nodes through the reference relationship.

[0126] Depth-first traversal is an algorithm for traversing or searching a tree / graph. In an embodiment of the present application, traversal can be performed based on a directed acyclic graph, that is, if a post-proposal block references a proposal block from a previous round, the post-proposal block is used as the starting point, and a depth-first traversal (DFS) is used to track and verify these referenced blocks.

[0127] The following is an explanation of the traversal process in combination with the principle of depth-first traversal. The verification node takes the post-proposal block generated in the n+x2th consensus round as the starting point, and then needs to select the first neighbor node. Since the current block references one or some previous blocks, the verification node will first select these referenced blocks as the first neighbor node for traversal; then, for each referenced block (neighbor node), the verification node will check whether the block references other blocks. If so, the verification node will recursively continue to traverse these referenced blocks until there are no more referenced blocks; then, when the verification node has traversed all blocks of a branch, it will backtrack to the previous node and continue to traverse other neighbor nodes of the node that have not been traversed; when the verification node has traversed all reachable blocks, or reaches a preset termination condition (such as traversal depth limit, time limit, etc.), the traversal process ends. In this way, it can be determined whether a certain pre-proposal block is supported by enough verification nodes.

[0128] The consensus device 400 of a blockchain system provided in the embodiment of the present application is shown in FIG. Fig.14 ,include:

[0129] The post-proposal block generation module 401 is used to refer to multiple proposal blocks in the n+x2th consensus round and generate a post-proposal block in combination with the current transaction of the client; wherein the multiple proposal blocks are generated in the nth consensus round by multiple verification nodes referring to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round;

[0130] The consensus module 402 is used to use the post-proposal block as the certificate of the pre-proposal block to reach a consensus on the pre-proposal block.

[0131] It should be noted that the consensus device 400 provided by the present application replaces the signature message in the traditional consensus method with a reference relationship, that is, if the post-proposal block references multiple proposal blocks, and multiple proposal blocks all reference a certain pre-proposal block, then the post-proposal block can be used as the certificate of the pre-proposal block, and the formula process is completed based on the certificate. Therefore, in the process of achieving consensus using the consensus device 400 provided by the present application, it is no longer necessary to transmit a large number of signature messages, but through the reference relationship, it can be determined whether a certain pre-proposal block has been verified by a sufficient number of verification nodes. In this way, the overhead of transmitting and verifying signature messages during the consensus process is reduced.

[0132] Based on the same inventive concept, in a possible implementation, x1 and x2 are the same or different, and x1 and x2 are respectively equal to 1 or are respectively not equal to 1.

[0133] It should be noted that x1 can be a positive integer of 1 or greater than 1. If x1 is 1, it means that the round of generating the proposal block is adjacent to the round of generating the preceding proposal block. If x1 is not 1, it means that the round of generating the proposal block is not adjacent to the round of generating the preceding proposal block. Similarly, x2 can also be a positive integer of 1 or greater than 1. If x2 is 1, it means that the round of generating the proposal block is adjacent to the round of generating the succeeding proposal block. If x2 is not 1, it means that the round of generating the proposal block is not adjacent to the round of generating the succeeding proposal block.

[0134] Based on the same inventive concept, this verification node is used together with other verification nodes to reference a previous proposal block to generate a corresponding proposal block.

[0135] It should be noted that in the nth consensus round, there is a process of referencing a previous proposal block to generate a proposal block. The execution subject of this process may include the current verification node or not.

[0136] Based on the same inventive concept, the post-proposal block generation module is specifically used to reference the hash index of any one of the proposal blocks, where the any one of the proposal blocks is one of the proposal block and the pre-proposal block.

[0137] It should be noted that the proposal block contains: transaction list, current consensus round, proposal signatory, proposal signature, and reference relationship with the proposal block generated in the previous round. Figure 5 Each proposal block contains the transaction list transactions, the current consensus round round, the proposal signatory author, the proposal signature signature, and the reference relationship parents to the proposal block of the previous round.

[0138] In one possible implementation, a hash index can be generated based on the current consensus round, proposal signatories, transaction list, and reference relationships. Figure 5 In the illustrated case, the hash indexes include h1, h2 and h3, where h1 is calculated by the hash function based on the current consensus round r, the proposal signer v1, the transaction list txs1 and the reference relationship p1; h2 is calculated by the hash function based on the current consensus round r, the proposal signer v2, the transaction list txs2 and the reference relationship p2; h3 is calculated by the hash function based on the current consensus round r, the proposal signer v3, the transaction list txs3 and the reference relationship p3.

[0139] Based on the same inventive concept, the preceding proposal block is generated by the current verification node, or the preceding proposal block is generated by other verification nodes.

[0140] It should be noted that in the above-mentioned embodiments 1, 2 and 3, the pre-proposal block and the post-proposal block are generated by the same verifier. In some possible implementations, corresponding to the above-mentioned three situations, the pre-proposal block and the post-proposal block may also be generated by different verifiers. This is explained below with a specific embodiment.

[0141] Based on the same inventive concept, the consensus module is specifically used to independently use the post-proposal block as a certificate of the pre-proposal block together with the post-proposal block generated by at least one other verification node, wherein if the number of certificates is greater than a preset threshold, the pre-proposal block is verified to have passed.

[0142] It should be noted that the certificate represents the verification node's confirmation and acceptance of the proposed block to be submitted. Each verification node can generate certificates for one or more proposed blocks to be submitted. These certificates are accumulated to form a quantitative indicator of the acceptance degree of a proposed block. In order to ensure the stability and security of the blockchain, only when the number of certificates for a proposed block to be submitted reaches or exceeds the preset value, the proposed block will be deemed to have sufficient support and thus be submitted to the target blockchain.

[0143] It should also be noted that the preset number of certificates can be adjusted according to the specific situation of the blockchain network. For example, if the blockchain network is small or the number of verification nodes is small, the preset number of certificates can be appropriately reduced; while if the blockchain network is large or the number of verification nodes is large, the preset number of certificates can be appropriately increased.

[0144] In an embodiment of the present application, for the same pre-proposal block, there can be multiple post-proposal blocks as its certificates, and the multiple certificates can be generated by different verification nodes in the same consensus round, or by the same verification node in different rounds.

[0145] Based on the same inventive concept, the number of proposed blocks is not less than 2f+1, where f is the number of dishonest verification nodes in the nth consensus round, and 3f+1 is the total number of verification nodes in the nth consensus round.

[0146] It should be noted that the use of the post-proposal block as the certificate of the pre-proposal block needs to meet certain conditions, that is, the number of proposal blocks referenced by the post-proposal block needs to meet the condition of 2f+1, which is based on the Byzantine Fault Tolerant algorithm. The Byzantine Fault Tolerant algorithm is a fault-tolerant algorithm for the Byzantine problem, which solves the problem of how to reach a consensus when the network communication is reliable but the nodes may fail and act maliciously. Its core theory is that the total number of nodes in the system is greater than or equal to 3f+1, and f is the number of nodes that are allowed to fail. In other words, for a certain proposal block, only a statutory number (not less than 2f+1) of verification nodes have verified and passed the block to ensure the correctness of the proposal block. Therefore, the embodiment of the present application requires that for the pre-proposal block, the number of proposal blocks referenced by it shall not be less than 2f+1.

[0147] In addition, for checking the reference relationship, a depth-first traversal method can be used, taking a post-proposal block of the n+x2th consensus round as the starting point, and preferentially traversing the proposal blocks with which it has a reference relationship, so as to determine whether a pre-proposal block is supported by enough verification nodes through the reference relationship.

[0148] Fig.15 The terminal device 1000 is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 1000 includes: at least one processor 1001 ( Fig.15 Only one processor is shown in the figure), a memory 1002, and a computer program 1003 stored in the memory 1002 and executable on the at least one processor 1001, wherein the processor 1001 implements the steps in the above 6 method embodiments when executing the computer program 1003.

[0149] The terminal device 1000 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 1001 and a memory 1002. Those skilled in the art will appreciate that Fig.15 It is only an example of the terminal device 1000 and does not constitute a limitation on the terminal device 1000 , and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.

[0150] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0151] In some embodiments, the memory 1002 may be an internal storage unit of the terminal device 1000, such as a hard disk or memory of the terminal device 1000. In other embodiments, the memory 1002 may also be an external storage device of the terminal device 1000, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 1000. Further, the memory 1002 may also include both an internal storage unit of the terminal device 1000 and an external storage device. The memory 1002 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program, etc. The memory 1002 may also be used to temporarily store data that has been output or is to be output.

[0152] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0153] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0154] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0157] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0158] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0160] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A consensus method for a blockchain system, characterized in that: The blockchain system includes a plurality of verification nodes, the consensus method is executed by a verification node, and the consensus method includes: In the n+x2th consensus round, multiple proposal blocks are referenced, and combined with the current transaction of the client, a post-proposal block is generated; wherein, the multiple proposal blocks are generated in the nth consensus round by multiple verification nodes referring to a pre-proposal block, and the pre-proposal block is generated in the n-x1th consensus round; wherein, x1 is a positive integer of 1 or greater than 1, and x2 is a positive integer of 1 or greater than 1; The post-proposal block is used as the certificate of the pre-proposal block to reach a consensus on the pre-proposal block.

2. The consensus method as claimed in claim 1, characterized in that: x1 and x2 are the same or different, and x1 and x2 are each equal to 1 or each not equal to 1.

3. The consensus method as claimed in claim 1, characterized in that: Multiple verification nodes reference a previous proposal block to generate corresponding proposal blocks, including: This verification node, together with other verification nodes, references a previous proposal block to generate a corresponding proposal block.

4. The consensus method according to claim 1, characterized in that: The step of referencing any one of the proposal blocks includes: referencing a hash index of the any one of the proposal blocks, wherein the any one of the proposal blocks is one of the proposal block and the preceding proposal block.

5. The consensus method according to claim 1, characterized in that: The previous proposal block is generated by this verification node, or the previous proposal block is generated by other verification nodes.

6. The consensus method according to claim 1, characterized in that: Using the post-proposal block as the certificate of the pre-proposal block includes: Together with the post-proposal block generated by at least one other verification node, each of the post-proposal blocks is independently used as a certificate of the pre-proposal block, wherein if the number of certificates is greater than a preset threshold, the pre-proposal block is verified to have passed.

7. The consensus method according to claim 1, characterized in that: The number of proposed blocks is not less than 2f+1, where f is the number of dishonest verification nodes in the nth consensus round, and 3f+1 is the total number of verification nodes in the nth consensus round.

8. A consensus device for a blockchain system, characterized in that: include: A post-proposal block generation module is used to refer to multiple proposal blocks in the n+x2th consensus round, and generate a post-proposal block in combination with the current transaction of the client; wherein the multiple proposal blocks are generated by multiple verification nodes referring to a pre-proposal block in the nth consensus round, and the pre-proposal block is generated in the n-x1th consensus round; wherein x1 is a positive integer of 1 or greater than 1, and x2 is a positive integer of 1 or greater than 1; The consensus module is used to use the post-proposal block as the certificate of the pre-proposal block to reach a consensus on the pre-proposal block.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the consensus method as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the consensus method as described in any one of claims 1 to 7 are implemented.