A method and system for off-chain trusted execution of blockchain computing-intensive transactions

By adopting off-chain trusted execution methods in the blockchain, computing intensive transactions are captured and computing trees are generated, and arbitration is determined during the public announcement period, the problems of waste of computing intensive transaction verification resources and data freezing are solved, and the block is improved chain scalability and data availability.

CN117911027BActive Publication Date: 2025-01-07SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410101310.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2025-01-07
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

The verification process of computing-intensive transactions in blockchain consumes a lot of computing power, resulting in waste of network resources and reduced throughput, and the off-chain computing protocol requires data freezing, affecting data availability.

Method used

The off-chain trusted execution method is adopted to capture transactions through calculation nodes and generate calculation trees, monitor and compare results during the public announcement period. If there is objection, arbitration will determine the correct result to ensure the correctness and availability of transaction results.

Benefits of technology

It effectively saves on-chain computing costs, improves the scalability of the blockchain, ensures the correctness of the calculation results and the timely availability of data, and avoids the inefficiency caused by waiting for confirmation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117911027B_ABST
    Figure CN117911027B_ABST
Patent Text Reader

Abstract

The present invention relates to a trusted execution method and system for blockchain computing-intensive transactions. The computing nodes under the chain of the present invention execute transaction calculations and package the calculation tree and the calculation results together and publish them on the blockchain; during the publicity period of the transaction results, all computing nodes monitor and compare whether the calculation results on the blockchain are the same as the local results, and if they are different, a transaction objection is initiated; the publisher of the calculation results receives the transaction objection information and publishes the variable status that is objected to in its own calculation tree; the consensus node arbitrates the correctness of the specified variable status and takes the final honest one as the latest result of the transaction; according to the availability status of the computing-intensive transaction, it is checked whether the transaction result meets the confirmation condition, and the relevant transaction results that do not meet the confirmation condition are discarded. A large number of transaction calculations are executed on a small number of nodes under the chain, thereby reducing the calculation overhead of the blockchain node when verifying the transaction, and preventing the long execution time of the computing-intensive transaction from blocking the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain, and in particular to an off-chain trusted execution method and system for blockchain computing-intensive transactions. Background Art

[0002] Blockchain is a distributed ledger maintained by multiple parties. Transaction information is packaged into blocks for storage and broadcast to all participants for verification and execution before consensus can be reached on the new ledger. Each participant in the blockchain network has his or her own ledger, and can resolve erroneous information through mutual verification without the involvement of a third party. With the decentralized nature of blockchain technology, it has been applied in more and more fields, and more types of transactions with different characteristics from different systems and businesses have gradually emerged. Supporting these transactions has become a new challenge facing blockchain. In particular, computationally intensive transactions have caused the computing power consumption contained in blockchain transactions to continue to rise, and the challenges brought to blockchain have become non-negligible.

[0003] For computationally intensive transactions, considering that transactions in the blockchain need to be verified by all participants re-executing the computational process, the more participants there are in the blockchain network, the more total computing power is consumed to process transactions, resulting in a huge waste of overall network resources. In addition, the verification time for computationally intensive transactions is too long, making it impossible for the blockchain system to maintain high throughput, affecting its practical value. And for nodes with poor computing performance, the huge computing threshold makes it impossible for them to participate in consensus in a timely manner, affecting the data security of the entire blockchain.

[0004] Off-chain computing is a secure and verifiable solution that moves transactions that are computationally expensive on the chain off-chain, and then the resulting computational results are uploaded to the chain. A large number of computational processes only need to be completed in a small number of nodes with rich computing power, and most ordinary nodes do not need to re-execute contracts, which greatly alleviates the computing power burden of the blockchain system. However, when the results of the transaction are resubmitted to the chain, how to verify the correctness of the results requires a secure and reliable off-chain computing protocol to ensure it. The current off-chain computing protocol requires that the relevant data must be frozen before the transaction is completed off-chain and submitted to the chain for authenticity verification, which seriously affects the data availability of the blockchain. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present invention provides an off-chain trusted execution method and system for blockchain computing-intensive transactions.

[0006] In a first aspect, the present invention provides a method for off-chain trusted execution of blockchain computing-intensive transactions, comprising:

[0007] The computing node captures the computation-intensive transactions published in the blockchain and completes the computational tasks in the computation-intensive transactions. During the execution process, it records the variable status of each recording point, generates a computation tree, and packages the computation tree and the computation results together and publishes them on the blockchain.

[0008] After the transaction is published to the blockchain, it enters the set publicity period. During the publicity period, all computing nodes monitor and compare the calculation results of the target computing-intensive transaction published on the blockchain with the local results. If they are different, a transaction objection is raised. The computing node that publishes the new block of the target computing-intensive transaction calculation result receives the transaction objection information and announces the variable status in the computing node's own computing tree that is subject to the objection. The consensus node arbitrates the correctness of the specified variable status in the target computing-intensive transaction and takes the final honest one as the latest result of the transaction.

[0009] At the end of the publicity period, the transaction results are checked to see if they meet the confirmation conditions based on the availability status of the computationally intensive transactions, and the related transaction results that do not meet the confirmation conditions are discarded. The data in the calculation results of the target computationally intensive transactions in the publicity period and the availability status of subsequent data based on the calculation results are controlled. All states in the publicity period are unconfirmed. If a calculation result data has not received any objection at present, it can be confirmed after the publicity period ends. If the calculation result is being disputed, the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained. The calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result, and continue to wait for the end of the publicity period. The confirmation of subsequent data based on the calculation result is based on the confirmation status of the previous calculation result.

[0010] Furthermore, during the execution of the computing task, the total logical time spent is defined as the number of basic operations in the computing task, marked as k, and divided into n parts on average. n moments {k / n, 2k / n, 3k / n, …, k} are found as n recording points of the computing task, and the variable state of each recording point is recorded. A hash function is used to summarize the entire variable state as a recording point state summary, and the recording point state summary is constructed into a Merkle tree as a computing tree.

[0011] Furthermore, the process of a computing node initiating a transaction objection includes: other computing nodes listening and receiving a new block on the blockchain containing the computation result;

[0012] Any other computing node checks whether the calculation result of the target computation-intensive transaction in the computing node is consistent with the calculation result in the new block; if they are consistent, the new block will be accepted by the other computing node; if they are inconsistent, the other computing node will broadcast to the entire network to request the publisher of the target computation-intensive transaction to obtain the complete computation tree of the target computation-intensive transaction;

[0013] Check whether the request gets a correct response. If not, wait for a response within the waiting period. If the waiting period is exceeded, it will be considered invalid. If a correct response is received from the publisher, compare the local computation tree of the other computing node with that of the publisher to find the abnormal hash value at the minimum moment, that is, the variable state summary of the minimum moment abnormality as the objection target. Publish the objection target computationally intensive transaction ID, local computation results, and the questioned variable state summary as objection information on the blockchain.

[0014] Furthermore, the transaction response process includes the following steps: the transaction response module of the publisher of the computation-intensive transaction calculation result and the new block of the computation tree receives the transaction objection information of other computing nodes;

[0015] The publisher obtains the state summary of the disputed record point stated in the transaction dispute information, determines the difference record point according to the state summary of the record point, executes the calculation fragment from the preceding record point of the difference record point, and obtains the state summary of the new record point at the difference record point;

[0016] Compare the newly obtained variable state summary with the record point state summary in the transaction objection information to see if they are consistent; if they are consistent, stop responding to the objection; if they are inconsistent, send the two record point state summaries and the path from the record point state summary to the computation tree to the blockchain.

[0017] Furthermore, the arbitration process includes the following steps:

[0018] The consensus node detects a transaction objection to the target computationally intensive transaction in the new block;

[0019] The consensus node detects whether the path from the state summary declared in the transaction objection information to the root of the computation tree is correct. If not, the transaction objection information is marked as invalid. If correct, the consensus node broadcasts a request to the entire network to obtain the complete state content corresponding to the state summary in the transaction objection information.

[0020] Check whether the consensus node receives the objection response information within a certain period of time; if not, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target computation-intensive transaction; if the objection response information is received, check whether the path from the state summary declared in the objection response information to the tree root is correct. If not, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target computation-intensive transaction; if correct, the consensus node broadcasts a request to the entire network to obtain the complete state content corresponding to the state summary in the response information;

[0021] Check whether the request to obtain the complete status content corresponding to the status summary is responded to; if there is no response, wait for a response within the waiting period, and it will be considered invalid if the waiting period is exceeded; if a response is received, the consensus node executes the calculation fragment between the difference record point and its predecessor record point, obtains the calculation result and retains the honest one in the original calculation result and the calculation result of the objection node.

[0022] Furthermore, the consensus node publishes the request information for obtaining the publisher's computation tree on the chain and sets a waiting period, which is independent of the public period of computationally intensive transactions;

[0023] Check whether the request information for obtaining the publisher's computation tree before the end of the waiting period is correctly responded to; if it is correctly responded to, the corresponding computing node or consensus node continues the objection process; if it is not correctly responded to, the response fails and the corresponding computation result is marked as invalid.

[0024] Furthermore, discarding related transaction results that do not meet the confirmation conditions includes the following steps: constructing a transaction dependency graph based on the read-write sets of all transactions; at the end of the public announcement period of the target computing-intensive transaction, detecting whether the contract meets the confirmation conditions; if so, the calculation result of the target computing-intensive transaction is successfully confirmed; if the constraints are not met, the calculation result of the target computing-intensive transaction is discarded, and according to the transaction dependency graph, all subsequent transactions that depend on the discarded results and the subsequent transaction results are discarded together.

[0025] In a second aspect, the present invention provides an off-chain trusted execution system for blockchain computing-intensive transactions, comprising: an arbitration module deployed on a consensus node, an off-chain transaction execution module, a transaction objection module, a transaction response module, and an asynchronous use module deployed on a computing node;

[0026] The off-chain transaction execution module is responsible for capturing computationally intensive transactions published in the blockchain, completing the computational tasks in the transactions, and publishing the computational results and the root signature of the resulting computational tree to the blockchain.

[0027] After the transaction is published to the blockchain, it enters the set public announcement period; during the public announcement period, the transaction objection module of all computing nodes is responsible for monitoring and comparing the results of the target computing-intensive transaction published on the blockchain with the local results. If they are different, an objection is raised, requiring the consensus node to enable the arbitration module to arbitrate the correctness of a certain computing fragment in the target computing-intensive transaction. If they are different, a transaction objection is raised; the transaction response module of the computing node that publishes the new block of the target computing-intensive transaction calculation result receives the transaction objection information and announces the variable status that is disputed in the computing node's own computing tree; the arbitration module of the consensus node arbitrates the correctness of the specified variable status in the target computing-intensive transaction, and takes the final honest one as the latest result of the transaction;

[0028] At the end of the publicity period, the asynchronous use module checks whether the transaction result meets the confirmation conditions and discards the relevant transaction results that do not meet the confirmation conditions. Among them, the asynchronous use module deployed on the computing node is responsible for controlling the data in the calculation results of the target computing-intensive transactions in the publicity period and the availability status of subsequent data obtained based on the calculation results; all states in the publicity period are unconfirmed. If a calculation result data has not received any objection at present, it can be confirmed after waiting for the end of the publicity period. If the calculation result is being disputed, then the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained; the calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result, and continue to wait for the end of the publicity period; the confirmation of subsequent data based on the calculation result is based on the confirmation status of the previous calculation result.

[0029] Furthermore, the transaction response module of the computing node monitors the newly arrived blocks. If there is an objection in the block, the transaction response module finds all the variable state record points recorded in the off-chain execution module, finds the preceding record point of the difference record point declared in the objection, and then executes the calculation fragment after the preceding record point to obtain the variable state summary of the next record point; if the variable state summary of the record point is the same as that declared in the objection, the response module stops and waits for the other party's result to replace its own result; if the variable state summary of the record point is different from that in the objection, then immediately initiate an objection response to declare its own two record point variable state summaries and the path from the record point variable state summary to the calculation tree.

[0030] Furthermore, the off-chain trusted execution system for blockchain computationally intensive transactions includes a response control module deployed on computing nodes and consensus nodes;

[0031] The response control module is responsible for issuing a common transaction when the transaction objection module requests the specific computation tree corresponding to the computation tree root from the blockchain network. If no response is received from other computation nodes, the response control module declares that no computation node is responsible for the computation result. The consensus node judges the statement and invalidates the result if the judgment is satisfactory.

[0032] The response control module is called when the arbitration module requests the complete variable status corresponding to the status summary from the blockchain network. If no response is obtained, a transaction will also be initiated to declare that no one is responsible for the result, and the consensus node will determine whether it is invalid.

[0033] The above technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:

[0034] The present invention transfers the execution of computationally intensive transactions from on-chain to off-chain, saving computational costs on the chain and effectively solving the scalability problem of blockchain. The present invention reasonably questions and verifies the computational results on the chain through local computations of other computing nodes through transaction objections, transaction objection responses and result arbitration, thereby ensuring the correctness of the computational results. The present invention manages the availability status of transaction computational results, allowing data in the public disclosure period to participate in subsequent transactions, avoiding the inefficiency caused by waiting for data confirmation time, and at the same time, through proper data status control and inspection, ensuring that correct data will be confirmed and incorrect data will not be confirmed. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

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

[0037] Figure 1 An architectural diagram of an off-chain trusted execution system for blockchain computing-intensive transactions provided by an embodiment of the present invention;

[0038] Figure 2 A flowchart of off-chain transaction execution provided by an embodiment of the present invention;

[0039] Figure 3 A flowchart of a computing node initiating a transaction objection provided by an embodiment of the present invention;

[0040] Figure 4 A flow chart of a transaction objection response provided by an embodiment of the present invention;

[0041] Figure 5 A flowchart of objection arbitration provided for an embodiment of the present invention;

[0042] Figure 6 A flowchart of controlling the execution of objection or arbitration according to request information for obtaining a publisher's computation tree provided by an embodiment of the present invention;

[0043] Figure 7 A flow chart of discarding relevant transaction results that do not meet confirmation conditions provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0046] A method for off-chain trusted execution of computationally intensive blockchain transactions, comprising:

[0047] When a user publishes a computationally intensive transaction, the off-chain transaction execution module deployed on the computing node obtains the computationally intensive transaction data and completes the computational tasks in the computationally intensive transaction. During the execution process, the variable status of each recording point is recorded, a computation tree is generated, and the computation results are packaged and uploaded to the chain.

[0048] During the execution of the computing task, the total logical duration is defined as the number of basic operations in the computing task, marked as k, and divided into n parts, then n moments can be found, namely {k / n, 2k / n, 3k / n, …, k}. These moments are defined as n recording points of the computing task, and the calculations occurring between the recording points are defined as a computing fragment. The variable state of each recording point is recorded, and a hash function is used to summarize the entire variable state as the recording point state summary, and the recording point state summary is constructed as a Merkle tree, recorded as a computing tree.

[0049] like Figure 2 As shown in the figure, the process of off-chain transaction execution includes:

[0050] Step S20: The user publishes the target computationally intensive transaction and broadcasts it to the blockchain network.

[0051] Step S21, the computing node identifies the target computing-intensive transaction and processes it by the off-chain computing execution module.

[0052] Step S22, the off-chain computing execution module analyzes the contract code to obtain the number k of basic operations in the contract as the logical execution time of the contract, and divides it into n parts to obtain n recording points of the computing task.

[0053] Step S23, the off-chain computing execution module executes the contract code and records the data of the state variables at the n recording points respectively.

[0054] In step S24, the off-chain computing execution module uses a hash function to obtain the hash value of the variable state data of the n recording points as a whole as the recording point state summary, and constructs the recording point state summary into a Merkle tree in chronological order, which is recorded as a computing tree.

[0055] Step S25, the off-chain computing execution module packages the calculation results of the target computing-intensive transaction and the calculation tree root signature and publishes them on the blockchain.

[0056] After the transaction is published to the blockchain through the off-chain transaction execution module, it enters the set public announcement period T. During the public announcement period T, other computing nodes are allowed to object to the calculation results.

[0057] During the public announcement period, the transaction objection module of all computing nodes is responsible for monitoring and comparing the calculation results of the target computing-intensive transactions published on the blockchain with the local results. If they are different, an objection will be raised. Figure 3 As shown, the process of a computing node initiating a transaction objection includes the following steps:

[0058] Step S30, the transaction objection modules of other computing nodes are responsible for monitoring and receiving new blocks containing calculation results on the blockchain.

[0059] In step S31, any other computing node transaction objection module checks whether the local calculation result of the computing node is consistent with the calculation result in the new block. If they are consistent, it proceeds to step S32, and the new block will be accepted by the other computing node; if they are inconsistent, it proceeds to step S33, and the other computing node will broadcast to the entire network to request the publisher to obtain the complete calculation tree of the target computing-intensive transaction.

[0060] Step S34, check whether the request has received a correct response. If not, proceed to step S35, which is handled by the response control module; if the publisher has received a correct response, proceed to step S36, compare the local computation tree of the other computing node with the publisher's computation tree, and find the abnormal hash value at the minimum time, that is, the variable state summary of the minimum abnormal time as the objection target. Figure 6 As shown, in the specific implementation process, the response control module controls the execution of the objection according to the request information of obtaining the publisher's computing tree, including the following steps: Step S60, publish the request information of obtaining the publisher's computing tree on the chain, and set a waiting period, which is independent of the public period of the target computing-intensive transaction. Step S61, check whether a correct response is obtained before the end of the waiting period. If a correct response is obtained, then enter step S62, and the computing node continues the objection process; if it is not correctly responded, then enter step S63, the response fails, and the corresponding calculation result is marked as invalid.

[0061] Step S37, publishing the target computationally intensive transaction ID, local computation results, and the questioned record point status summary as transaction objection information to the blockchain.

[0062] The transaction response module deployed on the computing node receives the transaction objection information, publishes the state of the objected variable in the computing tree of the computing node, and waits for arbitration by the consensus node.

[0063] In the specific implementation process, Figure 4 As shown, the transaction objection response process includes the following steps:

[0064] Step S40: The transaction response module of the publisher receives the transaction objection information from other computing nodes.

[0065] Step S41, the publisher obtains the difference record point declared in the transaction objection information, executes the calculation fragment from its preceding record point, and obtains the variable state summary at the difference record point.

[0066] Step S42: Compare the newly obtained variable state summary with the transaction objection information to see if they are consistent. If they are consistent, proceed to step S43 and stop responding to objections; if they are inconsistent, proceed to step S44 and send the two variable state summaries and the path from the state summary to the computation tree to the blockchain.

[0067] The arbitration module of the consensus node arbitrates the correctness of the state of the specified variables in the target computationally intensive transaction, and takes the final honest person as the latest result of the transaction; the final honest person is taken as the latest result of the transaction.

[0068] See also Figure 5 As shown, the objection arbitration process includes the following steps:

[0069] Step S50: the arbitration module detects transaction objection information about a target computationally intensive transaction in the new block.

[0070] Step S51, check whether the path from the status summary declared in the transaction objection information to the tree root is correct. If not, proceed to step S52, and the transaction objection information is marked as invalid; if correct, proceed to step S53, and the arbitration module broadcasts to the entire network to request the complete status content corresponding to the status summary in the transaction objection information.

[0071] Step S54, detect whether the arbitration module receives the objection response information within a certain period of time. If not, proceed to step S55, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target computationally intensive transaction; if the objection response information is received, proceed to step S56.

[0072] Step S56, check whether the path from the status summary declared in the response information to the tree root is correct. If not, proceed to step S57, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target computationally intensive transaction; if correct, proceed to step S58, and the arbitration module broadcasts a request to the entire network to obtain the complete status content corresponding to the status summary in the response information.

[0073] Step S59, detect whether the request to obtain the complete status content corresponding to the status summary is responded. If there is no response, enter step S510, which is processed by the response control module; if a response is obtained, enter step S511, the arbitration module executes the calculation fragment between the difference record point and its predecessor record point, obtains the calculation result and retains the honest one in the original calculation result and the calculation result of the objection node. In the specific implementation process, the execution process of the response control module includes the following steps: Step S60, publish the request information for obtaining the publisher's calculation tree on the chain, and set a waiting period, which is independent of the public announcement period of the target computationally intensive transaction. Step S61, detect whether a correct response is obtained before the end of the waiting period. If a correct response is obtained, enter step S62, and the arbitration module continues the objection process; if it is not correctly responded, enter step S63, the response fails, and the corresponding calculation result is marked as invalid.

[0074] At the end of the public announcement period, the asynchronous use module checks whether the transaction results meet the confirmation conditions based on the availability status of the computationally intensive transactions, and discards the relevant transaction results that do not meet the confirmation conditions to prevent the writing of erroneous data. In the specific implementation process, the data in the calculation results of the target computationally intensive transactions in the public announcement period and the availability status of the subsequent data obtained based on the calculation results are controlled; all states in the public announcement period are unconfirmed. If a calculation result data has not received any objection at present, it can be confirmed after waiting for the end of the public announcement period. If the calculation result is being disputed, then the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained; the calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result, and continue to wait for the end of the public announcement period; the confirmation of subsequent data based on the calculation result is based on the confirmation status of the previous calculation result.

[0075] Figure 7 Executing the discarding of relevant transaction results that do not meet the confirmation conditions for the asynchronous control module includes the following steps:

[0076] Step S70, constructing a transaction dependency graph based on the read-write sets of all transactions.

[0077] Step S71, at the end of the publicity period of the target computationally intensive transaction, check whether the contract meets the confirmation conditions. If so, proceed to step S72, and the calculation result of the target computationally intensive transaction is successfully confirmed; if not, proceed to step S73, and the result is discarded.

[0078] Step S74: According to the transaction dependency graph, all subsequent transactions that depend on the discarded result and the subsequent transaction results are marked as discarded.

[0079] Example 2

[0080] The present invention proposes an off-chain execution system for computationally intensive transactions, which acts on a blockchain network. This application divides all blockchain nodes on the blockchain network into two categories: computing nodes and consensus nodes. The computing nodes and consensus nodes cooperate to implement the off-chain trusted execution method for the blockchain computationally intensive transactions. The off-chain trusted execution system for blockchain computationally intensive transactions includes 6 modules, namely: off-chain transaction execution module, transaction objection module, transaction response module, response control module, asynchronous control module, and arbitration module. Consensus nodes need to deploy arbitration modules and response control modules, while computing nodes need to deploy five modules other than the arbitration module. The specific technical solution is as follows:

[0081] The off-chain transaction execution module is responsible for capturing computationally intensive transactions published in the blockchain, completing the computational tasks in the transactions, and publishing the computational results to the blockchain. Specifically, it includes the following steps:

[0082] When there is a new computationally intensive transaction in the blockchain, this computationally intensive transaction will be included in the block and propagated to the computing node along with the block. After the computing node recognizes this computationally intensive transaction, it starts the off-chain transaction execution module to process this computationally intensive transaction. The process does not block the computing node from continuing to execute the consensus of blocks and other ordinary transactions. The two are in a completely asynchronous and parallel relationship.

[0083] The off-chain transaction execution module will complete the computational tasks described in the target computationally intensive transaction. During the execution of the computational task, assume that the total logical time spent is the number of basic operations in the computational task, marked as k, and it is evenly divided into n parts, then n moments can be found, namely {k / n, 2k / n, 3k / n, …, k}. These moments are the n recording points of the calculation, and the calculation between the recording points is called a computational fragment. The variable states of the internal variables of the transaction at these moments are recorded, and the hash function is used to summarize the entire variable state, which is called the recording point state summary, and the recording point state summary is constructed into a Merkle tree as the computational tree.

[0084] After the target computationally intensive transaction is calculated, the off-chain transaction execution module will sign the transaction execution result and the root of the computation tree together, and then publish them to the blockchain.

[0085] The period of time after a computationally intensive transaction is published to the blockchain through the off-chain transaction execution module is called the public announcement period T. After the public announcement period, the calculation results of the computationally intensive transaction are officially deemed to be unchangeable, but during the public announcement period T, the transaction objection module of all computing nodes is responsible for monitoring and comparing the results of the target computationally intensive transaction published on the blockchain with the local results. If they are different, a normal transaction is initiated on the blockchain. The content of the transaction is to require the ordinary consensus node to enable the arbitration module to arbitrate the correctness of a certain computational fragment in the target computationally intensive transaction. Specifically, the following steps are included:

[0086] The computing node uses the transaction objection module to monitor the blockchain network at any time. When a new block arrives, the transaction objection module detects that the block contains the calculation result of a target computationally intensive transaction. The transaction objection module immediately compares the calculation result with the calculation result recorded in the local off-chain transaction execution module.

[0087] If the comparison finds that the calculation results are the same, the transaction objection module ends its work. If it is found that the results published by other computing nodes are different from the local results, the objector requests to obtain the publisher's calculation tree and compare it with the local calculation tree, starting from the root of the tree until the variable state record point with the smallest difference is found, and then the objection module initiates a normal transaction, which states the target calculation-intensive transaction, the record point with the difference and its preceding record point, the state summary corresponding to the two record points, the path from the state summary to the calculation tree, the local target calculation-intensive transaction execution result, the local calculation tree root, and then publishes it on the blockchain.

[0088] The transaction response module of the computing node that publishes the new block of the target computing-intensive transaction calculation result is responsible for monitoring whether other computing nodes have raised objections to the target computing-intensive transaction results they have published. If an objection is received, it is necessary to provide evidence to prove that its own result is correct and the other party's objection is wrong. Otherwise, the result of the objecting party will become the new calculation result, and continue to accept objections from other computing nodes. The specific contents include:

[0089] The transaction response module listens to the newly arrived blocks. If there is a transaction in the block that declares an objection to the results submitted by the computing node, the transaction response module will quickly find all the variable state record points recorded in the off-chain execution module, find the preceding record point of the difference record point declared by the objection, and then quickly execute the calculation fragment after the preceding record point to obtain the next record point variable state summary. If the state summary is the same as that declared in the objection, the response module stops and waits for the other party's result to replace its own result. If the state summary is different from that in the objection, then immediately initiate an objection response to declare the variable state summaries of the two record points on the side, as well as the path from the record point variable state summary to the calculation tree.

[0090] The arbitration module is deployed on the consensus node and is responsible for arbitrating disputes raised by computing nodes, that is, judging which result of the objection and the response is correct. Finally, after the public notice period ends, the execution result of the target computing-intensive transaction is officially confirmed. Specifically, it includes the following:

[0091] The arbitration module monitors the newly arrived block and finds that there is a transaction in it, which declares an objection to the execution result of a target computation-intensive transaction. The arbitration module then checks whether the path from the two record point variable state summaries declared in the objection transaction to the root of the computation tree is correct. If not, the objection transaction is invalid. If correct, a transaction needs to be broadcast in the blockchain network to obtain the complete state content corresponding to the state summary declared in the objection. Next, wait for the response transaction in the newly arrived block. If it does not arrive within a certain time limit, the objection is considered valid, and the execution result of the target computation-intensive transaction declared in the objection transaction is recognized as the latest result, and the objection continues to be accepted. If a response arrives within the time limit, first verify the correctness of the two state summaries in the response transaction to the computation tree. If it is incorrect, the response fails. If it is correct, obtain the complete content corresponding to the state summary in the blockchain network. Then the arbitration module re-executes the computation fragments between the two record points. If the calculation result is consistent with the statement in the objection, then the objection is successful and the result in the objection becomes the latest result. Otherwise, the response is successful, the original target computation-intensive transaction calculation result is still valid, and the next objection is received.

[0092] When the public notice period T ends, the arbitration module marks the latest result of the target computing-intensive transaction as confirmed, no objections will be accepted, and the execution result will be credibly confirmed.

[0093] The above is the complete process of the off-chain trusted execution protocol. In addition, there are response control modules and asynchronous use modules for additional functional control, which are:

[0094] The response control module is responsible for issuing a normal transaction when the objection module requests the specific computation tree corresponding to the computation tree root from the blockchain network. If no response is received from other computation nodes, the response control module declares that no computation node is responsible for the computation result. The consensus node judges the statement and invalidates the result if the judgment is satisfactory. The response control module is also called when the arbitration module requests the complete variable state corresponding to the state summary from the blockchain network. If no response is obtained, a transaction is also initiated to declare that no one is responsible for the result, and the consensus node determines whether to invalidate it.

[0095] The asynchronous use module is responsible for controlling the availability status of the data in the execution results of the target computationally intensive transactions in the public announcement period. All states in the public announcement period are unconfirmed. In particular, if a result data has not received any objections at present, then he only needs to wait for the end of the public announcement period to obtain confirmation. If the result is being disputed, then the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained. The calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result and continue to wait for the end of the public announcement period. In short, the execution result of the target computationally intensive transaction waiting for the end of the public announcement period is unique, and the result will only be confirmed after the end of the public announcement period.

[0096] Another responsibility of the asynchronous use module is to enable the trusted execution protocol under the transaction chain to allow unconfirmed data in the public disclosure period to be used, so as to improve the efficiency of transaction data usage. However, any modification to the data, or any data derived from these data, will also be marked as unconfirmed. It is not until the end of the public disclosure period that this series of data will be judged whether it has been officially confirmed. The judgment process mainly refers to judging whether the data used or indirectly used by the transaction that generated the data is still in the public disclosure period. If any earlier data is in the public disclosure period, then any data generated later will still be in the public disclosure period.

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

[0098] 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.

[0099] In addition, each functional unit in each embodiment of the present invention 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.

[0100] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A trusted execution method for off-chain computationally intensive transactions on a blockchain, characterized in that: include: The computing node captures the computation-intensive transactions published in the blockchain and completes the computational tasks in the computation-intensive transactions. During the execution process, it records the variable status of each recording point, generates a computation tree, and packages the computation tree and the computation results together and publishes them on the blockchain. After the transaction is published to the blockchain, it enters the set public announcement period. During the public announcement period, all computing nodes listen and compare whether the calculation results of the target computing-intensive transaction published on the blockchain are the same as the local results. If they are different, a transaction objection is initiated. The process of a computing node initiating a transaction objection includes: other computing nodes listen and receive a new block containing the calculation results on the blockchain; any other computing node checks whether the calculation result of the local target computing-intensive transaction of the computing node is consistent with the calculation result in the new block; if they are consistent, the new block will be accepted by the other computing node; if they are inconsistent, the other computing node will broadcast to the entire network to request the publisher of the target computing-intensive transaction to obtain the complete calculation tree of the target computing-intensive transaction; check whether the request is correctly responded to, if not, wait for a response within the waiting period, and it will be deemed invalid if the waiting period is exceeded; if a correct response is obtained from the publisher, compare the local calculation tree of the other computing node with the publisher, find the abnormal hash value at the minimum moment, that is, the variable state summary of the minimum moment abnormality as the objection target; publish the objection target computing-intensive transaction ID, local calculation result and questioned variable state summary as objection information on the blockchain; The computing node that publishes the new block of the target computing-intensive transaction calculation result receives the transaction objection information and publishes the variable status that is disputed in the computing node's own computing tree; wherein the transaction objection response process includes the following steps: the transaction response module of the publisher of the computing-intensive transaction calculation result and the new block of the computing tree receives the transaction objection information of other computing nodes; the publisher obtains the record point status summary that is disputed as stated in the transaction objection information, determines the difference record point according to the record point status summary, executes the calculation fragment from the previous record point of the difference record point, and obtains the new record point status summary at the difference record point; compares whether the newly obtained variable status summary is consistent with the record point status summary in the transaction objection information; if they are consistent, stops responding to the objection; if they are inconsistent, sends the two record point status summaries and the path from the record point status summary to the root of the computing tree to the blockchain; The consensus node arbitrates the correctness of the state of the specified variables in the target computationally intensive transaction, and takes the final honest one as the latest result of the transaction; the arbitration process includes the following steps: the consensus node detects the transaction objection information of the target computationally intensive transaction in the new block; the consensus node detects whether the path from the state summary declared in the transaction objection information to the root of the computation tree is correct. If not, the transaction objection information is marked as invalid; if correct, the consensus node broadcasts to the entire network to request the complete state content corresponding to the state summary in the transaction objection information; detects whether the consensus node receives the objection response information within a certain period of time; if not, the objection is successful, and the calculation result of the objection node is used as the original target computationally intensive transaction. The latest result of the type transaction; if an objection response message is received, it is detected whether the path from the state summary declared in the objection response message to the tree root is correct. If not, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target computationally intensive transaction; if it is correct, the consensus node broadcasts a request to the entire network to obtain the complete state content corresponding to the state summary in the response message; detect whether the request to obtain the complete state content corresponding to the state summary is responded to; if there is no response, wait for a response within the waiting period, and it will be deemed invalid if the waiting period is exceeded; if a response is received, the consensus node executes the calculation fragment between the difference record point and its predecessor record point, obtains the calculation result, and retains the honest one in the original calculation result and the calculation result of the objection node; Check whether the transaction results meet the confirmation conditions according to the availability status of the computationally intensive transactions. At the end of the publicity period, discard the relevant transaction results that do not meet the confirmation conditions; control the availability status of the data in the calculation results of the target computationally intensive transactions in the publicity period and the subsequent data obtained based on the calculation results; all states in the publicity period are unconfirmed. If a calculation result data has not received any objection at present, it can be confirmed after the publicity period ends. If the calculation result is being disputed, then the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained; the calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result, and continue to wait for the end of the publicity period; the confirmation of subsequent data based on the calculation result is based on the confirmation status of the previous calculation result.

2. The off-chain trusted execution method for blockchain computing-intensive transactions according to claim 1, characterized in that: During the execution of the computing task, the total logical time spent is defined as the number of basic operations in the computing task, marked as k, and divided into n parts on average to find n moments. As n recording points of the computing task, the variable state of each recording point is recorded, a hash function is used to take a summary of the variable state as a whole as the recording point state summary, and the recording point state summary is constructed into a Merkle tree as a computing tree.

3. The off-chain trusted execution method for blockchain computing-intensive transactions according to claim 1, characterized in that: The consensus node will publish the request information of the publisher's computation tree on the chain and set a waiting period, which is independent of the publicity period of computation-intensive transactions; Check whether the request information for obtaining the publisher's computation tree is correctly responded to before the waiting period ends; If a correct response is received, the corresponding computing node or consensus node continues the objection process; If it is not responded to correctly, the response fails and the corresponding calculation result is marked as invalid.

4. The off-chain trusted execution method for blockchain computing-intensive transactions according to claim 1, characterized in that: Abandoning relevant transaction results that do not meet the confirmation conditions includes the following steps: constructing a transaction dependency graph based on the read-write sets of all transactions; at the end of the public announcement period of the target computing-intensive transaction, detecting whether the contract meets the confirmation conditions; if so, the calculation result of the target computing-intensive transaction is successfully confirmed; if the constraints are not met, the calculation result of the target computing-intensive transaction is abandoned, and according to the transaction dependency graph, all subsequent transactions that depend on the abandoned results and the subsequent transaction results are abandoned together.

5. An off-chain trusted execution system for blockchain computationally intensive transactions, characterized in that: include: The arbitration module deployed on the consensus node, the off-chain transaction execution module, transaction objection module, transaction response module and asynchronous use module deployed on the computing node; The off-chain transaction execution module is responsible for capturing computationally intensive transactions published in the blockchain, completing the computational tasks in the transactions, and publishing the computational results and the root signature of the resulting computational tree to the blockchain. After the transaction is published to the blockchain, it enters the set publicity period; During the public announcement period, the transaction objection module of all computing nodes is responsible for monitoring and comparing the results of the target computing-intensive transaction published on the blockchain with the local results. If they are different, an objection is raised, requiring the consensus node to enable the arbitration module to arbitrate the correctness of a certain computing fragment in the target computing-intensive transaction. If they are different, a transaction objection is raised; the process of a computing node raising a transaction objection includes: other computing nodes monitor and receive a new block containing the calculation results on the blockchain; any other computing node checks whether the calculation result of the local target computing-intensive transaction of the computing node is consistent with the calculation result in the new block; if they are consistent, the new block will be The other computing node accepts it; if they are inconsistent, the other computing node will broadcast to the entire network to request the publisher of the target computing-intensive transaction to obtain the complete computing tree of the target computing-intensive transaction; check whether the request is correctly responded to, if not, wait for a response within the waiting period, and it will be deemed invalid if the waiting period is exceeded; if a correct response is obtained from the publisher, compare the local computing tree of the other computing node with the publisher, find the abnormal hash value at the minimum moment, that is, the variable state summary of the minimum moment abnormality as the objection target; publish the objection target computing-intensive transaction ID, local calculation results and the questioned variable state summary as objection information on the blockchain; The transaction response module of the computing node that publishes the new block of the target computing-intensive transaction calculation result receives the transaction objection information and publishes the variable state that is disputed in the computing node's own computing tree; wherein the transaction objection response process includes the following steps: the transaction response module of the publisher of the computing-intensive transaction calculation result and the new block of the computing tree receives the transaction objection information of other computing nodes; the publisher obtains the record point state summary that is disputed as stated in the transaction objection information, determines the difference record point according to the record point state summary, executes the calculation fragment from the previous record point of the difference record point, and obtains the new record point state summary at the difference record point; compares whether the newly obtained variable state summary is consistent with the record point state summary in the transaction objection information; if they are consistent, stop responding to the objection; if they are inconsistent, send the two record point state summaries and the path from the record point state summary to the root of the computing tree to the blockchain; The arbitration module of the consensus node arbitrates the correctness of the state of the specified variables in the target computationally intensive transaction, and takes the final honest person as the latest result of the transaction; the arbitration process includes the following steps: the consensus node detects the transaction objection information of the target computationally intensive transaction in the new block; the consensus node detects whether the path from the state summary declared in the transaction objection information to the root of the computation tree is correct. If not, the transaction objection information is marked as invalid; if correct, the consensus node broadcasts to the entire network to request the complete state content corresponding to the state summary in the transaction objection information; detects whether the consensus node receives the objection response information within a certain period of time; if not, the objection is successful, and the calculation result of the objection node is used as the original target calculation The latest result of the intensive transaction; if the objection response information is received, check whether the path from the state summary declared in the objection response information to the tree root is correct. If not, the objection is successful, and the calculation result of the objection node is used as the latest result of the original target calculation-intensive transaction; if it is correct, the consensus node broadcasts a request to the entire network to obtain the complete state content corresponding to the state summary in the response information; check whether the request to obtain the complete state content corresponding to the state summary is responded to; if there is no response, wait for a response within the waiting period, and it will be deemed invalid if the waiting period is exceeded; if a response is received, the consensus node executes the calculation fragment between the difference record point and its predecessor record point, obtains the calculation result and retains the honest one in the original calculation result and the calculation result of the objection node; At the end of the publicity period, the asynchronous use module checks whether the transaction result meets the confirmation conditions and discards the relevant transaction results that do not meet the confirmation conditions. Among them, the asynchronous use module deployed on the computing node is responsible for controlling the data in the calculation results of the target computing-intensive transactions in the publicity period and the availability status of subsequent data obtained based on the calculation results; all states in the publicity period are unconfirmed. If a calculation result data has not received any objection at present, it can be confirmed after waiting for the end of the publicity period. If the calculation result is being disputed, then the arbitration of the objection by the consensus node determines whether the calculation result is retained or the calculation result in the objection is retained; the calculation result of the party that is not retained will be directly marked as never effective, and the retained result will become the latest unconfirmed result, and continue to wait for the end of the publicity period; the confirmation of subsequent data based on the calculation result is based on the confirmation status of the previous calculation result.

6. The off-chain trusted execution system for blockchain computationally intensive transactions according to claim 5, characterized in that: The transaction response module of the computing node listens to the newly arrived blocks. If there is an objection in the block, the transaction response module finds all the variable state record points recorded in the off-chain execution module, finds the preceding record point of the difference record point declared in the objection, and then executes the calculation fragment after the preceding record point to obtain the variable state summary of the next record point; if the variable state summary of the record point is the same as that declared in the objection, the response module stops and waits for the other party's result to replace its own result; if the variable state summary of the record point is different from that in the objection, then immediately initiate an objection response to declare the variable state summaries of the two record points of the party, as well as the path from the variable state summary of the record point to the calculation tree.

7. The off-chain trusted execution system for blockchain computing-intensive transactions according to claim 5, characterized in that: Including response control modules deployed on computing nodes and consensus nodes; The response control module is responsible for issuing a common transaction when the transaction objection module requests the specific computation tree corresponding to the computation tree root from the blockchain network. If no response is received from other computation nodes, the response control module declares that no computation node is responsible for the computation result. The consensus node judges the statement and invalidates the result if the judgment is satisfactory. The response control module is called when the arbitration module requests the complete variable status corresponding to the status summary from the blockchain network. If no response is obtained, a transaction will also be initiated to declare that no one is responsible for the result, and the consensus node will determine whether it is invalid.