S1 smart contract deployment: Deploy the smart contract to the public chain. The smart contract includes: TB data of the transaction body, and related data acquisition methods, ETH transfer algorithm, update authorization list algorithm, and download the data algorithm in the interstellar file system IPFS.
S2. Data upload, right confirmation, encryption: Seller S uploads data on the data trading platform DTP, and the data trading platform DTP identifies the similar data according to the Hamming distance and then confirms the data right. Data encryption adopts ECC + AES hybrid encryption, and MD5 is used for data verification.
S3. Invoke the smart contract to upload the Interstellar File System IPFS: Once the data trading platform DTP calculates the difference in the Hamming distance of similar data reaches the threshold, the data rights are confirmed, and the smart contract is invoked to upload the Interplanetary File System IPFS.
S4. Data storage: store data in the interplanetary file system IPFS.
S5. Return CID: After the data is stored in the interplanetary file system IPFS, return the content identifier CID
S6. Return confirmation: When the content identifier CID is returned, the data is confirmed, and the first user is added to the user ID in the transaction body TB.
S7. The seller S initiates a request for selling resources. The data will be displayed on the data trading platform DTP.
S8. Buyer B sees the data it needs and initiates a transaction request.
S9. Buyer B makes payment and calls the smart contract transfer request.
S10. The seller's S account receives payment.
S11. Update the authorization list and return the data body ID: The payment made by the buyer B and the payment received by the seller S account are all transferred through the smart contract. After the transfer is completed, the authorization list is updated, and the user ID of the purchased data is added to the user ID.
S12. Download data request: Buyer B has completed the payment and can download the data. Through the data trading platform DTP, fill in the ID of the data to be downloaded. After clicking download, the data trading platform DTP will call the smart contract to obtain the IPFS data method of the interstellar file system. First, the authorization list user verification will be performed to check whether the user has purchased data, and if the user ID exists, the data will be downloaded.
S13. Return data: Buyer B gets the data set.