Privacy oracle system based on smart contract and working method thereof, medium
By using a privacy oracle system based on smart contracts, a deep integration of blockchain with privacy computing and federated learning is achieved, solving the data silo problem, enhancing the role of blockchain in privacy computing, and ensuring that man-in-the-middle attacks cannot steal data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI WANXIANG BLOCK CHAIN CO LTD
- Filing Date
- 2022-09-06
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies lack a low-trust-cost intermediary mechanism that deeply integrates blockchain with privacy computing and federated learning, and the role of blockchain in privacy computing has not been fully realized.
This paper presents a privacy oracle system based on smart contracts. Through the collaboration of the PrivacyLink administrator, the middleman Abiter, resource party A, and task party B, the privacy oracle system enables cross-contract calls and RPC module scheduling, performs privacy-preserving collaborative computation and federated learning, and ensures that data is not leaked.
It enables efficient and secure joint computation among multiple parties, solves the data silo problem, and leverages the openness and immutability of blockchain to allow intermediaries to prove their innocence, thereby enhancing the role of blockchain in privacy computing and federated learning.
Smart Images

Figure CN115455472B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more specifically, to a privacy oracle system based on smart contracts, its working method, and its medium. Background Technology
[0002] Currently, in privacy-preserving computation, blockchain smart contracts are mostly used for evidence storage and access control. However, privacy-preserving computation and federated learning lack a low-trust-cost intermediary (arbiter) that can connect multiple parties. There is no mechanism yet that can leverage oracles for privacy-preserving computation, deeply integrating blockchain with privacy-preserving computation and federated learning. This led to the idea of PrivacyLink.
[0003] The following issues exist in existing technologies: 1) How to deeply integrate blockchain with privacy computing and federated learning? Currently, in privacy computing, blockchain smart contracts are mostly used for operational notarization and node permission control. How can blockchain play a greater role and leverage its irreplaceable characteristics? 2) How can blockchain, acting as an intermediary, prove its innocence? Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a privacy oracle system based on smart contracts, along with its working method and medium.
[0005] According to the present invention, a privacy oracle system based on smart contracts, its working method, and a medium are provided, the solution of which is as follows:
[0006] Firstly, a privacy oracle system based on smart contracts is provided, the system comprising: a PrivacyLink administrator, a middleman Abiter, a resource provider A, and a task provider B;
[0007] Among them, the PrivacyLink administrator is responsible for deploying the entire set of on-chain and off-chain infrastructure for PrivacyLink;
[0008] Abiter, the middleman: Deploys a dedicated contract for middlemen, responsible for facilitating the connection between the two parties without stealing their data.
[0009] Resource Provider A: The party that provides the dataset and does not leak the data;
[0010] Task provider B: A party that requests collaborative computing and also has a dataset. It seeks a matching resource provider A to obtain the computing results without leaking the data.
[0011] Preferably, the PrivacyLink administrator includes:
[0012] 1) Deploy a PrivacyLinkCore contract, which is the management contract for the privacy oracle. Its function is:
[0013] Generate a PrivacyLinkEvent to notify the off-chain agent PrivacyLinkAgent;
[0014] The callback interface of PrivacyLinkBase is used for cross-contract callbacks.
[0015] 2) Provide a parent contract PrivacyLinkBase for a privacy oracle, the purpose of which is:
[0016] Call the PrivacyLinkCore's request method across contracts;
[0017] The callback function calls back to the subclass's callback.
[0018] 3) Deploy a PricocoOracle privacy-coordinated computing contract or a FederOracle privacy-fed learning contract, both of which inherit from the PrivacyLinkBase contract parent class with privacy oracle functionality and implement the interfaces request, callback, and getById;
[0019] 4) Deploy a privacy oracle agent, PrivacyLinkAgent, whose function is:
[0020] Listen for PrivacyLinkEvent events generated by the PrivacyLinkCore contract on the blockchain;
[0021] Parse the parameters and trigger the corresponding processor;
[0022] The computing nodes of both parties are scheduled by RPC to perform collaborative computing or federated learning.
[0023] Write the calculation results back to the chain using the fillResult method of the PrivacyLinkCore contract.
[0024] Preferably, the intermediary Abiter includes:
[0025] Deploying a PricocoAbiter privacy-focused collaborative computing intermediary contract, or a FedeAbiter privacy-focused federated learning intermediary contract, serves the following purpose:
[0026] Provide registration services for various resource providers (A);
[0027] Provide matching services for various task providers (B) to find a suitable resource provider (A);
[0028] The task provider B executes the computational task issued by the task provider B, and uses the PrivacyLink oracle to schedule collaborative computation between the nodes of both parties.
[0029] Save the encrypted calculation results according to the request ID.
[0030] Preferably, the resource provider A:
[0031] Deploy a PrivacyLinkClient privacy-co-computing node;
[0032] Import data source;
[0033] Publish the resources to the corresponding intermediary contract PricocoAbiter and wait for the task party B to perform the calculation.
[0034] Preferably, the task party B:
[0035] Deploy a PrivacyLinkClient privacy-co-computing node;
[0036] Import data source;
[0037] Find a suitable resource provider A in the corresponding intermediary contract PricocoAbiter and request to perform privacy-coordinated computation with resource provider A.
[0038] After the calculation is completed, check the calculation results in the intermediary contract.
[0039] Secondly, a method for operating a privacy oracle based on smart contracts is provided, the method comprising:
[0040] Step S1: Resource provider A publishes resources to the PricocoAbiter intermediary contract. The published resources do not include data.
[0041] Step S2: Task party B requests privacy-coordinated computation with resource party A through the PricocoAbiter intermediary contract;
[0042] Step S3: The PricocoAbiter intermediary contract calls the request method of the PricocoOracle privacy collaborative computing oracle contract across contracts;
[0043] Step S4: PricocoOracle generates a unique requestId, makes some necessary records, and then calls the request method of its parent class PrivacyLinkBase;
[0044] Step S5: Call the request method of the PrivacyLinkCore privacy oracle management contract across contracts to generate a PrivacyLinkEvent;
[0045] Step S6: The off-chain PrivacyLinkAgent privacy oracle agent listens for the on-chain event PrivacyLinkEvent;
[0046] Step S7: Trigger the corresponding processor according to the event parameters;
[0047] Step S8: Invoke the RPC module to begin scheduling both parties;
[0048] Step S9: Call the node interface for privacy collaborative computation between parties A and B;
[0049] Step S10: Both parties perform privacy-coordinated computation;
[0050] Step S11: After the calculation is completed, Party B encrypts the result with its own public key and returns the ciphertext to the PrivacyLinkAgent's RPC module;
[0051] Step S12: The PrivacyLinkAgent program uploads the encrypted result to the blockchain and calls the PrivacyLinkCore's fillResult method;
[0052] Step S13: Call back the PrivacyLinkBase callback method across contracts;
[0053] Step S14: Call the callback method of the subclass PricocoOracle to associate the ciphertext result with the corresponding requestId;
[0054] Step S15: Task party B views the calculation results through the PricocoAbiter contract;
[0055] Step S16: PricocoAbiter calls the getById method of PricocoOracle and uses requestId to query and obtain the calculation result.
[0056] Preferably, step S3 includes: when calling the request method across contracts, it is necessary to specify the host:post, data source, filtering conditions, data type, and calculation type or calculation formula of the two nodes participating in the calculation.
[0057] Preferably, step S9 includes: calling both parties to start the computation through the RPC module. The computation nodes of multiple parties need to register their services in advance. When step S9 is performed, the correct participating node can be found through host:post or node ID.
[0058] Preferably, step S10 includes: before the two parties perform privacy-preserving collaborative computation, they first authenticate their identities through TLS to confirm that they are genuine parties matched by Arbiter before starting collaborative computation.
[0059] Thirdly, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, implements the steps of the method.
[0060] Compared with the prior art, the present invention has the following beneficial effects:
[0061] 1. The Privacy Oracle (PrivacyLink) provided by this invention is a bridge between privacy computing and blockchain, enabling multiple parties to perform joint computation more efficiently and securely, and establishing an industry standard for using blockchain as an intermediary in the fields of privacy computing and federated learning.
[0062] 2. The Privacy Oracle (PrivacyLink) provided by this invention can be used to match and schedule multiple parties possessing data, enabling privacy-preserving collaborative computation or federated learning without data leakage. This solves the problem of data silos and, by leveraging the openness and immutability of blockchain, allows intermediaries to prove their innocence.
[0063] 3. To address the problems in the background technology, the privacy oracle provided by this invention allows the blockchain to act as an intermediary, undertaking more scheduling work without accessing user data. Leveraging the blockchain's transparency and immutability, the intermediary's contract mechanism can be examined to prove that it cannot obtain user data. Furthermore, TLS verification before privacy computation ensures that the intermediary cannot engage in malicious activities. Attached Figure Description
[0064] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0065] Figure 1 The workflow of the PrivacyLink oracle;
[0066] Figure 2 This is a sequence diagram of the key steps in on-chain and off-chain collaborative computation for the PrivacyLink oracle. Detailed Implementation
[0067] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0068] This invention provides a privacy oracle system based on smart contracts. This privacy oracle (PrivacyLink) serves as a bridge between privacy computing and blockchain, enabling more efficient and secure collaborative computation among multiple parties. It establishes an industry standard for using blockchain as an intermediary in the fields of privacy computing and federated learning. Specifically, it includes the following:
[0069] The roles of the Privacy Oracle (PrivacyLink) include: PrivacyLink Administrator, Man-in-the-Middle (Abiter), Resource Provider A, and Task Provider B.
[0070] Among them, the PrivacyLink administrator is responsible for deploying the entire set of on-chain and off-chain infrastructure for PrivacyLink;
[0071] Abiter (middleman): Deploys a dedicated contract for middlemen, responsible for facilitating the connection between the two parties, but will not steal data from either party;
[0072] Resource provider A: The party that provides the dataset but is unwilling to disclose the data;
[0073] Task provider B: A party that requests collaborative computing, also has a dataset, seeks a matching resource provider A to obtain the computing results, and is unwilling to disclose the data.
[0074] The following describes the roles and responsibilities of each character:
[0075] PrivacyLink Administrator:
[0076] 1) Deploy a PrivacyLinkCore contract, which is the management contract for the privacy oracle. Its function is:
[0077] Generate a PrivacyLinkEvent to notify the off-chain agent PrivacyLinkAgent;
[0078] The callback interface of PrivacyLinkBase is used for cross-contract callbacks.
[0079] 2) Provide a parent contract PrivacyLinkBase for a privacy oracle, the purpose of which is:
[0080] Call the PrivacyLinkCore's request method across contracts;
[0081] The callback function calls back to subclasses (such as PricocoOracle) through its abstract interface callback.
[0082] 3) Deploy a PricocoOracle privacy-coordinated computing contract or a FederOracle privacy-fed learning contract, both of which inherit from the PrivacyLinkBase contract parent class with privacy oracle functionality and implement the interfaces request, callback, and getById;
[0083] 4) Deploy a privacy oracle agent, PrivacyLinkAgent, whose function is:
[0084] Used to listen for PrivacyLinkEvent events generated by the PrivacyLinkCore contract on the blockchain;
[0085] Parse the parameters and trigger the corresponding processor (privacy-friendly collaborative computing or privacy-friendly federated learning);
[0086] The computing nodes of both parties are scheduled by RPC to perform collaborative computing or federated learning.
[0087] Write the calculation result (ciphertext, which has been encrypted with B's public key when returned by B's node) back to the chain using the fillResult method of the PrivacyLinkCore contract.
[0088] Abiter, the middleman, includes:
[0089] Deploying a PricocoAbiter privacy-focused collaborative computing intermediary contract, or a FedeAbiter privacy-focused federated learning intermediary contract, serves the following purpose:
[0090] Provide registration services for various resource providers (A);
[0091] Provide matching services for various task providers (B) to find a suitable resource provider (A);
[0092] The task is executed by the task provider B, and the Privacy oracle (PrivacyLink) is used to schedule the collaborative computation between the nodes of both parties.
[0093] Save the encrypted calculation results according to the request ID.
[0094] Resource provider A:
[0095] Deploy a PrivacyLinkClient privacy-co-computing node;
[0096] Import data source;
[0097] Publish the resources to the corresponding intermediary contract PricocoAbiter and wait for the task party B to perform the calculation.
[0098] Task Party B:
[0099] Deploy a PrivacyLinkClient privacy-co-computing node;
[0100] Import data source;
[0101] Find a suitable resource provider A in the corresponding intermediary contract PricocoAbiter and request to perform privacy-coordinated computation with resource provider A.
[0102] After the calculation is complete, check the intermediary contract for the calculation result (it is encrypted and needs to be decrypted using Party B's private key to view).
[0103] This invention also provides a method for operating a privacy oracle based on smart contracts, referring to... Figure 1 and Figure 2 As shown, it includes:
[0104] Step S1: Resource provider A publishes resources to the PricocoAbiter intermediary contract. The published resources do not include data.
[0105] Step S2: Task party B requests privacy-coordinated computation with resource party A through the PricocoAbiter intermediary contract.
[0106] Step S3: The PricocoAbiter intermediary contract calls the request method of the PricocoOracle privacy-focused collaborative computing oracle contract across contracts. When calling the request() method across contracts, it is necessary to specify the host:post of both participating nodes, the data source, filtering conditions, data types, and the computation type or formula, etc. This satisfies most collaborative computing and federated computing scenarios as much as possible.
[0107] Step S4: PricocoOracle generates a unique requestId, makes some necessary records, and then calls the request method of its parent class PrivacyLinkBase.
[0108] Step S5: Call the request method of the PrivacyLinkCore privacy oracle management contract across contracts to generate a PrivacyLinkEvent.
[0109] Step S6: The off-chain PrivacyLinkAgent privacy oracle agent listens for the on-chain event PrivacyLinkEvent.
[0110] Step S7: Trigger the corresponding processor (privacy collaborative computing or privacy federated learning) according to the event parameters.
[0111] Step S8: Call the RPC module (using the computer's communication protocol for remote scheduling) to begin scheduling both parties.
[0112] Step S9: Call the node interface for privacy collaborative computation between parties A and B.
[0113] The computation is initiated by calling both parties via the RPC module. This requires all computing nodes to register their services beforehand. When proceeding to step S9, the correct participating node can be found through the registered IP address and port number (host:post) or node ID. This is a crucial step in facilitating the intermediary's matchmaking between the two parties.
[0114] Step S10: Both parties perform privacy-preserving collaborative computation. Before performing privacy-preserving collaborative computation in this step, both parties first authenticate each other using TLS (Internet Protocol, used to provide confidentiality and data integrity between two communication applications) to confirm that they are the real two parties matched by Arbiter before starting collaborative computation. This can prevent third-party interference and make the entire privacy oracle solution more secure.
[0115] Step S11: After the calculation is completed, Party B encrypts the result with its own public key and returns the ciphertext to the PrivacyLinkAgent's RPC module.
[0116] Step S12: The PrivacyLinkAgent program uploads the encrypted result to the blockchain and calls the PrivacyLinkCore's fillResult method.
[0117] Step S13: Call back the PrivacyLinkBase callback method across contracts.
[0118] Step S14: Due to the polymorphism mechanism, the callback method of the subclass PricocoOracle will actually be called to associate the ciphertext result with the corresponding requestId.
[0119] Step S15: Task B can view the calculation result through the PricocoAbiter contract (the result is encrypted and can be decrypted using its own private key).
[0120] Step S16: PricocoAbiter calls the getById method of PricocoOracle and uses requestId to retrieve the calculation result (ciphertext).
[0121] Among them, the present invention Figure 2 This is a sequence diagram of the key steps in the on-chain and off-chain collaborative computation of the PrivacyLink oracle. Detailed operational descriptions are as follows:
[0122] On-chain: The PricocoAbiter intermediary contract calls the request method of the PricocoOracle privacy collaborative computing oracle contract across contracts; PricocoOracle generates a unique requestId, makes some necessary records, and then calls the request method of the PrivacyLinkCore privacy oracle management contract across contracts, generating a PrivacyLinkEvent.
[0123] Off-chain: After the PrivacyLinkAgent privacy oracle agent listens to the on-chain event PrivacyLinkEvent, it starts calling the node interfaces of both parties A and B for privacy computation according to the event parameters; both parties perform privacy computation and obtain the result. Party B encrypts the result with its own public key and returns the ciphertext to PrivacyLinkAgent.
[0124] Next, the PrivacyLinkAgent program uploads the encrypted result to the blockchain by calling the PrivacyLinkCore's fillResult method. Then, it calls back the PricocoOracle's callback method across contracts, associating the encrypted result with the corresponding requestId. After that, Party B can view the calculation result through the PricocoAbiter contract (decrypted using its own private key).
[0125] This invention provides a privacy oracle system based on smart contracts, along with its working method and medium. It can be used to match and schedule multiple parties possessing data, enabling privacy-preserving collaborative computation or federated learning without data leakage. This solves the problem of data silos and, by leveraging the openness and immutability of blockchain, allows intermediaries to prove their innocence.
[0126] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0127] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A privacy oracle system based on smart contracts, characterized in that, include: PrivacyLink administrator, middleman Abiter, resource provider A, and task provider B; Among them, the PrivacyLink administrator is responsible for deploying the entire set of on-chain and off-chain infrastructure for PrivacyLink; Abiter, the middleman: Deploys a dedicated contract for middlemen, responsible for facilitating the connection between the two parties without stealing their data. Resource Provider A: The party that provides the dataset and does not leak the data; Task provider B: A party with collaborative computing needs, also possessing a dataset, seeking a matching resource provider A to obtain computing results without leaking data; The PrivacyLink administrators include: 1) Deploy a PrivacyLinkCore contract, which is the management contract for the privacy oracle. Its function is: Generate a PrivacyLinkEvent to notify the off-chain agent PrivacyLinkAgent; The callback interface of PrivacyLinkBase is used for cross-contract callbacks. 2) Provide a parent contract PrivacyLinkBase for a set of privacy oracles, the purpose of which is: Call the PrivacyLinkCore's request method across contracts; The callback function calls back to the subclass's callback. 3) Deploy a PricocoOracle privacy-coordinated computing contract or a FederOracle privacy-fed learning contract, both of which inherit from the PrivacyLinkBase contract parent class with privacy oracle functionality and implement the interfaces request, callback, and getById; 4) Deploy a privacy oracle agent, PrivacyLinkAgent, whose function is: Listen for PrivacyLinkEvent events generated by the PrivacyLinkCore contract on the blockchain; Parse the parameters and trigger the corresponding processor; The computing nodes of both parties are scheduled by RPC to perform collaborative computing or federated learning. Write the calculation results back to the chain using the fillResult method of the PrivacyLinkCore contract.
2. The privacy oracle system based on smart contracts according to claim 1, characterized in that, The intermediary Abiter includes: Deploying a PricocoAbiter privacy-focused collaborative computing intermediary contract, or a FedeAbiter privacy-focused federated learning intermediary contract, serves the following purpose: Provide registration services for various resource providers (A); Provide matching services for various task providers (B) to find a suitable resource provider (A); The task provider B executes the computational task issued by the task provider B, and uses the PrivacyLink oracle to schedule collaborative computation between the nodes of both parties. Save the encrypted calculation results according to the request ID.
3. The privacy oracle system based on smart contracts according to claim 1, characterized in that, Resource provider A: Deploy a PrivacyLinkClient privacy-co-computing node; Import data source; Publish the resources to the corresponding intermediary contract PricocoAbiter and wait for the task party B to perform the calculation.
4. The privacy oracle system based on smart contracts according to claim 1, characterized in that, Task party B: Deploy a PrivacyLinkClient privacy-co-computing node; Import data source; Find a suitable resource provider A in the corresponding intermediary contract PricocoAbiter and request to perform privacy-coordinated computation with resource provider A. After the calculation is completed, check the calculation result in the intermediary contract.
5. A method for operating a privacy oracle based on smart contracts, characterized in that, The privacy oracle based on smart contracts according to any one of claims 1-4 includes: Step S1: Resource provider A publishes resources to the PricocoAbiter intermediary contract. The published resources do not include data. Step S2: Task party B requests privacy-coordinated computation with resource party A through the PricocoAbiter intermediary contract; Step S3: The PricocoAbiter intermediary contract calls the request method of the PricocoOracle privacy collaborative computing oracle contract across contracts; Step S4: PricocoOracle generates a unique requestId, makes some necessary records, and then calls the request method of its parent class PrivacyLinkBase; Step S5: Call the request method of the PrivacyLinkCore privacy oracle management contract across contracts to generate a PrivacyLinkEvent; Step S6: The off-chain PrivacyLinkAgent privacy oracle agent listens for the on-chain event PrivacyLinkEvent; Step S7: Trigger the corresponding processor according to the event parameters; Step S8: Invoke the RPC module to begin scheduling both parties; Step S9: Call the node interface for privacy collaborative computation between parties A and B; Step S10: Both parties perform privacy-coordinated computation; Step S11: After the calculation is completed, Party B encrypts the result with its own public key and returns the ciphertext to the PrivacyLinkAgent's RPC module; Step S12: The PrivacyLinkAgent program uploads the encrypted result to the blockchain and calls the PrivacyLinkCore's fillResult method; Step S13: Call back the PrivacyLinkBase callback method across contracts; Step S14: Call the callback method of the subclass PricocoOracle to associate the ciphertext result with the corresponding requestId; Step S15: Task party B views the calculation results through the PricocoAbiter contract; Step S16: PricocoAbiter calls the getById method of PricocoOracle and uses requestId to query and obtain the calculation result.
6. The method for operating a privacy oracle based on smart contracts according to claim 5, characterized in that, Step S3 includes: when calling the request method across contracts, it is necessary to specify the host:post, data source, filtering conditions, data type, and calculation type or calculation formula of the two nodes participating in the calculation.
7. The method for operating a privacy oracle based on smart contracts according to claim 5, characterized in that, Step S9 includes: calling both parties to start the computation through the RPC module. The computation nodes of multiple parties need to register their services in advance. When step S9 is performed, the correct participating node can be found through host:post or node ID.
8. The method for operating a privacy oracle based on smart contracts according to claim 5, characterized in that, Step S10 includes: before the two parties perform privacy-preserving collaborative computation, they first authenticate their identities through TLS to confirm that they are genuine parties matched by Arbiter before starting collaborative computation.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 5 to 8.