Block chain transaction processing method, related device and medium
Through the target consensus network, transactions are acquired and verified in the blockchain hierarchical consensus system, the problem that local consensus networks are difficult to query transactions on-chain results is solved, and trusted blockchain result interaction is achieved.
Patent Information
- Application Number
- CN202310566770.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2024-11-22
AI Technical Summary
In the blockchain hierarchical consensus system, it is difficult for local consensus networks to verify and query the on-chain results of certain types of transactions without reading the target blockchain information, resulting in a decrease in trust.
The target block is obtained from the first blockchain through the target consensus network, and the target transaction and block header are obtained. Verification is carried out on the chain based on transactions, verification information and block header. If the verification is successful, the transaction result data is obtained and sent to the subscription node .
It is realized that without reading the target blockchain information, the local consensus network can trustworthyly obtain transaction result data, which improves the interaction security and trust of the on-chain results.
Smart Images

Figure CN119003099A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain, and in particular to a blockchain transaction processing method, related devices and media. Background Art
[0002] In the current blockchain hierarchical consensus system, the local consensus network performs plaintext blockchain operations for locally generated transactions. However, for security reasons, some types of transactions do not want to be known to third parties in plaintext on the blockchain. Therefore, transactions of the target type that are not wanted to be made public in plaintext on the blockchain are sent to the target consensus network and recorded on the target blockchain, which prohibits external access to the target consensus network. However, due to the characteristic of the target blockchain prohibiting external access, the local consensus network is difficult to verify and query. How to interact with trusted on-chain results without reading the target blockchain information has become a difficult problem. Summary of the invention
[0003] The disclosed embodiments provide a blockchain transaction processing method, related devices, and media, which can perform trusted on-chain result interaction without reading target blockchain information.
[0004] According to one aspect of the present disclosure, a blockchain transaction processing method is provided, the blockchain transaction processing method being executed by a target consensus network, the blockchain transaction processing method comprising:
[0005] Obtaining an added first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is used to record a first transaction of a target type from a local consensus network, and the first blockchain prohibits access from outside the target consensus network;
[0006] Obtaining a first target transaction and a first block header from the first target block;
[0007] Acquire first verification information corresponding to the first target transaction;
[0008] Based on the first target transaction, the first verification information and the first block header, perform on-chain verification of the first target transaction;
[0009] If the on-chain verification is successful, obtaining the transaction result data of the first target transaction;
[0010] The transaction result data is sent to a subscribing node so that the local consensus network can obtain it from the subscribing node.
[0011] According to one aspect of the present disclosure, a blockchain transaction processing device is provided, the blockchain transaction processing device is located in a target consensus network, and the blockchain transaction processing device includes:
[0012] A first acquisition unit is configured to acquire an added first target block from each first block of a first blockchain, wherein the first block is generated by the target consensus network and is configured to record a first transaction of a target type from a local consensus network, and the first blockchain is prohibited from being accessed by anyone outside the target consensus network;
[0013] A second acquisition unit, configured to acquire a first target transaction and a first block header from the first target block;
[0014] A third acquisition unit, configured to acquire first verification information corresponding to the first target transaction;
[0015] An on-chain verification unit, configured to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header;
[0016] A fourth acquisition unit, configured to acquire transaction result data of the first target transaction if the on-chain verification is successful;
[0017] The first sending unit is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.
[0018] Optionally, the on-chain verification includes a first sub-verification and a second sub-verification;
[0019] The on-chain verification unit is specifically used for:
[0020] Obtaining a second block header of a next block of the first target block on the first blockchain;
[0021] Perform a first sub-verification based on the first block header and the second block header;
[0022] Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.
[0023] Optionally, the block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain;
[0024] The on-chain verification unit is also specifically used for:
[0025] If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.
[0026] Optionally, the third acquiring unit is specifically used to:
[0027] Generate a first tree, the first tree includes multiple layers of features, wherein the bottom layer of features of the first tree is the summary value of multiple first transactions in the first target block, the multiple first transactions include the first target transaction; two adjacent features of each layer of the first tree are connected to and generate a feature of a higher layer, until a first tree root feature of the first tree is generated, the first tree root feature is the summary value of the first block body;
[0028] Acquire a first bypass feature of a first path as the first verification information, wherein the first path is a path between the summary value of the first target transaction on the first tree and the first tree root feature, and the first bypass feature is a next-layer feature to which other features on the first path except the summary value of the first target transaction are connected;
[0029] The on-chain verification unit is also specifically used for:
[0030] determining a digest value of the first target transaction;
[0031] Determine a second tree root feature of the first tree based on the summary value of the first target transaction and the first verification information;
[0032] If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.
[0033] Optionally, the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key;
[0034] The second acquisition unit is specifically configured to: decrypt the first target block in the first secure execution space using the first key to obtain a decrypted first target block, and obtain the first target transaction and the first block header from the decrypted first target block;
[0035] The on-chain verification unit is further specifically configured to: in the first secure execution space, call a first sub-verification contract recorded on the first blockchain, and perform a first sub-verification based on the first block header and the second block header;
[0036] The on-chain verification unit is also specifically used to: in the first secure execution space, call the second sub-verification contract recorded on the first blockchain, and perform a second sub-verification based on the first target transaction, the first verification information and the first block header.
[0037] Optionally, after obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing device further includes:
[0038] A fifth acquiring unit, configured to acquire first blockchain height information of the first blockchain;
[0039] A second sending unit, configured to forward the first blockchain height information to a global consensus network, so that the global consensus network synchronizes the first blockchain height information to the local consensus network;
[0040] The first sending unit is specifically used to send the transaction result data to a subscription node, so that the local consensus network can obtain the transaction result data from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.
[0041] Optionally, the first transaction of the target type is acquired by the first relay node and sent to the target consensus network in the following manner:
[0042] Determining a transaction type of the first transaction generated by the local consensus network;
[0043] If the transaction type is a non-target type, keeping the first transaction in the local consensus network, and recording the first transaction in a second blockchain by the local consensus network, wherein the second blockchain allows access outside the local consensus network;
[0044] If the transaction type is the target type, the first transaction is obtained and sent to the target consensus network.
[0045] Optionally, the first acquiring unit is specifically configured to:
[0046] Setting a first blockchain height counter, wherein when one of the first blocks is added to the first blockchain, the first blockchain height counter increases by 1;
[0047] If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last obtained reaches a first threshold, the first block on the first blockchain from the first block height of the second value plus 1 to the first block with the first value as the first target block is obtained as the first target block;
[0048] If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.
[0049] Optionally, before obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing device further includes:
[0050] A first receiving unit, configured to receive a first subscription request from the subscription node, wherein the first subscription request has a first subscription condition;
[0051] The first acquisition unit is further specifically configured to:
[0052] Obtaining the first block added to the first blockchain;
[0053] If the added first block contains a first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.
[0054] Optionally, the first subscription request also includes a subscription period;
[0055] The first acquisition unit is further specifically configured to:
[0056] Determine a valid subscription request in which the subscription period has not expired in the first subscription request;
[0057] If the added first block contains a first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.
[0058] Optionally, before receiving the first subscription request from the subscription node, the blockchain transaction processing apparatus further includes:
[0059] A second receiving unit is configured to receive a registration request from the subscription node, wherein the registration request carries a private key of the subscription node; and record the private key of the subscription node on the first blockchain;
[0060] The first subscription request includes the private key of the subscription node;
[0061] After receiving the first subscription request of the subscription node, the blockchain transaction processing apparatus further includes:
[0062] A private key verification unit is used to verify that the private key included in the first subscription request is consistent with the private key recorded on the first blockchain.
[0063] Optionally, the subscription nodes are multiple subscription nodes corresponding to multiple transaction subtypes, and the first subscription condition is the transaction subtype corresponding to the subscription node;
[0064] The first sending unit is further specifically configured to send the transaction result data to the subscription node corresponding to the transaction subtype.
[0065] Optionally, the first transaction in the first block includes an associated object identifier, the subscription nodes are multiple subscription nodes corresponding to multiple object sets, and the first subscription condition is that the associated object identifier of the first transaction belongs to the object set corresponding to the subscription node;
[0066] The first sending unit is further specifically configured to send the transaction result data to the subscription node corresponding to the associated object identifier.
[0067] Optionally, the second acquisition unit is further specifically configured to: if the number of the first transactions that meet the first subscription condition among the plurality of first transactions is greater than 1, acquire the first transactions that meet the first subscription condition in a predetermined order as the first target transaction, wherein the predetermined order is determined in the following manner:
[0068] Determining a first priority of an object associated with the first transaction;
[0069] Determine a second priority of the subscription node corresponding to the first subscription condition;
[0070] The predetermined order is determined according to the first priority and the second priority.
[0071] Optionally, the second acquiring unit is further specifically configured to:
[0072] determining a first score for the first transaction according to the first priority;
[0073] determining a second score for the first transaction according to the second priority;
[0074] determining a total score for the first transaction based on the first score and the second score;
[0075] The predetermined order is determined based on the total score of the first transaction.
[0076] Optionally, the transaction result data is a variable affected after the execution of the first target transaction;
[0077] The fourth acquisition unit is specifically configured to: if the on-chain verification succeeds, acquire the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables;
[0078] The first sending unit is also specifically used to: send the variable and the second verification information to the subscribing node, so that the subscribing node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, stores the variable for the local consensus network to obtain from the subscribing node.
[0079] Optionally, the fourth acquiring unit is further specifically configured to:
[0080] Generate a second tree, the second tree includes multiple layers of features, wherein the bottom layer of features of the second tree is a summary value of the variable affected after each of the first transactions is executed, and each of the first transactions includes the first target transaction; two adjacent features of each layer of the second tree are connected to and generate a feature of a higher layer, until a third root feature of the second tree is generated;
[0081] Acquire a second bypass feature of a second path, together with the third tree root feature, as the second verification information, wherein the second path is a path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the third tree root feature, and the second bypass feature is a next-layer feature to which other features on the second path, except for the variable affected by the execution of the first target transaction, are connected;
[0082] The first sending unit is further specifically configured to:
[0083] Determining a fourth tree root feature of the second tree according to the summary value of the variable and the second bypass feature;
[0084] If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.
[0085] Optionally, the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space;
[0086] The first sending unit is further specifically configured to:
[0087] Encrypting the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data;
[0088] The first encrypted transaction result data is sent to the subscription node, so that the subscription node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain second encrypted transaction result data, and in response to a transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.
[0089] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the blockchain transaction processing method as described above is implemented.
[0090] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the blockchain transaction processing method as described above is implemented.
[0091] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain transaction processing method as described above.
[0092] In the disclosed embodiment, the target consensus network obtains the first target transaction, the first verification information corresponding to the first target transaction, and the first block header of the first target block added to the first blockchain, and verifies whether the first target transaction is truly on the chain. After the verification is successful, the transaction result data is obtained and sent to the subscription node for query by the local consensus network. In this way, the local consensus network obtains the transaction result data without reading the target blockchain information and without reducing the security of the target blockchain data, thereby realizing a trusted on-chain result interaction while ensuring the security of the target blockchain information.
[0093] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0095] Figure 1 It is a schematic diagram of the system architecture of a blockchain hierarchical consensus network to which an embodiment of the present disclosure is applied;
[0096] Figure 2 It is a schematic diagram of a blockchain transaction processing method according to an embodiment of the present disclosure applied to a resource transfer transaction on-chain scenario;
[0097] Figure 3 is a flowchart of a blockchain transaction processing method according to an embodiment of the present disclosure;
[0098] Figure 4 yes Figure 3 Step 310 uses the first blockchain height counter to obtain a first flow chart of the first target block;
[0099] Figure 5A Shows Figure 4 A schematic diagram of an implementation process of step 420;
[0100] Figure 5B Shows Figure 4 A schematic diagram of an implementation process of step 430;
[0101] Figure 6 Shows Figure 3 In step 310, a second flow chart of obtaining a first target block using a first blockchain height counter is provided;
[0102] Figure 7 Shows Figure 6 A schematic diagram of an implementation process of step 610;
[0103] Figure 8 Shows Figure 3 Step 310 is a flowchart of obtaining a first target block using a subscription condition;
[0104] Fig. 9A A schematic diagram of a data structure of a first subscription request with a first subscription condition is shown;
[0105] Fig. 9B A schematic diagram of a data structure of a first subscription request with a first subscription condition and a subscription period is shown;
[0106] Fig.10 is a flow chart of obtaining a first subscription request based on integration of multiple second subscription requests;
[0107] Fig.11 A schematic diagram of a data structure of a second subscription request with a second subscription condition is shown;
[0108] Fig.12 A schematic diagram of an implementation process of generating a first subscription condition based on multiple second subscription conditions is shown;
[0109] Fig.13 A schematic diagram of an implementation process of sending transaction result data to subscription nodes corresponding to different transaction subtypes is shown;
[0110] Fig.14 A schematic diagram of an implementation process of sending transaction result data to subscription nodes corresponding to different object sets is shown;
[0111] Fig.15 is a flow chart for obtaining a first transaction based on a first priority and a second priority;
[0112] Fig.16 A schematic diagram of an implementation process of acquiring a first transaction based on a first priority and a second priority is shown;
[0113] Fig.17 yes Fig.15 A flowchart of an implementation process of step 1520;
[0114] Fig.18 yes Figure 3 A flowchart of an implementation process of step 340;
[0115] Fig.19 A schematic diagram of an implementation process of performing a first sub-verification based on a first block header is shown;
[0116] Fig. 20 yes Fig.18 A flowchart of an implementation process of step 1830;
[0117] Fig.21A Shows Fig. 20 A schematic diagram of an implementation process of generating a first tree in step 2010;
[0118] Fig. 21B Shows Fig. 20 Step 220 obtains a schematic diagram of a first bypass feature of a first path;
[0119] Fig. 22 yes Figure 3 Step 340 is a flowchart of an implementation process using a trusted execution environment;
[0120] Fig.23 yes Figure 3 A flowchart of an implementation process of step 360;
[0121] Fig.24 is a flowchart of a blockchain transaction processing method according to another embodiment of the present disclosure;
[0122] Fig.25 is a flowchart of a blockchain transaction processing method according to another embodiment of the present disclosure;
[0123] Fig.26 yes Fig.25 A flowchart of an implementation process of steps 2510-2520;
[0124] Fig.27A Shows Fig.26 A schematic diagram of an implementation process of generating a first tree in step 2610;
[0125] Fig.27B Shows Fig.26 In step 2620, a schematic diagram of a first bypass feature of a first path is obtained;
[0126] Fig.28 yes Figure 3 Step 360 is a flowchart of an implementation process using a trusted execution environment;
[0127] Fig.29 is a multi-terminal interaction diagram of a detailed embodiment of the present disclosure;
[0128] Fig.30 is a module diagram of a blockchain transaction processing device according to an embodiment of the present disclosure;
[0129] Fig.31 According to the embodiment of the present disclosure Figure 3 The terminal structure diagram of the blockchain transaction processing method shown;
[0130] Fig.32 According to the embodiment of the present disclosure Figure 3 Server structure diagram of the blockchain transaction processing method shown. DETAILED DESCRIPTION
[0131] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0132] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0133] Artificial intelligence: It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain target results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0134] Blockchain: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission (P2P network), consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of its information (anti-counterfeiting) and associate with the previous block.
[0135] P2P network: a point-to-point network. P2P network is based on a specific type of network protocol. There is no need for a central node to maintain the network status between network nodes. Instead, each node maintains the node status of the entire network or the connection status of its adjacent nodes through broadcast interaction with adjacent nodes.
[0136] The blockchain hierarchical consensus system includes a local consensus network and a global consensus network. The consensus nodes in the local consensus network perform blockchain operations for local transactions (for example, transactions generated by a branch of a group), and the global consensus network performs blockchain operations for global transactions summarized from local transactions (for example, group transactions summarized from branch transactions). The local consensus network and the global consensus network have different blockchains for on-chain operations, thereby achieving hierarchical governance. In this way, the global consensus network does not need to handle a large number of local transactions and can focus on global governance.
[0137] In the current blockchain hierarchical consensus system, the local consensus network performs plaintext blockchain operations for locally generated transactions. However, for security reasons, some types of transactions do not want to be known to third parties in plaintext on the blockchain. Therefore, transactions of the target type that are not wanted to be made public in plaintext on the blockchain are sent to the target consensus network and recorded on the target blockchain, which prohibits external access to the target consensus network. However, due to the characteristic of the target blockchain prohibiting external access, the local consensus network is difficult to verify and query. How to interact with trusted on-chain results without reading the target blockchain information has become a difficult problem.
[0138] System architecture and scenario description of the application of the embodiments of the present disclosure
[0139] See also Figure 1 The blockchain hierarchical consensus network shown, the blockchain hierarchical consensus network refers to a blockchain network for hierarchical consensus on transactions, and the blockchain hierarchical consensus network includes a business node, a local consensus network, a core consensus network, a first relay node, and a subscription node. A business node refers to a node that generates a local transaction, does not go on the blockchain, but witnesses the on-chain of the local transaction. A local transaction refers to a transaction that only affects the local scope. For example, the resource-related affairs of a branch of a certain group are local affairs. The local consensus network refers to a network that reaches consensus on local transactions and goes on the chain. It includes multiple local consensus nodes. The core consensus network refers to a network that reaches consensus on global transactions and target transactions and goes on the chain, and the core consensus network includes a global consensus network, a target consensus network, and a second relay node. The global consensus network refers to a network that reaches consensus on global transactions derived from local transactions and goes on the chain. It includes multiple global consensus nodes. A global transaction refers to a transaction whose nature affects the global scope. For example, the transaction that the group summarizes the resource transfer of its branches is a global transaction. The target consensus network refers to a network that reaches consensus on the target transaction and goes on the chain, and it records the target transaction on the first blockchain. The target transaction refers to a transaction that is not intended to be accessed and known by a third party. The first blockchain is a blockchain that specifically records blocks of transactions that are not intended to be accessed and known by a third party, and the first blockchain is not intended to be accessed by the outside world. If you want to obtain verification information of the blocks recorded on the first blockchain, you can only do so by requesting the target consensus node in the target consensus network that records the first blockchain.
[0140] Since the target transaction is a transaction that is not intended to be accessed or known by a third party, the consent of the object that generated the target transaction must be sought before the target transaction is put on the chain. Specifically, when the object generates the target transaction and sends it to the local consensus network for on-chain, a query box can be displayed to the object to ask whether the object agrees to put the target transaction on the chain. If the object disagrees, the implementation method cannot be implemented, or only the part of the transaction that agrees to be put on the chain can be put on the chain.
[0141] The first relay node is the interface node between the local consensus node and the global consensus node. It forwards the local transactions generated by the local consensus network to the global consensus network, which aggregates the local transactions into global transactions and puts the global transactions on the chain. The second relay node is the interface node between the target consensus network and the global consensus network. It forwards the blockchain height information generated after the local transactions of the target type are recorded in the blockchain to the global consensus network, which is forwarded by the global consensus network to the local consensus network to notify the local consensus network that the local transactions of the target type have been successfully put on the chain. The subscription node is the interface node between the local consensus network and the target consensus network. It obtains the transaction result data generated after the local transactions of the target type are recorded in the target blockchain from the target consensus network and sends it to the local consensus network.
[0142] It should be noted that the target consensus node, the local consensus node, and the global consensus node are all consensus nodes, also known as blockchain nodes. The consensus node or blockchain node can be a server in the blockchain network or a user terminal connected to the blockchain network. The specific form of the consensus node or blockchain node is not limited here. The first relay node and the second relay node are both interface nodes. The first relay node and the second relay node can be an independent device, such as a separate computer or server. It can also be a part of an independent device, such as a virtual machine divided on a server. The specific form of the first relay node and the second relay node is not limited here.
[0143] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2 The scenario of resource transfer transactions being put on chain as shown.
[0144] See also Figure 2 , Figure 2 and Figure 1 The difference is that Figure 2 The second blockchain maintained by the local consensus network and the first blockchain maintained by the target consensus network are also shown. The second blockchain and the first blockchain are both the blockchains recorded above. The specific process of recording local transactions to the second blockchain is as follows:
[0145] Generally, a business node generates a local transaction based on the operation behavior of an object, and sends the local transaction and the digital signature of the business node to the neighboring local consensus node on the local consensus network, so that the local consensus node can verify the authenticity of the local transaction. During verification, the local consensus node verifies the digital signature using the public key of the business node to obtain the first summary value of the local transaction, and calculates the summary of the local transaction according to the summary algorithm to obtain the second summary value of the local transaction. The first summary value and the second summary value are compared. If the first summary value and the second summary value are the same, the verification is passed and the local transaction is a real transaction generated by the business node.
[0146] After verification, local transactions and other local transactions sent by business nodes are accumulated. When the accumulation reaches a certain level (for example, the number of accumulated transactions reaches a certain threshold, or the accumulation time reaches a certain threshold), these local transactions are packaged into local blocks and sent to other target consensus nodes in the local consensus network for consensus. After consensus is successful, each local consensus node records the local block on the second blockchain maintained by each local consensus node.
[0147] Continue to see Figure 2 The second blockchain consists of three local blocks, and two local transactions are recorded on local blocks 1-2, namely "A001, Company A received 500 resources in May" and "A002, Company A received 300 resources in May". These two local transactions on the second blockchain are forwarded to the global consensus node of the global consensus network through the first relay node. The global consensus node generates a global transaction based on these two local transactions, for example, "Company A received a total of 800 resources in invoice resources in May", and then generates a third block for the global transaction, and the third block is recorded on the third blockchain. The specific process of recording global transactions on the third blockchain is similar to the specific process of recording local transactions on the second blockchain, and will not be repeated here.
[0148] Continue to participate Figure 2 The first blockchain consists of two first blocks. The first block 1-2 records two target transactions, namely "Company A transfers 100 resources to Company B in May" and "Company A transfers 200 resources to Company C in May". Since these two target transactions involve resource transfers between different companies and are not allowed to be disclosed to the outside world, they are recorded on the first blockchain. The first blockchain is not accessible to the outside world, which improves the security of the target transaction on the chain. The specific process of recording the target transaction on the first blockchain is similar to the specific process of recording the local transaction on the second blockchain mentioned above, and will not be repeated here.
[0149] However, due to the fact that the first blockchain prohibits external access, the local consensus network cannot interact with the target consensus network to obtain the on-chain results without leaking the first blockchain information. That is, the local consensus network cannot synchronize the on-chain results of the target transaction, so the object that requests to upload the target transaction to the chain cannot know whether the target transaction has been truly uploaded to the first blockchain by the target consensus network, which affects the object's trust in the real on-chain of the target transaction.
[0150] General description of the disclosed embodiments
[0151] According to one embodiment of the present disclosure, a blockchain transaction processing method is provided.
[0152] This blockchain transaction processing method is generally used in business scenarios where transaction data does not want to be known to the outside world, such as Figure 2 The scenario of resource transfer transaction on-chain shown. Transactions that are not desired to be known to the outside world are called target transactions. The disclosed embodiment provides a solution in which the target consensus network uniformly executes and records target transactions and sends transaction result data to subscribed nodes, which can improve the security of target transaction on-chain and realize the interaction of on-chain results. The blockchain transaction processing method is executed by the target consensus network, for example, by the target consensus node in the target consensus network.
[0153] like Figure 3 As shown, a blockchain transaction processing method according to an embodiment of the present disclosure may include:
[0154] Step 310: Obtain an added first target block from each first block of the first blockchain;
[0155] Step 320: Obtain a first target transaction and a first block header from the first target block;
[0156] Step 330: Obtain first verification information corresponding to the first target transaction;
[0157] Step 340: Based on the first target transaction, the first verification information and the first block header, perform on-chain verification of the first target transaction;
[0158] Step 350: If the on-chain verification is successful, obtain the transaction result data of the first target transaction;
[0159] Step 360: Send the transaction result data to the subscribing node for the local consensus network to obtain from the subscribing node.
[0160] Steps 310 - 360 are described in detail below.
[0161] In step 310, the first blockchain is composed of multiple first blocks, and the first blockchain prohibits access from outside the target consensus network. The first block is generated by the target consensus network and is used to record the first transaction of the target type from the local consensus network. The first transaction of the target type is the target transaction as described above. Whenever the target consensus network generates a first block based on the first transaction of the target type, a first block is added to the first blockchain, and the target consensus network obtains the first target block from the added multiple first blocks. The specific process of obtaining the first target block will be described in detail below.
[0162] In step 320, each first target block includes a first block header and a first block body. The first block body stores multiple first transactions of the target type, so the first block header can be obtained from the first target block, and the first target transaction can be obtained from the multiple first transactions of the target type stored in the first block body.
[0163] In step 330, the first verification information is information used to verify that the target consensus network actually puts the local transaction on the chain.
[0164] In some embodiments, the setting of the acquisition period of the first verification information includes but is not limited to the following situations:
[0165] (1) After discovering the target consensus network and obtaining the first target transaction, immediately obtain the first verification information;
[0166] (2) According to the acquisition cycle preset by the target consensus network, after the target consensus network acquires the first target transaction and after the acquisition cycle has passed, the first verification information is acquired. For example, if the acquisition cycle preset by the target consensus network is 1 hour, if it is found that the target consensus network acquires the first target transaction at 7:00 a.m. on the same day, the first verification information is acquired at 8:00 a.m. on the same day.
[0167] The method for obtaining the first verification information will be introduced together with step 340 in the detailed description of step 340 below.
[0168] In step 340, the on-chain verification of the first target transaction refers to verifying whether the target consensus network actually puts the first target transaction on the chain. The specific on-chain verification process will be introduced in the detailed description of step 340 below.
[0169] In step 350, if the on-chain verification is successful, it means that the target consensus network has truly on-chained the first target transaction, and at this time the target consensus network obtains the transaction result data of the first target transaction. Transaction result data refers to the data generated after the target consensus network executes the first target transaction. The transaction result data can be a successful on-chain result, which means that the first target transaction has been successfully on-chained. For example, if the first target transaction is "Company A transfers 100 resources to Company B in May", the corresponding transaction result data is "100 resources have been successfully transferred".
[0170] In step 360, the transaction result data is sent to the subscription node, which is located between the local consensus network and the target consensus network and is a module for receiving transaction result data from the target consensus network and forwarding it to the local consensus network. The subscription node can be an independent device, such as a separate computer or server, or a part of an independent device, such as a virtual machine partitioned from a server.
[0171] In one embodiment, the local consensus network obtains transaction result data from the subscribing node in the following ways, including but not limited to:
[0172] (1) After the subscribing node receives the transaction result data, the subscribing node can actively send the transaction result data to the local consensus network so that the local consensus network can obtain the transaction result data.
[0173] (2) The local consensus network sends a request to the subscribing node to obtain the transaction result data. After the subscribing node receives the request, it sends the transaction result data to the local consensus network.
[0174] Through the above steps 310-360, the target consensus network obtains the first target transaction, the first verification information corresponding to the first target transaction, and the first block header for the first target block added to the first blockchain, and verifies whether the first target transaction is truly on the chain. After the verification is successful, the transaction result data is obtained and sent to the subscription node for query by the local consensus network. In this way, the local consensus network obtains the transaction result data without reading the target blockchain information and without reducing the security of the target blockchain data, and realizes a trusted on-chain result interaction while ensuring the security of the target blockchain information.
[0175] The above is a general description of steps 310 to 360. The following will describe in detail the specific implementation of steps 310 to 360.
[0176] Detailed description of step 310
[0177] In step 310, an added first target block is obtained from each first block of the first blockchain.
[0178] The present disclosure provides two decomposition methods for decomposing step 310. Each decomposition method describes step 310 in detail from a different perspective. The first decomposition method is described first.
[0179] In one embodiment, step 310 includes: in response to satisfying a predetermined condition, obtaining an added first target block from each first block of the first blockchain.
[0180] The predetermined condition includes at least one of the following: the difference between the current block height of the first blockchain and the block height when the first target block was last acquired reaches a first threshold, and the time difference between the current time and the time point when the first target block was last acquired reaches a second threshold. For example, in response to the difference between the current block height of the first blockchain and the block height when the first target block was last acquired reaches the first threshold, the target consensus network acquires the first target block from each first block of the first blockchain. For another example, in response to the difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the target consensus network acquires the first target block from each first block of the first blockchain. For another example, in response to the difference between the current block height of the first blockchain and the block height when the first target block was last acquired reaches the first threshold, and the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the target consensus network acquires the first target block from each first block of the first blockchain.
[0181] Under the above predetermined conditions, if only the difference in block height reaches the first threshold, it will affect the timeliness of acquisition, resulting in some transactions not being able to be verified on the chain for a long time. If only the time difference reaches the second threshold, although the timeliness is guaranteed, it may cause the number of first blocks contained in the first target block to be too small each time, wasting network resources. Similarly, if the difference in block height reaches the first threshold and the time difference reaches the second threshold at the same time, there is a possibility that the time difference has met the second threshold, but the difference in block height has not been able to reach the first threshold, which still affects the timeliness of acquisition. In addition, it is a waste of processing resources for the target consensus network to keep detecting the height of the first blockchain, which is not conducive to improving processing efficiency.
[0182] Therefore, in one embodiment, referring to Figure 4 , step 310 specifically includes:
[0183] Step 410: Setting a first blockchain height counter, wherein when a first block is added to the first blockchain, the first blockchain height counter increases by one;
[0184] Step 420: If the difference between the current first value of the first blockchain height counter and the second value when the last increased first target block was obtained reaches a first threshold, obtain the first block on the first blockchain from the first block with a block height of the second value plus 1 to the first block with a block height of the first value as the first target block;
[0185] Step 430: If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.
[0186] Steps 410 - 430 are described in detail below.
[0187] In step 410, the first blockchain height counter refers to a module for counting the height of the first blockchain, the height of the first blockchain refers to the number of the first block, and the first blockchain height counter represents the number of the first block with a first value. For example, see Figure 5A , the first blockchain includes the first block 1 and the first block 2, the number of first blocks is 2, so the current first value of the first blockchain height counter is 2; after the first blockchain adds a first block, the first blockchain also includes the first block 3, the number of first blocks is 3, so the current first value of the first blockchain height counter is 3.
[0188] In step 420, the first value refers to the current value of the first blockchain height counter, and the second value refers to the value when the last added first target block was obtained. If the difference between the first value and the second value reaches the first threshold, it means that the target consensus network needs to verify the first target transaction on the chain, so it is necessary to obtain the first block on the first blockchain from the first block with a block height of the second value plus 1 to the first block with a block height of the first value as the first target block.
[0189] For example, see Figure 5A , assuming that the first threshold is 2, and the second value is 1 (that is, the first target block obtained last time is the first block 1). When the first blockchain includes the first block 1 and the first block 2, the first value is 2; the difference between the first value and the second value is 1 (2-1=1), 1 is less than 2, so the first threshold is not reached, and the first target block cannot be obtained. After a first block is added to the first blockchain, the first value is 3; the difference between the first value and the second value is 2 (3-1=2), 2 is equal to 2, so the first threshold is reached; then the first block 2 and the first block 3 on the first blockchain need to be obtained as the first target block. Note that after obtaining the first block 3, the second value is updated to 3.
[0190] Next, in step 430, unlike step 420 which considers the first threshold, step 430 considers the influence of the time difference when the first threshold is not reached to improve the acquisition efficiency. Specifically, under the premise that the first threshold is not reached, but the time difference between the current time and the time point when the added first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.
[0191] For example, see Figure 5B , assuming that the first threshold is 3, the second threshold is 2 hours, the first value is 1, and the time point when the first target block was last acquired was 8 am on the same day. Then, when the first blockchain includes the first block 1 and the first block 2, the difference between the first value and the second value (2-1) does not reach the first threshold (3), and the time difference between the current time (9 am on the same day) and the time point when the first target block was last acquired (9-8=1 hour) does not reach the second threshold (2 hours), then the first target block cannot be obtained.
[0192] Continue to see Figure 5B , after the first blockchain adds another first block, the first blockchain also includes the first block 3. At this time, the difference between the first value and the second value (3-1) does not reach the first threshold (3), but the time difference between the current time and the time point when the first block 1 was last obtained (10-8=2 hours) has reached the second threshold (2 hours). Then, the first block 2 and the first block 3 on the first blockchain need to be obtained as the first target block. Note that after obtaining the first block 3, the second value is updated to 3.
[0193] The advantage of this embodiment is that the height of the first blockchain is detected with the help of the first blockchain height counter, which saves the processing resources of the target consensus network; combined with the difference between the first value and the second value and the time difference, the number of first blocks obtained each time will not be too small, wasting processing resources, and timeliness is taken into account, so that some first blocks will not be unable to be verified on the chain for a long time.
[0194] When the above step 310 includes steps 410-430, although the block height and time difference are taken into account, the first transaction itself is not taken into account. For some first transactions that need priority chain verification, if the first block where the first transaction is located is not obtained from the first blockchain in time and the first block is not verified on the chain, the priority chain verification requirements of different first transactions cannot be met. Therefore, in one embodiment, step 310 combines the priority setting mark of the first transaction, and first takes out the first transaction with the priority setting mark set in the first block and performs chain verification to meet the priority chain verification requirements.
[0195] In the specific implementation of this embodiment, the first transaction includes a priority setting mark. Under this premise, see Figure 6 , after step 420, step 310 further includes:
[0196] Step 610: If the difference between the current first value of the first blockchain height counter and the second value when the last added first target block was obtained does not reach the first threshold, but the first block on the first blockchain from the first block with a block height of the second value plus 1 to the first block with a block height of the first value contains a first transaction with a priority set flag set, obtain the first block on the first blockchain from the first block with a block height of the second value plus 1 to the first block with a block height of the first value as the first target block.
[0197] For example, see Figure 7 , assuming that the first threshold is 3, and the second value is 1 (that is, the first target block obtained and added last time is the first block 1). When the first blockchain includes the first block 1 and the first block 2, the first block 1 includes the first block header Q1 and the first transaction L1. The first transaction L1 includes a priority setting mark and transaction content, but the priority setting mark of the first transaction L1 is not set (for example, the priority position is marked as 0). Similarly, the first block 2 includes the first block header Q2 and the first transaction L2. The first transaction L2 includes a priority setting mark and transaction content, but the priority setting mark of the first transaction L2 is also not set (for example, the priority position is marked as 0). Therefore, when the first blockchain includes the first block 1 and the first block 2, the difference between the first value and the second value (2-1) does not reach the first threshold (3), and the priority setting mark is not set, then the first target block cannot be obtained.
[0198] Continue to see Figure 7 After the first blockchain adds another first block, the first blockchain also includes a first block 3, which includes a first block header Q3 and a first transaction L3. The first transaction L3 includes a priority setting mark and transaction content, but the priority setting mark of the first transaction L3 has been set (for example, the priority position is marked as 1, in Figure 7 In this case, the difference between the first value and the second value (3-1) does not reach the first threshold (3), but the priority setting flag of the first transaction L3 is set, so the first block 2 and the first block 3 on the first blockchain are obtained as the first target block. Note that after obtaining the first block 3, the second value is updated to 3.
[0199] The advantage of this embodiment is that the priority on-chain verification requirement of the first transaction is met by means of the priority setting mark, thereby improving the flexibility of on-chain verification.
[0200] The above is a detailed description of the first decomposition method. The following is a detailed description of the second decomposition method.
[0201] In one embodiment, before step 310, the blockchain transaction processing method further includes:
[0202] Step 810: Receive a first subscription request from a subscription node, where the first subscription request has a first subscription condition;
[0203] Correspondingly, step 310 includes:
[0204] Step 820: Obtain a first block added to the first blockchain;
[0205] Step 830: If the added first block contains a first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.
[0206] Steps 810-830 are described in detail below.
[0207] In step 810, the first subscription request refers to a request sent by the subscription node to the target consensus network to subscribe to the first transaction. Fig. 9A , the first subscription request has a first source address, a first destination address, and a first subscription condition. The first source address refers to the address of the subscription node (for example, the identifier of the subscription node), and the first destination address refers to the address of the global consensus node in the target consensus network (for example, the identifier of the global consensus node). The first subscription condition refers to the personalized subscription condition of the subscription node for the first transaction recorded on the first blockchain. If the added first block contains the first target transaction that meets the first subscription condition, it means that the first block needs to be taken out and participate in the chain verification, so the first block is used as the first target block.
[0208] The specific implementation process of step 820 is similar to the above steps 410-430, and will not be repeated here to save space.
[0209] In step 830, if the added first block contains the first target transaction that meets the first subscription condition, it means that the first block contains a transaction that needs to be verified on the chain, so the added first block is obtained as the first target block. In this way, the chain verification can be carried out in time, so that after the chain verification is successful, the subscription node can timely know the transaction result data of the first target transaction.
[0210] The advantage of this embodiment is that by using the first block containing the first target transaction that meets the first subscription condition as the first target block, the number of first blocks to be verified on the chain can be reduced, saving processing resources. In addition, by determining the first subscription condition from the first subscription request sent by the subscription node, the personalized subscription requirements of the subscription node for transactions that need to be verified on the chain can be met.
[0211] See also Fig. 9B , Fig. 9B The first subscription request shown in FIG. 8 includes not only the source address, the destination address and the first subscription condition, but also the subscription period. In the case where the first subscription request also includes the subscription period, step 830 specifically includes:
[0212] Determine a valid subscription request in the first subscription request whose subscription period has not expired;
[0213] If the added first block contains the first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.
[0214] Specifically, the subscription period refers to the deadline from when the first subscription request is valid to when it is invalid. If the subscription period has not expired, it means that the first subscription request is a valid subscription request; if the subscription period has expired, it means that the first subscription request is an invalid subscription request. For example, if the subscription period is February 1 of the current year, then from the time the first subscription request is received by the target consensus network to February 1 of the current year, the first subscription request is a valid subscription request. Then, if the added first block contains a first target transaction that meets the first subscription condition of a valid subscription request, it means that the first block contains a transaction that needs to be verified on the chain and the transaction meets the first subscription condition, so the added first block is obtained as the first target block.
[0215] The advantage of this embodiment is that the subscription period can avoid the first transaction that meets the first invalidation condition from being verified on the chain, saving processing resources. In addition, by determining the subscription period from the first subscription request sent by the subscription node, the personalized subscription requirements of the subscription node for transactions that need to be verified on the chain can be further met.
[0216] See also Fig.10 In one embodiment, the first subscription request is generated by the subscription node in the following manner:
[0217] Step 1011: receiving multiple second subscription requests from the local consensus network, each second subscription request having a second subscription condition of an associated object;
[0218] Step 1012: Integrate the second subscription conditions of multiple associated objects in the multiple second subscription requests into a first subscription condition to generate a first subscription request.
[0219] Steps 1011-1012 are described in detail below.
[0220] In step 1011, the second subscription request refers to a request sent by the local consensus network to the subscription node to subscribe to the first transaction. Fig.11The second subscription request has a second source address, a second destination address, a second subscription condition, and an associated object. The second source address refers to the address of a local consensus node in the local consensus network, such as the identifier of the local consensus node. The second destination address refers to the address of the subscription node, such as the identifier of the subscription node. The second subscription condition refers to the personalized subscription condition of the associated object for the first transaction recorded on the first blockchain. The associated object refers to the object corresponding to the second subscription condition, such as the associated object is Figure 1 The business node in .
[0221] In step 1012, the subscription node integrates the second subscription conditions of the multiple associated objects into the first subscription condition. Fig.12 , the subscription node receives the second subscription conditions 1 to M, and can obtain the second subscription conditions 1 to M from the second subscription conditions 1-M, and integrates N (N is less than or equal to M) second subscription conditions to obtain the first subscription condition, and the first subscription condition has the second subscription conditions 1 to N. Note that when N is less than M, the subscription node can integrate the second subscription conditions N+1 to M to obtain a new first subscription condition, and the first subscription condition has the second subscription conditions N+1 to M.
[0222] The advantage of this embodiment is that the first subscription condition is obtained based on the integration of multiple second subscription conditions and sent to the target consensus network, which is equivalent to the subscription node sending multiple second subscription conditions together to the target consensus network. Compared with the method of sending only one second subscription condition each time through a subscription node, the number of second subscription conditions is increased and network resources are saved. At the same time, the target consensus network can process multiple second subscription conditions in batches to improve processing efficiency.
[0223] The above is a detailed description of two decomposition methods of step 310. However, in the above two decomposition methods, the blockchain hierarchical consensus network includes a subscription node as the basis. After steps 310-350, the target consensus network obtains the transaction result data, and in step 360, the transaction result data is sent to the same subscription node. However, in another embodiment, the subscription node is a plurality of subscription nodes corresponding to a plurality of transaction subtypes, and the transaction result data of different transaction subtypes need to be sent to the corresponding subscription nodes. For example, one subscription node is specifically responsible for the collection of transaction result data of electronic invoice subtype transactions, and one subscription node is specifically responsible for the collection of transaction result data of resource subtype transactions.
[0224] In a specific implementation of this embodiment, the subscription nodes are multiple subscription nodes corresponding to multiple transaction subtypes, and the first subscription condition is the transaction subtype corresponding to the subscription node; correspondingly, step 360 includes: sending the transaction result data to the subscription node corresponding to the transaction subtype.
[0225] For example, see Fig.13 , Fig.13 Two subscription nodes are shown, namely subscription node S1 and subscription node S2. Subscription node S1 corresponds to transaction subtype D1, for example, transaction subtype D1 is an electronic invoice subtype. Subscription node S2 corresponds to transaction subtype D2, for example, transaction subtype D2 is a resource subtype. Fig.13 A transaction result data is also shown. Before the transaction result data needs to be sent to the subscription node, the transaction subtype corresponding to the subscription node is first obtained through the first subscription condition, and then the transaction result data is sent to the subscription node corresponding to the transaction subtype. For example, if the transaction subtype is known from the first subscription condition as the electronic invoice subtype, the transaction result data is sent to the subscription node S1. For another example, if the transaction subtype is known from the first subscription condition as the resource subtype, the transaction result data is sent to the subscription node S2.
[0226] The benefit of this embodiment is that, through the comparison relationship between transaction subtypes and subscription nodes, the transaction result data of the same transaction subtype is effectively sent to the same subscription node, which fully meets the personalized subscription requirements of the subscription node for the target consensus network based on the first subscription condition. At the same time, the possibility of sending transaction result data to other subscription nodes that do not meet the transaction subtype comparison relationship is reduced, data leakage is reduced, and security is further improved.
[0227] In another embodiment, there are also multiple subscription nodes, but different from the above embodiment, the subscription nodes in this embodiment are multiple subscription nodes corresponding to multiple object sets. For example, one subscription node is specifically responsible for collecting transaction result data of associated objects C1-C10, and one subscription node is specifically responsible for collecting transaction result data of associated objects C11-C20.
[0228] In a specific implementation of this embodiment, the first transaction in the first block includes an associated object identifier, the subscription nodes are multiple subscription nodes corresponding to multiple object sets, and the first subscription condition is that the associated object identifier of the first transaction belongs to the object set corresponding to the subscription node; correspondingly, step 360 includes: sending the transaction result data to the subscription node corresponding to the object set to which the associated object identifier belongs.
[0229] For example, see Fig.14 , Fig.14 The first block shown has a block header and a first transaction, and the first transaction has an associated object identifier and the content of the first transaction. The associated object identifier of the first transaction is C13. The content of the first transaction is "Company A transferred 100 resources to Company B in May", and the corresponding transaction result data is "100 resources have been transferred successfully". Fig.14The first subscription condition shown includes "the associated object identifiers C01 to C10 belong to the object set J1 corresponding to the subscription node S3" and "the associated object identifiers C11 to C20 belong to the object set J2 corresponding to the subscription node S4". Fig.14 The two subscription nodes shown are subscription node S3 and subscription node S4. Subscription node S3 corresponds to object set J1, and subscription node S4 corresponds to object set J2.
[0230] Continue to see Fig.14 , before the transaction result data needs to be sent to the subscription node, the associated object identifier is known to be C13 through the first block, and C13 belongs to the object set J2 through the first subscription condition, so the subscription node S4 is determined. Then the transaction result data (the transaction result data is "100 resources have been successfully transferred") is sent to the subscription node S4 ( Fig.14 In another example, if the associated object identifier is C03, the object set J1 is determined according to C03, thereby determining the subscription node S3; then the transaction result data (transaction result data is "100 resources have been successfully transferred") needs to be sent to the subscription node S3.
[0231] The above is a detailed description of step 310 .
[0232] Detailed description of step 320
[0233] In the above step 310 decomposed into 810-830, step 830 is to obtain the added first block as the first target block when the first block contains the first target transaction that meets the first subscription condition; correspondingly, after step 310, step 320 includes: obtaining the first transaction that meets the first subscription condition from multiple first transactions of the first target block as the first target transaction.
[0234] The advantage of doing so is that even if there are multiple first transactions in the first target block, not all of them need to be acquired, which can reduce the number of acquired first transactions; and by further screening the multiple first transactions with the help of the first subscription condition, the processing efficiency can be further improved.
[0235] See also Fig.15 In one embodiment, step 320 specifically includes:
[0236] Step 1540: If the number of first transactions that meet the first subscription condition among the multiple first transactions is greater than 1, obtain the first transactions that meet the first subscription condition in a predetermined order as the first target transactions;
[0237] The predetermined order is determined in the following manner:
[0238] Step 1510: Determine the first priority of the associated object of the first transaction;
[0239] Step 1520: Determine the second priority of the subscription node corresponding to the first subscription condition;
[0240] Step 1530: Determine a predetermined order according to the first priority and the second priority.
[0241] Steps 1510-1540 are described in detail below.
[0242] In step 1510, the first priority is determined in the following ways, including but not limited to:
[0243] (1) Obtain the first tag of the associated object from the first transaction, and search the first tag and first priority comparison table according to the first tag to determine the first priority. The first tag and first priority comparison table lists the correspondence between the first tag and the first priority. The following is an example of a first tag and first priority comparison table:
[0244] First Mark First priority Very important 5 General Important 3 unimportant 1
[0245] Table 1
[0246] As shown in Table 1, for the first mark of very important, it means that the associated object is a very important object, so the first priority is set to 5. Similarly, according to the different importance of each associated object, the first priority corresponding to the first mark of general importance is set to 3, and the first priority corresponding to the first mark of unimportant is set to 1.
[0247] (2) Obtain the associated object identifier from the first transaction, determine the identifier range according to the associated object identifier, and determine the first priority by searching the identifier range and first priority comparison table according to the identifier range. The identifier range and first priority comparison table lists the corresponding relationship between the identifier range and the first priority. The following is an example of an identifier range and first priority comparison table:
[0248] Identification range First priority C01-C10 3 C11-C20 2 C21-C30 1
[0249] Table 2
[0250] As shown in Table 2, for the associated object identifiers C01-C10 in the identification range, the associated objects in the identification range may be very important objects, and the first transaction should be acquired immediately, so the first priority is set to 3. Similarly, according to the different importance of each associated object, the first priority corresponding to the identification range C11-C20 is set to 2, and the first priority corresponding to the identification range C21-C30 is set to 1.
[0251] In step 1520, the second priority level is determined in the following ways, including but not limited to:
[0252] (1) Obtaining the second priority from the content of the first subscription condition. For example, if the content of the first subscription condition includes "the second priority of the subscription node S4 is 3", then the second priority can be learned as 3 from the first subscription condition.
[0253] (2) Obtain the second tag of the subscription node, search the second tag and second priority comparison table according to the second tag, and determine the second priority. The second tag and second priority comparison table lists the correspondence between the second tag and the second priority. The following is an example of a second tag and second priority comparison table:
[0254] Second Mark Second priority Very important 6 General Important 4 unimportant 2
[0255] Table 3
[0256] As shown in Table 3, for the second mark of very important, it means that the subscription node is a very important node, so the second priority is set to 6. Similarly, according to the different importance of each subscription node, the second priority corresponding to the second mark of general importance is set to 4, and the second priority corresponding to the second mark of unimportant is set to 2.
[0257] After the above steps 1510 and 1520, the target consensus network has obtained the first priority and the second priority. In step 1530, the target consensus network determines a predetermined order according to the first priority and the second priority. In step 1540, the target consensus network obtains a first transaction that meets the first subscription condition from a plurality of first transactions based on the predetermined order as the first target transaction.
[0258] For example, see Fig.16 , the target consensus network obtains three first transactions from the first target block, namely, the first transaction L1, the first transaction L2, and the first transaction L3. The first priority of the first transaction L1 is 3, and the second priority is 4. The first priority of the first transaction L2 is 5, and the second priority is 6. The first priority of the first transaction L3 is 1, and the second priority is 2. According to the first priority and the second priority, it is determined that the predetermined order of the first transaction L1 is 2, the predetermined order of the first transaction L2 is 1, and the predetermined order of the first transaction L3 is 3; then the first target transactions are the first transaction L2, the first transaction L1, and the first transaction L3.
[0259] The benefit of this embodiment is that it meets the priority on-chain verification requirements of different first transactions according to associated objects and subscription nodes, improves the flexibility of on-chain verification, and thus improves the flexibility of on-chain verification of first transactions.
[0260] The above is a general description of steps 1510 to 1540. Step 1530 is described in detail below.
[0261] See also Fig.17 , step 1530 includes:
[0262] Step 1710: Determine a first score for the first transaction according to the first priority;
[0263] Step 1720: Determine a second score for the first transaction according to the second priority;
[0264] Step 1730: Determine a total score of the first transaction based on the first score and the second score;
[0265] Step 1740: Determine a predetermined order based on the total score of the first transaction.
[0266] Steps 1710-1740 are described in detail below.
[0267] In step 1710, based on the first priority, a first score is determined, which may be done by looking up a comparison table of first priorities and first scores, or by using a formula method.
[0268] (1) According to the first priority, the first priority and first score comparison table is searched (the first priority and first score comparison table lists the corresponding relationship between the first priority and the first score), and the first score can be obtained. The following is an example of a first priority and first score comparison table:
[0269] First priority First Score 4 or more 100 3 90 2 80 1 70
[0270] Table 4
[0271] For example, the first priority of the first transaction L1 is 3, and the corresponding first score is 60 when looking up Table 4.
[0272] The above method of searching the comparison table of the first priority and the first score has the advantages of being simple and easy to implement with low processing overhead.
[0273] (2) When the formula method is used, the first score can be set to be proportional to the first priority, for example:
[0274] F1=K1·G1 Formula 1
[0275] Wherein, F1 represents the first score, G1 represents the first priority, and K1 is a preset constant that can be set according to actual needs. For example, K1=20, after substituting G1=3, the first score F1=60.
[0276] The advantages of the above method of determining the first score by means of a formula are high accuracy, and the formula can be adjusted as required, which is highly flexible.
[0277] In step 1720, based on the second priority, the second score is determined, which may be done by looking up a comparison table of the second priority and the second score, or by using a formula method.
[0278] (1) According to the second priority, the second priority and the second score comparison table is searched (the second priority and the second score comparison table lists the corresponding relationship between the second priority and the second score), and the second score can be obtained. The following is an example of a second priority and the first score comparison table:
[0279] Second priority Second score 6 or more 100 5 90 4 80 3 70 1-2 60
[0280] Table 5
[0281] For example, the second priority of the first transaction L1 is 4, and the corresponding second score is 80 when looking up Table 5.
[0282] The above method of searching the comparison table of the second priority and the second score has the advantages of being simple and easy to implement with low processing overhead.
[0283] (2) When the formula method is used, the second score can be set to be proportional to the second priority, for example:
[0284] F2=K2·G2 Formula 2
[0285] Wherein, F2 represents the second score, G2 represents the first priority, and K2 is a preset constant that can be set according to actual needs. For example, K2=20, after substituting G2=4, the second score F2=80.
[0286] The advantages of the above method of determining the second score by means of a formula are high accuracy, and the formula can be adjusted as required, which is highly flexible.
[0287] In step 1730, based on the first score and the second score, the total score of the first transaction is determined, which may be done by calculating an average or a weighted average of the first score and the second score.
[0288] When calculating the average of the first score and the second score as the total score, for example, the first score of the first transaction L1 is 60 and the second score is 80, then the total score is (60+80) / 2=70. The advantage of using the average to calculate the total score of the first transaction is that the influence of the first priority and the second priority on the order of the first transaction in multiple first transactions can be equally reflected.
[0289] When calculating the weighted average of the first score and the second score as the total score, for example, the weights of the transaction priority and the difference are set to 0.6 and 0.4 respectively, the first score of the first transaction L1 is 60, and the second score is 80, then the total score is 60×0.6+80×0.4=68. The advantage of using the weighted average to calculate the total score is that different weights can be set for the first priority and the second priority, which improves the flexibility of determining the order of the first transaction in multiple first transactions.
[0290] In step 1740, a predetermined order is determined based on the total score of the first transaction. In one embodiment, the order is determined in the following manner:
[0291] (1) According to the total score, the total score and the predetermined order comparison table are searched (the total score and the predetermined order comparison table lists the corresponding relationship between the total score and the predetermined order), and the predetermined order can be obtained. The following is an example of a total score and the predetermined order comparison table:
[0292]
[0293]
[0294] Table 6
[0295] Assuming that the total score of the first transaction L1 is 70, look up Table 6 and obtain the corresponding predetermined order as 3.
[0296] The advantages of the above method of searching the total score and the sequence comparison table are that it is simple and easy to implement and has low processing overhead.
[0297] (2) When the formula method is used, the predetermined order can be set to be inversely proportional to the total score, for example:
[0298] D=K3·F3+K4 Formula 3
[0299] Where D represents the order, F3 represents the total score, K3 and K4 are preset constants that can be set according to actual needs. For example, K3 = -2 / 70, K4 = 5, after substituting F3 = 70, D = 3.
[0300] The advantages of the above method of determining the order by formula are high accuracy, and the formula can be adjusted as needed, which is highly flexible.
[0301] The benefit of the embodiment of the above steps 1710-1740 using the first priority and the second priority to determine the predetermined order is that by effectively evaluating the degree of need for priority processing of the first transaction, the first transaction with a higher degree of need is prioritized as the first target transaction, so that the target consensus network can prioritize the first target transaction, thereby improving the flexibility of processing the first target transaction.
[0302] The above is a detailed description of step 320 .
[0303] Detailed description of step 340
[0304] Step 340: Based on the first target transaction, the first verification information and the first block header, perform on-chain verification of the first target transaction.
[0305] See also Fig.18 In one embodiment, the chain verification includes a first sub-verification and a second sub-verification, and step 340 specifically includes:
[0306] Step 1810: Obtain a second block header of a next block of the first target block on the first blockchain;
[0307] Step 1820: Perform a first sub-verification based on the first block header and the second block header of the next block;
[0308] Step 1830: Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.
[0309] Steps 1810-1830 are described in detail below.
[0310] In step 1810, among the multiple blocks on the first blockchain, the latter block header is related to the previous block header, so in order to perform the first sub-verification of step 1820, it is necessary to obtain the block header of the next block of the first target block as the second block header.
[0311] In step 1820, the first sub-verification refers to the security verification of the first target block where the first target transaction is located. The first blockchain is composed of multiple first blocks, and the block header in the genesis block among the multiple first blocks stores the first block body summary value, but no second block body summary value. Among the multiple first blocks, except for the block header in the genesis block, the remaining block headers include the first block body summary value and the second block body summary value. For the same first block, the first block body summary value refers to the characteristic value of the first block, and the second block body summary value refers to the characteristic value of the previous block (also known as the parent block) of the first block. For two adjacent first blocks, if the first block body summary value of the latter block is the same as the second summary value of the previous block, it means that the two first blocks are indeed associated, and the first sub-verification passes; if they are not the same, it means that a certain first block may have been tampered with, and the first sub-verification fails.
[0312] In one embodiment, the block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain. In a specific implementation of this embodiment, step 1820 includes:
[0313] If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.
[0314] For example, see Fig.19 , Fig.19 The first block header and the second block header are shown. The first block body digest value of the first block header is 9tta5acc, and the second block body digest value is ab50f328. The first block body digest value of the second block header is 7b50f329, and the second block body digest value is 9tta5acc. The first block header digest value (9tta5acc) of the first block header is the same as the second block body digest value (9tta5acc) of the second block header, indicating that the first block header and the second block header are indeed associated, and the first sub-verification passes.
[0315] In step 1830, the second sub-verification refers to performing security verification of the first target transaction itself. The specific process of the second sub-verification will be described in detail below.
[0316] The advantage of this embodiment is that, through the first sub-verification and the second sub-verification, not only the security of the first target block where the first target transaction is located is verified, but also the security of the first target transaction itself is verified, which greatly improves the credibility of the verification.
[0317] The above is a general description of steps 1810 to 1830. Step 1830 is described in detail below.
[0318] It should be noted that the second sub-verification in step 1830 needs to be based on the first verification information obtained in step 330 . Therefore, step 1830 is further described in detail below in conjunction with step 330 .
[0319] See also Fig. 20 In one embodiment, step 330 includes:
[0320] Step 2010: Generate a first tree, the first tree including multiple layers of features;
[0321] Step 2020: Obtain a first bypass feature of the first path as first verification information;
[0322] Correspondingly, step 1830 includes:
[0323] Step 2030: Determine the summary value of the first target transaction;
[0324] Step 2040: determining a second tree root feature of the first tree based on the summary value of the first target transaction and the first verification information;
[0325] Step 2050: If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.
[0326] Steps 2010-2050 are described in detail below.
[0327] In step 2010, the bottom layer feature of the first tree is the summary value of a plurality of first transactions in the first target block, and the plurality of first transactions includes the first target transaction.
[0328] The order of the bottom layer features of the first tree can be the order in which the target consensus node receives the first transaction. For example, the target consensus node first receives the first transaction L1 "Company A transfers 100 resources to Company B in May", and then receives the first transaction L2 "Company A transfers 200 resources to Company C in May", then the first transaction L1 is used as the first node of the bottom layer node, and the first transaction L2 is used as the second node of the bottom layer node". The digest algorithm used by the digest value can be one of the following:
[0329] (1) The target consensus node pre-specifies a fixed digest algorithm that is the same for each entity to which the first transaction belongs. For example, the same digest algorithm is used for the resource transfer transaction between Company A and Company B and the resource transfer transaction between Company A and Company C;
[0330] (2) The target consensus node pre-specifies different digest algorithms for each entity to which the first transaction belongs. For example, different digest algorithms are pre-specified for Company B and Company C. When it is determined that the first transaction belongs to a transaction between Company A and Company B, the digest algorithm pre-specified for Company B is used; when it is determined that the first transaction belongs to a transaction between Company A and Company C, the digest algorithm pre-specified for Company C is used. This embodiment uses different digest algorithms for different entities, which increases the difficulty of cracking local transactions from the digest value and improves the security of the first transaction on-chain verification.
[0331] It should be noted that no matter which of the above digest algorithms is used, it is necessary to ensure that the digest algorithm used by the target consensus node when verifying according to the digest value of the first transaction and the first bypass feature is consistent with the above digest algorithm.
[0332] In this embodiment, two adjacent features of each layer of the first tree are connected to generate a feature of a higher layer until a first root feature of the first tree is generated, and the first root feature is the first block summary value.
[0333] The first tree of the embodiment of the present disclosure is usually a binary tree, or a multi-branch tree. The first tree has all the characteristics of a tree structure, and the tree structure often contains multiple nodes ( Fig.21AThe first tree feature shown in the figure) includes at least one leaf node and one root node among the multiple nodes, and usually also includes multiple intermediate nodes between the leaf nodes and the root node.
[0334] The specific generation process of the first tree is as follows:
[0335] Reference Fig.21A The first tree shown in FIG. 1 takes the feature data of each first tree feature as a feature of the first tree. Therefore, the first tree contains multiple layers of features, wherein each bottom layer feature of the first tree corresponds to the first transaction recorded on a single first blockchain, and each bottom layer feature is the feature of the first transaction of the record (e.g. Fig.21A As shown, the feature of the first transaction is the summary value.) Two adjacent features of each layer of the first tree are connected to generate a feature of a higher layer, that is, each feature of the higher layer is obtained by calculating two adjacent features of the lower layer (such as Fig.21A As shown in , the summary value of the feature in the upper layer can be obtained by performing a summary operation on the summary values of the two adjacent features in the lower layer). This process is repeated until the root feature of the first tree is generated, and the complete first tree is obtained. Fig.21A As shown, the first tree feature 1 and the second tree feature 2 of the bottom layer are connected in series, and the first tree feature 7 of the second-to-last layer is generated through a digest algorithm; the first tree feature 3 and the second tree feature 4 of the bottom layer are connected in series, and the first tree feature 8 of the second-to-last layer is generated through a digest algorithm; the first tree feature 5 and the second tree feature of the bottom layer are connected in series, and the first tree feature 9 of the second-to-last layer is generated through a digest algorithm; the first tree feature 7 and the second tree feature 8 of the second-to-last layer are connected in series, and the first tree feature 11 of the third-to-last layer is generated through a digest algorithm; the first tree feature 9 and the second tree feature 10 of the second-to-last layer are connected in series, and the first tree feature 12 of the third-to-last layer is generated through a digest algorithm; the first tree feature 11 and the second tree feature 12 of the third-to-last layer are connected in series, and the first tree feature 13, i.e., the first tree root feature, is generated through a digest algorithm.
[0336] In step 2020, the first path is a path from the summary value of the first target transaction on the first tree to the first tree root feature, and the first bypass feature is a next layer feature to which other features on the first path except the summary value of the first target transaction are connected.
[0337] like Fig. 21BAs shown, assuming that the feature of the summary value of the first target transaction corresponds to the first tree feature 4, and the first tree root feature of the first tree corresponds to the first tree feature 13, the first path is the path between the first tree feature 4 and the first tree feature 13 on the first tree, wherein the first path covers the connection paths between the first tree feature 4, the first tree feature 8, the first tree feature 11, and the first tree feature 13. Since the first tree feature 8 needs to be generated based on the first tree feature 3 and the first tree feature 4, when the feature of the first tree feature 4 is known, the feature of the first tree feature 3 also needs to be obtained, and therefore, the feature of the first tree feature 3 is determined as a bypass feature. Similarly, since the first tree feature 11 needs to be generated based on the first tree feature 7 and the first tree feature 8, after generating the first tree feature 8 based on the first tree feature 3 and the first tree feature 4 as a bypass feature, the feature of the first tree feature 7 also needs to be obtained, and therefore, the feature of the first tree feature 7 is determined as a bypass feature. Similarly, since the first tree feature 13 needs to be generated based on the first tree feature 11 and the first tree feature 12, after the first tree feature 11 is generated based on the first tree feature 8 and the first tree feature 7 as a bypass feature, the feature of the first tree feature 12 needs to be obtained. Therefore, the feature of the first tree feature 12 is determined as a bypass feature. Therefore, the first bypass feature of the first path includes the features of the first tree feature 3, the first tree feature 7, and the first tree feature 12. Fig. 21B In the first tree, except for the first bypass feature and the bottom layer feature corresponding to the first target transaction, other features will not be provided to the target consensus node.
[0338] The benefit of steps 2010-2020 is that when the target consensus node performs the second sub-verification, the relevant information of the first tree root feature generated layer by layer from the first tree feature of the lowest layer corresponding to the summary value of the first target transaction has been provided to the target consensus node, ensuring that the target consensus node can perform the correct second sub-verification. At the same time, information that is not related to the first tree root feature generated layer by layer from the first tree feature of the lowest layer corresponding to the target consensus node is avoided as much as possible from being provided to the target consensus node, reducing information leakage of other transactions. At the same time, even the first bypass feature is generally only provided in the form of a summary value, etc., to reduce the leakage of real information of related transactions.
[0339] In step 2030, the digest algorithm may be used to digest the first target transaction to obtain a digest value of the first target transaction. It should be noted that the digest algorithm is required in both step 2030 and step 2040, and needs to be consistent with the digest algorithm used when generating the first tree in step 2010 to ensure that the second sub-verification proceeds smoothly.
[0340] Next, in step 2040, the target consensus node determines the second root feature of the first tree based on the summary value of the first target transaction and the first verification information.
[0341] The process of determining the second tree root feature of the first tree includes: determining the first tree feature corresponding to the summary value of the first target transaction, and then reproducing the first tree features (such as the first tree features corresponding to the summary value of the first target transaction) on the first path of generating the first tree root feature from the lowest layer of the first tree features corresponding to the first target transaction layer by layer in the first tree according to the first bypass feature (the first verification information) and the first tree feature corresponding to the summary value of the first target transaction. Fig. 21B The part circled by the curve) is used to obtain the second root feature.
[0342] like Fig. 21B As shown, when the second tree root feature of the first tree is determined by using the first bypass feature (first verification information) and the summary value of the first target transaction, it is assumed that the summary value of the first target transaction corresponds to the feature of the first tree feature 4, and the extracted first bypass feature includes the features of the first tree feature 3, the first tree feature 7, and the first tree feature 12. At this time, the feature of the first tree feature 8 is generated according to the feature of the first tree feature 4 and the bypass feature of the first tree feature 3. The feature of the first tree feature 11 is generated according to the feature of the first tree feature 8 and the bypass feature of the first tree feature 7. The feature of the first tree feature 13 is generated according to the feature of the first tree feature 11 and the bypass feature of the first tree feature 12. In this way, the first tree features 8, 11, and 13 on the first path of generating the first tree feature 13 layer by layer from the lowest layer of the first tree feature 4 corresponding to the summary value of the first target transaction in the first tree are reproduced. The feature of the first tree feature 13 on the reproduced first path is used as the second tree root feature.
[0343] After obtaining the second root feature in step 2040, the target consensus node compares the second root feature with the first block body summary value (first root feature). In step 2050, if the second root feature is consistent with the first block body summary value, the second sub-verification passes.
[0344] Through the above steps 2030-2050, the disclosed embodiment ensures that the target consensus node can accurately verify the first target transaction, and realizes the verification that the first target transaction is a real record without cheating. It also reduces the leakage of real information of related transactions and improves security.
[0345] It should be noted that the execution environment of the target consensus node in the embodiment of the present disclosure is divided into two situations. One situation is that the target consensus node has a trusted execution environment, and the other situation is that the target consensus node does not have a trusted execution environment. Obviously, the target consensus node in the above embodiment belongs to the situation where there is no trusted execution environment. The following will expand the detailed description of step 340 for the target consensus node having a trusted execution environment.
[0346] Before describing that the target consensus node has a trusted execution environment, the relevant content of the trusted execution environment is explained first.
[0347] Trusted Execution Environment (TEE): is a hardware-based secure computing solution. A secure area is built in the CPU through software and hardware methods to ensure that the programs and data loaded inside are protected in terms of confidentiality and integrity. TEE divides the system's hardware and software resources into two execution environments - the trusted part and the untrusted part (ordinary part). The two environments are isolated, and the untrusted part cannot access the storage and memory of the trusted part.
[0348] Trusted Execution Environment Hardware Key: When Intel produces the CPU, it burns the hardware key into the CPU. Its private key cannot be exported under any circumstances, and its public key can be exported in specific usage scenarios, but Intel does not recommend this practice.
[0349] Based on the content of the above-mentioned trusted execution environment, in one embodiment, when the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key.
[0350] When this embodiment is specifically implemented, see Fig. 22 , step 320 includes:
[0351] Step 2210: In the first secure execution space, decrypt the first target block using the first key to obtain the decrypted first target block, and obtain the first target transaction and the first block header from the decrypted first target block;
[0352] Correspondingly, step 340 includes:
[0353] Step 1810: Obtain a second block header of a next block of the first target block on the first blockchain;
[0354] Step 1820 includes: Step 2220, in the first secure execution space, calling the first sub-verification contract recorded on the first blockchain, and performing the first sub-verification based on the first block header and the second block header;
[0355] Step 1830 includes: Step 2230, in the first secure execution space, calling the second sub-verification contract recorded on the first blockchain, and performing a second sub-verification based on the first target transaction, the first verification information and the first block header.
[0356] Since step 1810 has been described in detail above, it will not be repeated here. Steps 2210-2230 are described in detail below.
[0357] In step 2210, since each first block of the first blockchain is encrypted with the first key, the target consensus network cannot directly read data from the first block after obtaining the first block from the first blockchain, and needs to decrypt the first block. However, the process of the target consensus network decrypting the first block may be known to a third party, resulting in information leakage and reduced security. Based on this, the target consensus network will decrypt the first target block in the first secure execution space, which is built based on a trusted execution environment and cannot be accessed by a third party, ensuring information security. After decrypting the first target block, the target consensus network can obtain the first target transaction and the first block header from the first target block.
[0358] In step 2220, similar to step 2210, on the basis that the third party cannot access the first secure execution space, the target consensus network will perform the first sub-verification in the first secure execution space to ensure information security. In step 2220, the first verification contract is also called, and the first verification contract refers to the contract for verifying the block header. The block header information is received, verified and stored in the first verification contract. For example, if the height of the first target block is 100, the first block header is the 100 block header. The target consensus network also obtains the first block with a height of 101, and the second block header is the 101 block header. The first verification contract will verify the integrity of the 100 block header, mainly to detect the match between the summary value of the 100 block header and the summary value of the parent block header in the 101 block header, as well as the consensus information in the 100 block header. After the first sub-verification is passed, the data of the first verification contract is used to provide to the "second verification contract" for transaction data verification.
[0359] In step 2230, similar to step 2220, on the basis that the third party cannot access the first secure execution space, the target consensus network will perform a second sub-verification in the first secure execution space to ensure information security. In step 2230, the second verification contract is also called, and the second verification contract refers to a contract that verifies the transaction. For example, assume that the second verification contract receives a first target transaction from the first target block (the height of the first target block is 100, then the first block header is the 100 block header). When the second verification contract is verified, the summary value of the first target transaction is first calculated based on the first target transaction, and the first bypass feature of the first path in the first verification information is calculated together to calculate the first tree root feature, and the first tree root feature is obtained from the "first verification contract" to obtain the second tree root feature in the 100 block header for comparison. If the comparison passes, the second sub-verification passes.
[0360] The advantage of this embodiment is that a trusted execution environment is used to ensure the security of on-chain verification. The first verification contract is also used to perform security verification on the first target block where the first target transaction is located, and the second verification contract is used to perform security verification on the first target transaction itself, thereby ensuring the accuracy of on-chain verification.
[0361] The above is a detailed description of step 340 .
[0362] Detailed description of step 360
[0363] Step 360: Send the transaction result data to the subscribing node for the local consensus network to obtain from the subscribing node.
[0364] It is understandable that after the subscription node receives the transaction result data sent by the target consensus network, the subscription node can actively send the transaction result data to the local consensus network. The subscription node can also send the transaction result data to the local consensus network in response to receiving a request to obtain transaction result data from the local consensus network.
[0365] In the case where the above-mentioned subscription node responds to receiving a request to obtain transaction result data, the local consensus network is required to generate the transaction result data acquisition request according to actual needs. For example, after the local consensus network sends the first transaction of the target type to the target consensus network and after a certain period of time, it generates a transaction result data acquisition request and sends it to the subscription node to obtain the transaction result data from the subscription node. However, when the subscription node receives the transaction result data acquisition request from the local consensus network, the subscription node may not have received the transaction result data sent by the target consensus network, and the subscription node cannot reply to the local consensus network, resulting in a waste of processing resources. Therefore, an embodiment that can ensure that the subscription node can reply to the local consensus network in a timely manner will be given below.
[0366] When this embodiment is specifically implemented, see Fig.23 , after step 310, the blockchain transaction processing method (executed by the target consensus network) further includes:
[0367] Step 2310: Obtain first blockchain height information of the first blockchain;
[0368] Step 2320: forward the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network;
[0369] Correspondingly, step 360 includes: step 2330, sending the transaction result data to the subscription node for the local consensus network to obtain from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.
[0370] Steps 2310-2330 are described in detail below.
[0371] In step 2310, the first blockchain height information refers to the information of the height of the first blockchain, and the height of the first blockchain refers to the number of the first block. Referring to the first blockchain height counter set in step 410, the target consensus network can read the first blockchain height information from the first blockchain height counter. Other methods can also be used to obtain the first blockchain height information.
[0372] In step 2320, the target consensus network may directly forward the first blockchain height information to the global consensus network, which in turn forwards it to the local consensus network. The target consensus network may also directly forward the first blockchain height information to the global consensus network, which in turn forwards it to the local consensus network in response to the request of the local consensus network. For example, see Figure 1 , the target consensus network can forward the first blockchain height information to the second relay node, the second relay node forwards the first blockchain height information to the global consensus network, the global consensus network forwards the first blockchain height to the first relay node, and the first relay node forwards the first blockchain height information to the local consensus network.
[0373] In step 2330, the target consensus network sends the transaction result data to the subscription node, but the subscription node does not actively forward the transaction result data to the local consensus network. Instead, the local consensus network needs to actively request the subscription node. Moreover, the local consensus network only makes a request to the subscription node when the height information of the first blockchain and the height information of the second blockchain are inconsistent. Note that if the height information of the first blockchain and the height information of the second blockchain are inconsistent, it means that the first transaction of the target type has been recorded in the first blockchain by the target consensus network, that is, the first transaction of the target type has been successfully uploaded to the chain. After the local consensus network knows that the first transaction of the target type has been successfully uploaded to the chain, it can naturally send a request to the subscription node to obtain the transaction result data. At this time, the subscription node can respond to the receipt of the transaction result data and reply the transaction result data to the local consensus network in a timely manner.
[0374] The benefit of this embodiment is that the success rate of the local consensus network requesting the subscription node to obtain transaction result data is improved based on the first blockchain height information.
[0375] The above is a detailed description of step 340 .
[0376] Detailed description of the first transaction of the target type in step 310
[0377] Based on the above content, the detailed description of steps 310-360 has been completed. In step 310, it is mentioned that the first block is generated by the target consensus network, and the first block is used to record the first transaction of the target type from the local consensus network. Figure 1 , the first relay node can realize cross-chain information forwarding between the local consensus network and the target consensus network. In one embodiment, the first relay node can obtain the first transaction of the target type from the local consensus network, and then the first relay node forwards the first transaction of the target type to the target consensus network.
[0378] When this embodiment is specifically implemented, see Fig.24 , the first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following way:
[0379] Step 2411: Determine the transaction type of the first transaction generated by the local consensus network;
[0380] Step 2412: If the transaction type is a non-target type, the first transaction is kept in the local consensus network, and the local consensus network records the first transaction to the second blockchain, and the second blockchain allows access outside the local consensus network;
[0381] Step 2413: If the transaction type is the target type, obtain the first transaction and send it to the target consensus network.
[0382] Steps 2411-2413 are described in detail below.
[0383] In step 2411, the transaction type includes a target type and a non-target type. The target type refers to a type that the outside world is not allowed to know. The non-target type refers to a type that the outside world is allowed to know.
[0384] The first relay node is a module for determining the type of the first transaction and forwarding the first transaction of the target type. The first relay node can be an independent device, such as a separate computer or server, or a part of an independent device, such as a virtual machine divided on a server.
[0385] In some embodiments, the type of the first transaction is determined in the following manners, including but not limited to:
[0386] (1) Extract key fields from the content of the first transaction, and search the field type comparison table based on the key fields to determine the transaction type of the first transaction. The following is an example of a field and type comparison table:
[0387] Key fields Transaction Type bill Target Type resource Target Type weather Non-target type
[0388] Table 7
[0389] As shown in Table 7, for the key field of invoice, the first transaction is not allowed to be disclosed to the outside world, so the transaction type of the first transaction is determined to be the target type. For the key field of resources, the first transaction is also not allowed to be disclosed to the outside world, so the type of the first transaction is determined to be the target type. For the key field of weather, the first transaction is allowed to be disclosed to the outside world, so the type of the first transaction is determined to be the non-target type.
[0390] For example, the first transaction is "100 first resources converted into 10 second resources", and the first key field included is "resource", so the transaction type of the first transaction is determined to be the target type. For another example, the first transaction is "weather 10001: sunny on XX month XX day", and the key field included is "weather", so the type of the first transaction is determined to be the non-target type.
[0391] (2) Obtaining a type identifier from the content of the first transaction, and determining the type of the first transaction according to the type identifier.
[0392] For example, if the content of the first transaction includes "100 first resources converted into 10 second resources; [target type]", then the transaction type of the first transaction is determined to be the target type according to the "[target type]" included in the content. For another example, if the content of the first transaction includes "Weather 10001: XX month XX day weather is sunny; [non-target type]", then the transaction type of the first transaction is determined to be the non-target type according to the "[non-target type]" included in the content.
[0393] In step 2412, a common business smart contract (such as the order smart contract below) is run on the local consensus network, and the business logic is publicly reflected in the contract code. The first transaction interacting with the common business smart contract is executed on the local consensus node, and the execution result is also recorded on the second blockchain maintained by the local consensus node. In addition, these execution results can also be transmitted back to the global consensus network in the core consensus network through the first relay node.
[0394] For example, assume that the first transaction of the non-target type is "Order 10001: Purchase 50 pieces of office supplies". The local consensus node calls the order smart contract to execute the first transaction, and the execution result is "Completed: Order 10001: Purchase 50 pieces of office supplies". The execution result is recorded by the local consensus node on the second blockchain, and all nodes except the local consensus node can access the second blockchain.
[0395] In step 2413, since the first transaction of the target type is a transaction that is not intended to be accessed and known by a third party, the first relay node sends the first transaction of the target type to the target consensus network, and the target consensus network executes the first transaction and records it to the first blockchain in response to receiving the first transaction of the target type. Note that since the target transaction is a transaction that is not intended to be accessed and known by a third party, before the first transaction is put on the chain, the consent of the object that generated the first transaction must be sought. Specifically, an inquiry box can be displayed to the object, asking the object whether it agrees to put the first transaction of the target type on the chain. If the object disagrees, this implementation method cannot be implemented, or only the part of the transaction that agrees to be put on the chain can be put on the chain.
[0396] Through the above steps 2411-2413, the disclosed embodiment utilizes the ability of the local consensus network to execute the first transaction of the non-target type and to transmit the first transaction of the target type in the local consensus network back through the first relay node, thereby realizing the separation of the first transaction and the secure on-chain of the first transaction of the target type. In other words, the first transaction of the target type is executed and recorded in the target consensus network, and the specific calculation process and calculation logic, as well as the intermediate results, are all completed in the target consensus network. At the same time, the consensus of the target consensus network itself and the on-chain verification in the target consensus network can effectively utilize the tamper-proof characteristics of the blockchain to ensure the correctness and credibility of the transaction.
[0397] Detailed description of the transaction result data in steps 350-360
[0398] In one embodiment, the transaction result data is a variable affected after the execution of the first target transaction.
[0399] When this embodiment is specifically implemented, see Fig.25 , step 350 comprises:
[0400] Step 2510: If the on-chain verification succeeds, obtain the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables;
[0401] Correspondingly, step 360 includes:
[0402] Step 2520 includes: sending the variable and the second verification information to the subscribing node so that the subscribing node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, storing the variable for the local consensus network to obtain from the subscribing node.
[0403] Steps 2510-2520 are described in detail below.
[0404] In step 2510, the variables affected after the execution of the first target transaction refer to the parameters that may be affected after the execution of the first transaction, such as the total amount of resources or the amount of items. For example, the first target transaction is "electronic invoice reimbursement 0001, amount 500". After the transaction is executed and chained, it will have an impact on the total amount of resources of the enterprise. Assuming that the original total amount of resources of the enterprise is 5000, after reimbursement of the electronic invoice, the total amount of resources becomes 4500. The total amount of resources is the variable affected after the execution of invoice reimbursement. For another example, the first target transaction is "giving enterprise A 600 movie tickets", which will have an impact on the number of movie tickets left in the cinema after the execution of the transaction. Assuming that the cinema originally has 5000 movie tickets, after the transaction is executed and chained, the number of movie tickets in the cinema becomes 4400. The number of movie tickets is the variable after the ticket gift transaction is executed. In order to verify the variables after the execution of the first target transaction, it is necessary to obtain the second verification information corresponding to the variables.
[0405] See also Fig.26 In one embodiment, obtaining the second verification information corresponding to the variable includes:
[0406] Step 2610: Generate a second tree, the second tree including multiple layers of features;
[0407] Step 2620: Obtain the second bypass feature of the second path, together with the third tree root feature, as the second verification information.
[0408] Steps 2610-2620 are described in detail below.
[0409] In step 2610, the bottom layer of features of the second tree is the summary value of the variables affected after the execution of each first transaction, and each first transaction includes the first target transaction. The order of the bottom layer of features of the second tree can be a pre-specified variable order. For example, the order of enterprises A, B, C, D... is used as the order of the bottom layer of features of the second tree. When the target consensus network receives the first transaction 1 "Employee X reimburses 1,000 resources at enterprise B", this transaction causes a change in the total number of resources of enterprise B, causing the total resources of enterprise B to change to 49,000. Therefore, the second feature of the bottom layer of features, that is, the second tree feature 2, is changed to a summary value of 49,000. When the target consensus network receives the first transaction 2 "Employee Y reimburses 500 resources at enterprise D", this transaction causes a change in the total number of resources of enterprise D, causing the total resources of enterprise D to change to 24,500. Therefore, the fourth feature of the bottom layer of features, that is, the second tree feature 4, is changed to a summary value of 24,500. As mentioned above Fig.21A-B is similar to the embodiment. The digest value here can be a fixed digest algorithm that is pre-specified by the target consensus network and is the same for the entity to which each first transaction belongs, or it can be a different digest algorithm that is pre-specified by the target consensus network for the entity to which each first transaction belongs, so it is not repeated here.
[0410] The two adjacent features of each layer of the second tree are connected to and generate a feature of the next layer, until the third root feature of the second tree is generated. The structure and generation process of the second tree are similar to those of the first tree, so the combination Fig.27A For the specific process of generating the second tree, please refer to the above combination Fig.21A The description of generating the first tree is not repeated here.
[0411] In step 2620, the second path is the path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the root feature of the third tree, and the second bypass feature is the next layer feature to which other features on the second path except the variable affected by the execution of the first target transaction are connected.
[0412] When this embodiment is implemented, step 2620 is similar to the specific implementation process when the feature of the first tree is the summary value of the first transaction, except that the second tree feature of the second tree in this embodiment is the variable affected after the execution of the first transaction, while the first tree feature of the first tree in the above embodiment is the summary value of the first transaction. To save space, it will not be repeated.
[0413] like Fig.27B As shown, assuming that the feature of the summary value of the variable affected by the execution of the first transaction corresponds to the second tree feature 4, and the third tree root feature of the second tree corresponds to the second tree feature 13, then the second path is the path between the second tree feature 4 and the second tree feature 13 on the second tree, wherein the second path covers the connection path between the second tree feature 4, the second tree feature 8, the second tree feature 11 and the second tree feature 13. The second bypass feature of the second path includes the features of the second tree feature 3, the second tree feature 7 and the second tree feature 12. The second bypass feature is Fig.27B In the second tree, except for the second bypass feature and the bottom-level feature corresponding to the summary value of the variable affected by the first transaction execution, other features will not be provided to the target consensus network.
[0414] The benefit of steps 2610-2620 is that it ensures that the target consensus node can perform the correct second sub-verification, but avoids providing information that is irrelevant to the first tree root feature generated layer by layer from the lowest first tree feature corresponding to the target consensus node to the target consensus node, thereby reducing information leakage of other transactions. At the same time, even the first bypass feature is generally only provided in the form of a summary value, etc., to reduce the leakage of real information of related transactions.
[0415] The above is a detailed description of step 2510.
[0416] Continue to see Fig.25 , step 2520 includes: 2520a, sending the variable and the second verification information to the subscription node, 2520b, so that the subscription node verifies the transaction result based on the variable and the second verification information, and 2520c, after the transaction result verification is successful, storing the variable for the local consensus network to obtain from the subscription node.
[0417] In one embodiment, see Fig.26 Step 2520b includes:
[0418] Step 2630: Determine the fourth root feature of the second tree according to the summary value of the variable and the second bypass feature;
[0419] Step 2640: If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.
[0420] Steps 2630-2640 are described in detail below.
[0421] In step 2630, the process of determining the fourth tree root feature of the second tree includes: determining the second tree feature corresponding to the summary value of the variable, and then reproducing the second tree features on the second path from the second tree feature corresponding to the summary value of the variable in the second tree layer by layer to generate the second tree root feature layer by layer according to the second bypass feature and the second tree feature corresponding to the summary value of the variable (such as Fig.27B The fourth root feature is obtained. Fig.27B The specific process of generating the fourth root feature can refer to the above combination Fig. 21B The description of generating the second tree root will not be repeated here.
[0422] After obtaining the fourth tree root feature in step 2630, the subscription node compares the third tree root feature with the fourth tree root feature. In step 2640, if the third tree root feature is consistent with the fourth tree root feature, the transaction result verification is successful.
[0423] Through the above steps 2630-2640, the subscribing node can verify whether the transaction result data is authentic through the variables affected after the transaction is executed, thereby improving the security of information transmission.
[0424] Similar to the target consensus network, the subscription node is also divided into two situations: with a trusted execution environment and without a trusted execution environment. The above embodiment belongs to the situation without a trusted execution environment. The following is a detailed description of the subscription node with a trusted execution environment.
[0425] In one embodiment, the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space.
[0426] When this embodiment is specifically implemented, see Fig.28 , step 360 includes:
[0427] Step 2810: Encrypt the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data;
[0428] Step 2820: Send the first encrypted transaction result data to the subscribing node, so that the subscribing node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain the second encrypted transaction result data, and in response to the transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain the first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.
[0429] The process of encryption and decryption performed by the subscription node based on the second trusted execution environment in steps 2810-2820 is similar to the process of encryption and decryption performed by the target consensus network based on the first trusted execution environment in steps 2210-2230, except that steps 2810-2820 use the second trusted execution environment to ensure the security of the transaction result data in the subscription node, while steps 2210-2230 use the first trusted execution environment to ensure the security of the first target block. In order to save space, it will not be repeated here.
[0430] Implementation details of the blockchain transaction processing method of the disclosed embodiment
[0431] Refer to the following Fig.29 , the implementation details of the blockchain transaction processing method of the embodiment of the present disclosure are explained in detail and by way of example.
[0432] At step 2411 (performed by the first relay node), determining a transaction type of a first transaction generated by the local consensus network;
[0433] In step 2412 (performed by the first relay node), if the transaction type is a non-target type, the first transaction is kept in the local consensus network, and the local consensus network records the first transaction to the second blockchain, and the second blockchain allows access outside the local consensus network;
[0434] In step 2413 (performed by the first relay node), if the transaction type is a target type, the first transaction is obtained and sent to the target consensus network, the target consensus network generates a first block based on the first target, and the first block is recorded in the first blockchain;
[0435] In step 1011 (performed by the subscription node), a plurality of second subscription requests are received from the local consensus network, each second subscription request having a second subscription condition of an associated object;
[0436] In step 1012 (performed by the subscription node), the second subscription conditions of the multiple associated objects in the multiple second subscription requests are integrated into a first subscription condition to generate a first subscription request;
[0437] In step 330, it is divided into steps 810-830;
[0438] In step 810 (performed by the target consensus node), a first subscription request from a subscription node is received, wherein the first subscription request has a first subscription condition;
[0439] In step 820 (performed by the target consensus node), a first block added to the first blockchain is obtained;
[0440] In step 830 (performed by the target consensus node), if the added first block contains the first target transaction that meets the first subscription condition, the added first block is obtained as the first target block;
[0441] In step 320 (performed by the target consensus node), a first target transaction and a first block header are obtained from the first target block;
[0442] At step 330 (performed by the target consensus node), first verification information corresponding to the first target transaction is obtained;
[0443] In step 340 (performed by the target consensus node), based on the first target transaction, the first verification information and the first block header, the first target transaction is verified on the blockchain;
[0444] In step 350 (performed by the target consensus node), if the on-chain verification is successful, the transaction result data of the first target transaction is obtained;
[0445] In step 2310 (performed by the target consensus node), first blockchain height information of the first blockchain is obtained;
[0446] At step 2320 (performed by the target consensus node), forwarding the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network;
[0447] In step 2330 (performed by the target consensus node), the transaction result data is sent to the subscribing node for the local consensus network to obtain from the subscribing node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.
[0448] The advantages of this embodiment include but are not limited to: based on a multi-layer chain framework, it is suitable for large-scale business in the form of blockchain electronic invoices; the multi-layer chain form facilitates hierarchical business governance, which can ensure that each local blockchain runs local-level business relatively independently, and there is no need to aggregate all the traffic of the entire business alliance to the global blockchain; it plays the role of data isolation, business privacy isolation, and legal compliance, and can ensure that the global consensus network does not need to carry a large number of segmented businesses, and can also focus on key tasks and global governance; the first transaction of the target type is executed and recorded in the target consensus network, and the specific calculation process and calculation logic, as well as the intermediate results, are all completed in the target consensus network and are not accessible to the outside, which improves the security of transaction chaining; with the help of a subscription request, multiple second subscription conditions are sent at the same time, saving network resources, and the target consensus network can process multiple second subscription conditions in batches, improving processing efficiency; by using the first block containing the first target transaction that meets the first subscription condition as the first target block, the number of first blocks for chain verification can be reduced, saving processing resources; based on the first blockchain height information, the success rate of the local consensus network requesting the subscription node to obtain transaction result data is improved; and trustworthy chain result interaction can be performed without reading the first blockchain information.
[0449] Description of the apparatus and device of the present disclosure
[0450] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0451] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.
[0452] Fig.30 The block chain transaction processing device 3000 is a schematic diagram of the structure of the block chain transaction device 3000 provided in the embodiment of the present disclosure. The block chain transaction processing device is located in the target consensus network, see Fig.30 , the blockchain transaction processing device 3000 includes:
[0453] A first acquisition unit 3010 is used to acquire an added first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is used to record a first transaction of a target type from the local consensus network, and the first blockchain prohibits access from outside the target consensus network;
[0454] The second acquisition unit 3020 is used to acquire a first target transaction and a first block header from the first target block;
[0455] The third acquisition unit 3030 is used to acquire first verification information corresponding to the first target transaction;
[0456] The on-chain verification unit 3040 is used to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information and the first block header;
[0457] The fourth acquisition unit 3050 is used to acquire the transaction result data of the first target transaction if the on-chain verification is successful;
[0458] The first sending unit 3060 is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.
[0459] Optionally, the on-chain verification includes a first sub-verification and a second sub-verification;
[0460] The up-chain verification unit 3040 is specifically used for:
[0461] Obtain a second block header of a next block of the first target block on the first blockchain;
[0462] Perform a first sub-verification based on the first block header and the second block header;
[0463] Based on the first target transaction, the first verification information and the first block header, a second sub-verification is performed.
[0464] Optionally, the block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain;
[0465] The on-chain verification unit 3040 is also specifically used for:
[0466] If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.
[0467] Optionally, the third acquiring unit 3030 is specifically configured to:
[0468] Generate a first tree, the first tree includes multiple layers of features, wherein the bottom layer of features of the first tree is the summary value of multiple first transactions in the first target block, the multiple first transactions include the first target transaction; two adjacent features of each layer of the first tree are connected to and generate a feature of a higher layer, until a first tree root feature of the first tree is generated, the first tree root feature is the summary value of the first block body;
[0469] Obtaining a first bypass feature of a first path as first verification information, wherein the first path is a path from the summary value of the first target transaction on the first tree to the first tree root feature, and the first bypass feature is a next-layer feature to which other features on the first path except the summary value of the first target transaction are connected;
[0470] The on-chain verification unit 3040 is also specifically used for:
[0471] determining a digest value of a first target transaction;
[0472] Determine a second tree root feature of the first tree based on the summary value of the first target transaction and the first verification information;
[0473] If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.
[0474] Optionally, the target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key;
[0475] The second acquisition unit 3020 is specifically used to: decrypt the first target block using the first key in the first secure execution space to obtain the decrypted first target block, and obtain the first target transaction and the first block header from the decrypted first target block;
[0476] The on-chain verification unit 3040 is further specifically used to: in the first secure execution space, call the first sub-verification contract recorded on the first blockchain, and perform the first sub-verification based on the first block header and the second block header;
[0477] The on-chain verification unit 3040 is also specifically used to: in the first secure execution space, call the second sub-verification contract recorded on the first blockchain, and perform a second sub-verification based on the first target transaction, the first verification information and the first block header.
[0478] Optionally, after obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing device 3000 further includes:
[0479] a fifth acquiring unit (not shown), configured to acquire first blockchain height information of the first blockchain;
[0480] A second sending unit (not shown), configured to forward the first blockchain height information to the global consensus network, so that the global consensus network synchronizes the first blockchain height information to the local consensus network;
[0481] The first sending unit 3060 is specifically used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information received from the global consensus network last time.
[0482] Optionally, the first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following manner:
[0483] Determining a transaction type of a first transaction generated by the local consensus network;
[0484] If the transaction type is a non-target type, the first transaction is kept in the local consensus network, and the local consensus network records the first transaction to the second blockchain, and the second blockchain allows access outside the local consensus network;
[0485] If the transaction type is the target type, get the first transaction and send it to the target consensus network.
[0486] Optionally, the first acquiring unit 3010 is specifically configured to:
[0487] Setting a first blockchain height counter, wherein when a first block is added to the first blockchain, the first blockchain height counter increases by 1;
[0488] If the difference between the current first value of the first blockchain height counter and the second value when the last increased first target block was obtained reaches the first threshold, the first block on the first blockchain from the first block with a block height of the second value plus 1 to the first block with a block height of the first value is obtained as the first target block;
[0489] If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.
[0490] Optionally, before obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing device 3000 further includes:
[0491] A first receiving unit (not shown), configured to receive a first subscription request from a subscription node, wherein the first subscription request has a first subscription condition;
[0492] The first acquisition unit 3010 is further specifically configured to:
[0493] Obtain the first block added to the first blockchain;
[0494] If the added first block contains the first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.
[0495] Optionally, the first subscription request also includes a subscription period;
[0496] The first acquisition unit 3010 is further specifically configured to:
[0497] Determine a valid subscription request in the first subscription request whose subscription period has not expired;
[0498] If the added first block contains the first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.
[0499] Optionally, before receiving the first subscription request from the subscription node, the blockchain transaction processing apparatus 3000 further includes:
[0500] A second receiving unit (not shown) is used to receive a registration request from a subscription node, the registration request carrying a private key of the subscription node; and record the private key of the subscription node on the first blockchain;
[0501] The first subscription request contains the private key of the subscribing node;
[0502] After receiving the first subscription request from the subscription node, the blockchain transaction processing device 3000 further includes:
[0503] A private key verification unit (not shown) is used to verify that the private key included in the first subscription request is consistent with the private key recorded on the first blockchain.
[0504] Optionally, the subscription node is a plurality of subscription nodes corresponding to a plurality of transaction subtypes, and the first subscription condition is the transaction subtype corresponding to the subscription node;
[0505] The first sending unit 3060 is further specifically configured to send the transaction result data to a subscription node corresponding to the transaction subtype.
[0506] Optionally, the first transaction in the first block includes an associated object identifier, the subscription nodes are multiple subscription nodes corresponding to the multiple object sets, and the first subscription condition is that the associated object identifier of the first transaction belongs to the object set corresponding to the subscription node;
[0507] The first sending unit 3060 is further specifically configured to send the transaction result data to a subscription node corresponding to the associated object identifier.
[0508] Optionally, the second acquisition unit 3020 is further specifically configured to: if the number of first transactions that meet the first subscription condition among the multiple first transactions is greater than 1, acquire the first transactions that meet the first subscription condition in a predetermined order as the first target transaction, wherein the predetermined order is determined in the following manner:
[0509] Determine a first priority of an associated object of the first transaction;
[0510] Determine a second priority of the subscription node corresponding to the first subscription condition;
[0511] According to the first priority and the second priority, a predetermined order is determined.
[0512] Optionally, the second acquiring unit 3020 is further specifically configured to:
[0513] Determining a first score for the first transaction according to the first priority;
[0514] determining a second score for the first transaction according to the second priority;
[0515] determining an overall score for the first transaction based on the first score and the second score;
[0516] Based on the total score of the first transaction, a predetermined order is determined.
[0517] Optionally, the transaction result data is a variable affected after the execution of the first target transaction;
[0518] The fourth acquisition unit 3050 is specifically used to: if the on-chain verification is successful, obtain the variables affected by the execution of the first target transaction and the second verification information corresponding to the variables;
[0519] The first sending unit 3060 is also specifically used to: send the variable and the second verification information to the subscribing node, so that the subscribing node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, stores the variable for the local consensus network to obtain from the subscribing node.
[0520] Optionally, the fourth acquiring unit 3050 is further specifically configured to:
[0521] Generate a second tree, the second tree includes multiple layers of features, wherein the bottom layer of features of the second tree is a summary value of a variable affected after each first transaction is executed, each first transaction includes a first target transaction; two adjacent features of each layer of the second tree are connected to and generate a feature of a higher layer, until a third tree root feature of the second tree is generated;
[0522] Acquire a second bypass feature of the second path, together with the third tree root feature, as the second verification information, wherein the second path is a path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the third tree root feature, and the second bypass feature is a next-layer feature to which other features on the second path, except for the variable affected by the execution of the first target transaction, are connected;
[0523] The first sending unit 3060 is further specifically configured to:
[0524] Determine a fourth tree root feature of the second tree according to the summary value of the variable and the second bypass feature;
[0525] If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.
[0526] Optionally, the subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space;
[0527] The first sending unit 3060 is further specifically configured to:
[0528] Encrypting the transaction result data with the public key of the local consensus network to obtain first encrypted transaction result data;
[0529] The first encrypted transaction result data is sent to the subscribing node, so that the subscribing node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain the second encrypted transaction result data, and in response to the transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain the first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.
[0530] Reference Fig.31 , Fig.31 The structural block diagram of the terminal part of the blockchain transaction processing method for implementing the embodiment of the present disclosure includes: Radio Frequency (RF) circuit 3110, memory 3115, input unit 3130, display unit 3140, sensor 3150, audio circuit 3160, wireless fidelity (WiFi) module 3170, processor 3180, and power supply 3190. Those skilled in the art can understand that Fig.31 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0531] The RF circuit 3110 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 3180 for processing; in addition, the designed uplink data is sent to the base station.
[0532] The memory 3115 may be used to store software programs and modules. The processor 3180 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 3115 .
[0533] The input unit 3130 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 3130 may include a touch panel 3131 and other input devices 3132.
[0534] The display unit 3140 may be used to display input information or provided information and various menus of the target terminal. The display unit 3140 may include a display panel 3141.
[0535] The audio circuit 3160 , the speaker 3161 , and the microphone 3162 may provide an audio interface.
[0536] In this embodiment, the processor 3180 included in the terminal can execute the blockchain transaction processing method of the previous embodiment.
[0537] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.
[0538] Fig.32 A block diagram of the structure of a portion of a server for implementing the blockchain transaction processing method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 3222 (e.g., one or more processors) and memory 3232, and one or more storage media 3230 (e.g., one or more mass storage devices) storing application programs 3242 or data 3244. Among them, the memory 3232 and the storage medium 3230 may be short-term storage or permanent storage. The program stored in the storage medium 3230 may include one or more modules (not shown in the figure), each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 3222 may be configured to communicate with the storage medium 3230 and execute a series of instruction operations in the storage medium 3230 on the server.
[0539] The server may also include one or more power supplies 3226, one or more wired or wireless network interfaces 3250, one or more input and output interfaces 3258, and / or one or more operating systems 3241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0540] The central processor 3222 in the server can be used to execute the blockchain transaction processing method of the embodiment of the present disclosure.
[0541] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store program code, and the program code is used to execute the blockchain transaction processing method of each of the aforementioned embodiments.
[0542] The present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned blockchain transaction processing method.
[0543] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0544] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0545] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0546] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0547] 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.
[0548] In addition, each functional unit in each embodiment of the present disclosure 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.
[0549] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including a number of 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 various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0550] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0551] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A blockchain transaction processing method, It is characterized in that The blockchain transaction processing method is executed by the target consensus network, and the blockchain transaction processing method includes: Obtaining an added first target block from each first block of the first blockchain, wherein the first block is generated by the target consensus network and is used to record a first transaction of a target type from a local consensus network, and the first blockchain prohibits access from outside the target consensus network; Obtaining a first target transaction and a first block header from the first target block; Acquire first verification information corresponding to the first target transaction; Based on the first target transaction, the first verification information and the first block header, perform on-chain verification of the first target transaction; If the on-chain verification is successful, obtaining the transaction result data of the first target transaction; The transaction result data is sent to a subscribing node so that the local consensus network can obtain it from the subscribing node.
2. The blockchain transaction processing method according to claim 1, It is characterized in that The on-chain verification includes a first sub-verification and a second sub-verification; The performing on-chain verification of the first target transaction based on the first target transaction, the first verification information and the first block header includes: Obtaining a second block header of a next block of the first target block on the first blockchain; Perform a first sub-verification based on the first block header and the second block header; Perform a second sub-verification based on the first target transaction, the first verification information, and the first block header.
3. The blockchain transaction processing method according to claim 2, It is characterized in that The block header of the first block includes a first block body digest value of the first block and a second block body digest value of a previous block of the first block on the first blockchain; The performing a first sub-verification based on the first block header and the second block header includes: If the first block body digest value in the first block header is the same as the second block body digest value in the second block header, it is determined that the first sub-verification is successful.
4. The blockchain transaction processing method according to claim 3, It is characterized in that The acquiring first verification information corresponding to the first target transaction includes: Generate a first tree, the first tree includes multiple layers of features, wherein the bottom layer of features of the first tree is the summary value of multiple first transactions in the first target block, and the multiple first transactions include the first target transaction; two adjacent features of each layer of the first tree are connected to and generate a feature of a higher layer, until a first tree root feature of the first tree is generated, and the first tree root feature is the summary value of the first block body; Acquire a first bypass feature of a first path as the first verification information, wherein the first path is a path between the summary value of the first target transaction on the first tree and the first tree root feature, and the first bypass feature is a next-layer feature to which other features on the first path except the summary value of the first target transaction are connected; The performing a second sub-verification based on the first target transaction, the first verification information and the first block header includes: determining a digest value of the first target transaction; Determine a second tree root feature of the first tree based on the summary value of the first target transaction and the first verification information; If the second tree root feature is consistent with the first block body digest value in the first block header, it is determined that the second sub-verification is successful.
5. The blockchain transaction processing method according to claim 2, It is characterized in that The target consensus network has a first trusted execution environment, the first trusted execution environment has a first secure execution space and a first key, the first secure execution space prohibits external access to the first secure execution space, and each first block of the first blockchain is encrypted with the first key; The obtaining the first target transaction and the first block header from the first target block includes: decrypting the first target block using the first key in the first secure execution space to obtain a decrypted first target block, and obtaining the first target transaction and the first block header from the decrypted first target block; The performing a first sub-verification based on the first block header and the second block header includes: in the first secure execution space, calling a first sub-verification contract recorded on the first blockchain, and performing a first sub-verification based on the first block header and the second block header; The performing a second sub-verification based on the first target transaction, the first verification information and the first block header includes: in the first secure execution space, calling a second sub-verification contract recorded on the first blockchain, and performing a second sub-verification based on the first target transaction, the first verification information and the first block header.
6. The blockchain transaction processing method according to claim 1, It is characterized in that After obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing method further includes: Obtain first blockchain height information of the first blockchain; Forwarding the first blockchain height information to the global consensus network so that the global consensus network synchronizes the first blockchain height information to the local consensus network; The sending of the transaction result data to a subscription node for the local consensus network to obtain from the subscription node includes: sending the transaction result data to a subscription node for the local consensus network to obtain from the subscription node when the first blockchain height information received from the global consensus network is inconsistent with the second blockchain height information last received from the global consensus network.
7. The blockchain transaction processing method according to claim 1, It is characterized in that The first transaction of the target type is obtained by the first relay node and sent to the target consensus network in the following manner: Determining a transaction type of the first transaction generated by the local consensus network; If the transaction type is a non-target type, keeping the first transaction in the local consensus network, and recording the first transaction in a second blockchain by the local consensus network, wherein the second blockchain allows access outside the local consensus network; If the transaction type is the target type, the first transaction is obtained and sent to the target consensus network.
8. The blockchain transaction processing method according to claim 1, It is characterized in that The obtaining the added first target block from each first block of the first blockchain includes: Setting a first blockchain height counter, wherein when one of the first blocks is added to the first blockchain, the first blockchain height counter increases by 1; If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last obtained reaches a first threshold, the first block on the first blockchain from the first block height of the second value plus 1 to the first block with the first value as the first target block is obtained as the first target block; If the difference between the current first value of the first blockchain height counter and the second value when the first target block was last acquired does not reach the first threshold, but the time difference between the current time and the time point when the first target block was last acquired reaches the second threshold, the first block added within the time difference is acquired as the first target block.
9. The blockchain transaction processing method according to claim 1, It is characterized in that Before obtaining the added first target block from each first block of the first blockchain, the blockchain transaction processing method further includes: receiving a first subscription request from the subscription node, wherein the first subscription request has a first subscription condition; The obtaining the added first target block from each first block of the first blockchain includes: Obtaining the first block added to the first blockchain; If the added first block contains a first target transaction that meets the first subscription condition, the added first block is obtained as the first target block.
10. The blockchain transaction processing method according to claim 9, It is characterized in that The first subscription request also includes a subscription period; If the added first block contains a first target transaction that meets the first subscription condition, acquiring the added first block as the first target block includes: Determine a valid subscription request in which the subscription period has not expired in the first subscription request; If the added first block contains a first target transaction that meets the first subscription condition of the valid subscription request, the added first block is obtained as the first target block.
11. The blockchain transaction processing method according to claim 9, It is characterized in that Before receiving the first subscription request of the subscription node, the blockchain transaction processing method further includes: receiving a registration request of the subscription node, the registration request carrying a private key of the subscription node; recording the private key of the subscription node on the first blockchain; The first subscription request includes the private key of the subscription node; After receiving the first subscription request from the subscription node, the blockchain transaction processing method further includes: verifying that the private key included in the first subscription request is consistent with the private key recorded on the first blockchain.
12. The blockchain transaction processing method according to claim 9, It is characterized in that The acquiring the first target transaction from the first target block includes: if the number of the first transactions that meet the first subscription condition among the plurality of the first transactions is greater than 1, acquiring the first transactions that meet the first subscription condition in a predetermined order as the first target transaction, wherein the predetermined order is determined in the following manner: Determining a first priority of an object associated with the first transaction; Determine a second priority of the subscription node corresponding to the first subscription condition; The predetermined order is determined according to the first priority and the second priority.
13. The blockchain transaction processing method according to claim 12, It is characterized in that The determining the predetermined order according to the first priority and the second priority includes: determining a first score for the first transaction according to the first priority; determining a second score for the first transaction according to the second priority; determining a total score for the first transaction based on the first score and the second score; The predetermined order is determined based on the total score of the first transaction.
14. The blockchain transaction processing method according to claim 1, It is characterized in that The transaction result data is the variables affected after the execution of the first target transaction; If the on-chain verification is successful, obtaining the transaction result data of the first target transaction includes: if the on-chain verification is successful, obtaining the variables affected by the execution of the first target transaction, and the second verification information corresponding to the variables; The sending of the transaction result data to the subscription node for the local consensus network to obtain from the subscription node includes: sending the variable and the second verification information to the subscription node, so that the subscription node verifies the transaction result based on the variable and the second verification information, and after the transaction result verification is successful, storing the variable for the local consensus network to obtain from the subscription node.
15. The blockchain transaction processing method according to claim 14, It is characterized in that The obtaining of second verification information corresponding to the variable includes: Generate a second tree, the second tree includes multiple layers of features, wherein the bottom layer of features of the second tree is a summary value of the variable affected after each of the first transactions is executed, and each of the first transactions includes the first target transaction; two adjacent features of each layer of the second tree are connected to and generate a feature of a higher layer, until a third root feature of the second tree is generated; Acquire a second bypass feature of a second path, together with the third tree root feature, as the second verification information, wherein the second path is a path from the summary value of the variable affected by the execution of the first target transaction on the second tree to the third tree root feature, and the second bypass feature is a next-layer feature to which other features on the second path, except for the variable affected by the execution of the first target transaction, are connected; The verifying the transaction result based on the variable and the second verification information includes: Determining a fourth tree root feature of the second tree according to the summary value of the variable and the second bypass feature; If the third tree root feature is consistent with the fourth tree root feature, it is determined that the transaction result verification is successful.
16. The blockchain transaction processing method according to claim 1, It is characterized in that The subscription node has a second trusted execution environment, the second trusted execution environment has a second secure execution space and a second key, and the second secure execution space prohibits external access to the second secure execution space; The sending of the transaction result data to a subscription node, so that the local consensus network can obtain the transaction result data from the subscription node, includes: Encrypting the transaction result data using the public key of the local consensus network to obtain first encrypted transaction result data; The first encrypted transaction result data is sent to the subscription node, so that the subscription node encrypts the first encrypted transaction result data with the second key in the second secure execution space to obtain second encrypted transaction result data, and in response to a transaction result data acquisition request from the local consensus network, decrypts the second encrypted transaction result data with the second key in the second secure execution space to obtain first decrypted transaction result data, and sends the first decrypted transaction result data to the local consensus network, which decrypts the first decrypted transaction result data using the private key of the local consensus network to obtain the transaction result data.
17. A blockchain transaction processing device, It is characterized in that The blockchain transaction processing device is located in the target consensus network, and the blockchain transaction processing device includes: A first acquisition unit is configured to acquire an added first target block from each first block of a first blockchain, wherein the first block is generated by the target consensus network and is configured to record a first transaction of a target type from a local consensus network, and the first blockchain is prohibited from being accessed by anyone outside the target consensus network; A second acquisition unit, configured to acquire a first target transaction and a first block header from the first target block; A third acquisition unit, configured to acquire first verification information corresponding to the first target transaction; An on-chain verification unit, configured to perform on-chain verification of the first target transaction based on the first target transaction, the first verification information, and the first block header; A fourth acquisition unit, configured to acquire transaction result data of the first target transaction if the on-chain verification is successful; The first sending unit is used to send the transaction result data to the subscription node, so that the local consensus network can obtain it from the subscription node.
18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the blockchain transaction processing method according to any one of claims 1 to 16 is implemented.
19. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the blockchain transaction processing method according to any one of claims 1 to 16 is implemented.
20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain transaction processing method according to any one of claims 1 to 16.
