Blockchain consensus method and apparatus, and computer device, medium and product

By using the hash fingerprint signature endorsement of the proposal node in the blockchain, the problem of large communication data volume of the consensus node is solved, the consensus efficiency and security of the blockchain are improved, and the data transmission is fast and stable.

WO2024183280A1PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2023/123756
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-08
Filing Date
2023-10-10
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

In the blockchain, the communication data volume of consensus nodes is large, resulting in low consensus efficiency and affecting the security and efficiency of the network.

Method used

By using the hash fingerprint of the proposal node instead of the complete certificate data for signature endorsement, the amount of data in the proposal message is reduced and consensus efficiency is improved.

Benefits of technology

It reduces the volume and transmission volume of proposal messages, improves the efficiency and security of blockchain consensus, and promotes fast and stable consensus among nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023123756_12092024_PF_FP_ABST
    Figure CN2023123756_12092024_PF_FP_ABST
Patent Text Reader

Abstract

A blockchain consensus method, which is performed by a computer device where a proposal node in a blockchain is located. The method comprises: acquiring a transaction block, on which a consensus is to be reached, wherein said transaction block is generated on the basis of at least one piece of transaction data to be packaged (S701); acquiring a hash fingerprint of a proposal node, and signing and endorsing said transaction block by using the hash fingerprint of the proposal node, so as to obtain signature endorsement information, wherein the hash fingerprint is determined after a hash operation is performed on certificate data corresponding to the proposal node (S702); assembling the signature endorsement information and said transaction block, so as to generate a proposal message (S703); and broadcasting the proposal message to at least one verification node in a blockchain, so as to trigger each verification node to reach a consensus on the proposal message according to the hash fingerprint of the proposal node in the proposal message (S704).
Need to check novelty before this filing date? Find Prior Art

Description

Blockchain consensus methods, devices, computer equipment, media and products

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023102691395, filed on March 8, 2023, entitled “Blockchain consensus method, device, computer equipment, medium and product,” the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to the field of blockchain technology, and in particular to a blockchain consensus method, a blockchain consensus device, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0004] In a decentralized network environment based on consensus algorithms such as the Byzantine algorithm, consensus nodes are operated by participants dispersed across different regions and organizations. To prevent attacks that could cause multiple nodes in the network to be controlled by the same party and undermine the security of the consensus, it is necessary to use certificate-based security processing methods in blockchain scenarios such as consortium chains for defense.

[0005] Currently, for security reasons, when consensus nodes in the blockchain reach consensus, the amount of data occupied by communication is large, resulting in low consensus efficiency.

[0006] Summary of the Invention

[0007] According to an embodiment of the present application, a blockchain consensus method, apparatus, computer equipment, medium, and product are provided.

[0008] In one aspect, an embodiment of the present application provides a blockchain consensus method, which is executed by a computer device where a proposal node in a blockchain is located, including:

[0009] Obtaining a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on at least one piece of transaction data to be packaged;

[0010] Obtaining the hash fingerprint of the proposal node, and using the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node;

[0011] Assembling the signature endorsement information and the transaction block to generate a proposal message; and

[0012] The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0013] In one aspect, an embodiment of the present application provides a blockchain consensus method, which is executed by a computer device where a verification node in a blockchain is located, and the method includes:

[0014] Get the proposal message sent by the proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0015] Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint; and

[0016] Based on the obtained certificate data, consensus is reached on the proposal message.

[0017] In one aspect, an embodiment of the present application provides a blockchain consensus device, comprising:

[0018] an acquiring unit, configured to acquire a transaction block to be agreed upon, wherein the transaction block to be agreed upon is generated based on at least one piece of transaction data to be packaged;

[0019] a processing unit, configured to obtain a hash fingerprint of a proposal node, and use the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information, wherein the hash fingerprint is determined by performing a hash operation on certificate data corresponding to the proposal node;

[0020] The processing unit is further configured to assemble the signature endorsement information and the transaction block to generate a proposal message;

[0021] The sending unit is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0022] In one aspect, an embodiment of the present application provides a blockchain consensus device, comprising:

[0023] A receiving unit, configured to receive a proposal message sent by a proposal node, wherein the proposal message is generated by assembling signature endorsement information and a transaction block, wherein the signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node, wherein the hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node;

[0024] a processing unit, configured to parse the proposal message to obtain a hash fingerprint of the proposal node, and obtain certificate data of the proposal node according to the hash fingerprint; and

[0025] The processing unit is further configured to reach a consensus on the proposal message based on the acquired certificate data.

[0026] On the other hand, an embodiment of the present application provides a computer device, which includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the methods of the embodiments of the present application.

[0027] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are read and executed by a processor, the processor executes the methods of the embodiments of the present application.

[0028] On the other hand, an embodiment of the present application provides a computer program product, which includes computer-readable instructions. When the computer-readable instructions are read and executed by a processor, the processor executes the methods of the embodiments of the present application.

[0029] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or traditional technical descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0031] FIG1 is a schematic diagram of the structure of a blockchain system provided in an embodiment of the present application;

[0032] FIG2 is a schematic diagram of a block generation process provided by an embodiment of the present application;

[0033] FIG3 is a schematic diagram of the structure of a blockchain provided in an embodiment of the present application;

[0034] FIG4 is a schematic diagram of the structure of a blockchain consensus system provided by an embodiment of the present application;

[0035] FIG5 is a schematic diagram of a consensus process of a proposal node provided in an embodiment of the present application;

[0036] FIG6 is a schematic diagram of a consensus process of a verification node provided in an embodiment of the present application;

[0037] FIG7 is a flow chart of a blockchain consensus method provided by an embodiment of the present application;

[0038] FIG8 is a schematic diagram of a process for uploading certificate data to a chain according to an embodiment of the present application;

[0039] FIG9 is a schematic diagram of a process for generating a proposal message according to an embodiment of the present application;

[0040] FIG10 is a flow chart of another blockchain consensus method provided in an embodiment of the present application;

[0041] FIG11 is a schematic diagram of a process for querying certificate data provided in an embodiment of the present application;

[0042] FIG12 is a schematic diagram of a process for executing transaction data provided by an embodiment of the present application;

[0043] FIG13 is an interactive flow chart of a blockchain consensus method provided by an embodiment of the present application;

[0044] FIG14 is a schematic diagram of the structure of a blockchain consensus device provided in an embodiment of the present application;

[0045] FIG15 is a schematic diagram of the structure of another blockchain consensus device provided in an embodiment of the present application;

[0046] FIG16 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0048] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0049] The present application provides a blockchain consensus solution. When constructing a proposal message, the blockchain consensus solution can use the hash fingerprint of the proposing node (for example, the hash fingerprint of the node certificate, or the hash fingerprint of the public key) instead of the complete certificate data (i.e., the node certificate or public key) to sign and endorse the block, thereby reducing the proportion of the signature endorsement information in the proposal message, making the data volume of the constructed proposal message smaller, reducing memory usage, and thus improving consensus efficiency.

[0050] Specifically, the principle of the blockchain consensus scheme provided by this application is roughly as follows: when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block; during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after signing and endorsing the hash fingerprint of the proposal node. Compared with signing and endorsing based on the complete certificate data of the proposal node, the hash fingerprint occupies a smaller amount of data, thereby reducing the volume of the proposal message; further, the proposal message with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby speeding up the consensus efficiency. In addition, the fast and stable transmission of the proposal message can accelerate the consensus between nodes and further improve the consensus efficiency.

[0051] Next, the relevant technical terms involved in the blockchain consensus solution provided by this application are introduced in detail with reference to the relevant drawings:

[0052] 1. Blockchain Technology

[0053] Blockchain is essentially a decentralized database, a string of data blocks generated using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and generate the next block.

[0054] (1) Blockchain system:

[0055] Please refer to Figure 1, which is a schematic diagram of the structure of a blockchain system provided in an embodiment of the present application. As shown in Figure 1, the blockchain system can be a data sharing system. The so-called data sharing system refers to a system for sharing data between nodes. The data sharing system 100 may include: a blockchain node 101 and at least one blockchain node 102, wherein the blockchain node 101 can be a proposal node (also known as a master node or leader node), and the blockchain node 102 can be a verification node (also known as a slave node or follower node). The proposal node can be a node elected by all consensus nodes in the blockchain network based on a consensus algorithm. The proposal node and the verification node are collectively referred to as a consensus node. Any blockchain node can refer to a computer device in the data sharing system 100, and the computer device can be, for example, a terminal device or a server. Among them, each node in the data sharing system 100 can form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol, and the above-mentioned data sharing system is maintained based on the TCP protocol.

[0056] In this embodiment of the present application, a proposal node 101 generates a proposal message corresponding to a transaction block and broadcasts it to each verification node 102 in the blockchain, thereby implementing the relevant blockchain consensus process. Therefore, the following describes how nodes (proposing nodes and verification nodes) in a blockchain system achieve block consensus and the related functions implemented by the nodes.

[0057] ① Block consensus between proposal nodes and verification nodes:

[0058] Specifically, to ensure information intercommunication within the blockchain system, an information connection may exist between each node in the blockchain system, and information can be transmitted between nodes through the information connection. The information connection is not limited to a specific connection method. For example, it can be directly or indirectly connected via wired communication, directly or indirectly connected via wireless communication, or through other connection methods, and this application does not impose any restrictions thereon.

[0059] It is understood that each blockchain node (proposal node 101 or verification node 102) can receive input information during normal operation and maintain the shared data within the data sharing system based on the received input information. For example, when the proposal node 101 in the blockchain system receives input information (for example, the proposal node can receive at least one transaction data sent by the user client), the proposal node 101 can package the received multiple transaction data to generate a transaction block, and then sign the transaction block based on the hash fingerprint of the proposal node, thereby generating a proposal message corresponding to the transaction block. For another example, the verification node 102 can also receive input information (for example, a proposal message sent by the proposal node 101), and the verification node 102 can parse the hash fingerprint in the proposal message and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the proposal message is reached based on the complete certificate data. Finally, after the proposal node 101 and each verification node 102 in the blockchain reach a consensus on the proposal message, both the proposal node 101 and the verification node 102 can store the transaction block, thereby maintaining the shared data (each transaction data) within the above-mentioned data sharing system.

[0060] ② Functions of the node:

[0061] a. Application functions are deployed within the blockchain to implement specific services based on actual business needs. They record data related to these functions to form record data (transaction data). For example, transaction data can refer to data used to implement resource transfer services, electronic invoicing services, or gaming services, among other things. The record data can include a digital signature (e.g., a signature endorsement executed by the proposing node on the transaction block based on certificate data such as the node certificate or public key) to indicate the source of the task data. The record data can also be sent to other verification nodes within the blockchain system. Upon successful verification of the record data's source and integrity, the other verification nodes can add the record data to a temporary block. Subsequently, after the proposing node and verification nodes reach consensus on the transaction block, the transaction block containing the transaction data can be added to the blockchain.

[0062] b. Routing: This is a basic function possessed by any node in a blockchain system, used to support communication between nodes. Specifically, the block consensus process between the proposal node 101 and the verification node 102 involves data exchange between nodes. This data exchange process is achieved through the routing function of each node.

[0063] ③Node identification:

[0064] Each node in the blockchain system (both the proposing node and the validating node) has a corresponding node identifier. Furthermore, each node in the blockchain system can store the node identifiers of other nodes in the blockchain system, allowing it to subsequently broadcast generated blocks to other nodes in the blockchain system based on the node identifiers of other nodes. Each node can maintain a node identifier list, as shown in the table below, storing the node name and node identifier in this node identifier list.

[0065] The node identifier may be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node. Table 1 only uses the IP address as an example for description.

[0066] Table 1. Node ID list

[0067] In an embodiment of the present application, each node in the blockchain system can carry its own node identification during the data interaction process (for example, the data interaction process in which the proposal node sends a proposal message to the verification node), so that other nodes can perform node verification based on the corresponding node identification before reaching consensus, thereby improving the security of the blockchain consensus process.

[0068] (2) Block:

[0069] This application primarily addresses block consensus. Before consensus can be achieved, the proposing node must generate a corresponding transaction block based on transaction data, allowing subsequent verification nodes to reach consensus on this transaction block. Therefore, the following sections will detail how a block is generated and its structure.

[0070] ①Block generation:

[0071] See Figure 2, which is a flow chart of a block generation process provided by an embodiment of the present application. As shown in Figure 2, when generating a transaction block in a blockchain, the proposal node can verify the input information when receiving the input information (transaction data). After the verification is completed, the input information is stored in the memory pool (transaction pool) and the hash tree used to record the input information is updated; thereafter, the update timestamp is updated to the time when the input information is received, and different random numbers are tried, and the eigenvalue calculation is performed multiple times so that the calculated eigenvalue can satisfy the following formula: SHA256(SHA256(version+prev_hash+merkle root +ntime+nbits+x)) <TARGET

[0072] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0073] In this way, when a random number that satisfies the above formula is calculated, the information can be stored accordingly, and the block header and block body can be generated to obtain the current transaction block. Subsequently, the proposal node sends the proposal message of the newly generated transaction block to the verification nodes in the data sharing system according to the node identification of other nodes (verification nodes) in the data sharing system. The verification nodes will reach consensus on the transaction block and, after reaching consensus, add the newly generated transaction block to the blockchain they store.

[0074] ②Block structure:

[0075] Referring to FIG3 , FIG3 is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application. As shown in FIG3 , a blockchain is composed of multiple blocks, and each blockchain includes a genesis block. As the name implies, the so-called genesis block is the first block, the initial block. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp and difficulty value, and the block body stores the input information (such as various transaction data). The next block of the genesis block uses the genesis block as the parent block. The next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp and difficulty value of the parent block, and so on. This makes the block data stored in each block in the blockchain associated with the block data stored in the parent block, ensuring the security of the transaction data in the block.

[0076] In an embodiment of the present application, when constructing a proposal message, the proposing node can package the voting qc (quorum certificate) data of the previous block into the proposal. Based on the structure of the blockchain, when the verification node subsequently receives the proposal message, it can verify that the parent block (previous block) referenced by the current block is consistent among the majority of nodes based on the voting qc data in the proposal, thereby ensuring the reliability of the blockchain consensus.

[0077] 2. Cloud Technology

[0078] In the blockchain consensus solution of this application, the blockchain involves a lot of data calculation and data storage services, which requires a lot of computer operating costs. Therefore, this application can use cloud storage technology in cloud technology to implement the specific operations involved in the blockchain consensus process. Specifically, for example, based on the data calculation service provided by cloud storage technology, the hash fingerprint of the proposal node can be used to sign and endorse the transaction block; for example, after the consensus on the proposal message block is passed, the certificate data of the proposal node can be stored in the DB database based on the data storage service provided by cloud storage technology.

[0079] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can be used on demand in a flexible and convenient manner. Cloud technology can include cloud storage technology. Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0080] It is particularly important to note that in the subsequent specific implementation methods of this application, user information and other related data are involved. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0081] In combination with the above description of the blockchain consensus solution provided by this application and the relevant technical terms involved, the architecture of the blockchain consensus system provided by the embodiment of this application is specifically introduced in conjunction with Figures 4-6.

[0082] Please refer to Figure 4, which is a schematic diagram of the architecture of a blockchain consensus system provided by an embodiment of the present application. The architecture diagram of the blockchain consensus system may include at least: a proposal node 201 and at least one verification node 202. It should be noted that the proposal node 201 and the verification node 202 can be collectively referred to as the consensus node in the blockchain system. The so-called consensus node is the node responsible for maintaining the data consistency of the entire blockchain network. Generally speaking, among the multiple consensus nodes corresponding to the block consensus process, the number of proposal nodes 201 (also known as the master node) is one, and the number of verification nodes 202 (also known as slave nodes) is multiple. Specifically, the proposal node can be a node selected by all consensus nodes in the blockchain network based on the consensus algorithm (for example, Hotstuff's BFT consensus algorithm, Hotstuff is a consensus protocol based on View (view), View represents a consensus unit, and the consensus process is composed of one View after another. In a View, there is a proposal node to lead the consensus protocol, and after three-stage voting to reach consensus, it switches to the next View to continue consensus). The verification node refers to other consensus nodes in the blockchain network except the proposal node. In addition, a communication connection can be established between the proposal node 201 and each verification node 202 via wired or wireless means.

[0083] First, referring to Figures 5 and 6 , the consensus processes of the proposal node 201 and the verification node 202 in the blockchain consensus process are respectively introduced:

[0084] ① Consensus process of proposal node 201.

[0085] Please refer to Figure 5, which is a schematic diagram of the consensus process of a proposal node provided by an embodiment of the present application. As shown in Figure 5, the transaction data sent by the user can be uploaded to the consensus node in the blockchain for consensus. When the consensus node receives the transaction data, it can determine whether it is a proposal node in the current view state. If not, the transaction data is ignored, that is, no operation is performed on the transaction data; if so, a transaction block is created based on the transaction data, and a proposal message is generated after signing and endorsing the transaction block. Finally, the proposal message is broadcast to each slave node in the blockchain. It can be seen that the proposal node plays a key role in a round of block consensus. If the proposal node acts maliciously, packages invalid transaction data, or there is an error in the block structure, this round of consensus will not reach a consensus on any block.

[0086] ②Verify the consensus process of node 202.

[0087] Please refer to Figure 6, which is a schematic diagram of the consensus process of a verification node provided by an embodiment of the present application. As shown in Figure 6, after receiving the proposal message sent by the proposal node 201, it is determined whether the proposal message is sent by the proposal node in the current view. If not, the proposal message is ignored, that is, no operation is performed on the proposal message; if so, the signature of the proposal message is verified. If the signature verification is successful, voting is performed and a voting message is generated after signing. Specifically, when the verification node verifies that the proposal message comes from the specified proposal node and the user transaction execution result contained in the transaction block is consistent with the proposal node, the hash of the block in the proposal is used to construct the voting message, and the hash fingerprint of the voting message is calculated for signing. The signature endorsement is then placed in the voting message and sent to the proposal node to indicate that it approves the current proposal message. When the proposal node receives at least 2f+1 votes in favor, the consensus nodes reach a consensus on the current proposal and enter the next view state. Wherein, f is the number of faulty nodes (also known as malicious nodes) in the blockchain system, and there are at least 3f+1 formula nodes in the blockchain system.

[0088] It should be noted that proposal node 201 and verification node 202 may include, but are not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MIDs), intelligent voice interaction devices, vehicle-mounted terminals, roadside devices, aircraft, wearable devices, smart home appliances, or wearable devices with blockchain consensus capabilities such as smart watches, smart bracelets, pedometers, etc. Proposal node 201 and verification node 202 may also be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0089] In one possible implementation, the blockchain consensus scheme provided by the above embodiment of the present application is described by taking the interaction process between the proposal node 201 and the verification node 202 as an example. First, the proposal node 201 can obtain at least one (i.e., at least one) transaction data to be packaged, and package each acquired transaction data to generate a transaction block; then, the proposal node 201 can sign and endorse the transaction block based on the hash fingerprint to obtain the signature endorsement information, and the hash fingerprint is determined after performing a hash operation based on the certificate data of the proposal node; next, the proposal node 201 assembles the signature endorsement information and the transaction block into a proposal message, and broadcasts the proposal message to the verification node 302 in the blockchain. Subsequently, after receiving the proposal message sent by the proposal node 201, the verification node 202 can parse the hash fingerprint in the proposal message and obtain the complete certificate data of the proposal node according to the hash fingerprint; finally, according to the acquired certificate data, the proposal message is consensus-based. A piece of transaction data may refer to the data required to conduct a transaction.

[0090] It can be understood that the blockchain consensus system described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. It is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0091] Based on the above description of the blockchain consensus solution and blockchain consensus system of the present application, the specific embodiments involved in the blockchain consensus solution will be described in detail with reference to the accompanying drawings.

[0092] Please refer to Figure 7, which is a flowchart of a blockchain consensus method provided by an embodiment of the present application. This method is applied to the proposal node in the blockchain consensus system shown in Figure 4 and can be executed by the computer device where the proposal node is located in the blockchain, that is, by the computer device that implements the proposal node function. The blockchain consensus method mainly includes but is not limited to the following steps S701 to S704:

[0093] S701: Obtain a transaction block to be agreed upon. The transaction block to be agreed upon is generated based on one or more transaction data to be packaged.

[0094] In one possible implementation, a proposal node may obtain at least one piece of transaction data to be packaged from the transaction pool, and then package each piece of the obtained transaction data to generate a transaction block. Optionally, during the process of packaging and generating a transaction block, the proposal node may first obtain a preset amount of transaction data, and then package the preset amount (e.g., 100) of transaction data to generate a transaction block; or, during the process of packaging and generating a transaction block, the proposal node may also obtain transaction data received within a preset time period (e.g., within 1 hour), and then package each piece of transaction data received within the preset time period to generate a transaction block.

[0095] In one possible implementation, a proposal node can retrieve transaction data from the batch transaction pool in batches. This refers to the batches of transactions stored in the batch transaction pool. A transaction batch is a collection of at least one transaction data item. These batches are then packaged to generate transaction blocks. This approach, which uses batches as units to retrieve transaction data and construct transaction blocks, can improve the efficiency of block construction.

[0096] S702: Use the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0097] Specifically, the certificate data of the proposal node refers to a type of data used to identify the identity of the proposal node. The certificate data may include, for example, node certificates, node public keys, and other content. Specifically, the node certificate may include: the start time of certificate issuance, the expiration time of the certificate, the organizational role corresponding to the proposal node, and other content. Among them, the so-called node certificate refers to an authoritative digital certificate (such as a CA certificate) issued by a certificate authority (i.e., a credible institution) to the proposal node. One node corresponds to one node certificate. In addition, the data type of the node certificate may include, but is not limited to, tables, documents, files, and the like.

[0098] Specifically, the principle of signature endorsement is roughly as follows: each node participating in the consensus process (proposing node, validating node) has a corresponding public-private key pair and node certificate (collectively referred to as certificate data). When generating a proposal message or voting message, the node will sign it based on the hash fingerprint of the corresponding message. The signature result and the certificate data (user certificate / public key) form the signature endorsement information as anti-counterfeiting data, which is added to the corresponding proposal message (or voting message) to identify the proposal message (voting message) as sent by the node itself. In short, signature endorsement is a means of identifying the node's identity, and other nodes can verify the source of the message based on the signature endorsement information.

[0099] In one possible implementation, a proposing node can send a node certificate request to a certificate authority. This node certificate request carries the proposing node's identity information (e.g., node identifier). After the certificate authority verifies the proposing node's identity information, it can generate a corresponding node certificate for the proposing node. Subsequently, the proposing node can store its own node certificate locally to facilitate signing and endorsing transaction blocks based on the node certificate's hash fingerprint.

[0100] It should be understood that the hash fingerprint refers to the data determined by performing a hash operation on the certificate data of the proposing node. Specifically, the hash fingerprint can be calculated based on the certificate data using a hash algorithm (such as MD5, SHA-1, SHA-256, SHA-512, etc.). Therefore, the amount of data corresponding to the hash fingerprint of the proposing node is naturally smaller than the amount of data corresponding to the certificate data of the proposing node.

[0101] In one possible implementation, before using the proposer's hash fingerprint to sign and endorse the transaction block, the proposer can also serialize the transaction block to obtain a serialized transaction block. Then, the serialized transaction block is signed and endorsed based on the proposer's hash fingerprint to obtain signature endorsement information. Serialization refers to converting the transaction block into a binary array. This serialization method can facilitate data processing and transmission efficiency, thereby improving the efficiency of constructing proposal messages.

[0102] In one possible implementation, the hash fingerprint of the proposal node and the corresponding certificate data can be associated and stored in the node's local database (DB database, hereinafter also referred to as the contract database). For example, the hash fingerprint and certificate data are stored in the K (key) -V (value) storage format, where the node's hash fingerprint is used as the key and the certificate data is used as the value. It should be understood that before the hash fingerprint and certificate data of the storage node are associated, the certificate data of each node must be uploaded to the blockchain. Next, taking the proposal node as an example, the specific process of uploading the certificate data of the proposal node to the blockchain is explained in detail:

[0103] (1) First, the proposal node may receive contract call transaction data sent by the operation node. The contract call transaction data includes: the contract identifier of the system contract. The system contract may be created by the proposal node after receiving the contract call transaction data, or may be created by the operation node when constructing the blockchain. This embodiment of the application does not limit this.

[0104] (2) Then, the packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate a node proposal to be uploaded to the blockchain; if it is determined that the blockchain consensus on the node proposal is passed, the certificate data of the proposal node is uploaded to the blockchain according to the contract identifier of the system contract; wherein, the contract identifier is used to instruct the proposal node and any verification node to store the certificate data of the proposal node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0105] (3) Next, after signing and endorsing the packaged transaction block based on the certificate data of the proposal node and generating the node proposal to be put on the chain, it also includes: broadcasting the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to put the certificate data corresponding to the proposal node on the blockchain; receiving the voting results sent by each verification node, the voting result refers to the result generated after any verification node reaches a consensus on the node proposal to be put on the chain; if it is determined that the blockchain consensus on the node proposal is passed based on the received voting results, then obtaining the hash fingerprint of the certificate data of the proposal node, and storing the certificate data and hash fingerprint of the proposal node in association in the contract database of the proposal node.

[0106] For example, please refer to Figure 8, which is a schematic diagram of a process for uploading certificate data to the chain provided by an embodiment of the present application. As shown in Figure 8, the node operator can create contract call transaction data and send it to the blockchain network. The contract call transaction data is used to indicate the call of a specified system contract. It should be understood that each consensus node in the blockchain network (e.g., consensus node A, consensus node B, and consensus node C) selects the proposal node corresponding to the current view based on the consensus algorithm, assuming it is consensus node A (the consensus node A is also called the proposal node). Specifically, ① after consensus node A receives the contract call transaction data, it can first package the contract call transaction data into a transaction block. For example, the contract call transaction data can be added to the transaction block to be packaged, or a new block can be created and the contract call transaction data can be added to the created new block to form a packaged transaction block. Then, consensus node A (which can be executed by the consensus engine) can sign and endorse the packaged transaction block based on the certificate data of consensus node A (node ​​certificate or node public key). After signing the transaction block, the full node certificate / node public key is used as part of the proposal signature endorsement, thereby generating a node proposal. Finally, the node proposal is broadcast to other verification nodes in the consensus network (consensus node B and consensus node C).

[0107] ② After consensus node B (or consensus node C) receives the node proposal containing the contract call transaction data, it uses the complete node certificate, signature, and block data in the signature endorsement of the node proposal to verify the validity of the proposal source (i.e., verify whether the current node proposal is sent by the proposal node in the current view, verify whether the signature of the proposal is obtained by the signature of the current proposal node, etc.); in addition, after the identity authentication is passed, the validity of the block data in the proposal can also be verified (for example, verify whether the block data contains sensitive transactions, illegal transactions, etc. If none of them are contained, the block data in the proposal is determined to be valid; if they are contained, the block data in the proposal is determined to be invalid). Finally, when the source and block data are verified, consensus node B can generate a voting result containing approval votes and send the voting result to the proposal node. It should be understood that the specific process of consensus on the node proposal by each verification node is the same, and the embodiments of this application will not be repeated here.

[0108] ③ Consensus node A receives the voting results sent by each verification node (consensus node B and consensus node C), and determines whether the current node proposal has passed the blockchain consensus based on the received voting results. The specific judgment method can be that if consensus node A receives 2f+1 (f is the number of malicious nodes in the blockchain, and malicious nodes can also be called faulty nodes) votes of approval, it can be determined that the current node proposal meets the consensus conditions, that is, it is determined that the node proposal consensus has passed. In one possible implementation method, if consensus node A determines that the node proposal consensus has passed based on the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message can carry the contract identifier of the system contract; consensus node A sends the notification message to each verification node in the blockchain, and the notification message is used to trigger any verification node to store the certificate data of the proposal node in its corresponding contract database; wherein, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node. That is, after a node proposal passes consensus and the block data in the proposal is uploaded to the blockchain, the certificate data of the proposing node can also be stored in the contract database (DB database) of each consensus node (e.g., consensus node A, consensus node B, and consensus node C), thereby completing the blockchain upload of the certificate data of the proposing node. In the contract database, the certificate data of the proposing node and the hash fingerprint (determined by hashing the certificate data) can be stored in association.

[0109] In this way, the complete certificate data of any other node on the chain can be stored in the contract database of each node in the system contract. Optionally, the node identifier of the corresponding node can also be recorded in the system contract. As shown in Table 2 below, the storage format of the system contract maintained in the contract data of any node is as follows:

[0110] Table 2. Storage format of system contracts

[0111] It should be noted that the above-mentioned process of uploading certificate data to the blockchain can be applied to any node. For example, in the embodiment of the present application, after the certificate data of consensus node A is successfully uploaded to the blockchain, the certificate data of consensus node B can be uploaded to the blockchain. After the certificate data of consensus node B is successfully uploaded to the blockchain, the certificate data of consensus node C can be uploaded to the blockchain, and so on. It should be understood that the detailed process of uploading certificate data of any node can refer to the above-mentioned process of uploading certificate data of consensus node A, and the embodiment of the present application will not be repeated here.

[0112] Based on this, signing and endorsing transaction blocks based on the node's hash fingerprint can reduce the amount of data occupied by the signature endorsement information, thereby reducing the amount of data in the generated proposal message, compared to signing and endorsing based on the node's complete certificate data. Furthermore, during the data transmission process, proposal messages with smaller data volumes can improve the efficiency of blockchain consensus. In addition, node certificate on-chain transactions are similar to regular user transactions, using the same transmission and consensus process, which can reduce the chance of bugs introduced by changes.

[0113] S703: Assemble the signature endorsement information and the transaction block to generate a proposal message.

[0114] In specific implementations, the proposal node assembles the signature endorsement information and the transaction block to generate a proposal message. Specifically, this may include, for example, compressing and packaging the signature endorsement information and the transaction block to generate the proposal message. Another example is adding the signature endorsement information to the block body of the transaction block to construct the proposal message. Another example is creating an extension field for the transaction block and then adding the signature endorsement information to the extension field of the transaction block to generate the proposal message.

[0115] In one possible implementation, there are multiple copies of transaction data to be packaged. In the process of generating a proposal message, the proposing node can also obtain the acquisition time of each transaction data to be packaged, sort the execution order of the multiple transaction data according to the acquisition time of each transaction data, and determine the transaction execution order of each transaction data; the transaction execution order is packaged into the proposal message; the transaction execution order is used to trigger any verification node that receives the proposal message to execute the transaction data in the transaction block in the order indicated by the transaction execution order. Specifically, the proposal node can sort each transaction data in sequence according to the acquisition time of each transaction data obtained from the transaction pool. Please refer to Figure 9, which is a schematic diagram of a process for generating a proposal message provided by an embodiment of the present application. As shown in Figure 9, the proposal node can obtain multiple transaction data: tx1, tx2, and tx3 from the transaction pool, and construct a transaction block based on each acquired transaction data. At the same time, the acquisition time of each transaction data can also be determined: for example, the acquisition time of transaction data tx1 is 10:00, the acquisition time of transaction data tx2 is 10:01, and the acquisition time of transaction data tx2 is 10:02, then the transaction execution order can be: tx1>tx2>tx3, that is, each node can execute transaction data tx1 first, then execute transaction data tx2, and finally execute transaction data tx3. In this way, when the amount of transaction data is large, each verification node can execute the transaction data in the block according to a unified transaction execution order, thereby improving consensus efficiency.

[0116] In one possible implementation, the proposal node can also execute each transaction data in the transaction block to obtain the transaction execution results of each transaction data. Then, when assembling the proposal message, the proposal node can write the transaction execution results of each transaction data into the proposal message.

[0117] S704: Broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0118] In specific implementation, the above consensus may include: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node. More specifically, after verifying the source of the proposal message (the validity of the signature endorsement information: whether it is signed by the proposal node elected in the current view, for example, the signature endorsement information can be verified based on the public key of the proposal node), the verification node can execute each transaction data in the proposal message to obtain the transaction execution results of each transaction data. The proposal message may also include the transaction execution results of the proposal node. If the two are consistent, the proposal message is voted in favor; if they are inconsistent, the proposal message is voted against.

[0119] In one possible implementation, after the proposal node broadcasts the proposal message to at least one verification node in the blockchain, the process may further include: receiving voting messages sent by each verification node, where the voting message is generated after any verification node reaches consensus on the proposal message; if it is determined based on the received voting messages that the proposal message meets the consensus conditions, the transaction block corresponding to the proposal message is uploaded to the blockchain.

[0120] The voting message indicates the consensus result of the verification nodes after reaching consensus on the transaction block corresponding to the proposal message. The consensus result is either a success or a failure. After receiving the voting messages from multiple verification nodes, the proposal node obtains the consensus result corresponding to each verification node. If the number of nodes that have successfully reached consensus is greater than or equal to the preset number threshold (2f+1), the proposal message is determined to meet the consensus conditions. If the number of nodes that have successfully reached consensus is less than the preset number threshold (2f+1), the proposal message is determined to not meet the consensus conditions.

[0121] Specifically, if the proposal message is determined to meet the consensus conditions based on the received voting messages, the following two transaction operations can be triggered: ① Deleting each transaction data in the transaction block from the transaction pool. For example, if the transaction block includes transaction data tx1, tx2, tx3, and tx4, then the transaction data tx1, tx2, tx3, and tx4 in the transaction pool are deleted. ② Obtaining the block height of the transaction block in the blockchain; obtaining at least one reference block in the blockchain that matches the block height; and storing each reference transaction included in each reference block obtained in the transaction pool. It should be understood that the same block height corresponds to one or more blocks to be added, but ultimately one block is allowed to be submitted to the chain. Therefore, this application needs to prune other blocks corresponding to the block height of the block to be on the chain (the transaction block that has passed consensus) to ensure that the transaction block is submitted to the chain.

[0122] In an embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block; during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after signing and endorsing the hash fingerprint of the proposal node. Compared with signing and endorsing based on the complete certificate data of the proposal node, the amount of data occupied by the hash fingerprint is smaller, thereby reducing the volume of the proposal message; further, the proposal message with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby speeding up the consensus efficiency.

[0123] Please refer to Figure 10, which is a flow chart of another blockchain consensus method provided in an embodiment of the present application. This method is applied to the verification node in the blockchain consensus system shown in Figure 4. The blockchain consensus method mainly includes but is not limited to the following steps S1001 to S1003:

[0124] S1001: Obtain the proposal message sent by the proposal node. The proposal message is generated by assembling the signature endorsement information and the transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0125] In an embodiment of the present application, any verification node may include: a consensus engine and a core engine. Specifically, the proposal message sent by the proposal node can be obtained based on the consensus engine, and then the proposal message received by the consensus engine can be sent to the core engine for consensus.

[0126] In one possible implementation, after receiving a proposal message from a proposing node, a validating node can also obtain the proposing node's node identifier. Based on the identifier, the validating node is verified. If verification succeeds, the validating node is triggered to parse the proposal message to obtain the proposing node's hash fingerprint and retrieve the proposing node's certificate data based on the hash fingerprint. This verification can include one or more of security verification and legality verification. This approach allows for secure verification of proposing nodes within a blockchain, thereby improving the security and reliability of blockchain consensus.

[0127] S1002: Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint.

[0128] In specific implementations, the verification node can parse the proposal message to obtain the signature endorsement information and the hash fingerprint of the signature endorsement information. The so-called data parsing may include: data decompression and key field parsing. For example, assuming that the proposal message is obtained after data compression in a preset format, the same format needs to be used for data decompression during the data decompression process. For another example, assuming that the proposal message includes an extension field, the proposal message can be parsed for the key field to obtain the extension field, thereby obtaining the hash fingerprint stored in the extension field. Next, the specific process of how to obtain the certificate data of the proposal node according to the hash fingerprint is explained in detail:

[0129] In one possible implementation, the verification node obtains the certificate data of the proposal node according to the hash fingerprint, which may include: querying data from the verification node's cache component according to the hash fingerprint, and using the queried data as the proposal node's certificate data; or, if no corresponding data is found in the verification node's cache component, querying the verification node's contract database according to the hash fingerprint to obtain the proposal node's certificate data; wherein the cache component is used to store the certificate data queried from the contract database. Optionally, if the certificate data is obtained from the contract database, the queried certificate data can also be stored in the LRU cache component of the current verification node, so that the corresponding certificate data can be directly queried from the LRU cache component next time.

[0130] Please refer to Figure 11, which is a schematic diagram of a process for querying certificate data provided by an embodiment of the present application. In specific implementation, after receiving a proposal message, the verification node preferentially queries the certificate data of the corresponding proposal node from the LRU (Least Recently Used) cache component (hereinafter referred to as the cache component) in the node memory. If the certificate data corresponding to the hash fingerprint is not found in the LRU cache component, the data is queried from the contract database of the verification node. If the certificate data is obtained from the contract database, the queried certificate data can also be stored in the LRU cache component of the current node. It should be understood that when any verification node reaches consensus on a proposal message for the first time, it is necessary to query the corresponding complete certificate data from the node's contract database according to the hash fingerprint of the proposal node x, and then the queried certificate data can be stored in the LRU cache component, so that when the proposal message signed by the hash fingerprint of the proposal node x is received again in the future, the complete certificate data of the proposal node x can be obtained directly from the LRU cache component without having to query the data from the contract database. The purpose of doing this is because the contract database (DB database) of any node stores the certificate data of other nodes in the blockchain network, and the data volume is large, and the LRU cache component usually only stores the certificate data queried by the node during the consensus process. Therefore, the efficiency of the verification node querying the contract database is often lower than the efficiency of querying the LRU cache component, which can reduce the query time and thus improve the consensus efficiency.

[0131] In one possible implementation, if the corresponding data is not found from the cache component according to the hash fingerprint, and the corresponding data is not found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated; and the voting message indicating that the consensus has not been passed is sent to the proposal node. Specifically, if the corresponding certificate data is not found from the LRU cache component and the contract database of the slave node, the signature endorsement can be considered invalid, and the verification node determines that the consensus verification of the proposal message containing it has failed, thereby voting against the proposal message (the voting message indicating that the consensus has not been passed). Optionally, if the corresponding certificate data is not found from the LRU cache component and the contract database of the slave node, the node identifier of the proposal node can be obtained, and the certificate data can be queried from the system contract maintained in the contract database based on the node identifier. If the corresponding data is not found, the signature endorsement is considered invalid; if it can be found, the corresponding data found will be used as the certificate data of the proposal node.

[0132] In one possible implementation, before receiving the proposal message from the proposing node, the validating node may also obtain the node proposal to be uploaded from the proposing node. The node proposal to be uploaded includes the proposing node's certificate data. Based on the certificate data included in the node proposal, consensus is reached on the node proposal. This consensus includes verifying the identity of the proposing node, the validity of the transaction data in the node proposal, and the security of the transaction data. If the node proposal is passed by consensus, a voting result is generated and sent to the proposing node. In specific implementations, ① verifying the validity of the block data may include verifying the legality of the transaction (whether it contains sensitive or inappropriate information) and verifying transaction permissions (for example, for transfer transactions, verifying whether the party initiating the transfer has transfer permissions; for data query transactions, verifying whether the party initiating the data query has query permissions, etc.). ② Verifying the identity of the proposing node may include verifying whether the current node proposal was initiated by the designated proposing node and whether the signature endorsement information is correct.

[0133] That is to say, before performing data query based on hash fingerprint, the verification node needs to participate in the blockchain on-chain process of the proposal node's certificate data (the blockchain on-chain process is used to store the proposal node's certificate data in the system contract of the contract database. The specific process can refer to the relevant process involved in the embodiment of Figure 7). Therefore, when the corresponding certificate data needs to be queried, the certificate data of the proposal node can be queried from the contract database based on the specified hash fingerprint.

[0134] S1003: Reach consensus on the proposal message based on the obtained certificate data.

[0135] In specific implementation, consensus can include: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node. The following is a detailed explanation of the above two verification methods:

[0136] ① Verify the source of the proposal message:

[0137] In one possible implementation, the process of the verification node verifying whether the proposal message is generated by the proposal node may include: determining the proposal node associated with the obtained certificate data, and verifying whether the proposal node is consistent with the master node elected in the current consensus view; if consistent, it is determined that the proposal message is generated by the proposal node, and the step of verifying each transaction data in the proposal message may be triggered.

[0138] ②Verify whether the transaction execution results are consistent:

[0139] In one possible implementation, the process by which a verification node verifies whether transaction execution results are consistent may include: executing each transaction data included in the transaction block in a proposal message to obtain the transaction execution results for each transaction data; parsing the proposal message to obtain the transaction execution results of the proposing node for each transaction data in the transaction block; if the transaction execution results corresponding to the verification node are the same as those of the proposing node, generating a voting message indicating the consensus has passed for the proposal message and sending the voting message to the proposing node. Optionally, the proposal message includes a transaction execution order. The verification node may parse the transaction execution order in the proposal message and, in accordance with the parsed transaction execution order, sequentially execute each transaction data in the transaction block to obtain the transaction execution results for each transaction data. Finally, the verification node compares the transaction execution results obtained for each transaction data with the transaction execution results corresponding to the proposing node. If they are consistent, the block data consensus is passed. In this way, executing each transaction data according to the transaction execution order of the proposing node ensures consistency in the order in which transaction data is executed across nodes, thereby improving consensus efficiency.

[0140] Specifically, each transaction data in the transaction block can be executed by calling a smart contract. For example, please refer to Figure 12, which is a schematic diagram of a process for executing transaction data provided by an embodiment of the present application. As shown in Figure 12, the process of executing transaction data mainly includes the following steps S1-S6:

[0141] S1. Trigger the contract.

[0142] In specific implementation, the verification node can obtain the contract address of the smart contract based on the transaction type of the transaction data, and trigger the call of its corresponding smart contract based on the contract address.

[0143] S2. Analyze transaction data.

[0144] In specific implementation, the verification node parses the transaction data, obtains the contract call address and contract name, and obtains the smart contract used to execute the corresponding business request (for example, including contract name, contract method, and contract input information).

[0145] S3. Load the contract’s storage information and contract bytecode.

[0146] In specific implementation, the verification node obtains the corresponding contract bytecode and contract input from the transaction data and status database.

[0147] S4. Execute the contract.

[0148] During specific implementation, the contract code is executed in the verification node to complete the business logic indicated by the corresponding transaction data, such as digital resource transfer logic, invoicing logic, game logic, and other business logic.

[0149] S5. Return the result and update the status database.

[0150] In specific implementation, the verification node writes the transaction execution results corresponding to the transaction data back to the status database to complete the update of the business status.

[0151] S6. Create the Merkle tree root and store it in the block.

[0152] In one possible implementation, after reaching consensus on the proposal message based on the acquired certificate data, the verification node can also receive a voting confirmation message from the proposing node (which may include a QC data set consisting of the voting messages of each verification node). The so-called voting confirmation message means that after receiving 2f+1 affirmative votes, the proposing node can confirm that the current proposal message has reached consensus among the majority of consensus nodes, thereby generating a voting confirmation message indicating that the consensus has passed. This voting confirmation message is used by each verification node to inform that the current proposal message has reached consensus among the majority of nodes, and it can then enter the next consensus phase.

[0153] In an embodiment of the present application, during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. Among them, the present application can use the LRU cache record in the node memory to record the certificate data obtained from the system contract. When verifying a proposal message that uses the hash fingerprint as a signature endorsement, the hash fingerprint can be used to query the LRU cache component in the memory first. If it does not exist, the system contract data in the DB database can be queried. This method can reduce the number of times the contract data in the DB database is queried when verifying the signature endorsement of the proposal message, thereby improving data query efficiency.

[0154] Please refer to Figure 13, which is a schematic diagram of the interaction process of a blockchain consensus method provided in an embodiment of the present application. This interaction process is applied to the proposal node and verification node in the blockchain consensus system shown in Figure 4. The interaction process of the blockchain consensus method mainly includes but is not limited to the following steps S1301 to S1309:

[0155] S1301: The proposal node receives transaction data sent by the user client.

[0156] In specific implementation, the transaction data may be transaction data initiated by the user client in real time, or the transaction data may be transaction data obtained from the transaction pool.

[0157] S1302: The proposal node constructs a transaction block.

[0158] In specific implementations, the proposal node may obtain one or more transaction data, and the proposal node may add each acquired transaction data to the block body of the transaction block. Optionally, when constructing a transaction block, the proposal node may store each transaction data in the transaction block in sequence according to the time it was acquired. For example, if transaction data tx1 was acquired at 10:00, transaction data tx2 was acquired at 10:01, and transaction data tx3 was acquired at 10:02, transaction data tx1 may be added to the transaction block first, followed by transaction data tx2, and finally, transaction data tx3. Optionally, when constructing a transaction block, the proposal node may also store each transaction data in the transaction block in sequence according to the data size of each transaction data. For example, if the data size of transaction data tx1 is data1, the data size of transaction data tx2 is data2, and the data size of transaction data tx3 is data3, and data1>data2>data3, then transaction data tx3 may be added to the transaction block first, then transaction data tx2 may be added to the transaction block, and finally transaction data tx1 may be added to the transaction block.

[0159] S1303: The proposal node signs and endorses the transaction block based on the hash fingerprint.

[0160] In specific implementations, the hash fingerprint can include: the hash fingerprint of the node certificate or the hash fingerprint of the node public key. The hash fingerprint of the node certificate refers to the data obtained by hashing the node certificate, and the hash fingerprint of the node public key refers to the data obtained by hashing the node public key. After signing and endorsing the transaction block based on the hash fingerprint of the proposing node, the signature endorsement information can be obtained.

[0161] S1304: The proposal node generates a proposal message.

[0162] In specific implementation, the proposal node may assemble the signature endorsement information and the transaction block to obtain a proposal message. Optionally, the specific process of the proposal node generating the proposal message may include: for example, the signature endorsement information and the transaction block may be compressed and packaged to obtain the proposal message; for another example, the signature endorsement information may be added to the block body of the transaction block to construct the proposal message; for another example, an extension field may be created for the transaction block, and then the signature endorsement information may be added to the extension field of the transaction block to generate the proposal message.

[0163] S1305: The proposing node broadcasts the proposal message to the verification node.

[0164] In one possible implementation, the proposing node may send a proposal message to some or all verification nodes to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposing node in the proposal message.

[0165] S1306: The verification node obtains the certificate data of the proposing node according to the hash fingerprint in the proposal message.

[0166] In specific implementation, the verification node can parse the proposal message, obtain the hash fingerprint in the proposal message, and then obtain the certificate data of the proposal node based on the hash fingerprint obtained by parsing. More specifically, the verification node proposal node obtains the certificate data of the proposal node according to the hash fingerprint in the proposal message, which can include: querying data from the cache component of the verification node according to the hash fingerprint, and using the queried data as the certificate data of the proposal node; or, if the corresponding data is not queried from the cache component of the verification node, querying the contract database of the verification node according to the hash fingerprint to obtain the certificate data of the proposal node; wherein the cache component is used to store the certificate data queried from the contract database. Optionally, if the certificate data is obtained by querying from the contract database, the certificate data obtained by the query can also be stored in the LRU cache component of the current verification node, so that the corresponding certificate data can be directly queried from the LRU cache component next time.

[0167] S1307: The verification node reaches consensus on the proposal message based on the certificate data.

[0168] In specific implementations, consensus may include verifying whether the transaction execution results of the proposing node for each transaction data in the transaction block are consistent with the transaction execution results of the validating node for each transaction data in the transaction block, and verifying whether the proposal message was generated by the proposing node. It should be noted that the consensus process of the validating node on the proposal message can be specifically referred to the specific process performed in step S1003 in the embodiment of FIG. 10 , and will not be further described in this embodiment of the present application.

[0169] S1308: The verification node sends a voting message to the proposal node.

[0170] In practice, after reaching consensus on a proposal message, the validating nodes can generate a voting message. This voting message indicates the voting result on the proposal message, such as a yes or no vote. Optionally, the validating nodes can sign the voting message and send it to the proposing node.

[0171] S1309: The proposal node determines the consensus result and enters the next round of consensus.

[0172] In specific implementations, after receiving voting messages from various verification nodes, the proposal node determines the consensus result of the proposal message based on the received voting messages. If the number of received votes in favor is greater than or equal to 2f+1, the consensus result is determined to be a success, triggering the next round of consensus. If the number of received votes in favor is less than 2f+1, the consensus result is determined to be a failure. In addition, if the consensus on the proposal message is determined to be successful, the transaction block can be uploaded to the blockchain.

[0173] In an embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block. During the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. When constructing a proposal message, the proposal node performs signature endorsement based on the hash fingerprint, which can reduce the size of the proposal message and reduce the amount of message transmission between networks, thereby improving the consensus efficiency. In addition, in a weak network environment, the transmission efficiency and arrival rate of the proposal message can be improved due to the reduction in the amount of message transmission. The fast and stable transmission of the proposal message accelerates the achievement of consensus between nodes, further improving the consensus efficiency.

[0174] The above describes in detail the method of the embodiment of the present application. In order to facilitate the better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below. Next, in combination with the blockchain consensus scheme provided in the above embodiment of the present application, the relevant devices of the embodiment of the present application are introduced accordingly.

[0175] Please refer to Figure 14, which is a schematic diagram of the structure of a blockchain consensus device provided in an embodiment of the present application. As shown in Figure 14, the blockchain consensus device 1400 can be applied to the proposal node mentioned in the aforementioned embodiment (for example, it can be a terminal device or a server). Specifically, the blockchain consensus device 1400 can be a computer-readable instruction (including program code) running on a computer device, for example, the blockchain consensus device 1400 is an application software; the blockchain consensus device 1400 can be used to execute the corresponding steps in the blockchain-based identity authentication method provided in an embodiment of the present application. The blockchain consensus device 1400 can specifically include:

[0176] The acquisition unit 1401 is used to acquire a transaction block to be agreed upon. The transaction block to be agreed upon is generated based on at least one piece of transaction data to be packaged.

[0177] Processing unit 1402 is used to obtain the hash fingerprint of the proposal node, use the hash fingerprint of the proposal node to sign and endorse the transaction block, and obtain signature endorsement information. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0178] The processing unit 1402 is further configured to assemble the signature endorsement information and the transaction block to generate a proposal message.

[0179] The sending unit 1403 is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0180] In one possible implementation, the processing unit 1402 is further used to receive contract call transaction data sent by the operating node, where the contract call transaction data includes: the contract identifier of the system contract; signing and endorsing the packaged transaction block based on the certificate data of the proposal node to generate a node proposal to be uploaded to the chain, where the packaged transaction block includes the contract call transaction data; if it is determined that the blockchain consensus on the node proposal is passed, the certificate data of the proposal node is uploaded to the blockchain based on the contract identifier of the system contract; wherein the contract identifier is used to instruct the proposal node and any verification node to store the certificate data of the proposal node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0181] In one possible implementation, the processing unit 1402 signs and endorses the packaged transaction block based on the certificate data of the proposing node, and after generating the node proposal to be put on the chain, it is also used to broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to put the certificate data corresponding to the proposing node on the blockchain; receive the voting results sent by each verification node, and the voting results refer to the results generated after any verification node reaches a consensus on the node proposal to be put on the chain; if it is determined that the blockchain consensus on the node proposal is passed based on the received voting results, the hash fingerprint of the certificate data of the proposing node is obtained, and the certificate data and hash fingerprint of the proposing node are associated and stored in the contract database of the proposing node.

[0182] In one possible implementation, the processing unit 1402 uploads the certificate data of the proposal node to the blockchain according to the contract identifier of the system contract, and generates a notification message of the node proposal consensus passing if it is determined that the node proposal consensus is passed based on the received voting results. The notification message carries the contract identifier of the system contract; the notification message is sent to each verification node in the blockchain, and the notification message is used to trigger any verification node to store the certificate data of the proposal node in its respective corresponding contract database; wherein, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node.

[0183] In one possible implementation, after the processing unit 1402 broadcasts the proposal message to at least one verification node in the blockchain, it is also used to receive voting messages sent by each verification node, where the voting message is generated by any verification node after consensus is reached on the proposal message; if it is determined based on the received voting messages that the proposal message meets the consensus conditions, the transaction block corresponding to the proposal message is put on the blockchain; wherein the consensus executed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

[0184] In one possible implementation, there are multiple copies of transaction data to be packaged; the processing unit 1402 is further used to obtain the acquisition time of each transaction data to be packaged, and sort the execution order of the multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data; the transaction execution order is packaged into the proposal message; wherein, the transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

[0185] In an embodiment of the present application, when constructing a proposal message, the proposal node first packages the transaction data to be packaged to obtain a transaction block, and then determines the signature endorsement information after signing and endorsing the transaction block based on the hash fingerprint of the proposal node. Next, the proposal message is constructed based on the signature endorsement information and the transaction block; during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. It can be seen that the proposal message constructed in the consensus process is generated after signing and endorsing the hash fingerprint of the proposal node. Compared with signing and endorsing based on the complete certificate data of the proposal node, the amount of data occupied by the hash fingerprint is smaller, thereby reducing the volume of the proposal message; further, the proposal message with a smaller volume can also reduce the amount of data transmission during the data transmission process, thereby speeding up the consensus efficiency.

[0186] Please refer to Figure 15, which is a schematic diagram of the structure of another blockchain consensus device provided in an embodiment of the present application. As shown in Figure 15, the blockchain consensus device 1500 can be applied to the verification node mentioned in the aforementioned embodiment (for example, it can be a terminal device or a server). Specifically, the blockchain consensus device 1500 can be a computer-readable instruction (including program code) running on a computer device, for example, the blockchain consensus device 1500 is an application software; the blockchain consensus device 1500 can be used to execute the corresponding steps in the blockchain-based identity authentication method provided in an embodiment of the present application. The blockchain consensus device 1500 can specifically include:

[0187] Receiving unit 1501 is used to receive a proposal message sent by a proposal node. The proposal message is generated by assembling signature endorsement information and a transaction block. The signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node. The hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node.

[0188] The processing unit 1502 is configured to parse the proposal message to obtain a hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint.

[0189] The processing unit 1502 is further configured to reach a consensus on the proposal message based on the acquired certificate data.

[0190] In one possible implementation, the processing unit 1502 obtains the certificate data of the proposal node according to the hash fingerprint, and is used to query data from the cache component of the verification node according to the hash fingerprint, and uses the queried data as the certificate data of the proposal node; or, if the corresponding data is not queried from the cache component of the verification node, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node; wherein the cache component is used to store the certificate data queried from the contract database.

[0191] In one possible implementation, the processing unit 1502 is further used to generate a voting message indicating that the consensus on the proposal message has not been passed if the corresponding data is not queried from the cache component according to the hash fingerprint and the corresponding data is not queried from the contract database according to the hash fingerprint; and send the voting message indicating that the consensus has not been passed to the proposal node.

[0192] In one possible implementation, the processing unit 1502 reaches a consensus on the proposal message based on the acquired certificate data, determines the proposal node associated with the acquired certificate data, and verifies whether the proposal node is consistent with the master node elected in the current consensus view; if consistent, it triggers the execution of the step of verifying each transaction data in the proposal message.

[0193] In one possible implementation, the processing unit 1502 is further configured to execute each transaction data included in the transaction block in the proposal message to obtain a transaction execution result for each transaction data; parse the proposal message to obtain the transaction execution result of the proposal node for each transaction data in the transaction block; if the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message indicating consensus passed for the proposal message is generated and the voting message is sent to the proposal node.

[0194] In one possible implementation, the processing unit 1502 is further used to obtain the node proposal to be uploaded to the chain sent by the proposing node, and the node proposal to be uploaded to the chain includes the certificate data of the proposing node; consensus is reached on the node proposal based on the certificate data included in the node proposal, and the consensus includes: verifying the identity of the proposing node, verifying the validity and security of the transaction data in the node proposal, or any one or more of the following; if the consensus on the node proposal is passed, a voting result of the consensus is generated, and the voting result is sent to the proposing node.

[0195] In an embodiment of the present application, during the block consensus process, after receiving the proposal message sent by the proposal node, the verification node can parse the hash fingerprint of the proposal node in the proposal message, and obtain the complete certificate data of the proposal node according to the hash fingerprint. Finally, the verification node reaches a consensus on the proposal message based on the obtained complete certificate data. Among them, the present application can use the LRU cache record in the node memory to record the certificate data obtained from the system contract. When verifying a proposal message that uses the hash fingerprint as a signature endorsement, the hash fingerprint can be used to query the LRU cache component in the memory first. If it does not exist, the system contract data in the DB database can be queried. This method can reduce the number of times the contract data in the DB database is queried when verifying the signature endorsement of the proposal message, thereby improving data query efficiency.

[0196] Please refer to Figure 16, which is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Computer device 1600 is used to execute the steps performed by the proposal node and verification node in the aforementioned method embodiments. Computer device 1600 includes: one or more processors 1601; one or more input devices 1602; one or more output devices 1603; and memory 1604. Processor 1601, input device 1602, output device 1603, and memory 1604 are connected via bus 1605. Processor 1601 (also known as a CPU (Central Processing Unit)) is the processing core of the computer device. Processor 1601 is adapted to implement one or more computer-readable instructions, specifically, to load and execute one or more computer-readable instructions to implement the aforementioned blockchain consensus method process. Memory 1604 can be high-speed RAM or non-volatile memory, such as at least one disk drive; optionally, it can be at least one memory located remotely from the aforementioned processors. Memory 1604 provides storage space for storing the operating system of the content playback device. In addition, the storage space is also used to store computer-readable instructions, which include computer-readable instructions, and the computer-readable instructions are suitable for being called and executed by the processor to perform the various steps of the blockchain consensus method in this application.

[0197] Specifically, the memory 1604 is used to store computer-readable instructions, and the processor 1601 calls the computer-readable instructions stored in the memory 1604 to perform the following operations:

[0198] Obtain the transaction block to be agreed upon. The transaction block to be agreed upon is generated based on at least one transaction data to be packaged;

[0199] Obtain the hash fingerprint of the proposal node, use the hash fingerprint of the proposal node to sign and endorse the transaction block, and obtain the signature endorsement information. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node;

[0200] Assemble the signature endorsement information and transaction block to generate a proposal message;

[0201] The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

[0202] In a possible implementation, the processor 1601 is further configured to perform the following operations:

[0203] Receive the contract call transaction data sent by the operation node. The contract call transaction data includes: the contract identifier of the system contract;

[0204] The packaged transaction block is signed and endorsed based on the certificate data of the proposal node to generate a node proposal to be uploaded to the chain. The packaged transaction block includes the contract call transaction data;

[0205] If the blockchain consensus on the node proposal is passed, the certificate data of the proposal node will be uploaded to the blockchain according to the contract identifier of the system contract;

[0206] The contract identifier is used to instruct the proposing node and any verification node to store the certificate data of the proposing node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

[0207] In one possible implementation, processor 1601 signs and endorses the packaged transaction block based on the certificate data of the proposing node, generates a node proposal to be uploaded to the blockchain, and then performs the following operations:

[0208] Broadcast the node proposal to be on-chain to at least one verification node in the blockchain to trigger each verification node to on-chain the certificate data corresponding to the proposing node;

[0209] Receive voting results from each verification node. The voting results are generated after any verification node reaches consensus on the node proposal to be put on the chain;

[0210] If the blockchain consensus on the node proposal is passed based on the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data and hash fingerprint of the proposal node are associated and stored in the contract database of the proposal node.

[0211] In one possible implementation, the processor 1601 uploads the certificate data of the proposal node to the blockchain according to the contract identifier of the system contract, and performs the following operations:

[0212] If the node proposal consensus is passed according to the received voting results, a notification message is generated, which carries the contract identifier of the system contract.

[0213] Send the notification message to each verification node in the blockchain. The notification message is used to trigger any verification node to store the certificate data of the proposing node in its corresponding contract database;

[0214] Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and certificate data stored in association with the proposal node.

[0215] In one possible implementation, after broadcasting the proposal message to at least one verification node in the blockchain, the processor 1601 is further configured to perform the following operations:

[0216] Receive voting messages sent by each verification node. Voting messages are generated by any verification node after reaching consensus on the proposal message.

[0217] If the proposal message is determined to meet the consensus conditions based on the received voting messages, the transaction block corresponding to the proposal message will be uploaded to the blockchain;

[0218] Among them, the consensus executed by any verification node includes: verifying whether the transaction execution results of the proposal node for each transaction data in the transaction block are consistent with the transaction execution results of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

[0219] In a possible implementation, the transaction data to be packaged is in multiple copies; the processor 1601 is further configured to perform the following operations:

[0220] Obtaining the acquisition time of each transaction data to be packaged, and sorting the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data;

[0221] Pack the transaction execution order into the proposal message;

[0222] The transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

[0223] Specifically, the memory 1604 is used to store computer-readable instructions, and the processor 1601 calls the computer-readable instructions stored in the memory 1604 and is further used to perform the following operations:

[0224] Receive proposal messages sent by proposal nodes. Proposal messages are generated by assembling signature endorsement information and transaction blocks. Signature endorsement information is determined by signing and endorsing the transaction block based on the proposal node's hash fingerprint. The hash fingerprint is determined by hashing the certificate data corresponding to the proposal node.

[0225] Parse the proposal message to obtain the hash fingerprint of the proposal node, and obtain the certificate data of the proposal node according to the hash fingerprint;

[0226] Based on the obtained certificate data, consensus is reached on the proposal message.

[0227] In one possible implementation, the processor 1601 obtains the certificate data of the proposing node according to the hash fingerprint, and performs the following operations:

[0228] Query data from the cache component of the verification node based on the hash fingerprint, and use the queried data as the certificate data of the proposal node; or

[0229] If the corresponding data is not found in the cache component of the verification node, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node;

[0230] Among them, the cache component is used to store the certificate data queried from the contract database.

[0231] In a possible implementation, the processor 1601 is further configured to perform the following operations:

[0232] If no corresponding data is found from the cache component according to the hash fingerprint, and no corresponding data is found from the contract database according to the hash fingerprint, a voting message indicating that the consensus on the proposal message has failed is generated;

[0233] Send the voting message that the consensus fails to pass to the proposal node.

[0234] In one possible implementation, processor 1601 reaches a consensus on the proposal message based on the acquired certificate data to perform the following operations:

[0235] Determine the proposal node associated with the obtained certificate data and verify whether the proposal node is consistent with the master node elected in the current consensus view;

[0236] If they are consistent, the step of verifying each transaction data in the proposal message is triggered.

[0237] In a possible implementation, the processor 1601 is further configured to perform the following operations:

[0238] Execute each transaction data included in the transaction block in the proposal message and obtain the transaction execution results of each transaction data;

[0239] Parse the proposal message to obtain the transaction execution results of the proposal node for each transaction data in the transaction block;

[0240] If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message indicating that the consensus on the proposal message has passed is generated and sent to the proposal node.

[0241] In a possible implementation, the processor 1601 is further configured to perform the following operations:

[0242] Obtain the node proposal to be on-chain sent by the proposing node. The node proposal to be on-chain includes the certificate data of the proposing node;

[0243] Reaching consensus on the node proposal based on the certificate data included in the node proposal. The consensus includes: verifying the identity of the proposing node, verifying the validity and security of the transaction data in the node proposal;

[0244] If the consensus on the node proposal is passed, a voting result of consensus passing is generated and sent to the proposing node.

[0245] As can be seen from this, the proposal message constructed during the consensus process is generated based on the hash fingerprint signature endorsement of the proposing node. Compared to signing and endorsing based on the complete certificate data of the proposing node, the hash fingerprint occupies a smaller amount of data, thereby reducing the size of the proposal message. Furthermore, the smaller proposal message size can also reduce the amount of data transmitted during the data transmission process, thereby accelerating consensus efficiency. In addition, the rapid and stable transmission of proposal messages can accelerate the achievement of consensus between nodes, further improving consensus efficiency.

[0246] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer storage medium, and the computer storage medium stores computer-readable instructions, and the computer-readable instructions include computer-readable instructions. When the processor executes the above-mentioned computer-readable instructions, it can execute the method in the corresponding embodiment above, so it will not be described in detail here. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the computer-readable instructions can be deployed on a computer device, or executed on multiple computer devices located at one location, or, executed on multiple computer devices distributed at multiple locations and interconnected by a communication network.

[0247] According to one aspect of the present application, a computer program product is provided. The computer program product includes computer-readable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer-readable instructions from the computer-readable storage medium and executes the computer-readable instructions, so that the computer device can perform the method of the above embodiments. Therefore, a detailed description thereof will not be given here.

[0248] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The above-described program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The above-described storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0249] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

[0250] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0251] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A blockchain consensus method, executed by a computer device where a proposal node is located in a blockchain, comprising: Obtaining a transaction block to be agreed upon, where the transaction block to be agreed upon is generated based on at least one piece of transaction data to be packaged; Obtaining the hash fingerprint of the proposal node, using the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information, wherein the hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node; Assembling the signature endorsement information and the transaction block to generate a proposal message; and The proposal message is broadcast to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

2. The method of claim 1, further comprising: Receiving contract call transaction data sent by the operation node, wherein the contract call transaction data includes a contract identifier of the system contract; The packaged transaction block is signed and endorsed according to the certificate data of the proposal node to generate a node proposal to be uploaded to the chain, wherein the packaged transaction block includes the contract call transaction data; If it is determined that the blockchain consensus on the node proposal is passed, the certificate data of the proposal node is uploaded to the blockchain according to the contract identifier of the system contract; The contract identifier is used to instruct the proposal node and any verification node to store the certificate data of the proposal node in their respective contract databases, and the contract database maintains the system contract indicated by the contract identifier.

3. The method of claim 2, further comprising: Broadcast the node proposal to be put on the chain to at least one verification node in the blockchain to trigger each verification node to put the certificate data corresponding to the proposal node on the blockchain; Receive voting results sent by each verification node, where the voting results are generated after any verification node reaches consensus on the node proposal to be put on the chain; If the blockchain consensus on the node proposal is passed according to the received voting results, the hash fingerprint of the certificate data of the proposal node is obtained, and the certificate data of the proposal node and the hash fingerprint are associated and stored in the contract database of the proposal node.

4. The method according to claim 3, wherein the step of uploading the certificate data of the proposal node to the blockchain according to the contract identifier of the system contract comprises: If it is determined that the node proposal consensus is passed according to the received voting results, a notification message of the node proposal consensus passing is generated, and the notification message carries the contract identifier of the system contract; Send the notification message to each verification node in the blockchain, and the notification message is used to trigger any verification node to store the certificate data of the proposal node in the corresponding contract database; Among them, the system contract maintained in the contract database of any verification node records: the hash fingerprint and the certificate data stored in association with the proposal node.

5. The method according to any one of claims 1 to 4, further comprising: Receive voting messages sent by each verification node, where the voting messages are generated by any verification node after consensus is reached on the proposal message; If it is determined that the proposal message meets the consensus condition based on the received voting messages, the transaction block corresponding to the proposal message is put on the blockchain; Among them, the consensus on the proposal message performed by any verification node includes: verifying whether the transaction execution result of the proposal node for each transaction data in the transaction block is consistent with the transaction execution result of the verification node for each transaction data in the transaction block, and verifying whether the proposal message is generated by the proposal node.

6. The method according to any one of claims 1 to 5, wherein the transaction data to be packaged is a plurality of copies, and the method further comprises: Acquire the acquisition time of each transaction data to be packaged, and sort the execution order of multiple transaction data according to the acquisition time of each transaction data to determine the transaction execution order of each transaction data; Packing the transaction execution order into the proposal message; The transaction execution order is used to trigger any verification node that receives the proposal message to execute each transaction data in the transaction block in the order indicated by the transaction execution order.

7. A blockchain consensus method, executed by a computer device where a verification node in a blockchain is located, comprising: Receive a proposal message sent by a proposal node, where the proposal message is generated by assembling signature endorsement information and a transaction block, where the signature endorsement information is determined by signing and endorsing the transaction block based on the hash fingerprint of the proposal node, where the hash fingerprint is determined by performing a hash operation on the certificate data corresponding to the proposal node; Parsing the proposal message to obtain the hash fingerprint of the proposal node, and obtaining the certificate data of the proposal node according to the hash fingerprint; and A consensus is reached on the proposal message based on the acquired certificate data.

8. The method of claim 7, wherein obtaining the certificate data of the proposal node according to the hash fingerprint comprises: According to the hash fingerprint, data is queried from the cache component of the verification node, and the queried data is used as the certificate data of the proposal node. The cache component is used to store the certificate data queried from the contract database.

9. The method according to claim 7 or 8, wherein obtaining the certificate data of the proposal node according to the hash fingerprint comprises: If the corresponding data is not found in the cache component of the verification node according to the hash fingerprint, the contract database of the verification node is queried according to the hash fingerprint to obtain the certificate data of the proposal node. The cache component is used to store the certificate data queried from the contract database.

10. The method of claim 9, further comprising: If no corresponding data is found from the cache component according to the hash fingerprint, and no corresponding data is found from the contract database according to the hash fingerprint, a voting message indicating that the consensus of the proposal message has not been passed is generated; The voting message that the consensus fails is sent to the proposal node.

11. The method according to any one of claims 7 to 10, wherein consensus is reached on the proposal message based on the acquired certificate data, comprising: Determine the proposal node associated with the obtained certificate data, and verify whether the proposal node is consistent with the master node elected in the current consensus view; If they are consistent, it triggers the step of verifying each transaction data in the proposal message.

12. The method of claim 11, further comprising: Execute each transaction data included in the transaction block in the proposal message to obtain the transaction execution result of each transaction data; Parsing the proposal message to obtain the transaction execution result of the proposal node for each transaction data in the transaction block; If the transaction execution result corresponding to the verification node is the same as the transaction execution result of the proposal node, a voting message for consensus passing of the proposal message is generated and sent to the proposal node.

13. The method according to any one of claims 7 to 12, further comprising: Obtaining a node proposal to be put on the chain sent by a proposing node, wherein the node proposal to be put on the chain includes the certificate data of the proposing node; A consensus is reached on the node proposal according to the certificate data included in the node proposal, wherein the consensus includes: verifying the identity of the proposing node, and verifying at least one of the validity or security of the transaction data in the node proposal; If the consensus on the node proposal is passed, a voting result of the consensus is generated and the voting result is sent to the proposing node.

14. A blockchain consensus device, comprising: An acquisition unit, used for acquiring a transaction block to be agreed upon, wherein the transaction block to be agreed upon is generated based on at least one transaction data to be packaged; A processing unit, configured to obtain a hash fingerprint of a proposal node, and use the hash fingerprint of the proposal node to sign and endorse the transaction block to obtain signature endorsement information, wherein the hash fingerprint is determined by performing a hash operation on certificate data corresponding to the proposal node; The processing unit is further used to assemble the signature endorsement information and the transaction block to generate a proposal message; The sending unit is used to broadcast the proposal message to at least one verification node in the blockchain to trigger each verification node to reach a consensus on the proposal message based on the hash fingerprint of the proposal node in the proposal message.

15. A blockchain consensus device, comprising: A receiving unit, configured to receive a proposal message sent by a proposal node, wherein the proposal message is generated by assembling signature endorsement information and a transaction block, wherein the signature endorsement information is determined by signing and endorsing the transaction block based on a hash fingerprint of the proposal node, and the hash fingerprint is determined by performing a hash operation on certificate data corresponding to the proposal node; A processing unit, configured to parse the proposal message to obtain a hash fingerprint of the proposal node, and obtain certificate data of the proposal node according to the hash fingerprint; and The processing unit is further used to reach a consensus on the proposal message based on the acquired certificate data.

16. A computer device comprising: A memory and a processor, wherein the memory stores computer-readable instructions, and the processor is used to load and execute the computer-readable instructions to implement the method according to any one of claims 1 to 13.

17. A computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions, when loaded and executed by a processor, implement the method according to any one of claims 1 to 13.

18. A computer program product, comprising computer readable instructions, wherein when the computer readable instructions are loaded and executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Certificate processing method and device for blockchain network, electronic equipment and storage medium

    CN110597911A

  • Alliance block chain consensus method and system based on joint signature

    CN113256427A

  • Certificate processing method and device of block chain network, electronic equipment and storage medium

    CN113609222A

  • Energy industry cloud network data tracing method and device

    CN113726525A

  • Blockchain endorsement with approximate hash verification

    US20200380154A1

Cited By

  • Financial information management method and system based on block chain technology

    CN119444422A

  • Method and system for optimizing consensus mechanism of alliance block chain

    CN119483887A

  • User data processing method and device based on block chain and storage medium

    CN119831740A

  • Data storage evidence preservation processing method and system based on distributed storage technology

    CN122348814A