A data outsourcing computing transaction method based on smart contracts

Through smart contracts and inadvertent transmission protocols, the problems of distrust and data privacy are solved in data outsourcing computing, and the improvement of fairness, autonomy and security are achieved, and transaction costs are reduced.

CN114969815BActive Publication Date: 2025-05-13CHANGCHUN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210599798.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2025-05-13
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

During the data outsourcing calculation process, distrust issues lead to increased transaction costs, and third-party supervision has subjectivity and fairness issues, and data privacy is difficult to guarantee.

Method used

The data outsourcing calculation and transaction method based on smart contracts is adopted, and the data is divided into multiple servers through inadvertent transmission protocols, combining the punishment mechanism and improved replication proof technology to verify the correctness of the data calculation results, and ensure the transparency and immutability of transactions through blockchain technology.

Benefits of technology

It reduces third-party interference, improves the fairness and autonomy of transactions, ensures the privacy and security of data, reduces transaction costs, and limits dishonest behavior through punishment mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969815B_ABST
    Figure CN114969815B_ABST
Patent Text Reader

Abstract

The present invention discloses a data outsourcing computing transaction method based on smart contracts, comprising: deploying smart contracts on a blockchain platform; a client joins the blockchain and calls the smart contract; and the client deposits a deposit according to the client deposit amount in the smart contract; the client publishes the transaction on the blockchain platform, and multiple service ends participating in the transaction join the blockchain and call the smart contract, and deposit deposits respectively according to the server deposit amount in the smart contract; the client transmits the data to be calculated to multiple service ends respectively based on an oblivious transfer protocol through the smart contract; the service end calculates with the received data to be calculated and the data calculation method, and transmits the calculation result to the smart contract; the smart contract verifies the calculation result received from each service end, and if the verification is successful, the client receives the calculation result through the smart contract and pays the service end through the smart contract; if the verification fails, the deposit of the corresponding service end is deducted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart contracts, and in particular relates to a data outsourcing computing transaction method based on smart contracts. Background Art

[0002] With the development of the information age, data has become crucial, and data outsourcing computing has received more and more attention. However, there are some problems in the process of data outsourcing computing, such as the server returning false results, the client receiving the results but not paying, etc., so there is mutual distrust, which affects the normal execution of data outsourcing. Therefore, a third party is usually required for supervision, which increases transaction costs and is a time-consuming and labor-intensive process when resolving disputes. At the same time, there is the subjectivity of the third party, which leads to unfair and unjust judgment results. In addition, data privacy is also a key issue in the transaction process. Therefore, in data outsourcing computing, how to make both parties perform calculations honestly and return results, while ensuring the privacy of all data in this process becomes a top priority.

[0003] In recent years, blockchain technology has developed rapidly. As a distributed shared ledger technology, blockchain technology has the characteristics of decentralization, tamper-proof, and traceability. The smart contract technology in the blockchain is a programmable computer program. Once deployed to the blockchain, it can only be accessed and cannot be changed. Smart contracts can be automatically executed without a third party. Summary of the invention

[0004] The purpose of the present invention is to provide a data outsourcing computing transaction method based on smart contracts. One of the purposes of the present invention is to divide data onto multiple servers based on an oblivious transfer protocol, thereby ensuring the privacy and security of the data, and adopting a penalty mechanism to limit dishonest behavior and improve the fairness of transactions.

[0005] Another purpose of the present invention is to verify the data calculation results using improved replication proof, and the calculation results are verified between two servers through only one of the data, thereby reducing transaction costs.

[0006] The technical solution provided by the present invention is:

[0007] A data outsourcing computing transaction method based on smart contracts, comprising the following steps:

[0008] Step 1: The blockchain platform deploys an initial smart contract; the client joins the blockchain, calls the initial smart contract, and sets the client deposit amount, the amount of data to be calculated by the server, the server deposit amount and the remuneration amount in the initial smart contract to obtain a transaction smart contract; and the client deposits a deposit according to the client deposit amount in the transaction smart contract;

[0009] Step 2: The client publishes the transaction smart contract in the blockchain platform, and multiple server terminals participating in the transaction join the blockchain platform and call the transaction smart contract, and deposit a deposit according to the server deposit amount in the transaction smart contract;

[0010] Step 3: The client transmits the data to be calculated to the multiple servers respectively based on the oblivious transfer protocol through the transaction smart contract;

[0011] Step 4: The server performs calculations using the received data to be calculated and the data calculation method, and transmits the calculation results to the transaction smart contract;

[0012] Step 5: The transaction smart contract verifies the calculation results received from each server. If the verification is successful, the client receives the calculation results through the transaction smart contract and pays the server through the transaction smart contract.

[0013] If the verification fails, the deposit of the corresponding server will be deducted.

[0014] Preferably, in step 1, the deposit amount of the client is not less than the remuneration it should pay, and the deposit amount of the server is not less than the remuneration it should receive.

[0015] Preferably, in step 2, the client divides the data to be calculated into multiple data sets, and uploads the data to be calculated and the calculation method of the data to the transaction smart contract;

[0016] There is a one-to-one correspondence between the multiple data sets and the multiple server ends, and there is a same data in every two of the data sets.

[0017] Preferably, in step 3, the client transmitting the data to be calculated to the server comprises the following steps:

[0018] Step 1: The client generates multiple pairs of public keys and private keys, and sends the public keys to the server through the transaction smart contract;

[0019] Wherein, the public key and the server are in a one-to-one correspondence;

[0020] Step 2: The server receives the public key through the transaction smart contract, selects a random number, encrypts the random number with the received public key, and sends the encrypted result to the transaction smart contract;

[0021] Step 3: The client receives the encryption result through the transaction smart contract, and decrypts the encryption result with the corresponding private key to obtain the random number; the client encrypts the data to be calculated and the calculation method of the data with the random number to obtain a ciphertext, and transmits the ciphertext to the transaction smart contract;

[0022] Step 4: The server receives the ciphertext through the smart contract, and after decrypting the ciphertext through the private key, the server obtains the data to be calculated and the calculation method of the data.

[0023] Preferably, in step 5, the method by which the smart contract verifies the received calculation result is:

[0024] Determine whether the calculation results of the same data returned by different servers are the same; if the calculation result of the same data returned by the server is the same as the calculation result returned by other servers, the verification is successful;

[0025] If the calculation results of the same data returned by two adjacent servers are different, the data results returned by these two servers will continue to be compared with those returned by other servers until the dishonest server is found. The smart contract will determine the calculation results returned by the dishonest server as verification failure;

[0026] Among them, if the calculation result of one server is different from the calculation results of the same data of two or more servers, the server is judged to be a dishonest server.

[0027] Preferably, the data outsourcing computing transaction method based on smart contracts further includes: setting a transaction time limit in the transaction smart contract, and if the client or the server exceeds the transaction time limit during the transaction, the transaction smart contract is terminated.

[0028] The beneficial effects of the present invention are:

[0029] The data outsourcing computing transaction party based on smart contracts provided by the present invention automatically executes transactions through smart contracts, reduces the interference of third-party entities, and ensures fairness and autonomy; divides data to multiple servers based on the oblivious transfer protocol to ensure the privacy and security of data; adopts an improved replication-based proof technology to verify the results of transaction data, and by transmitting part of the same data between every two servers, the server does not know which data is the same, so the honesty of the server can be verified when returning the result; at the same time, the server only transmits part of the same data, which reduces the cost waste based on repetitiveness; transaction transactions are constrained by timing control, thereby preventing laziness and dishonesty of the server and the client in the transaction; adopts a penalty mechanism to limit dishonest behavior and also improves fairness for transactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The overall architecture of the data outsourcing computing transaction of the present invention.

[0031] Figure 2 This is a flow chart of the data outsourcing computing transaction method based on smart contracts described in the present invention.

[0032] Figure 3 The present invention is a flow chart of transmitting and calculating data.

[0033] Figure 4 This is a transaction sequence diagram in the present invention. DETAILED DESCRIPTION

[0034] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0035] like Figure 1 As shown, the overall architecture of the data outsourcing computing transaction of the present invention includes: the client has data and data calculation formulas, wants to obtain data calculation results, and is responsible for paying the computing power. The server is responsible for data calculation and returning data results. The client and the server join the blockchain, call smart contracts, and transactions are carried out through smart contracts. The contract consists of modules such as privacy protection, data verification, and penalty mechanism. Data transmission relies on the IPFS file system for uploading and downloading; by depositing a deposit in the contract, penalties are imposed when disputes occur to ensure the fairness of the transaction and constrain the honesty of the user; by transmitting the public key and encrypting the data using the oblivious transfer protocol, privacy protection is achieved; by verifying partially identical data results, data verifiability is achieved.

[0036] like Figure 2-4As shown, the present invention provides a data outsourcing computing transaction method based on smart contracts, which performs data outsourcing transactions based on the oblivious transfer protocol and smart contract technology, and uses smart contracts to achieve automatic execution and fairness of transactions; uses improved replication proof to verify data results, and verifies the calculation results of data through one of the data, thereby reducing transaction costs, and the privacy of data is guaranteed by the oblivious transfer protocol; when the smart contract transaction is successful, the server obtains compensation and the client obtains data results.

[0037] The present invention uses the Remix test environment to simulate the process of compiling, verifying and deploying Ethereum smart contracts. The technical solutions adopted by the present invention are as follows:

[0038] The blockchain platform deploys the smart contract, the client joins the blockchain, calls the smart contract, and then the client sets the deposit amount to be deposited by the client and the server in the smart contract, sets the data value and the amount of data to be calculated by the server, and then publishes the information in the blockchain, and deposits the deposit according to the set deposit amount that the client needs to deposit.

[0039] The data value is the remuneration to be paid. The client's deposit should be no less than the data value it pays, and the server's deposit should be no less than the remuneration it deserves. When depositing a deposit, its value should be no less than the set deposit. Transactions in the smart contract will not proceed until the client sends the correct deposit amount. The client needs to set the deposit amount, data value and deposit the deposit within T0, otherwise the transaction will not be able to proceed.

[0040] The client publishes the transaction in the blockchain. If the server is interested in the transaction, it joins the blockchain and calls the contract, and then deposits the amount set by the client.

[0041] The server needs to deposit a deposit within T1 to ensure that the deposit amount is not less than the reward it deserves. When one server fails to deposit a deposit, the transaction will end.

[0042] Before the transaction, the client will divide the data to be calculated into n parts, and when dividing the data, it must ensure that there is one identical data in two adjacent parts. After the division, the data and calculation formula are uploaded to the Interplanetary File System (IPFS), encrypted with the public key and private key, and the hash value is automatically obtained as input.

[0043] The server and the client use smart contracts to encrypt and transmit computing data using the oblivious transfer protocol.

[0044] The oblivious transfer protocol protects the privacy of data. The application of the oblivious transfer protocol prevents the server from knowing the remaining data other than the data calculated by itself, thus ensuring the privacy of data. The present invention improves the oblivious transfer protocol and adopts a 1-to-n oblivious transfer protocol to realize the privacy of transactions. The 1-to-n oblivious transfer protocol is more complex in calculation and slower in speed, but more secure, which can improve fairness and flexibility, and improve the level of privacy protection and security.

[0045] The main process of an oblivious transfer protocol transaction is as follows:

[0046] (1) The client generates n pairs of public and private keys and sends the public keys to n servers through a smart contract. The transmission needs to be completed within T2.

[0047] (2) The server receives one of the public keys through the smart contract, selects a random number, encrypts it with the assigned public key, and sends the encrypted result to the client through the smart contract within T3.

[0048] (3) The client uses the corresponding private key to decrypt these encrypted results to obtain random numbers, and then uses the random numbers to encrypt the data (the data to be calculated and the calculation method of the data) to obtain the ciphertext, and sends the ciphertext to the smart contract. The sending process must be completed within T4.

[0049] (4) The server receives the encryption result sent by the client, and decrypts the ciphertext with its own key. After decryption, the server obtains the data to be calculated and the calculation method of the data.

[0050] The server uses the obtained data and data calculation method to perform calculations and returns the data calculation results to the smart contract. The server must return the transmission results within T5. If the server fails to transmit the results within T5, it is considered dishonest and its output is set to empty.

[0051] When a smart contract receives data calculation results for verification, it only needs to verify whether the calculation results of the same data (one of every two copies is the same) are the same.

[0052] As a preferred method, based on the improved replication proof to verify the data calculation results, the client outsources the same calculation task to multiple servers to achieve the fairness and correctness of the verifiable calculation and reduce the duplication cost. The specific method is as follows:

[0053] The present invention divides the outsourced calculation into n servers, and generally we assume that n>2. The client divides the data into n parts, and ensures that one of the two adjacent data is the same; then uploads the data to IPFS, obtains the data address, and then submits the data address to the smart contract; after obtaining the data, the server performs calculation work and submits the calculation result; the smart contract verifies the output, and only compares and verifies the calculation results of the same data in the server. The data of the server is compared with the data of the previous server. If they are the same, they are compared with the data of the next server. If they are the same, the server is judged to be honest. If they are not the same, the next server is judged to be dishonest. If they are not the same, the server is judged to be dishonest. The verification of the data calculation results of the server is similar, and finally the deposit of the dishonest server will be deducted.

[0054] If the server is verified to be an honest server, the client receives the data calculation results returned by the client through the smart contract. After receiving the data, the client must deliver the reward to the smart contract within T6; the deposit deposited in the smart contract is returned to the client and the server, completing the entire transaction.

[0055] The fairness of outsourced computing is guaranteed by introducing a penalty mechanism. Before a transaction, the client deposits a deposit of no less than the reward to the smart contract, and multiple servers also deposit a deposit of no less than the reward they deserve. When the client does not return data or the data verification is inconsistent, it can be determined which server has made a calculation error by comparing it with other servers. If the server is ultimately judged to be dishonest, its deposit will be deducted. The rest of the deposit will be returned. When the client does not pay the reward, its deposit will be deducted and the deposit deposited by the client will be used as the reward.

[0056] The data outsourcing computing transaction method based on smart contracts provided by the present invention has the functions of depositing a deposit, sending a public key, verifying data results, a penalty mechanism, and privacy protection. The server and the client deposit a deposit, and the penalty mechanism is used to limit dishonest behavior at both ends and ensure fairness. The client sends the public key to the server, and the data privacy is protected through the oblivious transfer protocol, ensuring that the server only knows the data calculated by itself, and does not know the data of other servers, and the correctness of the result is verified through the copy proof.

[0057] Based on smart contracts and oblivious transfer protocols, as well as the verifiability of replication, the fairness and autonomy of data outsourcing computing are achieved. Smart contracts automatically execute transactions, the content of smart contracts is open and transparent, and smart contracts cannot be modified after deployment. Oblivious transfer ensures the privacy of data, and at the same time, based on the verifiability of replication, the data is divided into multiple pieces. In order to reduce unnecessary workload, only one piece of data is repeated between each two servers.

[0058] like Figure 3 As shown, the data transmission in the present invention has the following processing steps:

[0059] 1. The client passes the data to be calculated and the data calculation method to IPFS,

[0060] 2. The client encrypts and uploads the data with the corresponding public and private keys, and obtains the Hash value from IPFS after encryption.

[0061] 3. The client then encrypts the data according to the corresponding encryption process and transmits it to the smart contract

[0062] 4. After receiving the data, the server decrypts it, applies to IPFS, transmits the public key, and then downloads the data from IPFS.

[0063] like Figure 4 As shown, as a preferred embodiment, the transaction in the present invention needs to be completed within the time limit set in the smart contract, and the time limit is as follows:

[0064] The client joins the blockchain, calls the smart contract, sets the deposit amount and data reward in the contract, and deposits the deposit within T0. If the deposit is not deposited within the time, the contract will be terminated.

[0065] Any server that intends to call the contract needs to deposit a deposit within T1. If any of the servers fails to deposit the deposit, the contract will be terminated.

[0066] The client generates n pairs of public and private keys and needs to submit the public key to the server through the smart contract within T2 time.

[0067] The server selects a random number, encrypts it with the corresponding public key, and then submits the encrypted result to the smart contract within T3.

[0068] The client decrypts the encryption result, and the random number obtained after decryption is used to encrypt the data Hash value and transmitted to the smart contract within T4 time.

[0069] Each server decrypts the encrypted data, then calculates the data result using the calculation formula and outputs the result before T5. The smart contract compares the results and terminates the contract if no output or the results are different.

[0070] After the client obtains the data results, it needs to pay the remuneration within T6, otherwise the deposit will be deducted and used as remuneration.

[0071] In this embodiment, a buffer time T is also set to ensure that the client has enough time to check the received data results. The server has time to extract the reward. After T time, the deposit will be sent back to the server and client through the smart contract.

[0072] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A data outsourcing computing transaction method based on smart contracts, characterized in that: The steps include: Step 1: The blockchain platform deploys an initial smart contract; the client joins the blockchain, calls the initial smart contract, and sets the client deposit amount, the amount of data to be calculated by the server, the server deposit amount and the remuneration amount in the initial smart contract to obtain a transaction smart contract; and the client deposits a deposit according to the client deposit amount in the transaction smart contract; Step 2: The client publishes the transaction smart contract in the blockchain platform, and multiple server terminals participating in the transaction join the blockchain platform and call the transaction smart contract, and deposit a deposit according to the server deposit amount in the transaction smart contract; Step 3: The client transmits the data to be calculated to the multiple servers respectively through the transaction smart contract based on the oblivious transfer protocol, including the following steps: Step 1: The client generates multiple pairs of public keys and private keys, and sends the public keys to the server through the transaction smart contract; Wherein, the public key and the server are in a one-to-one correspondence; Step 2: The server receives the public key through the transaction smart contract, selects a random number, encrypts the random number with the received public key, and sends the encrypted result to the transaction smart contract; Step 3: The client receives the encryption result through the transaction smart contract, and decrypts the encryption result with the corresponding private key to obtain the random number; the client encrypts the data to be calculated and the calculation method of the data with the random number to obtain a ciphertext, and transmits the ciphertext to the transaction smart contract; Step 4: The server receives the ciphertext through the smart contract, and after decrypting the ciphertext through the private key, the server obtains the data to be calculated and the calculation method of the data; Step 4: The server performs calculations using the received data to be calculated and the data calculation method, and transmits the calculation results to the transaction smart contract; Step 5: The transaction smart contract verifies the calculation results received from each server. If the verification is successful, the client receives the calculation results through the transaction smart contract and pays the server through the transaction smart contract. If the verification fails, the deposit of the corresponding server will be deducted.

2. The data outsourcing computing transaction method based on smart contracts according to claim 1 is characterized in that: In the step 1, the deposit amount of the client is not less than the remuneration it should pay, and the deposit amount of the server is not less than the remuneration it should receive.

3. The data outsourcing computing transaction method based on smart contract according to claim 1 or 2, characterized in that: In the step 2, the client divides the data to be calculated into multiple data sets, and uploads the data to be calculated and the calculation method of the data to the transaction smart contract; There is a one-to-one correspondence between the multiple data sets and the multiple server ends, and there is a same data in every two of the data sets.

4. The data outsourcing computing transaction method based on smart contracts according to claim 3 is characterized in that: In step 5, the method by which the smart contract verifies the received calculation result is: Determine whether the calculation results of the same data returned by different servers are the same; if the calculation result of the same data returned by the server is the same as the calculation result returned by other servers, the verification is successful; If the calculation results of the same data returned by two adjacent servers are different, the data results returned by these two servers will continue to be compared with those returned by other servers until the dishonest server is found. The smart contract will determine the calculation results returned by the dishonest server as verification failure; Among them, if the calculation result of one server is different from the calculation results of the same data of two or more servers, the server is judged to be a dishonest server.

5. The data outsourcing computing transaction method based on smart contracts according to claim 4 is characterized in that: Also includes: A transaction time limit is set in the transaction smart contract. If the client or the server exceeds the transaction time limit during the transaction, the transaction smart contract is terminated.

Citation Information

Patent Citations

  • Fair data transaction method and system based on block chain

    CN111681002A

  • Privacy protection-oriented vehicle-mounted network authentication method and system based on block chain

    CN112039870A