Block chain transaction delivery and verification method and device

By using certificate identification instead of identity certificates in the blockchain system, the problems of high transaction costs and long confirmation times of blockchain technology in high-throughput scenarios are solved, achieving more efficient transaction processing and throughput improvement.

CN118608155APending Publication Date: 2024-09-06HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410777469.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2019-06-28
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Blockchain technology's large transaction volume in enterprise-level massive data application scenarios leads to high network and storage costs, long transaction confirmation times, and low throughput, making it difficult to meet the financial system's demand for high throughput.

Method used

By using certificate identification instead of identity certificates in the blockchain system, the amount of data processing during the transaction process is reduced, transaction efficiency is improved, and network and storage overhead are reduced. The specific method includes the first node receiving the verification message sent by the second node, parsing the certificate field content to obtain the certificate identification, obtaining the identity certificate from the certificate list for verification, and storing and managing the certificate identification in the certificate list to improve efficiency.

Benefits of technology

It effectively reduces the network and storage overhead of blockchain transactions, improves transaction efficiency and throughput, and meets the financial system's demand for high throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608155A
    Figure CN118608155A
Patent Text Reader

Abstract

The invention discloses a block chain transaction payment and verification method and device, and the method comprises the steps: a second node generates a first verification message comprising a certificate identifier corresponding to an identity certificate of the second node, and transmits the first verification message to a first node, and the first node receives the first verification message, and obtaining a certificate identifier in the first verification message through analysis, further obtaining an identity certificate corresponding to the certificate identifier from a certificate list stored in the first node, and verifying the identity of the second node through the identity certificate. In the process, because the first verification message comprises the certificate identifier corresponding to the identity certificate of the second node, the original identity certificate of the second node is replaced, the data processing amount in the block chain transaction process is reduced, the network overhead and the storage overhead are further reduced, and the block chain transaction efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 201910588164.3, and the original application date is June 28, 2019. The entire content of the original application is incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of blockchain technology, and in particular to a blockchain transaction delivery and verification method and device. Background Art

[0003] Blockchain technology has been applied in many fields such as finance, trade, credit reporting, Internet of Things, and sharing economy. Due to the distributed fault tolerance, immutability, and privacy protection of blockchain technology, it can help enterprises or government departments build a trustworthy, low-cost, and secure network. Users can complete all exchange processes related to information, value (including currency, securities, patents, copyrights, digital goods, physical objects, etc.), and credit in the blockchain network.

[0004] As a distributed infrastructure, the underlying platform of the blockchain platform is complex to build and the operation and maintenance is cumbersome. This is a big challenge for many application developers, making it impossible for enterprises to focus on the development and innovation of upper-level applications. In order to solve these problems, the blockchain cloud service platform came into being. Blockchain cloud services can take advantage of the deployment and management advantages of cloud service infrastructure to provide developers with fast services for creating, using, and even securely monitoring blockchain platforms. At present, some blockchain cutting-edge technology teams in the industry have taken the lead in developing and launching blockchain service platforms, mainly including Huawei Cloud Blockchain Service (BCS), Alibaba Cloud Blockchain Service (BaaS), Tencent Cloud Blockchain Service (TBaaS), AWS's Amazon Managed Blockchain, and IBM Bluemix Cloud's blockchain service.

[0005] When using blockchain cloud services, users need to purchase computing resources, communication resources, and storage resources provided by the public cloud platform. IT infrastructure expenses often take up a large amount of corporate expenditures, increasing the cost of using blockchain services. When faced with application scenarios with massive enterprise-level data, the transaction volume in the blockchain system increases sharply, resulting in a sharp increase in the network cost and storage cost of blockchain services. In Huawei Cloud's BCS service, the network cost of some enterprises is even as high as 50% of the enterprise cost. Therefore, reducing infrastructure expenses such as network cost and storage cost and improving the cost-effectiveness of blockchain services have become the main demands of users.

[0006] At present, the long transaction confirmation time and low throughput have greatly limited the applicable scenarios of blockchain technology. In the public chain scenario, the current Bitcoin system can process 7 transactions per second, and the safe transaction confirmation time is about one hour. In the alliance chain scenario, there are certain trust premises and interest constraints among the participating parties, and a more optimized design can be adopted in exchange for performance improvement. As a representative of the alliance chain, Hyperledger Fabric has a throughput of only a few hundred to a few thousand transactions per second, which cannot meet the current financial system's demand for throughput (tens of thousands of transactions per second). Therefore, the industry is currently very concerned about how to improve the throughput of blockchain system transactions and reduce the confirmation delay of transactions. Summary of the invention

[0007] The embodiments of the present application provide a blockchain transaction delivery and verification method and device. The solution of the embodiments of the present application can reduce the amount of data in the blockchain transaction during node delivery and node verification, thereby reducing network overhead and storage overhead and improving transaction efficiency.

[0008] In a first aspect, an embodiment of the present application provides a blockchain transaction verification method, which is applied to a first node in a blockchain system, and the method includes:

[0009] Receiving a first verification message sent by the second node, and parsing the verification message to obtain certificate field content, wherein the certificate field content includes a certificate identifier;

[0010] Acquire the identity certificate corresponding to the certificate identifier from a certificate list of the first node, wherein the certificate list includes multiple certificate identifiers and the identity certificate corresponding to each of the multiple certificate identifiers;

[0011] The second node is authenticated according to the identity certificate.

[0012] In an embodiment of the present application, when the first node receives the verification message sent by the second node, if it parses that the certificate field content includes a certificate identifier, it obtains the identity certificate corresponding to the certificate identifier from the certificate list, and then verifies the second node based on the identity certificate. In this process, the first node receives the certificate identifier instead of the identity certificate, which can improve the reception efficiency; obtaining the identity certificate corresponding to the certificate identifier from the certificate list can improve the convenience of obtaining the identity certificate while ensuring reliability. This method improves the efficiency of receiving and obtaining identity certificates for transaction verification as a whole.

[0013] In a feasible embodiment, the method further includes:

[0014] receiving a second verification message sent by a second node, and parsing the verification message to obtain content of a certificate field, wherein the content of the certificate field includes an identity certificate, wherein the second verification message is sent before the first verification message;

[0015] verifying the second node according to the identity certificate;

[0016] Determining whether the certificate list of the first node includes the identity certificate;

[0017] If it is determined that the certificate list of the first node does not include the identity certificate, a certificate identifier corresponding to the identity certificate is generated according to the identity certificate, and the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node.

[0018] In a feasible embodiment, before obtaining the identity certificate corresponding to the certificate identifier from the certificate list of the first node, the method further includes:

[0019] storing the certificate list of the first node in a cache of the first node; and / or

[0020] The certificate list of the first node is stored in a local database of the first node.

[0021] In a second aspect, an embodiment of the present application provides a blockchain transaction delivery method, which is applied to a second node in a blockchain system, and the method includes:

[0022] Determine whether the certificate list of the second node includes its own identity certificate, where the own identity certificate is an identity certificate issued by the CA for the second node;

[0023] If it is determined that the certificate list includes the self-identity certificate, obtaining the certificate identifier corresponding to the self-identity certificate, and generating a first verification message including the certificate identifier;

[0024] The first verification message is sent to the first node.

[0025] In an embodiment of the present application, when it is determined that the certificate list of the second node includes its own identity certificate, the certificate identifier corresponding to the own identity certificate is obtained, and a first verification message including the certificate identifier is generated, and finally the first verification message is sent to the first node. In this process, after determining that the certificate list of the second node includes its own identity certificate, the first verification message sent to the first node includes the certificate identifier corresponding to the own identity certificate instead of the certificate itself, which can effectively reduce the amount of data processing when generating the first verification message and improve the efficiency of generating and sending the first verification message. This method improves the efficiency of generating and sending the first verification message for transaction verification as a whole.

[0026] In a feasible embodiment, after determining whether the certificate list of the second node includes its own identity certificate, the method further includes:

[0027] If it is determined that the certificate list of the second node does not include its own identity certificate, obtain the second node's own identity certificate from outside the certificate list, and generate a second verification message including the second node's own identity certificate, where the second node's own identity certificate is an identity certificate issued by the CA for the second node;

[0028] Send the second verification message to the first node.

[0029] In a feasible embodiment, obtaining the certificate identifier corresponding to the own identity certificate includes:

[0030] A hash operation is performed on the identity certificate to obtain a certificate identifier corresponding to the identity certificate.

[0031] In a feasible embodiment, the method further includes:

[0032] Obtain the identity certificate and private key corresponding to the second node issued by the CA;

[0033] Obtaining a sent message of the second node, encrypting the sent message or a digest of the sent message using a private key, and obtaining a signature corresponding to the second node;

[0034] Generate a first verification message for the second node according to the signature, the sent message and a certificate field, wherein the content of the certificate field includes the certificate identifier; or

[0035] A second verification message of the second node is generated according to the signature, the sending message and the certificate field, wherein the content of the certificate field includes the self-identity certificate.

[0036] In a third aspect, an embodiment of the present application provides a blockchain transaction verification device, the device comprising:

[0037] A receiving unit, configured to receive a verification message sent by the second node, and parse the verification message to obtain a certificate field content, wherein the certificate field content includes a certificate identifier;

[0038] an acquiring unit, configured to acquire an identity certificate corresponding to the certificate identifier from a certificate list of the first node, wherein the certificate list includes a plurality of certificate identifiers and an identity certificate corresponding to each of the plurality of certificate identifiers;

[0039] A verification unit is used to verify the second node according to the identity certificate.

[0040] In a feasible embodiment, the acquisition unit is further used for:

[0041] receiving a second verification message sent by a second node, and parsing the verification message to obtain content of a certificate field, wherein the content of the certificate field includes an identity certificate, wherein the second verification message is sent before the first verification message;

[0042] The verification unit is also used for:

[0043] verifying the second node according to the identity certificate;

[0044] Determining whether the certificate list of the first node includes the identity certificate;

[0045] If it is determined that the certificate list of the first node does not include the identity certificate, a certificate identifier corresponding to the identity certificate is generated according to the identity certificate, and the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node.

[0046] In a feasible embodiment, the device further includes a storage unit, which is used to:

[0047] storing the certificate list of the first node in a cache of the first node; and / or

[0048] The certificate list of the first node is stored in a local database of the first node.

[0049] In a fourth aspect, an embodiment of the present application provides a blockchain transaction delivery device, the device comprising:

[0050] A determination unit, configured to determine whether the certificate list of the second node includes its own identity certificate;

[0051] A generating unit, configured to obtain a certificate identifier corresponding to the self-identity certificate if it is determined that the certificate list includes the self-identity certificate, and generate a first verification message including the certificate identifier;

[0052] A sending unit, configured to send the first verification message to the first node.

[0053] In a feasible embodiment, after determining whether the certificate list of the second node includes its own identity certificate, the generating unit is further used to:

[0054] If it is determined that the certificate list of the second node does not include its own identity certificate, obtaining the second node's own identity certificate from outside the certificate list, and generating a second verification message including the own identity certificate;

[0055] Send the second verification message to the first node.

[0056] In a feasible embodiment, in terms of obtaining the certificate identifier corresponding to the own identity certificate, the generating unit is further specifically used to:

[0057] A hash operation is performed on the identity certificate to obtain a certificate identifier corresponding to the identity certificate.

[0058] In a feasible embodiment, the generating unit is further specifically used for:

[0059] Obtaining the identity certificate and private key corresponding to the second node;

[0060] Obtaining a sent message of the second node, encrypting the sent message or a digest of the sent message using the private key, and obtaining a signature corresponding to the second node;

[0061] Generate a first verification message for the second node according to the signature, the sent message and the content of the certificate field, wherein the content of the certificate field includes the certificate identifier; or

[0062] A second verification message of the second node is generated according to the signature, the sending message and the content of the certificate field, wherein the content of the certificate field includes the self-identity certificate.

[0063] In a fifth aspect, an embodiment of the present application provides a device, including:

[0064] A memory storing executable program code;

[0065] a processor coupled to the memory;

[0066] The processor calls the executable program code stored in the memory, so that the device executes any one of the methods described in the first aspect and the second aspect.

[0067] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium includes program instructions, and when the program instructions are executed on a computer, the computer executes any one of the methods described in the first and second aspects.

[0068] It can be seen that in the scheme of the embodiment of the present application, the above-mentioned blockchain transaction delivery and verification method and device first generates a first verification message at the second node, and sends the first verification message to the first node. The first node receives the first verification message, and obtains the certificate field in the first verification message by parsing, and then obtains the identity certificate, and verifies the identity of the second node. In this process, since the certificate field in the first verification message can be the certificate identifier corresponding to the identity certificate of the second node itself, it replaces the original identity certificate of the second node itself, reduces the amount of data processing in the blockchain transaction process, and then reduces network overhead and storage overhead, and improves the efficiency of blockchain transactions.

[0069] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0071] Figure 1 A schematic diagram of a blockchain structure provided for an embodiment of the present application;

[0072] Figure 2 A schematic diagram of a consortium chain structure provided for an embodiment of the present application;

[0073] Figure 3 A blockchain transaction delivery verification method provided in an embodiment of the present application;

[0074] Figure 4 Another blockchain transaction delivery verification method provided in an embodiment of the present application;

[0075] Figure 5 A schematic diagram of a Fabric transaction process provided in an embodiment of the present application;

[0076] Figure 6 A schematic diagram of a specific blockchain transaction verification and delivery process provided in an embodiment of the present application;

[0077] Figure 7 A blockchain transaction verification device provided in an embodiment of the present application;

[0078] Figure 8 A blockchain transaction delivery device provided in an embodiment of the present application;

[0079] Fig. 9A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0081] See also Figure 1 , Figure 1 A schematic diagram of a blockchain structure provided in an embodiment of the present application is shown in the figure. Figure 1 In the blockchain, there is a ring structure consisting of multiple terminals (data blocks), each of which is a node, and the ring structure is a blockchain. In the blockchain structure, each node has the same status, and the consensus mechanism is used to ensure storage consistency, and each terminal stores complete data.

[0082] For all nodes in the same blockchain system, the transaction information stored on the blockchain is public. In order to ensure the security of transactions, the account identity information needs to be highly encrypted and can only be accessed with the authorization of the data owner. In this process, asymmetric encryption technology is usually used to authenticate user identity information.

[0083] Consortium chain is a special blockchain structure, see Figure 2 , Figure 2 A schematic diagram of a consortium chain structure provided in an embodiment of the present application is shown in the figure. Figure 2 In the diagram, there are multiple peer nodes. All peer nodes in the consortium chain are connected by dotted lines. Some of the peer nodes form an organization, for example, nodes 1.1 to 1.3 form organization 1 (org1), nodes 2.1 to 2.3 form organization 2 (org2), and nodes 3.1 to 3.3 form organization 3 (org3). Peer nodes in the same organization are connected by thin solid lines. Peer nodes in different organizations can form channels. The data between different channels are isolated from each other to ensure that transaction information is visible only to the transaction participants. Peer nodes in the same channel are connected by thick solid lines and are connected to ordering nodes. Each channel is an independent blockchain, so multiple users can share the same blockchain system without worrying about information leakage. One or more ordering nodes are used to complete the ordering service, which is responsible for sorting all transactions sent to the network, ensuring the transaction order in the blockchain, generating blocks according to the specified block generation strategy, and broadcasting them to peer nodes.

[0084] Figure 2The alliance chain structure shown also includes client nodes, where the client issues a transaction proposal, and the peer node responds to the transaction proposal, and finally the transaction is concluded. All nodes in the alliance chain are issued identity certificates by an authoritative certificate authority (CA), which is used to verify the legitimacy of the public key of the asymmetric encryption technology in the blockchain.

[0085] Since the identity certificate issued by the CA is used to authenticate the node signature, the identity certificate must be packaged, sent, parsed and signed in each transaction. The amount of data in the identity certificate is sometimes even larger than the transaction data in the blockchain, which will cause a large amount of data redundancy and reduce the efficiency of blockchain transactions.

[0086] In order to solve the above problems, Figure 3 A blockchain transaction delivery verification method provided in an embodiment of the present application, such as Figure 3 As shown, the method includes:

[0087] 101. A second node determines whether its own identity certificate is included in a certificate list of the second node.

[0088] When all nodes in the blockchain system conduct transactions (or data transmission), identity verification is required. CA issues an identity certificate (containing a public key), a private key, and a root certificate to each node in the blockchain system. The private key is used to sign the message or message digest to be sent by the sending node, and then the signature and identity certificate are sent to the receiving node. The receiving node uses the root certificate to authenticate the identity certificate to confirm its legitimacy, and then obtains the public key in the identity certificate to authenticate the signature of the sending node (generated by private key encryption), completing the authentication process of the sending node.

[0089] In the embodiment of the present application, the second node is the node that sends the message, and the first node is the node that receives the message. The client or peer node in the alliance chain can be used as the node that sends the message, that is, the second node; the client, peer node and sorting node can be used as the node that receives the message, that is, the first node.

[0090] In addition, the certificate list of the second node is used to store the identity certificates of all nodes that have concluded transactions with the second node and the certificate identifiers corresponding to the identity certificates. In the process of blockchain transactions, the conclusion of transactions relies on the consensus mechanism. Therefore, only when all nodes involved in the transaction have authenticated and traded with all other nodes can the transaction be concluded. Then the certificate list of each node stores the identity certificates of all nodes involved in the transaction and the certificate identifiers corresponding to the identity certificates, including its own.

[0091] The self-identity certificate is the identity certificate issued by the CA obtained by the second node. If it is determined that the certificate list of the second node includes its own identity certificate, it means that the second node has conducted transactions with all nodes in the channel. If the certificate list of the second node does not include its own identity certificate, it means that the second node has not conducted transactions with other nodes in the channel.

[0092] 102. If it is determined that the certificate list includes its own identity certificate, the second node obtains a certificate identifier corresponding to the own identity certificate, and generates a first verification message including the certificate identifier.

[0093] Specifically, in order to reduce the amount of data processing when conducting transactions between nodes in the alliance chain, the certificate field content in the verification message sent by the second node is replaced by the identity certificate with the certificate identifier, where the certificate identifier represents a mark used to represent the characteristics of the identity certificate. Because the identity certificate uniquely marks a node, the certificate identifier corresponding to the identity certificate also needs to uniquely mark a node. In addition, the certificate identifier should uniquely correspond to the identity certificate, that is, only a unique certificate identifier can be obtained based on an identity certificate. After tampering with the identity certificate or identity identifier, the certificate identifier and the identity certificate no longer correspond.

[0094] After determining that the certificate list of the second node includes its own identity certificate, a first verification message is generated and sent to the first node to complete the verification and transaction between the nodes. The certificate field content in the first and second nodes is the certificate identifier of the second node.

[0095] Optionally, obtaining the certificate identifier corresponding to the own identity certificate includes: performing a hash operation on the identity certificate to obtain the certificate identifier corresponding to the identity certificate.

[0096] Specifically, according to the characteristics of the certificate identifier, it can be determined that the hash value obtained by performing a hash operation on the identity certificate can be used as the certificate identifier corresponding to the identity certificate. The hash value is a value in a fixed format. Performing a hash operation on the identity certificate to obtain the corresponding hash value can greatly reduce the amount of data. And the hash values ​​obtained from different data are basically not the same. Therefore, replacing the identity certificate sent during the transaction with the hash value corresponding to the identity certificate can reduce the amount of transaction data and ensure that the identity certificate corresponding to the second node can be obtained according to the certificate identifier for subsequent node verification.

[0097] Optionally, the method also includes: receiving the self-identity certificate and private key corresponding to the second node issued by the CA; obtaining the sending message of the second node, encrypting the sending message or the summary of the sending message with the private key, and obtaining the signature corresponding to the second node; generating a first verification message of the second node according to the signature, the sending message and the certificate field, wherein the content of the certificate field includes the certificate identifier; or generating a second verification message of the second node according to the signature, the sending message and the certificate field, wherein the content of the certificate field includes the self-identity certificate.

[0098] Specifically, the verification message of the second node is used to complete the identity authentication of the second node at the first node and reach a transaction. Therefore, the verification message must include both identity information and transaction data. The specific process of generating a verification message is: obtain the second node's own identity certificate and private key, and the self-identity certificate is the identity certificate corresponding to the second node. The private key is used to encrypt the second node's sent message or the summary of the sent message to obtain the signature corresponding to the second node. A verification message is generated based on the signature, the sent message, and the certificate field content. When it is determined that the certificate list of the second node includes its own identity certificate, the certificate field content is the certificate identifier corresponding to its own identity certificate, and the generated verification message is the first verification message; when it is determined that the certificate list of the second node does not include its own identity certificate, the certificate field content is its own identity certificate, and the generated verification message is the second verification message.

[0099] 103. The second node sends a first verification message to the first node.

[0100] In an embodiment of the present application, since it is determined that the certificate list of the second node includes the second node's own identity certificate, a first verification message is generated based on the certificate identifier corresponding to its own identity certificate. Then, the second node also sends the first verification message to the first node, which is used to complete the identity authentication of the second node and complete the process of the second node transmitting transaction data to the first node.

[0101] 104. The first node receives a first verification message sent by the second node, and parses the first verification message to obtain certificate field content, where the certificate field content includes a certificate identifier.

[0102] The certificate list of the first node is used to store the identity certificates of all nodes that have concluded transactions with the first node and the certificate identifiers corresponding to the identity certificates. As can be seen from the above content, the first verification message includes the certificate identifier, so the certificate field content in the first verification message obtained by the first node parsing includes the certificate identifier.

[0103] 105. The first node obtains the identity certificate corresponding to the certificate identifier from the certificate list of the first node.

[0104] After obtaining the certificate identifier, traverse the certificate list of the first node and obtain the identity certificate corresponding to the certificate identifier.

[0105] The certificate list of the first node contains the certificate identifier of the second node, indicating that the two have traded before. Every transaction between alliance chain nodes requires node identity authentication. Non-first transactions can reduce the amount of transaction data, that is, replace the identity certificate in the verification message with the certificate identifier. When it is determined that the certificate list stored by the first node includes the certificate identifier of the second node, the identity certificate corresponding to the certificate identifier of the second node is obtained from the certificate list, that is, the identity certificate of the second node, and then the identity of the second node is verified.

[0106] If the certificate list stored in the first node does not include the certificate identifier of the second node, it is possible that the first node and the second node have not yet conducted a transaction, or the identity certificate-related data stored in the first node is lost or tampered with, and the transaction fails, notifying the second node to resend the verification message.

[0107] Optionally, before obtaining the identity certificate corresponding to the certificate identifier from the certificate list of the first node, the method also includes: storing the certificate list of the first node in the cache of the first node; and / or storing the certificate list of the first node in the local database of the first node.

[0108] Specifically, the certificate list of the first node is stored in the cache of the first node, so that the content in the certificate list can be quickly obtained, further improving the verification efficiency of the second node. The certificate list of the first node is stored in the local database of the first node, so that the security of the certificate list storage can be guaranteed. If the security of storage is guaranteed while improving the verification efficiency, the certificate list can be stored in the cache and the local database at the same time.

[0109] Optionally, the certificate identifier in the certificate list can be obtained and stored in the cache of the first node, while the certificate list continues to be stored in the local database of the first node. When the certificate field content of the second node is parsed to include the certificate identifier, the certificate identifier in the cache of the first node is traversed. On the one hand, this can improve the efficiency of determining whether the certificate list of the first node includes the certificate identifier of the second node. On the other hand, storing the certificate identifier in the certificate list instead of the entire certificate list in the cache can reduce the storage burden of the cache. Storing the certificate list in the local database of the first node can also reduce the storage burden of the cache while ensuring the security of the certificate list storage.

[0110] 106. The first node verifies the second node according to the identity certificate corresponding to the certificate identifier.

[0111] The identity certificate obtained according to the certificate identifier is the identity certificate corresponding to the second node. The identity certificate is used to verify the identity of the second node. The verification process is: the first node uses the root certificate obtained from the CA to authenticate the identity certificate to confirm its legitimacy, then obtains the public key in the identity certificate, decrypts the signature of the second node, and completes the authentication process of the second node.

[0112] It can be seen that in the embodiment of the present application, when the first node receives the verification message sent by the second node, if it is parsed that the certificate field content includes a certificate identifier, the certificate list of the first node is traversed to determine that the certificate list includes the certificate identifier, and then the identity certificate corresponding to the certificate identifier is obtained from the certificate list, and then the second node is verified based on the identity certificate. In this process, the first node receives the certificate identifier instead of the identity certificate, which can improve the reception efficiency; obtaining the identity certificate corresponding to the certificate identifier from the certificate list can improve the convenience of obtaining the identity certificate while ensuring reliability. This method improves the efficiency of receiving and obtaining identity certificates for transaction verification as a whole.

[0113] See also Figure 4 , Figure 4 Another blockchain transaction delivery verification method provided in the embodiment of the present application is as follows: Figure 4 As shown, the method includes:

[0114] 201. A second node determines whether its own identity certificate is included in a certificate list of the second node.

[0115] The description of this step is the same as step 101 and will not be repeated here.

[0116] 202. If it is determined that the certificate list of the second node does not include its own identity certificate, obtain the second node's own identity certificate from outside the certificate list, and generate a second verification message including the own identity certificate.

[0117] Specifically, if the second node's certificate list does not include its own identity certificate, it means that the second node has not yet conducted transactions with other nodes in the channel. The first node that has not conducted transactions has not received the second node's identity certificate, and naturally cannot store and obtain the second node's identity certificate, and cannot verify the identity of the second node based on the identity certificate. At this time, the second node obtains its own identity certificate, which can be obtained from the CA or from the second node's storage space, generates a second verification message including its own identity certificate, and sends the second verification message to the first node to conduct transactions.

[0118] In one possible case, the second node sends a first verification message to the first node, but due to reasons such as the loss or tampering of the content stored in the first node, the certificate identifier of the second node is not included after traversing the certificate list of the first node. Then the first node sends a prompt message to the second node to prompt the second node to resend the verification message. After receiving the prompt message, the second node regenerates the second verification message and sends the second verification message to the first node.

[0119] 203. The second node sends the second verification message to the first node.

[0120] The second node generates a second verification message, that is, sends the second verification message to the first node, which is used to complete the identity authentication of the second node and complete the process of the second node transmitting transaction data to the first node. Usually, because the second verification message is generated before the second node has traded with other nodes in the channel, the second verification message will be generated and sent before the first verification message.

[0121] 204. The first node receives a second verification message sent by the second node, and parses the second verification message to obtain content of a certificate field, where the content of the certificate field includes an identity certificate.

[0122] After receiving the verification message sent by the second node, the first node parses the verification message to obtain the certificate field content. In an embodiment of the present application, the second verification message sent by the second node includes the second node's own identity certificate, so after receiving the second verification message, the first node can parse and obtain the identity certificate in the second verification message.

[0123] 205. The first node verifies the second node according to the identity certificate.

[0124] The identity certificate parsed from the second verification message is the second node's own identity certificate, which can be used directly to authenticate the second node. The verification process is as follows: the first node uses the root certificate obtained from the CA to authenticate the identity certificate to confirm its legitimacy, then obtains the public key in the identity certificate, decrypts the signature of the second node, and completes the authentication process of the second node.

[0125] 206. The first node determines whether the identity certificate is included in a certificate list of the first node.

[0126] After the verification is completed, determine whether the identity certificate is included in the certificate list of the first node. Under normal circumstances, the certificate list of each node is the identity certificate and its corresponding certificate identifier of the node that has conducted transactions with each other, so the certificate list of the first node should be the same as the certificate list of the second node. If the certificate list of the second node does not include its own identity certificate, then the certificate list of the first node should also not include the identity certificate of the second node.

[0127] 207. If it is determined that the certificate list of the first node does not include the identity certificate, the first node generates a certificate identifier corresponding to the identity certificate according to the identity certificate, and adds the identity certificate and its corresponding certificate identifier to the certificate list of the first node.

[0128] If the identity certificate of the second node is not included in the certificate list of the first node, it means that the first node has not stored the identity certificate of the second node. A certificate identifier corresponding to the identity certificate is generated based on the identity certificate, and the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node, so that the next time a node transaction is performed, the first node can directly obtain the identity certificate of the second node from the certificate list stored in itself.

[0129] If the first node determines that the identity certificate of the second node is included in the certificate list of the first node, and if possible, the certificate list of the second node does not include its own identity certificate, which is inconsistent with the certificate list of the first node, then the certificate list of the second node may be lost or tampered with. The first node can issue a prompt to the second node while completing the verification of the second node. On the other hand, when the second node sends a verification message to the first node, it also needs to store the verification message, so it will re-store its own identity certificate, and the first node may not make any prompts.

[0130] It can be seen that in an embodiment of the present application, when the first node receives a verification message from the second node, if it is parsed from the verification message that the content of the certificate field is an identity certificate, the identity certificate is used to verify the second node, and at the same time, it is determined whether the certificate list of the first node includes the identity certificate. If not, the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node, so that in subsequent node transactions, the certificate field content in the verification message can be replaced by the identity certificate with the certificate identifier. This process can effectively improve the verification efficiency of the second node.

[0131] The following is a specific blockchain transaction process in a consortium chain. There are many excellent architecture implementations in the consortium chain, and Hyperledger Fabric (Fabric for short) is one of them. In the Fabric architecture, the specific process of implementing a data transaction can be found in Figure 5, Figure 5 A schematic diagram of a Fabric transaction process provided in an embodiment of the present application is as follows: Figure 5 As shown in the figure, the client software development kit (SDK) initiates a transaction proposal, which is a request to call a smart contract function in order to read or write the ledger. The transaction proposal is signed using the private key issued by the CA, and the signature and certificate field contents are packaged into the transaction proposal. The transaction proposal is sent to the peer node, which can be divided into an endorser node and a committer node. The endorser node receives the client's transaction proposal, verifies the transaction proposal, and executes the smart contract according to the transaction proposal, including reading the historical state, generating a read-write set, and finally generating the execution result. The execution result is signed with its own private key, and the signature, certificate field content and execution result are encapsulated into a transaction response. The client receives the transaction response, verifies the transaction response, encapsulates the transaction proposal and transaction response into the transaction, which includes a read set and a write set, and finally the client sends the transaction to the sorting node. The sorting node receives transactions from all channels in the network, verifies the client signature, sorts the transactions by time and channel, and creates blocks according to the specified block generation strategy. The sorting node then sends the block to the accounting node in the same channel corresponding to the transaction. The accounting node verifies the client and endorsing node corresponding to the transaction and checks for possible double-spending issues. After the verification is completed, each accounting node writes the block to the accounting node's blockchain and submits the write set of valid transactions to the current state database to complete the ledger update.

[0132] This process always runs through the verification process between nodes, including the second node sending a verification message, the first node receiving the verification message and verifying the signature in the verification message. When the second node is a client, the first node is a peer node (including an endorsement node and a bookkeeping node) or a sorting node. When the second node is a peer node, the first node is a client. When the second node is a sorting node, the first node is a peer node. For details about the verification process, please refer to Figure 6 , Figure 6 A schematic diagram of a specific blockchain transaction verification and delivery process provided in an embodiment of the present application is as follows: Figure 6 As shown, the premise for executing the method is that the CA has issued a root certificate, as well as its corresponding private key and identity certificate to the second node and the first node. The method includes:

[0133] 301. The second node determines whether the certificate list of the second node includes its own identity certificate. If yes, execute step 302; if no, execute 303.

[0134] 302. The second node obtains a certificate identifier corresponding to its own identity certificate, and generates a first verification message including the certificate identifier.

[0135] 303. The second node obtains its own identity certificate, and generates a second verification message including the own identity certificate.

[0136] 304. The second node sends the first verification message or the second verification message to the first node.

[0137] 305. The first node receives a second verification message sent by the second node, and parses the verification message to obtain content of a certificate field, where the content of the certificate field is the identity certificate.

[0138] 306. The first node verifies the second node according to the identity certificate.

[0139] 307. The first node determines whether the identity certificate is included in a certificate list of the first node.

[0140] 308. If it is determined that the certificate list of the first node does not include the identity certificate, the first node generates a certificate identifier corresponding to the identity certificate according to the identity certificate, and adds the identity certificate and its corresponding certificate identifier to the certificate list of the first node.

[0141] 309. The first node receives the first verification message sent by the second node, and parses the verification message to obtain the content of the certificate field, where the content of the certificate field is the certificate identifier.

[0142] 310. The first node obtains an identity certificate corresponding to the certificate identifier from the certificate list of the first node.

[0143] 311. The first node verifies the second node according to the identity certificate.

[0144] The specific description of the above steps 301 to 311 can refer to the corresponding description of the display method described in steps 101 to 106 and steps 201 to 207, and will not be repeated here.

[0145] It can be seen that in the embodiment of the present application, when the first node receives the verification message of the second node, if the certificate field content is parsed to be a certificate identifier, the certificate identifier is matched with the certificate list of the first node to obtain the identity certificate corresponding to the certificate identifier, which can reduce the amount of data processing when the first node receives the verification message, and at the same time, the identity certificate of the second node is obtained from the certificate list stored by the first node itself, which can improve the convenience and security of obtaining the identity certificate. If the certificate field content is parsed from the verification message as an identity certificate, the identity certificate is used to verify the second node, and it is determined whether the certificate list of the first node includes the identity certificate. If not, the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node, so that in subsequent node transactions, the certificate field content in the verification message can be replaced by the identity certificate with the certificate identifier. This process can effectively improve the verification efficiency of the second node.

[0146] See also Figure 7 , Figure 7 A blockchain transaction verification device is provided in an embodiment of the present application. Figure 7 As shown, the blockchain transaction verification device 400 includes:

[0147] The receiving unit 401 is configured to receive a first verification message sent by a second node, and parse the first verification message to obtain a certificate field content, where the certificate field content includes a certificate identifier;

[0148] An acquiring unit 402 is configured to acquire an identity certificate corresponding to the certificate identifier from a certificate list of the first node, wherein the certificate list includes multiple certificate identifiers and an identity certificate corresponding to each of the multiple certificate identifiers;

[0149] The verification unit 403 is configured to verify the second node according to the identity certificate.

[0150] It can be seen that in the blockchain transaction verification device provided in the embodiment of the present application, when the first node receives the verification message sent by the second node, if it parses that the certificate field content includes a certificate identifier, it obtains the identity certificate corresponding to the certificate identifier from the certificate list, and then verifies the second node based on the identity certificate. In this process, the first node receives the certificate identifier instead of the identity certificate, which can improve the reception efficiency; obtaining the identity certificate corresponding to the certificate identifier from the certificate list can improve the convenience of obtaining the identity certificate while ensuring reliability. This method improves the efficiency of receiving and obtaining identity certificates for transaction verification as a whole.

[0151] In an optional example, the acquiring unit 402 is further configured to:

[0152] receiving a second verification message sent by a second node, and parsing the verification message to obtain content of a certificate field, wherein the content of the certificate field includes an identity certificate, wherein the second verification message is sent before the first verification message;

[0153] The verification unit 403 is also used for:

[0154] verifying the second node according to the identity certificate;

[0155] Determining whether the certificate list of the first node includes the identity certificate;

[0156] If it is determined that the certificate list of the first node does not include the identity certificate, a certificate identifier corresponding to the identity certificate is generated according to the identity certificate, and the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node.

[0157] In an optional example, the apparatus further includes a storage unit 404 (not shown in the figure), configured to:

[0158] storing the certificate list of the first node in a cache of the first node; and / or

[0159] The certificate list of the first node is stored in a local database of the first node.

[0160] See also Figure 8 , Figure 8 A blockchain transaction delivery device is provided in an embodiment of the present application. Figure 8 As shown, the blockchain transaction delivery device 500 includes:

[0161] A determining unit 501 is used to determine whether the certificate list of the second node includes its own identity certificate;

[0162] The generating unit 502 is configured to obtain a certificate identifier corresponding to the self-identity certificate if it is determined that the certificate list includes the self-identity certificate, and generate a first verification message including the certificate identifier;

[0163] The sending unit 503 sends the first verification message to the first node.

[0164] In an optional example, after determining whether the certificate list of the second node includes its own identity certificate, the generating unit 502 is further configured to:

[0165] If it is determined that the certificate list of the second node does not include its own identity certificate, obtaining the second node's own identity certificate from outside the certificate list, and generating a second verification message including the own identity certificate;

[0166] Send the second verification message to the first node.

[0167] It can be seen that in the blockchain transaction delivery device provided in the embodiment of the present application, when it is determined that the certificate list of the second node includes its own identity certificate, the certificate identifier corresponding to its own identity certificate is obtained, and a first verification message including the certificate identifier is generated, and finally the first verification message is sent to the first node. In this process, after determining that the certificate list of the second node includes its own identity certificate, the first verification message sent to the first node includes the certificate identifier corresponding to its own identity certificate instead of the certificate itself, which can effectively reduce the amount of data processing when generating the first verification message and improve the generation and sending efficiency of the first verification message. This method improves the efficiency of generating and sending the first verification message for transaction verification as a whole.

[0168] In an optional example, in terms of obtaining the certificate identifier corresponding to the own identity certificate, the generating unit 502 is further specifically configured to:

[0169] A hash operation is performed on the identity certificate to obtain a certificate identifier corresponding to the identity certificate.

[0170] In an optional example, the generating unit 502 is further specifically configured to:

[0171] Obtaining the identity certificate and private key corresponding to the second node;

[0172] Obtaining a sent message of the second node, encrypting the sent message or a digest of the sent message using the private key, and obtaining a signature corresponding to the second node;

[0173] Generate a first verification message for the second node according to the signature, the sent message and the content of the certificate field, wherein the content of the certificate field includes the certificate identifier; or

[0174] A second verification message of the second node is generated according to the signature, the sending message and the content of the certificate field, wherein the content of the certificate field includes the self-identity certificate.

[0175] It should be noted that each unit of the above-mentioned blockchain transaction verification device and blockchain transaction delivery device is used to execute the relevant steps of the above-mentioned method.

[0176] In this embodiment, the apparatus 400 and the apparatus 500 are presented in the form of a unit. The "unit" here may refer to an application-specific integrated circuit (ASIC), a processor and a memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions. In addition, the above receiving unit 401, the acquisition unit 402 and the verification unit 403, or the determination unit 501, the generation unit 502 and the sending unit 503 can be Fig. 9 The processor 601 of the device 600 shown is implemented.

[0177] like Fig. 9 As shown, the device 600 can be Fig. 9 The device 600 includes at least one processor 601, at least one memory 602 and at least one communication interface 603. The processor 601, the memory 602 and the communication interface 603 are connected through the communication bus and communicate with each other.

[0178] The processor 601 may be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.

[0179] The communication interface 603 may be used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.

[0180] The memory 602 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0181] The memory 602 is used to store application code for executing the above solution, and the execution is controlled by the processor 601. The processor 601 is used to execute the application code stored in the memory 602.

[0182] The code stored in the memory 602 can execute the blockchain transaction verification method and blockchain transaction delivery method provided above. For example: the second node determines whether the certificate list of the second node includes its own identity certificate; if it is determined that the certificate list includes its own identity certificate, the certificate identifier corresponding to the identity certificate is obtained, and a first verification message including the certificate identifier is generated; the first verification message is sent to the first node. The first node receives the first verification message sent by the second node, and parses the first verification message to obtain the certificate field content, the certificate field content includes the certificate identifier; obtains the identity certificate corresponding to the certificate identifier from the certificate list of the first node, the certificate list includes multiple certificate identifiers and the identity certificate corresponding to each of the multiple certificate identifiers; the second node is verified according to the identity certificate.

[0183] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, includes part or all of the steps of any one of the blockchain transaction verification methods and blockchain transaction delivery methods recorded in the above method embodiments.

[0184] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

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

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

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

[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0190] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0191] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A blockchain transaction verification method, characterized in that: Applied to a first node in a blockchain system, the method comprises: Receiving a first message sent by a second node, wherein the first message includes a certificate identifier; Acquire the identity certificate corresponding to the certificate identifier from the certificate list of the first node, wherein the certificate list includes a correspondence between the certificate identifier and the identity certificate; The second node is authenticated according to the identity certificate.

2. The method according to claim 1, characterized in that The method further comprises: receiving a second message sent by a second node, wherein the second message includes an identity certificate; verifying the second node according to the identity certificate; If the certificate list of the first node does not include the identity certificate, a certificate identifier corresponding to the identity certificate is generated according to the identity certificate, and the identity certificate and its corresponding certificate identifier are added to the certificate list of the first node.

3. The method according to claim 1 or 2, characterized in that: Before obtaining the identity certificate corresponding to the certificate identifier from the certificate list of the first node, the method further includes: storing the certificate list of the first node in a cache of the first node; and / or The certificate list of the first node is stored in a local database of the first node.

4. A blockchain transaction method, characterized in that: Applied to a second node in a blockchain system, the method comprises: Obtaining a certificate identifier corresponding to the self-identity certificate of the second node, and generating a first message including the certificate identifier, wherein the self-identity certificate is an identity certificate issued by a certificate authority CA to the second node; The first message is sent to the first node.

5. The method according to claim 4, characterized in that Before generating the first message including the certificate identification, the method further includes: generating a second message including the self-identity certificate; The second message is sent to the first node.

6. The method according to claim 4 or 5, characterized in that: The step of obtaining the certificate identifier corresponding to the own identity certificate includes: A hash operation is performed on the identity certificate to obtain a certificate identifier corresponding to the identity certificate.

7. The method according to claim 4, characterized in that The method further comprises: Obtaining the identity certificate and private key corresponding to the second node; Obtaining a sent message of the second node, encrypting the sent message or a digest of the sent message using the private key, and obtaining a signature corresponding to the second node; Generate a first message for the second node according to the signature, the send message and the content of the certificate field, wherein the content of the certificate field includes the certificate identifier; or A second message for the second node is generated according to the signature, the sending message and the content of the certificate field, wherein the content of the certificate field includes the self-identity certificate.

8. An electronic device, characterized in that: include: A memory storing executable program code, and a processor coupled to the memory; The processor calls the executable program code stored in the memory, so that the device executes the method according to any one of claims 1 to 3.

9. An electronic device, characterized in that: include: A memory storing executable program code, and a processor coupled to the memory; The processor calls the executable program code stored in the memory, so that the device executes the method according to any one of claims 4 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, enables the method according to any one of claims 1 to 3 to be implemented, or enables the method according to any one of claims 4 to 7 to be implemented.

11. A computer program, characterized in that When the computer program is executed, the method according to any one of claims 1 to 3 is implemented, or the method according to any one of claims 4 to 7 is implemented.