A method for privacy computation based on a blockchain system

By deploying smart contracts and off-chain terminals in the blockchain system, the problems of unclear responsibilities, uncontrollable data flow, and complex system integration in cross-organizational privacy computing are solved, realizing the transparency and credibility of privacy computing and ensuring data security and compliance.

CN122113166APending Publication Date: 2026-05-29ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2026-02-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In privacy computing scenarios across organizations and trusted domains, existing technologies suffer from problems such as unclear responsibilities, easy tampering of collaboration processes, uncontrollable data flow, and high system integration complexity. In particular, it is difficult to achieve effective protection of data privacy and security in the government and financial sectors.

Method used

By deploying smart contracts in the blockchain system, on-chain notarization and automatic execution of computing task scheduling and data flow rules are achieved, ensuring transparency and traceability of the collaboration process. Off-chain terminals are used to execute computing tasks and record scheduling and execution status on the blockchain, forming an immutable execution log.

Benefits of technology

It enables full-process traceability, verifiability, and auditability of privacy-preserving computation, improving the credibility and security of computation and reducing the integration complexity of computation participants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113166A_ABST
    Figure CN122113166A_ABST
Patent Text Reader

Abstract

A method for privacy calculation based on a blockchain system, the blockchain system is connected with a plurality of off-chain terminals, the plurality of off-chain terminals respectively maintain data participating in the privacy calculation, the method is executed by a node of the blockchain system, comprising: receiving a first transaction, the first transaction calls a collaboration contract; the collaboration contract is generated based on a calculation process corresponding to the privacy calculation, the calculation process contains a plurality of calculation tasks. By executing the collaboration contract based on the first transaction, the following steps are executed: determining a first calculation task to be executed from the plurality of calculation tasks according to the calculation process, the first calculation task is configured to be executed by a first off-chain terminal. A first scheduling instruction is generated and stored in the blockchain system, the first scheduling instruction is used to instruct the first off-chain terminal to execute the first calculation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of blockchain technology, and in particular to a method for privacy computation based on a blockchain system. Background Technology

[0002] Privacy computing is a computational theory and methodology focused on protecting privacy throughout the entire lifecycle of information. It aims to enable data analysis and computation while ensuring data is not leaked. Currently, mainstream privacy computing technologies typically include: Federated Learning (FL) incorporating artificial intelligence, Secure Multi-Party Computation (MPC) based on cryptography, and Trusted Execution Environments (TEEs) based on trusted hardware, among others.

[0003] In practical applications, the data involved in privacy-preserving computation may come from multiple different data sources. These data sources are often scattered across different organizations or maintained by different computation participants in their respective trusted domains. This results in each data source having its own independent data governance policies, security usage guidelines, and data compliance requirements. A complete privacy-preserving computation task, such as Private Set Intersection (PSI) or joint modeling, often requires linking multiple privacy-preserving computation steps with data transfer steps, forming a complex collaborative process.

[0004] However, traditional privacy-preserving computing solutions typically rely on centralized schedulers or trusted third parties to coordinate computing tasks. In cross-organizational and cross-trust domain collaborative privacy-preserving computing scenarios, such solutions can lead to problems such as unclear responsibilities, susceptibility to tampering and malicious actions in collaborative processes, uncontrollable data flow, and difficulty in real-time auditing. These problems are particularly pronounced in sectors with high requirements for data privacy, data security, and data compliance, such as government and finance.

[0005] Therefore, there is a need for a technical solution that can make the privacy computing collaboration process transparent through technical means, enabling real-time auditing of the privacy computing execution process, in order to enhance the credibility of the collaborative scheduling and execution of privacy computing. Summary of the Invention

[0006] This specification provides a method for privacy computation based on a blockchain system, wherein the blockchain system is connected to several off-chain terminals, each of which maintains data participating in the privacy computation, and the method is executed by nodes of the blockchain system, including:

[0007] The system receives a first transaction, which invokes a collaboration contract. The collaboration contract is generated based on a computation process corresponding to the privacy computation, and the computation process includes several computation tasks.

[0008] The following steps are performed by executing the collaboration contract based on the first transaction:

[0009] According to the calculation process, a first calculation task to be executed is determined from the plurality of calculation tasks, and the first calculation task is configured to be executed by a first off-chain terminal.

[0010] A first scheduling instruction is generated and stored in the blockchain system. The first scheduling instruction is used to instruct the first off-chain terminal to execute the first computing task.

[0011] A second aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0012] According to the method provided in the embodiments of this specification, the multi-party collaboration process in privacy computing can be deployed in the form of smart contracts on a blockchain system. This enables on-chain notarization and automatic execution of computing task scheduling and data flow rules, thereby ensuring at the technical level that the collaboration process cannot be tampered with and that data rights and responsibilities are traceable. Simultaneously, each computing task scheduling can be persisted in the blockchain's distributed ledger, forming an immutable execution log. This achieves full traceability, verifiability, and auditability of the privacy computing process, significantly improving the credibility of privacy computing. Attached Figure Description

[0013] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a diagram of a blockchain system architecture provided according to an exemplary embodiment of this specification;

[0015] Figure 2 This is a schematic diagram illustrating a collaborative contract generation process according to an embodiment of this specification;

[0016] Figure 3 This is a flowchart illustrating a method for privacy computation based on a blockchain system according to embodiments of this specification.

[0017] Figure 4This is a schematic diagram illustrating the components of an exemplary collaboration contract disclosed in this specification;

[0018] Figure 5 This is a flowchart illustrating an exemplary off-chain terminal performing a computation task according to an embodiment of this specification. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0020] To facilitate understanding of the embodiments in this specification, we will first introduce the relevant content of blockchain technology.

[0021] A blockchain system can include N interconnected nodes. These nodes can store the entire ledger, that is, the state of all blocks and all accounts. Each node in the blockchain system can produce the same state by executing the same transaction, thus each node can store the same state database.

[0022] In the blockchain field, a transaction refers to a task unit executed and recorded within the blockchain system. A transaction typically includes a From field, a To field, and a Data field. Specifically, in the case of a transfer transaction, the From field represents the account address initiating the transaction (i.e., initiating a transfer task to another account), the To field represents the account address receiving the transaction (i.e., receiving the transfer), and the Data field includes the transfer amount.

[0023] Blockchain systems offer smart contract functionality. A smart contract on a blockchain is a contract that can be triggered and executed by transactions. Smart contracts can be defined in the form of code. Invoking a smart contract within a blockchain system involves initiating a transaction pointing to the smart contract's address, causing each node in the blockchain system to run the smart contract code in a distributed manner.

[0024] In a contract deployment scenario, for example, Bob sends a transaction containing information about creating a smart contract (i.e., deploying the contract) to the blockchain system. The transaction's `data` field includes the code of the contract to be created (such as bytecode or machine code), and the `to` field is empty to indicate that the transaction is used for contract deployment. After the nodes reach a consensus through the consensus mechanism, they determine the contract address "0x6f8ae93…". Each node adds a contract account corresponding to the smart contract's contract address to its state database, allocates state storage corresponding to that contract account, stores the contract code, and saves the hash value of the contract code in the contract's state storage, thus successfully creating the contract.

[0025] In a contract invocation scenario, for example, Bob sends a transaction to the blockchain system to invoke a smart contract. The `from` field of this transaction is the address of the account of the transaction initiator (i.e., Bob), the `to` field is the address of the smart contract to be invoked, such as the contract address "0x6f8ae93…" mentioned above, and the `data` field includes the method and parameters for invoking the smart contract. After consensus is reached on this transaction within the blockchain system, each node in the blockchain system can execute the transaction, thereby executing the contract individually. Based on the execution of the contract, the state of the contract is updated in the state database.

[0026] As mentioned earlier, privacy-preserving computation enables multiple untrusted computational participants to jointly compute an objective function based on their private data without disclosing any data (except for the final result data), and each participant can obtain the final output data of the objective function.

[0027] While privacy-preserving computation now possesses mature technologies such as federated learning, secure multi-party computation, and trusted execution environments, it still faces numerous challenges in sectors with high requirements for data privacy, security, and compliance, such as government and finance, and in scenarios requiring cross-organizational data collaboration. Typical examples include:

[0028] Unclear Responsibilities for Privacy Data: In privacy-preserving computation processes involving multiple participants, data is handled by multiple data holders (typically, the computation participants are also the data holders) at each stage of preparation, transfer, computation, and storage. Because data is easily copied and the operational chain is opaque, it is difficult to clearly define the specific roles and responsibilities of each participant in the data derivation chain. In the event of data breaches or compliance issues during privacy-preserving computation, effective tracing is impossible.

[0029] Uncontrollable data flow: In the execution of privacy-preserving computation, centralized platforms are typically relied upon for data scheduling and exchange. Once data leaves the holder's trusted domain, its scope of use, access permissions, and storage period become difficult to effectively regulate. Data holders often face a dilemma: either provide all data to external parties or refuse to share. It is impossible to achieve secure, controllable, and fine-grained data flow while ensuring data ownership.

[0030] System integration and expansion are challenging: the data storage, security components, and computing engines of each computing participant have different construction schemes and their technology stacks cannot be standardized. When accessing privacy computing capabilities or implementing multi-party collaboration, a large amount of customized adaptation development is required, resulting in excessively high integration complexity and long implementation cycles for multi-party secure computing. This makes it difficult to quickly respond to scenario requirements and hinders the construction of a data collaborative computing ecosystem.

[0031] In view of this, the inventors propose a method for privacy computing based on a blockchain system in the embodiments of this specification, aiming to build a trustworthy, auditable, standardized, and easily integrated privacy computing mechanism. By deploying the multi-party collaborative process in privacy computing in the form of smart contracts on the blockchain system, on-chain notarization and automatic execution of computing task scheduling and data flow rules are achieved, thereby ensuring at the technical level that the collaborative process cannot be tampered with and that data rights and responsibilities are traceable. At the same time, by introducing standardized collaborative components into the off-chain terminals of each computing participant, the computing task scheduling and data flow specifications are unified, reducing the integration complexity of the private data of computing participants into the privacy computing process. Thus, while strictly adhering to the agreed collaborative process for privacy computing scheduling and execution, the execution history is notarized on-chain, improving the trustworthiness of privacy computing.

[0032] In implementation, each participant in the computation can have its own off-chain terminal, which can be equipped with a data engine to maintain private data used for the privacy computation. For privacy computations requiring collaboration among multiple participants, nodes corresponding to each off-chain terminal can be deployed within the blockchain system, forming an interconnected network structure between on-chain and off-chain components. Off-chain terminals can also be equipped with collaboration components to listen for contract events generated by blockchain nodes according to the collaboration contract's scheduling. These events include scheduling instructions for off-chain terminals, invoking them to perform data provision, data computation, or data storage operations to complete the computation task. Off-chain terminals can update the execution status of the computation task, allowing the collaboration contract to trigger the scheduling of subsequent computation tasks based on this status.

[0033] See appendix Figure 1 , attached Figure 1A blockchain system architecture diagram in an exemplary embodiment is shown. The blockchain system interfaces with several off-chain terminals, which can correspond to blockchain nodes. Nodes, by executing collaboration contracts, can determine the computational tasks to be executed according to the privacy computation process set in the collaboration contracts and generate corresponding scheduling instructions. Nodes can communicate with their corresponding off-chain terminals so that the off-chain terminals can listen to the contract events containing scheduling instructions generated by the nodes and complete the corresponding privacy computation tasks. In a preferred embodiment, the off-chain terminals can be deployed with collaboration components and a data engine; wherein, the data engine can be used to execute specific data processing and privacy computation logic, including but not limited to data extraction, data preprocessing, data encryption and desensitization, signature verification, secure intersection computation, joint modeling computation, etc., and ensure that the original data does not leave the local trusted domain without authorization; the collaboration components can respond to the scheduling of the collaboration contract and work with the local data engine to complete the execution of the computation tasks.

[0034] The blockchain system also deploys a collaboration contract, which is generated based on the computational process corresponding to the privacy computation. This contract defines the execution order of the various computational participants and the execution conditions of the computational tasks. Blockchain nodes execute the collaboration contract, progressively identifying the computational tasks to be executed according to the computational process, scheduling off-chain terminals related to those tasks to execute them, and updating the execution status of the tasks. Then, based on the computational process and the execution status of the tasks, the next computational task to be executed is determined. This process is repeated until all computational tasks in the computational process are completed, yielding the final result of the privacy computation. During this process, the orchestration information of the computational process, the scheduling instructions to each off-chain terminal, and the execution status of each computational task are all stored on the blockchain, making the privacy computation process transparent and traceable. This effectively prevents the privacy computation process from being tampered with or maliciously manipulated, and provides real-time auditing capabilities.

[0035] It should be noted that the various system components shown in the embodiments and accompanying drawings of this specification are merely illustrative. In practice, some system components may be integrated or further separated based on requirements, and this specification does not impose any particular limitations on this.

[0036] To better understand and illustrate the solutions of the various embodiments of this application, based on the above architecture, the following will, in conjunction with the accompanying drawings and embodiments, first introduce the generation and deployment of collaborative contracts, and then describe a method for privacy computing based on a blockchain system.

[0037] See appendix Figure 2This illustrates the collaborative contract generation process provided according to embodiments of this specification. The collaborative contract defines the computational logic corresponding to the privacy computation process in code form. After the collaborative contract is generated, it can be deployed to a blockchain system for users to invoke.

[0038] In practice, to quickly generate collaborative contracts, an operator library containing several template operators can be pre-configured. An operator is a packaged basic functional unit. This basic functional unit can have several input ports and / or output ports. Ports can be used to receive or transmit parameters (e.g., input ports are used to receive input parameters, and output ports are used to transmit output parameters). Port indices can be used to uniquely identify each output port in scenarios where the operator has multiple outputs; for example, they can be numbered sequentially starting from 0.

[0039] A template operator encapsulates a computational operation implemented using a specific privacy-preserving computation technique. This operation could include, for example, a computational operation implemented using MPC, a computational operation implemented using TEE, a computational operation implemented using FL, and so on. Similarly, a single computational operation can correspond to multiple template operators implemented using various privacy-preserving computation techniques. For example, for privacy-preserving intersection (PSI), the corresponding template operators could include a PSI template operator implemented using MPC, a PSI template operator implemented using TEE, and so on. In other words, for PSI, two different template operators can be implemented using MPC and / or TEE privacy-preserving computation techniques respectively.

[0040] Users can configure template operators, such as specifying specific data inputs, data outputs, data processing parameters, encryption algorithms, data transmission protocols, and data access control rules, to configure template operators as task operators with clearly defined input / output and execution logic. One or more task operators can be combined into a computation task. When a task operator is configured as a computation task, and multiple result data are generated by calling the task operator through execution of the computation task, downstream (subsequent) computation tasks can accurately obtain the required result data from the multiple outputs of the task operator by specifying an index. In this way, a single computation task can output result data to multiple downstream dependents (subsequent computation tasks). It can be understood that a single output port can also support outputting result data to multiple dependents.

[0041] In an optional embodiment, a client can display various template operators in an operator library to the user and obtain at least one template operator selected by the user, as well as the input, output, and data security configurations provided by the user for each selected template operator. Based on this, at least one task operator corresponding to the at least one template operator is generated. Then, based on the combination configuration of the at least one task operator provided by the user, several computational tasks are generated.

[0042] In another alternative embodiment, users can declare configurations for any template operator in the operator library by writing code, instantiating the corresponding task operator. This instantiation includes configuring the input, output, and data security of the template operator. Simultaneously, combination relationships set for the task operator can be declared in the code to construct a computational task.

[0043] After the user generates several computing tasks, the computing process for privacy-preserving computing can be planned. (See attached...) Figure 2 In one implementation, a visual computational flow planning interface is displayed to the user via a client. This interface integrates a predefined operator library and displays the various template operators using graphical elements (e.g., icons, polygons). Users can interact with this interface to intuitively express their privacy-preserving computation needs. Specifically, users can drag or select at least one template operator from the operator library onto the canvas area, configure corresponding input data, output data, and data security policies for each template operator, thereby obtaining at least one instantiated task operator, which can then be combined into several computational tasks. Furthermore, users can explicitly specify the execution dependencies and data flow order between different computational tasks by establishing directed connections between them on the canvas area. These computational task nodes and their connections together constitute a Directed Acyclic Graph (DAG) with a defined execution order. This DAG represents the user-planned privacy-preserving computational flow. For example, users can select N template operators in the computation process planning interface to instantiate N task operators and configure them as M computation tasks (usually, M≤N). By connecting the computation tasks, the execution dependencies between them can be constructed, and the execution order of the above M computation tasks can be specified to form a computation process represented by DAG.

[0044] It should be noted that the above-described graphical interaction method is only one optional embodiment, and this specification does not specifically limit the specific interface operation form. Other interaction methods that can realize the definition of computing tasks and the arrangement of computing processes, such as form-based configuration and script code editing, are all within the scope of protection of this solution. Its core lies in generating a directed acyclic graph (DAG) with computing tasks as vertices and dependencies between computing tasks as connecting edges through user configuration, expressing the computing process of privacy-preserving computation, and using this as the basis for generating collaborative contracts.

[0045] Next, a corresponding collaborative contract can be generated based on the above computational process. This collaborative contract fully encapsulates the privacy-preserving computation logic defined by the computational process in the form of executable code. In a specific embodiment, the client can automatically generate executable code that implements the computational process logic according to the user-configured computational process, and compile this code into collaborative contract bytecode that can run on the blockchain system virtual machine (e.g., EVM). Subsequently, the collaborative contract is deployed to the blockchain system. The specific process of deploying the collaborative contract is usually achieved by initiating a smart contract creation transaction. For example, a creation transaction containing the above contract bytecode is submitted to the blockchain system. The nodes in the system will reach a consensus on the transaction. After the consensus is reached, the transaction is executed, thereby creating a smart contract account in the blockchain system; and the contract code is persistently stored in association with the account in the state database.

[0046] At this point, the collaborative contract deployment is complete and can be invoked by authorized users to initiate the privacy computing process. The deployment and transaction execution mechanisms of smart contracts will not be elaborated upon here.

[0047] The above is a detailed description of the generation and deployment process of the collaborative contract in the embodiments of this specification. Please refer to the appendix below. Figure 3 , attached Figure 3 A flowchart illustrating a method for privacy computation based on a blockchain system according to embodiments of this specification is shown. It is understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. See appendix. Figure 3In one embodiment, the method is executed by a node of the blockchain system and includes at least the following steps: S301: Receiving a first transaction, the first transaction invoking a collaboration contract; the collaboration contract is generated based on a computational process corresponding to the privacy computation, the computational process including several computational tasks. S303: Executing steps S3031-S3033 by executing the collaboration contract based on the first transaction. S3031: Determining a first computational task to be executed from the several computational tasks according to the computational process, the first computational task being configured to be executed by a first off-chain terminal. S3033: Generating a first scheduling instruction and storing the first scheduling instruction in the blockchain system, the first scheduling instruction being used to instruct the first off-chain terminal to execute the first computational task.

[0048] The specific execution methods of the above steps will be described in detail below with reference to the embodiments.

[0049] As mentioned earlier, in a blockchain system, there are several off-chain terminals. These off-chain terminals maintain the data that participates in the privacy computation and can deploy collaborative components and data engines for performing computational tasks.

[0050] Step S301: Receive a first transaction (shown as "transaction" in the figure) sent by the user, the first transaction calling a collaboration contract; the collaboration contract is generated based on a computation process corresponding to the privacy computation, the computation process containing several computation tasks.

[0051] The first transaction is a blockchain transaction initiated by a user to trigger a privacy-preserving computation process. This transaction contains the contract address of the collaboration contract and may also contain calling parameters, such as process instance identifiers or initialization parameters. The collaboration contract encapsulates the computation process of the privacy-preserving computation, described by a directed acyclic graph structure consisting of several computation tasks. Each computation task is associated with a specific task operator (instantiated by configuring a template operator) and the execution dependencies and data flow between computation tasks are clearly defined.

[0052] Appendix Figure 4 The components of an exemplary collaboration contract are shown in the appendix. Figure 4 The collaboration contract defines the computation process corresponding to the privacy computation through code, as shown in the figure. This computation process can be abstracted as a directed acyclic graph, which contains vertices representing computation tasks and directed edges representing dependencies between vertices. As described above, the computation task includes at least one task operator. The task operator can specifically be one of the following:

[0053] Data computation operators: These are used to perform privacy-preserving computations based on input data, such as secure intersection, joint statistics, and joint modeling. Each task operator encapsulates computational logic implemented using specific privacy-preserving computation techniques (such as MPC, TEE, and FL), and is configured with the necessary parameters, algorithms, and input-output mappings. Typically, this task operator uses the results of previous computational tasks as input and outputs the results after computation is complete.

[0054] Data Providing Operator: Used to retrieve data from a data source for privacy-preserving computation. This task operator is responsible for extracting data from a specified data source (such as a database or file system) and can be configured with data security policies such as data filtering, anonymization, and encryption to ensure that the output data meets privacy protection requirements, providing data for subsequent computation tasks. Typically, this task operator does not depend on preceding computation tasks, retrieves data from the trusted domain of the off-chain terminal executing the task operator, encrypts the data at the output port according to a specified data security policy (e.g., ECIES using DID) before outputting it externally.

[0055] Data storage operator: Used to define the storage logic for computation results (including intermediate and final results). This task operator receives the result data generated by the preceding computation task and persists it according to the configured storage location, format, encryption method, and access control policy.

[0056] The computational task that includes task operators can also include security policy-related configuration information, such as authorized addresses, data flow specifications, and data encryption types.

[0057] Authorized Address: This indicates the account authorized to use the computational task's result data. It is typically one or more blockchain account addresses or decentralized identifiers (DIDs). During the flow of result data, the system verifies whether the consumer of the result data is on the authorized address list to ensure that the computational task's result data is used only within the authorized scope.

[0058] Data flow specifications: These define the transmission specifications for the results data of the computation task, including but not limited to data transmission protocols, data validity periods, data file formats, and data compression algorithms.

[0059] Data encryption type: This indicates the encryption method used for the result data of the computation task, such as specifying whether an asymmetric encryption algorithm or a symmetric encryption algorithm is used. It is understood that if an asymmetric encryption algorithm is specified for encrypting the result data, the encryption key used must be clearly defined; conversely, if a symmetric encryption algorithm is specified for encrypting the result data, a key distribution mechanism must be agreed upon.

[0060] After receiving the first transaction, a node in the blockchain system packages it into a block and, after consensus verification, triggers the execution of the collaboration contract. Therefore, in step S303, the following steps S3031-S3033 are executed by executing the collaboration contract based on the first transaction.

[0061] In step S3031: According to the calculation process, a first calculation task to be executed is determined from the plurality of calculation tasks, and the first calculation task is configured to be executed by a first offline terminal.

[0062] Nodes can execute collaboration contracts to schedule off-chain terminals according to the computation flow, complete the execution of computation tasks, and maintain the execution status of the computation tasks in the contract state. Nodes traverse several computation tasks in the computation flow by executing collaboration contracts, checking the execution readiness conditions of each computation task. The execution readiness conditions refer to the prerequisite constraints that must be met for a computation task to be allowed to start execution at the current block height, including the satisfaction of dependencies and the validity of the computation task state. For example, these may include: all preceding dependent computation tasks of the computation task have been completed; the computation task does not depend on any preceding computation tasks; the computation task has not yet started execution, etc.

[0063] When a computing task meets the above-mentioned execution readiness conditions, it can be identified as the first computing task to be executed. Based on the configuration information of the computing task, the executor of the computing task, i.e., the corresponding off-chain terminal, can be determined. For example, the executor can be determined by obtaining the execution terminal information of the first computing task. In this embodiment, the executor of the first computing task is referred to as the first off-chain terminal.

[0064] Understandably, in the scenario of the first execution of the computation process (which could be triggered by a user sending a transaction to initiate privacy computation and calling a collaboration contract), the node can execute the collaboration contract and, according to the computation process, retrieve a computation task without prior dependencies from the plurality of computation tasks, and determine it as the first computation task. In this scenario, the absence of prior dependencies typically means, from the perspective of a directed acyclic graph, that the in-degree of this computation task is zero.

[0065] After determining the first computing task to be executed and the first off-chain terminal to execute the computing task, in step S3033: a first scheduling instruction is generated and the first scheduling instruction is stored in the blockchain system. The first scheduling instruction is used to instruct the first off-chain terminal to execute the first computing task.

[0066] A first scheduling instruction containing detailed parameters of the first computation task is generated. This first scheduling instruction may include: a computation task identifier, a description of the input data source (e.g., the output port index of the task operator of the preceding dependent computation task), computation parameter configuration, and data security specifications. The first scheduling instruction can be issued in the form of a contract event and recorded in the distributed ledger of the blockchain system, achieving traceability and immutability of the computation task scheduling operation.

[0067] A contract event is a mechanism that allows smart contracts to communicate with external devices within a blockchain system. By triggering a contract event, key operations during the execution of a smart contract can be recorded. The contract event is then recorded as a log entry in the transaction receipt generated by the transaction. After the transaction receipt is verified through consensus along with the block, the contract event is permanently and immutably recorded on the blockchain.

[0068] The first off-chain terminal can obtain a first scheduling instruction directed to itself by listening to contract events in the blockchain system. Based on this first scheduling instruction, the first off-chain terminal can trigger its local computing environment to execute corresponding privacy-preserving computation operations.

[0069] In one optional implementation, several off-chain terminals may each have their own corresponding node in the blockchain system. After determining the first computational task by executing a collaboration contract, a node in the blockchain system can generate a first contract event containing the first scheduling instruction and store the first contract event in the receipt of the first transaction. It is readily apparent that the first contract event corresponds to the first off-chain terminal and is received by it. In another optional implementation, the node in the blockchain system may also store the first contract event in the contract state of the collaboration contract; this embodiment is not limited to this.

[0070] The first off-chain terminal can monitor its corresponding blockchain system node. When that node generates a first contract event, the first off-chain terminal can detect the event and extract the first scheduling instruction contained within it through parsing. Subsequently, the first off-chain terminal can execute the corresponding first computation task according to the first scheduling instruction. After the first computation task is completed, the first off-chain terminal can update the execution status of the first computation task to the blockchain system.

[0071] In a specific implementation, after the first off-chain terminal completes the first computation task, it can send a state update transaction to the nodes of the blockchain system to update the execution status. This transaction includes the first execution status of the first computation task and may optionally include metadata such as the cryptographic hash of the result data of the first computation task. The nodes can update the execution status of the first computation task in the contract state of the collaboration contract based on the first execution status. Specifically, when a node in the blockchain system (usually the node corresponding to the first off-chain terminal) receives the state update transaction, it broadcasts the transaction to the entire network. Subsequently, the accounting node packages this transaction along with other transactions into a new candidate block. The state update transaction can invoke the collaboration contract to update the execution status of the first computation task, for example, by triggering the corresponding state update function in the collaboration contract, locating the first computation task based on the computation task identifier, and updating its execution status to the first execution status. Finally, after the candidate block reaches a consensus on its validity through the consensus mechanism, the candidate block can be appended to the blockchain system, thereby confirming the validity of the state update transaction it contains. This state update is permanently and immutably recorded in the blockchain system, and the collaborative contract can also automatically trigger the execution and scheduling of subsequent computing tasks based on this.

[0072] It should be noted that the status update mechanism for computational tasks can be flexible in practical applications. Off-chain terminals typically execute computational tasks asynchronously, and their status reporting strategies can be flexibly adjusted according to actual needs. For example, an off-chain terminal can report the execution status only once, when the computational task is finally completed or fails, or it can report the real-time execution status of the computational task to the blockchain system at a certain frequency to achieve more granular progress monitoring. In addition, as an alternative mechanism, nodes in the blockchain system can also proactively initiate queries to off-chain terminals regarding the execution status of specific computational tasks.

[0073] According to one implementation, in addition to reporting the execution status of a computation task, an off-chain terminal can also report the metadata of the corresponding result to the blockchain system. The metadata is summary information describing the result data, and may include, for example, the result data hash, the storage handle of the result data, cryptographic commitments, etc. As immutable audit data, the metadata can be stored in the blockchain system along with the execution status of the corresponding computation task.

[0074] After the first computation task Task0 is successfully executed, the node can continue to execute the collaboration contract to obtain the execution status of each computation task. Then, based on the computation flow and the execution status of each computation task, it can determine the next computation task to be executed, Task1. It can be understood that Task1 is in an unexecuted state, and all its preceding dependent computation tasks are in an executed state.

[0075] The aforementioned methods for triggering the privacy computing process through continuous execution of the collaboration contract are diverse. For example, it can be triggered by a state update transaction from an off-chain terminal: when the state update transaction sent by the first off-chain terminal is confirmed and executed by the blockchain, this transaction can trigger a callback function in the collaboration contract to immediately check whether there is a next pending computing task, Task1, after updating the execution status of Task0. It can also be triggered by a user-sent transaction: a user can send a query or call transaction to the blockchain system (e.g., a transaction to query the execution progress of the computing process, or a transaction to trigger the scheduling of computing tasks). The node executing this transaction can call the corresponding function of the collaboration contract, triggering a check of the computing tasks in the computing process and determining whether there is a next pending computing task, Task1. Regardless of the triggering method, the node executing the collaboration contract can determine the pending computing tasks based on the latest execution status of the computing tasks and the computing process, thereby making scheduling decisions to ensure the reliable advancement of the privacy computing process. This specification does not provide examples of all of these methods in its embodiments.

[0076] As described above, it is easy to understand that steps S3031-S3033 can be executed multiple times until all the computational tasks included in the computational process have been executed. In this way, the collaborative contract can orderly and reliably schedule off-chain terminals to execute several computational tasks according to the predetermined computational process, and store the scheduling and execution process of the computational tasks in the blockchain system, ensuring the automated execution of privacy computation and the reliability of the execution process.

[0077] Appendix Figure 5 A flowchart illustrating an exemplary off-chain terminal executing a computation task is shown. Referring to the accompanying figure, node A in the blockchain system corresponds to off-chain terminal A, and node B corresponds to off-chain terminal B. Each off-chain terminal listens to its corresponding node. Computation tasks A1 and A2 are executed by off-chain terminal A, while computation tasks B1, B2, and B3 are executed by off-chain terminal B. The execution dependencies and execution order between the various computation tasks are shown in the figure.

[0078] The blockchain node executes the first transaction, invoking a collaboration contract to initiate the privacy-preserving computation process. Computation tasks A1 and B1 have no prior dependencies and can therefore be executed first. The node schedules the executors of computation task A1 (off-chain terminal A) and computation task B1 (off-chain terminal B1) through the collaboration contract. Taking computation task A1 as an example, specifically, the node generates a contract event containing scheduling instructions. These instructions instruct off-chain terminal A to execute computation task A1. The off-chain terminal obtains this contract event by listening to node A, executes computation task A1 according to the scheduling instructions, and reports the execution status to the blockchain system.

[0079] After computation task A1 is completed, the prerequisites for computation task A2 have been executed, satisfying the execution readiness condition. Therefore, off-chain terminal A can be scheduled to execute computation task A2. As shown in the attached diagram, computation tasks A2 and B2 have a privacy-preserving intersection (PSI) operation. Therefore, after off-chain terminal B is scheduled to execute computation task B2, off-chain terminal A and off-chain terminal B can jointly complete the off-chain execution of the PSI. Similarly, off-chain terminal A and off-chain terminal B can report the execution status of computation tasks A2 and B2 to the blockchain system, respectively.

[0080] Typically, a complete privacy computation process includes a data storage task at the end to persistently store the final computation result. As shown in the attached diagram, assuming computation task B3 is a data storage task, after its predecessors (computation tasks A2 and B2) are completed, off-chain terminal B can be scheduled to execute computation task B3, storing the final computation result according to a pre-defined storage strategy. Simultaneously, the metadata of the final computation result can be reported to the blockchain system for notarization. Thus, a complete privacy computation process driven by the blockchain system and executed through collaborative contract scheduling is completed. During the execution of this computation process, all scheduling information and computation task execution information are recorded in the blockchain, achieving full traceability and auditing capabilities for the privacy computation process.

[0081] In an optional embodiment, after all the computational tasks included in the computation process have been executed, the nodes of the blockchain system can provide the user with the computation results of the privacy computation. Specifically, in response to a second transaction sent by the user, the nodes of the blockchain system can determine a second off-chain terminal according to the computation process. This second off-chain terminal is the storage provider for the computation results of the privacy computation. Download information for the computation results of the privacy computation can then be obtained through the second off-chain terminal.

[0082] The second transaction is initiated by the user to query or obtain the final computation result of privacy computing. When a blockchain node executes this transaction, it invokes the already executed collaboration contract. The collaboration contract determines the storage location of the final computation result based on the execution status and result metadata of the computation process stored internally. Typically, this computation result is held by the last computation task in the computation process (such as a data storage task) and stored on the off-chain terminal responsible for executing that computation task, i.e., the second off-chain terminal.

[0083] After identifying the second off-chain terminal, the node can obtain access information for the computation result through this terminal, such as the storage handle or unique identifier of the result. Furthermore, the node can verify whether the user address initiating the second transaction is authorized to access the computation result. Upon successful verification, the node can return a transaction receipt to the user containing download information for the computation result (such as a signed, authorized access token or a secure data download link). The user or their corresponding client can then use this download information to securely request the second off-chain terminal to obtain the final encrypted or plaintext computation result.

[0084] The preceding text detailed a method for privacy computation based on a blockchain system. This method encapsulates the computational process of multi-party collaborative privacy computation on the blockchain in the form of smart contracts. Through on-chain scheduling and off-chain execution, it ensures that each participant strictly adheres to the agreed-upon computational process. Any malicious attempts to skip, repeat, or tamper with execution steps will be detected or rejected by the blockchain. Simultaneously, the scheduling, execution status, and result digest proof of each computational task are persisted in the blockchain's distributed ledger, forming an immutable execution log. This enables the entire privacy computation process to be traceable, verifiable, and auditable, thereby significantly improving the credibility of privacy computation.

[0085] In this specification, the terms "first" in the first transaction, first computation task, etc., and the corresponding terms "second" and "third" (if any) in the text, are merely for the convenience of distinction and description, and do not have any limiting meaning.

[0086] The foregoing description describes specific embodiments of this specification; other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than those shown in the embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the drawings do not necessarily need to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0087] This specification also provides a computing device in its embodiments, including a memory and a processor. The memory stores computer programs / instructions, and when the processor executes the computer programs / instructions, it implements the methods in the foregoing embodiments.

[0088] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0089] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0090] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0091] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.

[0092] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0093] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0094] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0096] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0097] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0098] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0099] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0100] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0101] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0102] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of these embodiments. Various modifications and variations can be made to these embodiments by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.

Claims

1. A method for privacy computation based on a blockchain system, wherein the blockchain system is connected to a plurality of off-chain terminals, each of which maintains data participating in the privacy computation, and the method is executed by nodes of the blockchain system, comprising: Receive the first transaction, which invokes the collaboration contract; The collaboration contract is generated based on a computation process corresponding to the privacy computation, and the computation process includes several computation tasks; The following steps are performed by executing the collaboration contract based on the first transaction: According to the calculation process, a first calculation task to be executed is determined from the plurality of calculation tasks, and the first calculation task is configured to be executed by a first off-chain terminal. A first scheduling instruction is generated and stored in the blockchain system. The first scheduling instruction is used to instruct the first off-chain terminal to execute the first computing task.

2. The method according to claim 1, wherein the plurality of off-chain terminals each have their own corresponding node in the blockchain system; Generate and store the first scheduling instruction, including: A first contract event containing the first scheduling instruction is generated; the first contract event corresponds to the first off-chain terminal so that it can be received by the first off-chain terminal; The first contract event is documented in the receipt of the first transaction.

3. The method according to claim 1, wherein, The first transaction is sent by the user and is used to invoke the collaboration contract to trigger the first execution of the computation process; According to the aforementioned calculation process, a first calculation task to be executed is determined from the plurality of calculation tasks, including: According to the calculation process, a calculation task that does not have a prior dependency is retrieved from the plurality of calculation tasks and determined as the first calculation task.

4. The method according to claim 1, further comprising: Receive a status update transaction sent by the first off-chain terminal, which includes the first execution status of the first computing task; Based on the first execution state, the execution state of the first computing task is updated in the contract state of the collaborative contract.

5. The method according to claim 1, wherein determining a first computational task to be executed from the plurality of computational tasks according to the computational flow includes: Obtain the execution status of each of the aforementioned computational tasks; Based on the calculation process and the execution status of each calculation task, the first calculation task is determined. The first computation task is in an unexecuted state, and all its preceding computation tasks are in an executed state.

6. The method according to claim 1, wherein, The computation task includes at least one task operator; the task operator is one of the following: a data computation operator, a data provision operator, or a data storage operator.

7. The method according to claim 1, wherein, The computing task includes an authorized address, a data flow specification, and a data encryption type; the authorized address is used to indicate the account authorized to use the computing task result data; the data flow specification is used to define the transmission specification of the computing task result data; and the data encryption type is used to indicate the encryption method of the computing task result data.

8. The method according to claim 1, wherein, The computation process includes several task operators related to the privacy computation specified by the user. The task operators are configured by the user according to any template operator in the operator library. The template operators include one or more of the following: operators implemented based on Trusted Execution Environment (TEE), operators implemented based on Multi-Party Secure Computation (MPC), and operators implemented based on Federated Learning (FL).

9. The method according to claim 1, wherein, After all the computational tasks have been executed, the method further includes: In response to the second transaction sent by the user, a second off-chain terminal is determined according to the calculation process; the second off-chain terminal is the storage provider for the calculation result of the privacy calculation. Download information for the privacy computation results is obtained through the second off-chain terminal.

10. A computing device comprising a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, implements the method of any one of claims 1-9.