Data transaction method and system based on verifiable differential privacy
Patent Information
- Application Number
- CN202611434502.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-10-27
AI Technical Summary
[0002]目前的数据交易系统中,保护数据只依赖简单的噪声添加或普通的加密技术,很难做到保护数据隐私的同时保障数据的可用性和可信度
1、通过结合差分隐私、零知识证明以及承诺技术在保护原始数据的同时也实现了保护后数据的可验证性,有利于更好地保护卖方原始数据的隐私;
Smart Images

Figure CN122989088A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of privacy protection technology, specifically to a data transaction method and system based on verifiable differential privacy. Background Technology
[0002] Current data trading systems rely solely on simple noise addition or basic encryption techniques for data protection, making it difficult to simultaneously protect data privacy while ensuring data availability and trustworthiness. In practical applications, it is necessary to protect the seller's original data in data transactions, guarantee the availability of data after differential privacy, and enhance the buyer's trust in the data's availability.
[0003] How to protect data privacy while ensuring data availability and credibility in data transactions is a technical problem that needs to be solved. Summary of the Invention
[0004] The technical objective of this invention is to address the above-mentioned shortcomings by providing a data transaction method and system based on verifiable differential privacy, thereby solving the technical problem of how to protect data privacy while ensuring data availability and credibility in data transactions.
[0005] In a first aspect, the present invention provides a data transaction method based on verifiable differential privacy, applied to a data transaction system including blockchain, transaction platform, intelligent agent, user terminal, and administrator terminal, comprising the following steps: Initialization: For smart contracts deployed on the blockchain, the administrator configures access and calling permissions for users and their corresponding smart agents. Users include buyers and sellers. Transaction Confirmation: The buyer stores its purchase parameters in a smart contract and returns the storage address. The buyer then initiates a purchase request through its smart agent. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests. Differential Privacy and Verification: The seller's smart agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address. After performing differential privacy calculation on the original data, it calculates the commitment value of the differential privacy data and the opening information, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address. Based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, a zero-knowledge proof is constructed. The generated zero-knowledge proof is stored in the smart contract and the storage address is returned. The first commitment value, second commitment value, and the storage address of the zero-knowledge proof are aggregated and sent to the buyer's smart agent. The buyer's smart agent calls the smart contract to execute the zero-knowledge proof verification. After the verification is successful, the transaction is executed. Transaction execution: Based on the second commitment value and purchase parameters, the buyer's smart agent calls the smart contract to submit the purchase. The trading platform monitors the buyer's funds, verifies the access rights to the differential privacy data and the matching of the opened information with the second commitment value, and then the buyer accesses and downloads the differential privacy data.
[0006] Preferably, initialization includes the following operations: Deploy pre-written smart contracts on the blockchain. Smart contracts have functions such as storing data and returning the storage address, returning data based on the storage address, purchasing and submitting, and general zero-knowledge proof verification. For users registered on the trading platform, user identity information, blockchain address and key information are generated. Based on the user role, access and calling permissions for smart contracts are configured for users who are buyers and sellers. Both buyers and sellers have data storage and query permissions, and buyers have the right to call purchase submission and zero-knowledge proof verification methods. For the smart agent corresponding to the user, the smart agent shares the user's access and invocation permissions to the smart contract. The smart agent acts as an automated agent configured by the user and interacts with the blockchain smart contract and trading platform through a standardized context extension protocol.
[0007] As a preferred option, confirming a transaction includes the following steps: The buyer constructs purchase parameters based on the acceptable minimum difference privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. Indicates the highest price; The buyer invokes the smart contract to store purchase parameters and retrieves the storage address of these parameters. ; The buyer initiates a purchase request to the buyer's intelligent agent, specifying the purchase parameters, the storage address of the purchase parameters, and the data requirements. Based on the data requirements in the purchase request, the buyer's agent retrieves matching data in the transaction platform and sends a transaction request to the seller's agent corresponding to the matching data based on the storage address of the purchase parameters. Based on the storage address in the transaction request, the seller agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller agent returns an agreement request to the buyer agent. If the transaction request is not accepted, the seller agent returns a rejection request to the buyer agent. If the buyer agent does not receive any consent requests, the process ends. If the buyer agent receives at least one consent request, it selects the seller agent to confirm the transaction from the received consent requests and sends a purchase confirmation request to the confirmed seller agent. The seller agent that receives the purchase confirmation request performs differential privacy and verification.
[0008] As a preferred option, differential privacy and verification include the following operations: The seller agent calculates key statistical indicators of the raw data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; The seller's smart agent calls the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; The seller's intelligent agent performs differential privacy computation on the original data, injecting controlled random noise into the original data based on the purchase parameters to generate differentially privacy-preserving data. During the differential privacy computation, parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; The seller agent calculates the mean and variance of the differentially privacy-preserving data using the following formula: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. The seller agent selects random numbers to generate a commitment value and access information for the differentially privacy-preserving data, and uses the commitment value corresponding to the differentially privacy-preserving data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; The first commitment value, purchase parameters, and second commitment value are used as public parameters of the zero-knowledge proof, while the original data, differentially privacy-enhanced data, differentially privacy calculation parameters, and secret values from the commitment values are used as private parameters. A general zero-knowledge proof circuit is compiled based on these constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; The seller's smart agent calls the smart contract to store zero-knowledge proofs And obtain the storage address of the zero-knowledge proof. ; The seller agent stores the address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; The buyer's agent receives the aggregated address sent by the seller's agent. Then, based on the purchase parameters and the aggregated address The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
[0009] As a preferred option, transaction execution includes the following operations: The buyer's smart agent calls the smart contract, reads the second commitment value based on the storage address of the second commitment value, and calls the purchase submission method of the smart contract with the second commitment value and purchase parameters as calling parameters. The smart contract stores the calling parameters with a purchase submission identifier attached. After the trading platform detects that the purchase submission method in the smart contract has been called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. Based on the permission granting request, the seller's agent grants the buyer access to and download permissions for the differentially private data through the trading platform, writes the granting information to the trading platform, and sends the permission granting request to the trading platform's agent. The trading platform's intelligent agent verifies whether the seller's intelligent agent has correctly granted permissions and verifies the matching between the access information and the second commitment value. During verification, a commitment value is calculated based on the differentially private data and random number in the access information, as well as the generator element selected when generating the second commitment value, as a comparison commitment value. It then determines whether the comparison commitment value is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds in the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. The buyer accesses and downloads the differentially private data through the trading platform.
[0010] Secondly, the present invention provides a data trading system based on verifiable differential privacy, comprising a blockchain, a trading platform, an intelligent agent, a user terminal, and an administrator terminal; During the initialization phase, the administrator is used to deploy smart contracts in the blockchain and configure access and calling permissions for users and their corresponding smart agents. Users include buyers and sellers. During the transaction confirmation phase, the user terminal, acting as the buyer, stores its purchase parameters in a smart contract and returns the storage address. This is used to initiate a purchase request through the buyer's smart agent. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests. In the differential privacy and verification phase, the seller's smart agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address, performs differential privacy calculations on the original data, calculates the commitment value of the differential privacy data and the opening information, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address, constructs a zero-knowledge proof based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, stores the generated zero-knowledge proof in the smart contract and returns the storage address, aggregates the first commitment value, second commitment value, and the storage address of the zero-knowledge proof and sends it to the buyer's smart agent, which calls the smart contract to execute the zero-knowledge proof verification. After successful verification, the transaction is executed. During the transaction execution phase, based on the second commitment value and purchase parameters, the buyer's smart agent is used to call the smart contract to submit the purchase, the trading platform is used to monitor the buyer's funds, verify the access rights to differential privacy data and the matching of the opened information with the second commitment value, and the buyer's user terminal is used to access and download the differential privacy data.
[0011] As a preferred option, during the initialization phase, the administrator side is used to deploy pre-written smart contracts on the blockchain. The smart contracts have functions such as storing data and returning the storage address, returning data based on the storage address, purchasing and submitting, and general zero-knowledge proof verification. For users registered on the trading platform, the administrator is used to generate the user's identity information, blockchain address, and key information. Based on the user's role, the administrator configures the access and calling permissions of smart contracts for users who are buyers and sellers. Both buyers and sellers have data storage and query permissions, and buyers have the right to call purchase submission and zero-knowledge proof verification methods. For the smart agent corresponding to the user, the smart agent shares the user's access and invocation permissions to the smart contract. The smart agent acts as an automated agent configured by the user and interacts with the blockchain smart contract and trading platform through a standardized context extension protocol.
[0012] As a preferred approach, during the transaction confirmation phase, the user terminal, the smart agent, and the blockchain work together to perform the following operations: The buyer's client-side uses parameters to construct purchase parameters based on the acceptable minimum difference privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. Indicates the highest price; The user client, acting as the buyer, invokes the smart contract to store purchase parameters and retrieves the storage address of these parameters. ; The user terminal, acting as the buyer, is used to initiate a purchase request to the buyer's intelligent agent. The purchase request specifies the purchase parameters, the storage address of the purchase parameters, and the data requirements. Based on the data requirements in the purchase request, the buyer's intelligent agent is used to retrieve matching data in the transaction platform and send a transaction request to the seller's intelligent agent corresponding to the matching data based on the storage address of the purchase parameters. Based on the storage address in the transaction request, the seller's smart agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller's smart agent returns an agreement request to the buyer's smart agent. If the transaction request is not accepted, the seller's smart agent returns a rejection request to the buyer's smart agent. If the buyer agent does not receive any consent requests, the process ends. If the buyer agent receives at least one consent request, it selects the seller agent to confirm the transaction from the received consent requests and sends a purchase confirmation request to the confirmed seller agent. The seller agent that receives the purchase confirmation request performs differential privacy and verification.
[0013] As a preferred approach, during the differential privacy and verification phase, the seller's intelligent agent, the blockchain, and the buyer's intelligent agent work together to perform the following operations: The seller agent calculates key statistical indicators of the raw data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; The seller agent is used to call the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; The seller agent performs differential privacy computation on the raw data. Based on the purchase parameters, it injects controlled random noise into the raw data to generate differentially privacy-preserving data. During the differential privacy computation, parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; The seller agent is used to calculate the mean and variance of the differentially privacy-preserving data, using the following formula: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. The seller agent selects random numbers to generate the commitment value and open information for the differentially privacy-preserving data, and uses the commitment value corresponding to the differentially privacy-preserving data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; The first commitment value, purchase parameters, and second commitment value are used as public parameters of the zero-knowledge proof, while the original data, differentially privacy-enhanced data, differentially privacy calculation parameters, and secret values from the commitment values are used as private parameters. A general zero-knowledge proof circuit is compiled based on these constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; The seller agent is used to call the smart contract to store zero-knowledge proofs. And obtain the storage address of the zero-knowledge proof. ; The seller's intelligent agent uses the storage address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; The buyer's agent receives the aggregated address sent by the seller's agent. Then, it is used based on purchase parameters and the aggregated address. The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
[0014] As a preferred approach, during the transaction execution phase, the buyer's intelligent agent, the seller's intelligent agent, the trading platform, and the blockchain work together to perform the following operations: The buyer's smart agent is used to call the smart contract. It reads the second commitment value based on the storage address of the second commitment value, and calls the purchase submission method of the smart contract with the second commitment value and purchase parameters as the call parameters. The smart contract stores the call parameters after attaching a purchase submission identifier. After the trading platform detects that the purchase submission method in the smart contract has been called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. Based on the permission granting request, the seller agent grants the buyer access to and download permissions for differential privacy-enhanced data through the trading platform, writes the granting information to the trading platform, and sends the permission granting request to the trading platform agent. The trading platform's intelligent agent is used to verify whether the seller's intelligent agent has correctly granted permissions and to verify the matching between the access information and the second commitment value. During verification, a commitment value is calculated based on the differentially private data and random numbers in the access information, as well as the generator element selected when generating the second commitment value, as a comparison commitment value. The comparison commitment value is then used to determine whether it is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds from the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. The user terminal, acting as the buyer, is used to access and download differentially private data through the trading platform.
[0015] The data transaction method and system based on verifiable differential privacy of the present invention have the following advantages: 1. By combining differential privacy, zero-knowledge proof, and commitment techniques, the verifiability of the protected data is achieved while protecting the original data, which is conducive to better protecting the privacy of the seller's original data; 2. Using blockchain to store key transaction data enhances the credibility of transactions; 3. The intelligent agent participated in most of the work in the entire transaction process, realizing the automated execution and real-time processing of transactions, thus improving transaction efficiency. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] The invention will be further described below with reference to the accompanying drawings.
[0018] Figure 1 This is a flowchart of a data transaction method based on verifiable differential privacy, as described in Example 1. Figure 2 This is a flowchart illustrating the transaction confirmation process in Example 1, a data transaction method based on verifiable differential privacy. Figure 3 This is a flowchart illustrating the differential privacy and verification process in a data transaction method based on verifiable differential privacy, as described in Example 1. Figure 4 This is a flowchart of the transaction execution process in a data transaction method based on verifiable differential privacy, as described in Example 1. Detailed Implementation
[0019] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0020] This invention provides a data transaction method and system based on verifiable differential privacy, which addresses the technical problem of how to protect data privacy while ensuring data availability and reliability in data transactions.
[0021] Example 1: This invention discloses a data transaction method based on verifiable differential privacy, applicable to a data transaction system including blockchain, transaction platform, intelligent agent, user terminal and administrator terminal, comprising four steps: initialization, transaction confirmation, differential privacy and verification, and transaction execution.
[0022] Step S100 Initialization: For smart contracts deployed on the blockchain, the administrator configures access and calling permissions for users and corresponding smart agents. Users include buyers and sellers.
[0023] As a specific implementation of initialization, this step includes the following operations: (1) Deploy pre-written smart contracts on the blockchain. The smart contracts have functions such as storing data and returning the storage address, returning data according to the storage address, purchasing submission, and general zero-knowledge proof verification. (2) For users registered on the trading platform, generate user identity information, blockchain address and key information, and configure access and calling permissions for smart contracts for users who are buyers and sellers according to user roles. Both buyers and sellers have data storage and query permissions, and buyers have the right to call purchase submission and zero-knowledge proof verification methods. (3) For the smart agent corresponding to the user, the smart agent shares the user's access and calling permissions to the smart contract. The smart agent, as an automated agent configured by the user, interacts with the blockchain smart contract and the trading platform through the standardized context extension protocol.
[0024] In this embodiment, the administrator deploys the written smart contract on the blockchain and sets the permissions for buyers and sellers within the system to access and invoke the smart contract.
[0025] Step S200: Confirm Transaction: The buyer stores its purchase parameters in the smart contract and returns the storage address. The buyer's smart agent initiates a purchase request. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests.
[0026] As a specific implementation of confirming the transaction, this step includes the following operations: (1) The buyer constructs purchase parameters based on the acceptable minimum difference privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. This represents the highest price, and key statistical indicators include the mean, variance, and standard deviation. (2) The buyer calls the smart contract to store the purchase parameters and obtains the storage address of the purchase parameters. ; (3) The buyer initiates a purchase request to the buyer's intelligent agent. The purchase request specifies the purchase parameters, the storage address of the purchase parameters, and the data requirements. (4) Based on the data requirements in the purchase request, the buyer agent retrieves matching data in the transaction platform and sends a transaction request to the seller agent corresponding to the matching data based on the storage address of the purchase parameters. In specific execution, the buyer agent retrieves the data that meets the requirements in the transaction platform through the transaction platform MPC. The transaction platform stores the data description information. The agent can compare the description information with the purchase requirements in turn and select the most suitable data. (5) Based on the storage address in the transaction request, the seller agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller agent returns an agreement request to the buyer agent. If the transaction request is not accepted, the seller agent returns a rejection request to the buyer agent. In specific execution, the seller agent uses the storage address it accepted. Using parameters, query the storage address of MCP through a blockchain smart contract. Corresponding purchase parameters Determine purchase parameters If the purchase parameters are within the seller's acceptable range, send a request to the buyer's agent to agree to the purchase; otherwise, send a request to the buyer's agent to refuse the purchase. (6) If the buyer agent does not receive any consent request, the process ends. If the buyer agent receives at least one consent request, it selects the seller agent to confirm the transaction from the received consent requests (selecting the seller whose data quality best meets the requirements) and sends a confirmation purchase request to the confirmed seller agent. The seller agent that receives the confirmation purchase request performs differential privacy and verification.
[0027] In this embodiment, during the transaction confirmation stage, the buyer sets the purchase parameters that they can accept and stores them on the blockchain smart contract. Then, the buyer's smart agent and the seller's smart agent interact to confirm the transaction.
[0028] Step S300: Differential Privacy and Verification: The seller's agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address. After performing differential privacy calculation on the original data, it calculates the commitment value and opening information of the differential privacy data, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address. Based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, a zero-knowledge proof is constructed. The generated zero-knowledge proof is stored in the smart contract and the storage address is returned. The first commitment value, second commitment value, and the storage address of the zero-knowledge proof are aggregated and sent to the buyer's agent. The buyer's agent calls the smart contract to execute the zero-knowledge proof verification. After successful verification, the transaction is executed.
[0029] As a specific implementation of differential privacy and verification, this step includes the following operations: (1) The seller agent calculates the key statistical indicators of the original data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; (2) The seller's smart agent calls the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; (3) The seller's intelligent agent performs differential privacy computation on the original data, injects controlled random noise into the original data based on the purchase parameters, and generates differential privacy-preserving data. During differential privacy computation, the parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; (4) The seller agent calculates the mean and variance of the differentially privacy-preserving data using the following formula: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. (5) The seller agent selects a random number to generate the commitment value and opening information of the differentially private data, and uses the commitment value corresponding to the differentially private data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; (6) Using the first commitment value, purchase parameters, and second commitment value as public parameters of the zero-knowledge proof, and the original data, differential privacy-enhanced data, differential privacy calculation parameters, and secret values in the commitment value as private parameters of the zero-knowledge proof, a general zero-knowledge proof circuit is compiled based on constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; (7) The seller's smart agent calls the smart contract to store zero-knowledge proofs And obtain the storage address of the zero-knowledge proof. ; (8) The seller's intelligent agent stores the address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; (9) The buyer's agent receives the aggregated address sent by the seller's agent. Then, based on the purchase parameters and the aggregated address The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
[0030] In this example, during the differential privacy and verification phase, the seller's agent calculates the statistical metrics and commitments of the data, performs differential privacy on the data and calculates the commitments, calculates the corresponding zero-knowledge proofs, and stores the corresponding information in a blockchain smart contract. The buyer's agent verifies the validity of the corresponding zero-knowledge proofs through a blockchain smart contract. After receiving the confirmation purchase request, the seller's agent calculates the original data. The data includes statistical indicators such as mean, variance, and standard deviation, and the commitment value is calculated. The seller's smart agent calls the MCP through a blockchain smart contract, using the cryptographic commitment value of the original data as a parameter to call the blockchain smart contract, storing the cryptographic commitment values of these statistical indicators in the blockchain smart contract, and obtaining the storage address. The seller's intelligent agent in the raw data On top of that, a differential privacy algorithm is run, injecting controlled random noise into the data based on the purchase parameters, thereby generating data with differential privacy protection. Seller's intelligent agent calculates data. Commitment value and open information And through a blockchain smart contract, MCP is invoked to transfer the commitment value. Stored in a blockchain smart contract, obtaining the storage address The seller's intelligent agent will use the cryptographic commitment value and purchase parameters of the original data. The promise value of data after differential privacy As a public parameter of zero-knowledge proof, with the original data Data after differential privacy protection The parameters in the differential privacy algorithm, the secret value in the commitment value, etc., are used as private parameters in the zero-knowledge proof. It is the raw data. Key performance indicators and data In the data Promise values generated by running differential privacy-preserving algorithms It is data The commitment, the parameters in the differential privacy algorithm are greater than or equal to Inside Corresponding parameters and data With data The deviation of the corresponding statistical indicator is less than or equal to Inside Using the corresponding deviation as a constraint, compile the required zero-knowledge proof circuit and generate the corresponding zero-knowledge proof. The seller's smart agent invokes the zero-knowledge proof of MCP through a blockchain smart contract. Stored in a blockchain smart contract, obtain its storage address. The seller's intelligent agent will address , , Equal address accumulation The message is sent to the buyer's smart agent; after receiving the different storage addresses sent by the seller's smart agent, the buyer's smart agent invokes the MCP via a blockchain smart contract to purchase the parameters. and Call the blockchain smart contract with parameters; the blockchain smart contract from The key indicator commitment values of the raw data are obtained sequentially. The promised value of data after differential privacy protection and zero-knowledge proof and with As a public parameter of zero-knowledge proof, with As evidence of the zero-knowledge proof, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's intelligent agent. The verification algorithm checks whether the previous constraints are all valid by combining the zero-knowledge proof and the public parameters. This is also the general verification method of zero-knowledge proof. If the verification result is true, the next step is continued. Otherwise, the buyer's intelligent agent ends the operation.
[0031] Step S400 Transaction Execution: Based on the second commitment value and purchase parameters, the buyer's smart agent calls the smart contract to submit the purchase. The trading platform monitors the buyer's funds, verifies the access rights to the differential privacy data and the matching of the opened information with the second commitment value, and then the buyer accesses and downloads the differential privacy data.
[0032] As a specific implementation of transaction execution, it includes the following operations: (1) The buyer's smart agent calls the smart contract, reads the second commitment value based on the storage address of the second commitment value, and calls the purchase submission method of the smart contract with the second commitment value and the purchase parameters as the call parameters. The smart contract stores the call parameters after attaching the purchase submission mark. (2) After the trading platform detects that the purchase submission method in the smart contract has been called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. (3) Based on the permission release request, the seller agent releases the access and download permissions of the differential privacy data to the buyer through the trading platform, writes the opening information to the trading platform, and sends the permission release request to the trading platform agent; (4) The trading platform agent verifies whether the seller agent has correctly granted permissions and verifies the matching between the opening information and the second commitment value. During verification, the commitment value is calculated based on the differentially private data and random number in the opening information and the generator selected when generating the second commitment value as the comparison commitment value. It is then determined whether the comparison commitment value is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds in the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. (6) The buyer accesses and downloads the differential privacy data through the trading platform.
[0033] In this embodiment, during the transaction execution phase, the buyer's smart agent calls the blockchain smart contract to submit a purchase request. The trading platform smart agent transfers the amount corresponding to the buyer's account to an intermediary account. The seller's smart agent grants the buyer access to and data download permissions and writes the corresponding promised access information to the trading platform. After verification, the trading platform smart agent transfers the funds, and the buyer accesses and downloads the data. The trading platform smart agent uses the trading platform's MCP to call the trading platform's fund transfer and permission verification capabilities, and also has the ability to monitor the blockchain and interact with other smart agents. The trading platform smart agent focuses on decision-making functions, while the trading platform focuses on providing infrastructure functions. In specific execution, the buyer's smart agent calls the MCP through the blockchain smart contract, first... Call the query method of the blockchain smart contract with the parameters to obtain the commitment. Then make a promise and purchase parameters The transaction platform's intelligent agent detects the invocation of the purchase submission method in the smart contract and retrieves the commitment from it. and purchase parameters The platform then transfers the funds corresponding to the buyer's account to an intermediary account and sends a request to the seller's agent to grant permissions. Upon receiving the request from the trading platform's agent, the seller's agent transmits the differentially privacy-protected data through the trading platform's MCP. Grant the buyer access and download permissions to transfer the data. Open Message The transaction is written to the trading platform, and a request to the trading platform's intelligent agent indicating that permissions have been granted is sent. Upon receiving the request, the trading platform's intelligent agent verifies, through the trading platform's MCP (Multi-Channel Programming), whether the seller has correctly granted permissions. and open information Can the promise be opened correctly? If both verifications pass, the trading platform agent will transfer the corresponding amount from the intermediary account to the seller's account via the trading platform's MCP; otherwise, the trading platform agent will transfer the corresponding amount from the intermediary account to the buyer's account via the trading platform's MCP. The buyer then accesses and downloads the data from the seller's account. The trading platform has a database table that records permissions. It has the function of querying the database based on database conditions to check if the corresponding permission exists, and provides an access interface for this function. The trading platform's intelligent agent can access this interface through the trading platform's MCP.
[0034] The method in this embodiment can protect the seller's original data in data transactions, ensure the availability of data after differential privacy, and enhance the buyer's trust in the availability of data in data transactions.
[0035] Example 2: This invention discloses a data trading system based on verifiable differential privacy, comprising a blockchain, a trading platform, an intelligent agent, a user terminal, and an administrator terminal.
[0036] During the initialization phase, the administrator is used to deploy smart contracts in the blockchain and configure access and invocation permissions for users and their corresponding smart agents. Users include buyers and sellers.
[0037] In the specific implementation phase, the administrator side is used to deploy pre-written smart contracts on the blockchain. These smart contracts have functions such as storing data and returning storage addresses, returning data based on storage addresses, submitting purchases, and verifying using general zero-knowledge proofs. For users registered on the trading platform, the administrator side generates user identity information, blockchain addresses, and key information. Based on user roles, it configures access and invocation permissions for smart contracts for both buyers and sellers. Both buyers and sellers have data storage and query permissions, while buyers have the permission to submit purchases and invoke zero-knowledge proof verification methods. For the smart agent corresponding to a user, the smart agent shares the user's access and invocation permissions for smart contracts. The smart agent acts as an automated agent configured by the user, interacting with the blockchain smart contracts and the trading platform through a standardized context extension protocol.
[0038] In this embodiment, the administrator deploys the written smart contract on the blockchain and sets the permissions for buyers and sellers within the system to access and invoke the smart contract.
[0039] During the transaction confirmation phase, the user terminal, acting as the buyer, stores its purchase parameters in a smart contract and returns the storage address. This is used to initiate a purchase request through the buyer's smart agent. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests.
[0040] In practice, during the transaction confirmation phase, the user terminal, smart agent, and blockchain work together to perform the following operations: (1) The buyer's client is used to construct purchase parameters based on the acceptable minimum differential privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. Indicates the highest price; (2) The user end, acting as the buyer, calls the smart contract to store the purchase parameters and obtains the storage address of the purchase parameters. ; (3) The user terminal, acting as the buyer, is used to initiate a purchase request to the buyer's intelligent agent. The purchase request specifies the purchase parameters, the storage address of the purchase parameters, and the data requirements. (4) Based on the data requirements in the purchase request, the buyer's agent is used to retrieve matching data in the transaction platform and send a transaction request to the seller's agent corresponding to the matching data based on the storage address of the purchase parameters. (5) Based on the storage address in the transaction request, the seller smart agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller smart agent returns an agreement request to the buyer smart agent. If the transaction request is not accepted, the seller smart agent returns a rejection request to the buyer smart agent. (6) If the buyer's agent does not receive any consent request, the process ends. If the buyer's agent receives at least one consent request, it selects the seller's agent to confirm the transaction from the received consent requests and sends a confirmation purchase request to the confirmed seller's agent. The seller's agent that receives the confirmation purchase request performs differential privacy and verification.
[0041] In this embodiment, during the transaction confirmation stage, the buyer sets the purchase parameters that they can accept and stores them on the blockchain smart contract. Then, the buyer's smart agent and the seller's smart agent interact to confirm the transaction.
[0042] In the differential privacy and verification phase, the seller's smart agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address, performs differential privacy calculations on the original data, calculates the commitment value of the differential privacy data and the opening information, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address, constructs a zero-knowledge proof based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, stores the generated zero-knowledge proof in the smart contract and returns the storage address, aggregates the first commitment value, second commitment value, and the storage address of the zero-knowledge proof and sends it to the buyer's smart agent, which calls the smart contract to execute the zero-knowledge proof verification. After successful verification, the transaction is executed.
[0043] As a specific implementation, in the differential privacy and verification phase, the seller's intelligent agent, the blockchain, and the buyer's intelligent agent work together to perform the following operations: (1) The seller agent calculates the key statistical indicators of the original data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; (2) The seller's smart agent is used to call the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; (3) The seller agent is used to perform differential privacy calculation on the original data. Based on the purchase parameters, controlled random noise is injected into the original data to generate differential privacy data. During differential privacy calculation, the parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; (4) The seller agent is used to calculate the mean and variance of the data after differential privacy, and the calculation formula is as follows: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. (5) The seller agent selects random numbers to generate the commitment value and open information of the differentially private data, and uses the commitment value corresponding to the differentially private data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; (6) Using the first commitment value, purchase parameters, and second commitment value as public parameters of the zero-knowledge proof, and the original data, differential privacy-enhanced data, differential privacy calculation parameters, and secret values in the commitment value as private parameters of the zero-knowledge proof, a general zero-knowledge proof circuit is compiled based on constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; (7) The seller's smart agent is used to call the smart contract to store zero-knowledge proofs. And obtain the storage address of the zero-knowledge proof. ; (8) The seller's intelligent agent uses the storage address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; (9) The buyer's agent receives the aggregated address sent by the seller's agent. Then, it is used based on purchase parameters and the aggregated address. The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
[0044] In this example, during the differential privacy and verification phase, the seller's agent calculates the statistical metrics and commitments of the data, performs differential privacy on the data and calculates the commitments, calculates the corresponding zero-knowledge proofs, and stores the corresponding information in a blockchain smart contract. The buyer's agent verifies the validity of the corresponding zero-knowledge proofs through a blockchain smart contract. After receiving the confirmation purchase request, the seller's agent calculates the original data. The data includes statistical indicators such as mean, variance, and standard deviation, and the commitment value is calculated. The seller's smart agent calls the MCP through a blockchain smart contract, using the cryptographic commitment value of the original data as a parameter to call the blockchain smart contract, storing the cryptographic commitment values of these statistical indicators in the blockchain smart contract, and obtaining the storage address. The seller's intelligent agent in the raw data On top of that, a differential privacy algorithm is run, injecting controlled random noise into the data based on the purchase parameters, thereby generating data with differential privacy protection. Seller's intelligent agent calculates data. Commitment value and open information And through a blockchain smart contract, MCP is invoked to transfer the commitment value. Stored in a blockchain smart contract, obtaining the storage address The seller's intelligent agent will use the cryptographic commitment value and purchase parameters of the original data. The promise value of data after differential privacy As a public parameter of zero-knowledge proof, with the original data Data after differential privacy protection The parameters in the differential privacy algorithm, the secret value in the commitment value, etc., are used as private parameters in the zero-knowledge proof. It is the raw data. Key performance indicators and data In the data Promise values generated by running differential privacy-preserving algorithms It is data The commitment, the parameters in the differential privacy algorithm are greater than or equal to Inside Corresponding parameters and data With data The deviation of the corresponding statistical indicator is less than or equal to Inside Using the corresponding deviation as a constraint, compile the required zero-knowledge proof circuit and generate the corresponding zero-knowledge proof. The seller's smart agent invokes the zero-knowledge proof of MCP through a blockchain smart contract. Stored in a blockchain smart contract, obtain its storage address. The seller's intelligent agent will address , , Equal address accumulation The message is sent to the buyer's smart agent; after receiving the different storage addresses sent by the seller's smart agent, the buyer's smart agent invokes the MCP via a blockchain smart contract to purchase the parameters. and Call the blockchain smart contract with parameters; the blockchain smart contract from The key indicator commitment values of the raw data are obtained sequentially. The promised value of data after differential privacy protection and zero-knowledge proof and with As a public parameter of zero-knowledge proof, with As evidence of the zero-knowledge proof, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's intelligent agent. The verification algorithm checks whether the previous constraints are all valid by combining the zero-knowledge proof and the public parameters. This is also the general verification method of zero-knowledge proof. If the verification result is true, the next step is continued. Otherwise, the buyer's intelligent agent ends the operation.
[0045] During the transaction execution phase, based on the second commitment value and purchase parameters, the buyer's smart agent is used to call the smart contract to submit the purchase, the trading platform is used to monitor the buyer's funds, verify the access rights to differential privacy data and the matching of the opened information with the second commitment value, and the buyer's user terminal is used to access and download the differential privacy data.
[0046] In practice, during the transaction execution phase, the buyer's intelligent agent, the seller's intelligent agent, the trading platform, and the blockchain work together to perform the following operations: (1) The buyer's smart agent is used to call the smart contract, read the second commitment value based on the storage address of the second commitment value, and call the purchase submission method of the smart contract with the second commitment value and the purchase parameters as the call parameters. The smart contract stores the call parameters after attaching the purchase submission identifier. (2) After the trading platform detects that the purchase submission method in the smart contract is called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. (3) Based on the permission release request, the seller agent is used to release the access and download permissions of the differential privacy data to the buyer through the trading platform, write the release information to the trading platform, and send the permission release request to the trading platform agent; (4) The trading platform agent is used to verify whether the seller agent has correctly granted permissions and to verify the matching between the opening information and the second commitment value. During verification, the commitment value is calculated based on the differentially private data and random number in the opening information and the generator selected when generating the second commitment value as the comparison commitment value. It is then determined whether the comparison commitment value is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds from the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. (5) The user terminal, acting as the buyer, is used to access and download differential privacy-protected data through the trading platform.
[0047] In this embodiment, during the transaction execution phase, the buyer's smart agent calls the blockchain smart contract to submit a purchase request. The trading platform smart agent transfers the amount corresponding to the buyer's account to an intermediary account. The seller's smart agent grants the buyer access to and data download permissions and writes the corresponding promised access information to the trading platform. After verification, the trading platform smart agent transfers the funds, and the buyer accesses and downloads the data. The trading platform smart agent uses the trading platform's MCP to call the trading platform's fund transfer and permission verification capabilities, and also has the ability to monitor the blockchain and interact with other smart agents. The trading platform smart agent focuses on decision-making functions, while the trading platform focuses on providing infrastructure functions. In specific execution, the buyer's smart agent calls the MCP through the blockchain smart contract, first... Call the query method of the blockchain smart contract with the parameters to obtain the commitment. Then make a promise and purchase parameters The transaction platform's intelligent agent detects the invocation of the purchase submission method in the smart contract and retrieves the commitment from it. and purchase parameters The platform then transfers the funds corresponding to the buyer's account to an intermediary account and sends a request to the seller's agent to grant permissions. Upon receiving the request from the trading platform's agent, the seller's agent transmits the differentially privacy-protected data through the trading platform's MCP. Grant the buyer access and download permissions to transfer the data. Open Message The transaction is written to the trading platform, and a request to the trading platform's intelligent agent indicating that permissions have been granted is sent. Upon receiving the request, the trading platform's intelligent agent verifies, through the trading platform's MCP (Multi-Channel Programming), whether the seller has correctly granted permissions. and open information Can the promise be opened correctly? If both verifications pass, the trading platform agent will transfer the corresponding amount from the intermediary account to the seller's account via the trading platform's MCP; otherwise, the trading platform agent will transfer the corresponding amount from the intermediary account to the buyer's account via the trading platform's MCP. The buyer then accesses and downloads the data from the seller's account. The trading platform has a database table that records permissions. It has the function of querying the database based on database conditions to check if the corresponding permission exists, and provides an access interface for this function. The trading platform's intelligent agent can access this interface through the trading platform's MCP.
[0048] The system in this embodiment can execute the method disclosed in Embodiment 1 to realize data transactions, protect the seller's original data in the data transaction, ensure the availability of data after differential privacy, and enhance the buyer's trust in the availability of data in the data transaction.
[0049] The above provides a detailed description of the data transaction method and system based on verifiable differential privacy provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data transaction method based on verifiable differential privacy, characterized in that, A data trading system applied to include blockchain, trading platforms, intelligent agents, user terminals, and administrator terminals includes the following steps: Initialization: For smart contracts deployed on the blockchain, the administrator configures access and calling permissions for users and their corresponding smart agents. Users include buyers and sellers. Transaction Confirmation: The buyer stores its purchase parameters in a smart contract and returns the storage address. The buyer then initiates a purchase request through its smart agent. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests. Differential Privacy and Verification: The seller's smart agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address. After performing differential privacy calculation on the original data, it calculates the commitment value of the differential privacy data and the opening information, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address. Based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, a zero-knowledge proof is constructed. The generated zero-knowledge proof is stored in the smart contract and the storage address is returned. The first commitment value, second commitment value, and the storage address of the zero-knowledge proof are aggregated and sent to the buyer's smart agent. The buyer's smart agent calls the smart contract to execute the zero-knowledge proof verification. After the verification is successful, the transaction is executed. Transaction execution: Based on the second commitment value and purchase parameters, the buyer's smart agent calls the smart contract to submit the purchase. The trading platform monitors the buyer's funds, verifies the access rights to the differential privacy data and the matching of the opened information with the second commitment value, and then the buyer accesses and downloads the differential privacy data.
2. The data transaction method based on verifiable differential privacy according to claim 1, characterized in that, Initialization includes the following operations: Deploy pre-written smart contracts on the blockchain. Smart contracts have functions such as storing data and returning the storage address, returning data based on the storage address, purchasing and submitting, and general zero-knowledge proof verification. For users registered on the trading platform, user identity information, blockchain address and key information are generated. Based on the user role, access and calling permissions for smart contracts are configured for users who are buyers and sellers. Both buyers and sellers have data storage and query permissions, and buyers have the right to call purchase submission and zero-knowledge proof verification methods. For the smart agent corresponding to the user, the smart agent shares the user's access and invocation permissions to the smart contract. The smart agent acts as an automated agent configured by the user and interacts with the blockchain smart contract and trading platform through a standardized context extension protocol.
3. The data transaction method based on verifiable differential privacy according to claim 1, characterized in that, Confirming a transaction includes the following steps: The buyer constructs purchase parameters based on the acceptable minimum difference privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. Indicates the highest price; The buyer invokes the smart contract to store purchase parameters and retrieves the storage address of these parameters. ; The buyer initiates a purchase request to the buyer's intelligent agent, specifying the purchase parameters, the storage address of the purchase parameters, and the data requirements. Based on the data requirements in the purchase request, the buyer's agent retrieves matching data in the transaction platform and sends a transaction request to the seller's agent corresponding to the matching data based on the storage address of the purchase parameters. Based on the storage address in the transaction request, the seller agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller agent returns an agreement request to the buyer agent. If the transaction request is not accepted, the seller agent returns a rejection request to the buyer agent. If the buyer agent does not receive any consent requests, the process ends. If the buyer agent receives at least one consent request, it selects the seller agent to confirm the transaction from the received consent requests and sends a purchase confirmation request to the confirmed seller agent. The seller agent that receives the purchase confirmation request performs differential privacy and verification.
4. The data transaction method based on verifiable differential privacy according to claim 1, characterized in that, Differential privacy and authentication include the following operations: The seller agent calculates key statistical indicators of the raw data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; The seller's smart agent calls the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; The seller's intelligent agent performs differential privacy computation on the original data, injecting controlled random noise into the original data based on the purchase parameters to generate differentially privacy-preserving data. During the differential privacy computation, parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; The seller agent calculates the mean and variance of the differentially privacy-preserving data using the following formula: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. The seller agent selects random numbers to generate a commitment value and access information for the differentially privacy-preserving data, and uses the commitment value corresponding to the differentially privacy-preserving data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; The first commitment value, purchase parameters, and second commitment value are used as public parameters of the zero-knowledge proof, while the original data, differentially privacy-enhanced data, differentially privacy calculation parameters, and secret values from the commitment values are used as private parameters. A general zero-knowledge proof circuit is compiled based on these constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; The seller's smart agent calls the smart contract to store zero-knowledge proofs And obtain the storage address of the zero-knowledge proof. ; The seller agent stores the address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; The buyer's agent receives the aggregated address sent by the seller's agent. Then, based on the purchase parameters and the aggregated address The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
5. The data transaction method based on verifiable differential privacy according to claim 1, characterized in that, Transaction execution includes the following operations: The buyer's smart agent calls the smart contract, reads the second commitment value based on the storage address of the second commitment value, and calls the purchase submission method of the smart contract with the second commitment value and purchase parameters as calling parameters. The smart contract stores the calling parameters with a purchase submission identifier attached. After the trading platform detects that the purchase submission method in the smart contract has been called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. Based on the permission granting request, the seller's agent grants the buyer access to and download permissions for the differentially private data through the trading platform, writes the granting information to the trading platform, and sends the permission granting request to the trading platform's agent. The trading platform's intelligent agent verifies whether the seller's intelligent agent has correctly granted permissions and verifies the matching between the access information and the second commitment value. During verification, a commitment value is calculated based on the differentially private data and random number in the access information, as well as the generator element selected when generating the second commitment value, as a comparison commitment value. It then determines whether the comparison commitment value is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds in the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. The buyer accesses and downloads the differentially private data through the trading platform.
6. A data transaction system based on verifiable differential privacy, characterized in that, This includes blockchain, trading platforms, smart agents, user terminals, and administrator terminals; During the initialization phase, the administrator is used to deploy smart contracts in the blockchain and configure access and calling permissions for users and their corresponding smart agents. Users include buyers and sellers. During the transaction confirmation phase, the user terminal, acting as the buyer, stores its purchase parameters in a smart contract and returns the storage address. This is used to initiate a purchase request through the buyer's smart agent. The buyer's smart agent retrieves matching data from the trading platform and sends a transaction request to the corresponding seller's smart agent. The seller's smart agent queries the purchase parameters based on the storage address of the purchase parameters in the transaction request and confirms whether to accept them. The buyer's smart agent selects confirmation from the received consent requests. In the differential privacy and verification phase, the seller's smart agent calculates the commitment value of the original data as the first commitment value, stores the first commitment value in the smart contract and returns the storage address, performs differential privacy calculations on the original data, calculates the commitment value of the differential privacy data and the opening information, stores the commitment value of the differential privacy data as the second commitment value in the smart contract and returns the storage address, constructs a zero-knowledge proof based on the first commitment value, purchase parameters, second commitment value, original data, differential privacy data, differential privacy calculation parameters, and secret values in the commitment value, stores the generated zero-knowledge proof in the smart contract and returns the storage address, aggregates the first commitment value, second commitment value, and the storage address of the zero-knowledge proof and sends it to the buyer's smart agent, which calls the smart contract to execute the zero-knowledge proof verification. After successful verification, the transaction is executed. During the transaction execution phase, based on the second commitment value and purchase parameters, the buyer's smart agent is used to call the smart contract to submit the purchase, the trading platform is used to monitor the buyer's funds, verify the access rights to differential privacy data and the matching of the opened information with the second commitment value, and the buyer's user terminal is used to access and download the differential privacy data.
7. The data transaction system based on verifiable differential privacy according to claim 6, characterized in that, During the initialization phase, the administrator side is used to deploy pre-written smart contracts on the blockchain. The smart contracts have functions such as storing data and returning the storage address, returning data based on the storage address, purchasing and submitting, and general zero-knowledge proof verification. For users registered on the trading platform, the administrator is used to generate the user's identity information, blockchain address, and key information. Based on the user's role, the administrator configures the access and calling permissions of smart contracts for users who are buyers and sellers. Both buyers and sellers have data storage and query permissions, and buyers have the right to call purchase submission and zero-knowledge proof verification methods. For the smart agent corresponding to the user, the smart agent shares the user's access and invocation permissions to the smart contract. The smart agent acts as an automated agent configured by the user and interacts with the blockchain smart contract and trading platform through a standardized context extension protocol.
8. The data transaction system based on verifiable differential privacy according to claim 6, characterized in that, During the transaction confirmation phase, the user terminal, smart agent, and blockchain work together to perform the following operations: The buyer's client-side uses parameters to construct purchase parameters based on the acceptable minimum difference privacy parameter, the maximum deviation of key statistical indicators, and the highest price. Represented as , This represents the minimum difference privacy parameter. , This represents the minimum privacy budget in differential privacy. This represents the minimum relaxation term in differential privacy. This indicates the maximum deviation of key statistical indicators. , This represents the maximum deviation from the mean. This represents the maximum deviation of the variance. Indicates the highest price; The user client, acting as the buyer, invokes the smart contract to store purchase parameters and retrieves the storage address of these parameters. ; The user terminal, acting as the buyer, is used to initiate a purchase request to the buyer's intelligent agent. The purchase request specifies the purchase parameters, the storage address of the purchase parameters, and the data requirements. Based on the data requirements in the purchase request, the buyer's intelligent agent is used to retrieve matching data in the transaction platform and send a transaction request to the seller's intelligent agent corresponding to the matching data based on the storage address of the purchase parameters. Based on the storage address in the transaction request, the seller's smart agent queries the corresponding purchase parameters from the smart contract and confirms whether to accept the transaction request. If the transaction request is accepted, the seller's smart agent returns an agreement request to the buyer's smart agent. If the transaction request is not accepted, the seller's smart agent returns a rejection request to the buyer's smart agent. If the buyer agent does not receive any consent requests, the process ends. If the buyer agent receives at least one consent request, it selects the seller agent to confirm the transaction from the received consent requests and sends a purchase confirmation request to the confirmed seller agent. The seller agent that receives the purchase confirmation request performs differential privacy and verification.
9. The data transaction system based on verifiable differential privacy according to claim 6, characterized in that, During the differential privacy and verification phase, the seller's intelligent agent, the blockchain, and the buyer's intelligent agent work together to perform the following operations: The seller agent calculates key statistical indicators of the raw data and selects random numbers to generate a commitment value as the first commitment value. First commitment value The calculation formula is: , , , In the formula, For the generators of the multiplicative cyclic group, This represents the mean of the key statistical indicators corresponding to the original data. This represents the variance of the key statistical indicators corresponding to the original data. For the selected random number, For raw data The Middle Data points, Represents raw data Number of data points in the middle , as well as As a secret value within the commitment value; The seller agent is used to call the smart contract to store the first commitment value. and obtain the first commitment value. storage address ; The seller agent performs differential privacy computation on the raw data. Based on the purchase parameters, it injects controlled random noise into the raw data to generate differentially privacy-preserving data. During the differential privacy computation, parameters are selected based on the minimum differential privacy parameter among the purchase parameters. and Based on parameters and Calculate the difference between the maximum and minimum values in the original data. Based on parameters and and difference Calculate noise parameters Based on noise parameters For each data point in each original dataset, from Gaussian noise is generated by random sampling to obtain differential privacy-preserving data. , For the data after differential privacy, the first Data points The calculation formula is as follows: , , , , , In the formula, Indicates the first in the original data Data points, and Representing data points Corresponding from Random sampling in Representing data points The corresponding Gaussian noise, , as well as As a parameter for differential privacy computation; The seller agent is used to calculate the mean and variance of the differentially privacy-preserving data, using the following formula: , , In the formula, This represents the mean of the data after differential privacy treatment. This represents the variance of the data after differential privacy. The seller agent selects random numbers to generate the commitment value and open information for the differentially privacy-preserving data, and uses the commitment value corresponding to the differentially privacy-preserving data as the second commitment value. Second commitment value and open information The calculation formula is as follows: , , In the formula, Denotes the generators on the multiplicative cyclic group. Indicating differential privacy in the data of the first... Data points, It is a random number. As a secret value within the commitment value; The first commitment value, purchase parameters, and second commitment value are used as public parameters of the zero-knowledge proof, while the original data, differentially privacy-enhanced data, differentially privacy calculation parameters, and secret values from the commitment values are used as private parameters. A general zero-knowledge proof circuit is compiled based on these constraints to generate the zero-knowledge proof. The constraints are: , , , , , , , , , , | , ; The seller agent is used to call the smart contract to store zero-knowledge proofs. And obtain the storage address of the zero-knowledge proof. ; The seller's intelligent agent uses the storage address of the first commitment value. The storage address of the second commitment value and the storage address of zero-knowledge proofs Aggregation, the aggregated address Send to the buyer's intelligent agent, where, ; The buyer's agent receives the aggregated address sent by the seller's agent. Then, it is used based on purchase parameters and the aggregated address. The smart contract is invoked. Based on the aggregated address, the smart contract reads the first commitment value, the second commitment value, and the zero-knowledge proof in sequence. Using the first commitment value, the second commitment value, and the zero-knowledge proof as public parameters, the zero-knowledge proof verification algorithm is executed, and the verification result is returned to the buyer's smart agent. If the verification passes, the transaction is executed; if the verification fails, the buyer's smart agent ends the operation.
10. The data transaction system based on verifiable differential privacy according to claim 6, characterized in that, During the transaction execution phase, the buyer's intelligent agent, the seller's intelligent agent, the trading platform, and the blockchain work together to perform the following operations: The buyer's smart agent is used to call the smart contract. It reads the second commitment value based on the storage address of the second commitment value, and calls the purchase submission method of the smart contract with the second commitment value and purchase parameters as the call parameters. The smart contract stores the call parameters after attaching a purchase submission identifier. After the trading platform detects that the purchase submission method in the smart contract has been called, it extracts the call parameters, transfers the corresponding amount from the buyer's account to the intermediary account, and sends a request to the seller's smart agent to grant permissions. Based on the permission granting request, the seller agent grants the buyer access to and download permissions for differential privacy-enhanced data through the trading platform, writes the granting information to the trading platform, and sends the permission granting request to the trading platform agent. The trading platform's intelligent agent is used to verify whether the seller's intelligent agent has correctly granted permissions and to verify the matching between the access information and the second commitment value. During verification, a commitment value is calculated based on the differentially private data and random numbers in the access information, as well as the generator element selected when generating the second commitment value, as a comparison commitment value. The comparison commitment value is then used to determine whether it is equal to the second commitment value. The calculation formula is as follows: ; If both the permission verification and the commitment verification pass, the trading platform will transfer the funds from the intermediary account to the seller's account; otherwise, the funds will be returned to the buyer's account. The user terminal, acting as the buyer, is used to access and download differentially private data through the trading platform.