Verifiable data storage method supporting fair payment based on block chain

Through the combination of blockchain and smart contracts, decentralized data storage and non-interactive data integrity verification are achieved, security risks and transaction fairness of cloud storage systems are solved, and data security and transaction fairness are ensured. sex.

CN118916911APending Publication Date: 2024-11-08XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410958228.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Existing cloud storage systems have problems such as data storage security risks, and relying on third-party auditors to rely on privacy leakage risks and difficult to guarantee transaction fairness.

Method used

Adopt a decentralized data storage system based on blockchain, combine smart contracts to achieve non-interactive data integrity verification, eliminate dependence on third-party auditors, and punish dishonest storage nodes through smart contracts to ensure the security of data storage and transaction fairness.

Benefits of technology

It realizes efficient and secure decentralized data storage, avoids single point of failure and information leakage, ensures automatic audit of the integrity of data storage, reduces the risk of privacy leakage, and achieves fair payment of storage services through smart contracts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916911A_ABST
    Figure CN118916911A_ABST
Patent Text Reader

Abstract

The invention discloses a verifiable data storage method supporting fair payment based on a block chain, and the method specifically comprises the steps: 1, building a decentration data storage system based on the block chain, and carrying out the initialization of the decentration data storage system; 2, registering a storage node; step 3, data preprocessing; 4, the data owner DO sends data and deploys a storage contract T1; 5, storing the data; 6, generating a data holding proof; and step 7, verification and payment. According to the method, a non-interactive data integrity verification mechanism is introduced to replace a third-party verifier to achieve data integrity verification, the privacy disclosure risk existing in challenge-response interaction is avoided, data integrity verification is achieved in combination with an intelligent contract, dishonest behaviors of a storage service provider are punished, and storage transaction fairness is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cryptography and information security, and specifically relates to a verifiable data storage method based on blockchain supporting fair payment. Background Art

[0002] With the continuous development of information and communication technology, data in the IoT industries such as smart cities, healthcare, and industrial manufacturing are decentralized and growing explosively. Traditional centralized cloud storage (such as Dropbox, iCloud, and Google Drive) has become the main storage method for IoT data. Users store data on the servers of cloud storage providers and can view and download data at any time through the Internet, which largely solves the growing storage needs of users. However, with the continuous expansion of the cloud storage market, its own storage mechanism has many risks, challenges, and security risks.

[0003] The first is the data storage security issue. Cloud storage uses a centralized storage method to process, store and manage data through a central server. However, this storage model is vulnerable to hacker attacks and has security issues such as single point failure of the central server and information leakage. Blockchain has the characteristics of being tamper-proof, decentralized, highly transparent and traceable, and can be used to solve the above problems. Therefore, introducing blockchain to design a decentralized storage solution for massive data can eliminate dependence on centralized cloud storage and achieve secure storage and management of IoT data.

[0004] The second is the problem of data verification privacy leakage. Most of the current data storage integrity verification is based on interactive data integrity verification by third-party auditors (TPA), which requires challenge-response data interaction between the verifier and the storage service provider. Untrusted TPAs ​​can repeatedly launch challenge attacks on some data blocks in the same location to steal user data privacy, or collude with storage service providers to send wrong verification results to users. Therefore, it is of great significance to study how to eliminate dependence on third parties.

[0005] The third is the fair payment problem of data transactions. In general data transaction schemes, a trusted third party is introduced to act as an intermediary to achieve fair payment. However, completely trusted third parties are rare, and the mechanism for resolving transaction disputes is relatively complicated. Trusted third parties act as arbitrators, and the arbitration requester needs to submit proof to the arbitrator. Losing control of the data makes it difficult for the data owner to prove that the data has been tampered with or inaccessible. Audit services are provided by third-party auditors (TPA), and it is inevitable to pay the corresponding audit fees to the TPA. Most audit schemes are based on the assumption that service-payment is fair. If the storage service provider does not store user data completely or the TPA does not perform the verification task correctly, then the service-payment fairness in the data verification integrity verification process will not be effectively guaranteed. As one of the most important functions in blockchain applications, smart contracts realize trusted transactions without the need for third parties. Therefore, it is of great significance to apply smart contracts to the fair payment method for data storage. Summary of the invention

[0006] The purpose of the present invention is to provide a verifiable data storage method based on blockchain to support fair payment. The method introduces a non-interactive data integrity verification mechanism to replace a third-party auditor (TPA) to implement data integrity verification, avoid the privacy leakage risk in challenge-response interaction, combine with smart contracts to implement data integrity verification, and punish the dishonest behavior of storage service providers to maintain the fairness of storage transactions.

[0007] The technical solution adopted by the present invention is a verifiable data storage method based on blockchain to support fair payment, specifically:

[0008] Step 1: Establish a decentralized data storage system based on blockchain, and then initialize the decentralized storage system;

[0009] Step 2: Storage node registration;

[0010] Step 3: Data preprocessing;

[0011] Step 4: The data owner DO sends the data and deploys the storage contract T1;

[0012] Step 5: Store data;

[0013] Step 6: Data possession certificate generation;

[0014] Step 7: Verification and payment.

[0015] The present invention is also characterized in that:

[0016] Step 1 is as follows:

[0017] Step 1.1: Establish a decentralized storage system consisting of data owner DO, storage node SN, blockchain and smart contracts;

[0018] Step 1.2: Initialize the decentralized storage system; specifically: the host registers on the Ethereum blockchain and obtains a public-private key pair (sk, pk). Ethereum randomly generates a 32-byte private key through a pseudo-random function, and uses the elliptic curve digital signature algorithm to map the private key to a 64-byte public key. The public key is then used as the input of the SHA-256 hash algorithm to obtain a hexadecimal string. The last 40 characters are taken plus the prefix "0X" as the node address. In this way, the host participates in data storage transactions as the data owner DO or the storage node SN. The transaction price and storage time are defined by the data owner DO, and the storage node SN selects appropriate data for storage based on the storage space it provides.

[0019] Step 2 is as follows:

[0020] The storage node SN deploys the compensation contract T2 on the blockchain. The compensation contract T2 is deployed by the storage node SN and contains three methods: Registration, SubmitParam and PayDeposit. The Registration method is called by the storage node SN and the input is the storage deposit R V , used to store the deposit R V Stored in the compensation contract T2; the SubmitParam method is called by the storage node SN, and the input is the hash value of the ciphertext data and the transaction compensation fee R g and storage period, which is used by the storage node SN to submit the storage data proof. PayDeposit is called by the verification contract T3, and the input is the compensation fee R g , used to pay compensation to the data owner DO for incorrectly storing data. The storage node SN calls the Registration method to submit a storage deposit R that matches the storage space to the compensation contract T2. V , the amount in the contract increases by R V ; R V It indicates the pre-set deposit amount corresponding to the available storage space. If the storage node SN does not store the data correctly, the verification contract T3 calls the compensation contract T2 to pay compensation to the data owner DO. V If the transaction is written to the Ethereum blockchain, it means that the storage node SN is successfully registered.

[0021] Step 3 is as follows:

[0022] Step 3.1: The data owner DO has the plaintext data F and uses the symmetric encryption algorithm AES-128 to encrypt the plaintext data F:

[0023] f=Enc AES (F,Key) (1)

[0024] In formula (1), f represents the ciphertext data after symmetrical encryption, F represents the plaintext data, and Key represents the encryption key. After encryption, the ciphertext data f is divided into blocks:

[0025] f={m i},1≤i≤n (2)

[0026] In formula (2), f represents the encrypted ciphertext data. The encrypted ciphertext data f is divided into n data blocks, m i Represents the i-th data block;

[0027] Step 3.2: For data block m i Generate tags: First, introduce the bilinear mapping to construct the encryption and decryption algorithm, e:G×G→G T is a bilinear map, G and G T Both are multiplicative cyclic groups of prime order p, g is the generator of G, and two hash functions: H(·):{0,1} * →G,h(·):G T →Z p , H(·) is to uniformly map any string to the G group; h(·) is to map G T Mapping to group Z p , Z p is the set of integers modulo p; function η(·): {0,1} * →[0,1] is a secure pseudo-random function that maps any value to the integer range [0,1]. The data owner DO first p Select a random number a←Z p , choose u←G on the group G, and calculate v=g a , generate a public-private key pair (ssk, spk) for verification, where private key ssk = (sk, a), public key spk = (pk, g, u, v, e, H (·), h (·), η (·)), calculate the data block m i Tags:

[0028]

[0029] In formula (3), σ i is the data block m i W = Fname||i is the concatenation of Fname and i, Fname is the file identifier; H(W) is the hash value of the ciphertext data, u is an element of the group G, m i is the i-th data block, a is in the set Z p The random number selected above, is the label σ i To ensure the correctness of the file identifier, the data owner DO signs the file identifier Fname with the private key sk and generates t←Fname||Sig sk (Fname) is used as the identifier of the ciphertext data f; the data owner DO combines the data block label and the ciphertext data identifier t into a label set

[0030] Step 4 is as follows:

[0031] Step 4.1: The data owner DO uses the private key sk to encrypt the ciphertext data f and the label set Sign and generate Sig sk (f,Φ), is sent to the physical address specified by the storage node SN through the off-chain method;

[0032] Step 4.2: The data owner DO deploys the storage contract T1. The storage contract T1 contains three methods: SubmitParam, StoreFee and PayFee. The SubmitParam method is called by the data owner and takes as input the ciphertext data file name, ciphertext data hash value, storage period and data verification public key, which is used to upload these verification parameters to the blockchain. The StoreFee method is called by the data owner and takes as input the storage fee R. f , used to convert the storage cost R f Deposit into storage contract T1; the PayFee method is called by verification contract T3 to transfer the storage fee R in storage contract T1 f The data owner DO calls the SubmitParam method to send the ciphertext data file name Fname, ciphertext data hash value H(W), storage period Time end The data verification public key spk is stored on the blockchain, and the method StoreFee is called to deposit the storage fee R to be paid into the storage contract T1 pool f , when the storage fee R is deposited f When the transaction is written into the blockchain, the storage contract T1 is deployed successfully.

[0033] Step 5 is as follows:

[0034] Step 5.1: The storage node SN verifies the received ciphertext data f and label set Φ, and uses the public key pk of the data owner DO to verify the signature of the data owner. After the verification, the ciphertext data is hashed and compared with the hash value H(W) stored by the data owner DO on the blockchain. If they are consistent, the data is proven to be complete and the storage node SN stores the data; if they are inconsistent, the storage fails;

[0035] Step 5.2: The storage node calls the SubmitParam method to send the hash value H(W) of the ciphertext data and the transaction compensation fee R g and storage period Time end The verification information is stored in the compensation contract T2.

[0036] Step 6 is as follows:

[0037] Step 6.1: The storage node SN takes the ciphertext data f, the label set Φ, and the public state information τ as input to generate the storage proof Σ. In the non-interactive data integrity verification method, τ should be public to the entire network and is not controlled by the storage node SN. It will change over time. The hash value of the last block on the blockchain is selected as the public parameter τ. The storage node SN randomly selects c elements from the set [1,n]. For any i∈[1,c], the storage node SN calculates:

[0038] s i ←η(τ||i) (4)

[0039] In formula (4), s i It is the challenge information for data verification generated according to the public parameters τ and i. The challenge information is not controlled by the storage node SN and the data owner DO. The challenge information consists of a set I = {s1, s2, …, s c}, where k∈I,s1≤k≤s c , storage node SN calculation:

[0040] v k ←h(τ||k) (5)

[0041] In formula (5), v k It represents the verification parameter composed of the challenge information k and the public verification parameter τ. The storage node verifies the verification parameter v k and the kth data block label σ k Generate storage proof:

[0042]

[0043] In formula (6), v k is the verification parameter of the kth data block, σ k is the label of the kth data block, m k For the kth ciphertext data block, the storage node SN selects a random number r←Z p ,calculate:

[0044] ρ=e(u,v) r ,ρ∈G T (7)

[0045] and:

[0046] μ=r+γ·μ′ (8)

[0047] In formula (7), e is a bilinear map, u is an element of group G, and v = g a , r is Z p The elements in; in formula (8), γ=h(ρ), γ∈Z p , taking Σ={μ,σ,ρ,τ,c} as the data possession proof of the storage node SN;

[0048] Step 6.2: The storage node SN deploys the verification contract T3. The verification contract T3 contains two methods: SubmitProof and Verify. The SubmitProof method is called by the storage node SN to store the generated storage proof Σ={μ,σ,ρ,τ,c} on the blockchain. The Verify method is called by the storage node SN to verify the storage proof Σ. The storage node SN calls the SubmitProof method to upload the generated integrity proof Σ to the blockchain.

[0049] Step 7 is as follows:

[0050] Step 7.1: The storage node SN calls the Verify method in the verification contract T3 for verification. The verification node on the blockchain performs the verification operation and calculates I = {η(τ||1), η(τ||2)...η(τ||c),}, {v k =h(τ||k)} k∈I , γ=h(ρ), and then calculate according to the ciphertext data hash value H(W) uploaded to the blockchain by the data owner DO and the data verification public key spk:

[0051]

[0052] In formula (9), ρ = e(u,v) r , e is a bilinear mapping, H(W) is the hash value of the ciphertext data, u is an element of the group G, and v = g a , r is Z p The elements in , γ=h(ρ),γ∈Z p , calculate whether the results on both sides of the equation are equal.

[0053] Step 7.2: If the calculation results on both sides of the equation are equal, the verification is passed and storage continues; when the storage time reaches the deadline Time end After verification, contract T3 calls the PayFee method of storage contract T1 to perform payment operation, and transfers the storage fee R in the contract pool to the storage fee R in the contract pool. fSent to the address of the storage node SN; if the calculation results on both sides of the equation are not equal, it proves that the verification failed, and the verification contract T3 calls the PayDeposit method of the compensation contract T2 to perform the payment operation, and the compensation fee R in the contract pool is g Sent to the data owner DO as compensation.

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

[0055] (1) The method of the present invention aims to solve the problems of single point failure and information leakage in cloud-based data storage systems, and proposes a decentralized data storage method based on blockchain, which integrates decentralized independent hard disks and storage spaces to efficiently and securely store data at a lower cost. By eliminating the dependence on third-party cloud service providers, the risk of internal attackers tampering with or accessing private data is reduced.

[0056] (2) The method of the present invention aims at the security issues such as single point failure of the central server and information leakage in the centralized cloud storage of smart city scenarios, designs a data storage solution based on blockchain, and designs a non-interactive data integrity verification mechanism in combination with the Ethereum blockchain. The storage node generates a random challenge data block based on the public status information of the current block of the blockchain as input, and generates a data integrity proof. Without introducing a third-party auditor (TPA), the method realizes automatic audit of data storage integrity and avoids privacy leakage caused by data verification.

[0057] (3) The method of the present invention proposes a reward and punishment mechanism to address possible transaction disputes between data owners and storage nodes. It uses smart contracts to reward honest storage nodes and punish malicious storage nodes, thereby encouraging network nodes to honestly participate in data storage transactions and achieving storage service-payment fairness. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is the system model diagram in step 1 of the method of the present invention;

[0059] Figure 2 It is a diagram of the data integrity verification process in the method of the present invention;

[0060] Figure 3 This is a performance comparison chart obtained in Example 1. DETAILED DESCRIPTION

[0061] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments:

[0062] The present invention provides a verifiable data storage method based on blockchain to support fair payment, such as Figure 1 As shown, the specific implementation steps are as follows:

[0063] Step 1: Establish a decentralized data storage system based on blockchain, and then initialize the decentralized storage system.

[0064] Step 1.1: Establish a decentralized storage system consisting of data owner DO, storage node SN, blockchain and smart contract. The system model is shown in the figure below: Figure 1 The following roles are included:

[0065] Data owner DO: collects data from IoT devices, symmetric encrypts the data through encryption algorithms, generates ciphertext data labels, and stores the encrypted data file ciphertext and corresponding data labels in storage nodes SN;

[0066] Storage node SN: Use the public key pk of the data owner DO DO Verify the signature of the data file ciphertext and data tag; store the data file ciphertext and data tag of the data owner DO; generate a data storage certificate based on the hash value of the current block of the blockchain, and call the smart contract to verify the correctness of the data storage certificate;

[0067] Smart contract: The data owner DO and the storage node SN deploy storage contracts, compensation contracts and verification contracts on the blockchain respectively, and execute verification and pay storage service fees by calling contracts;

[0068] Step 1.2: Initialize the decentralized storage system. Specifically, the host registers on the Ethereum blockchain and obtains a public-private key pair (sk, pk). Ethereum randomly generates a 32-byte private key through a pseudo-random function, and uses the elliptic curve digital signature algorithm (ECDSA) to map the private key to a 64-byte public key. The public key is then used as the input of the SHA-256 hash algorithm to obtain a hexadecimal string. The last 40 characters are taken plus the prefix "0X" as the node address. In this way, the host participates in data storage transactions as a data owner DO or a storage node SN. The transaction price and storage time are defined by the data owner DO, and the storage node SN selects appropriate data for storage based on the storage space it can provide.

[0069] Step 2: Storage node registration;

[0070] Step 2 is as follows: the storage node SN deploys the compensation contract T2 on the blockchain. The compensation contract T2 is deployed by the storage node SN and contains three methods: Registration, SubmitParam and PayDeposit. The Registration method is called by the storage node SN and the input is the storage deposit R. V , used to store the deposit R VStored in the compensation contract T2; the SubmitParam method is called by the storage node SN, and the input is the hash value of the ciphertext data and the transaction compensation fee R g and storage period, which is used by the storage node SN to submit the storage data proof. PayDeposit is called by the verification contract T3, and the input is the compensation fee R g , used to pay compensation to the data owner DO for incorrectly storing data. The storage node SN calls the Registration method to submit a storage deposit R that matches the storage space to the compensation contract T2. V , the amount in the contract increases by R V ; R V It indicates the pre-set deposit amount corresponding to the available storage space. If the storage node SN does not store the data correctly, the verification contract T3 calls the compensation contract T2 to pay compensation to the data owner DO. V If the transaction is written to the Ethereum blockchain, it means that the storage node SN is successfully registered.

[0071] Step 3: Data preprocessing; Figure 2 Process diagram for steps 3-7: Data file preprocessing is specifically implemented according to the following steps:

[0072] Step 3.1: The data owner DO has the plaintext data F and uses the symmetric encryption algorithm AES-128 to encrypt the plaintext data F:

[0073] f=Enc AES (F,Key) (1)

[0074] In formula (1), f represents the ciphertext data after symmetrical encryption, F represents the plaintext data, and Key represents the encryption key. After encryption, the ciphertext data f is divided into blocks:

[0075] f={m i},1≤i≤n (2)

[0076] In formula (2), f represents the encrypted ciphertext data. The encrypted ciphertext data f is divided into n data blocks, m i Represents the i-th data block;

[0077] Step 3.2: For data block m i Generate tags: First, introduce the bilinear mapping to construct the encryption and decryption algorithm, e:G×G→G T is a bilinear map, G and G T Both are multiplicative cyclic groups of prime order p, g is the generator of G, and two hash functions: H(·):{0,1} * →G,h(·):G T →Zp , H(·) is to uniformly map any string to the G group; h(·) is to map G T Mapping to group Z p , Z p is the set of integers modulo p; function η(·): {0,1} * →[0,1] is a secure pseudo-random function that maps any value to the integer range [0,1]. The data owner DO first p Select a random number a←Z p , choose u←G on the group G, and calculate v=g a , generate a public-private key pair (ssk, spk) for verification, where private key ssk = (sk, a), public key spk = (pk, g, u, v, e, H (·), h (·), η (·)), calculate the data block m i Tags:

[0078]

[0079] In formula (3), σ i is the data block m i W = Fname||i is the concatenation of Fname and i, Fname is the file identifier; H(W) is the hash value of the ciphertext data, u is an element of the group G, m i is the i-th data block, a is in the set Z p The random number selected above, is the label σ i To ensure the correctness of the file identifier, the data owner DO signs the file identifier Fname with the private key sk and generates t←Fname||Sig sk (Fname) is used as the identifier of the ciphertext data f; the data owner DO combines the data block label and the ciphertext data identifier t into a label set

[0080] Step 4: The data owner DO sends the data and deploys the storage contract T1, specifically:

[0081] Step 4.1: The data owner DO uses the private key sk to encrypt the ciphertext data f and the label set Sign and generate Sig sk (f,Φ), is sent to the physical address specified by the storage node SN through the off-chain method;

[0082] Step 4.2: The data owner DO deploys the storage contract T1. The storage contract T1 contains three methods: SubmitParam, StoreFee and PayFee. The SubmitParam method is called by the data owner and takes as input the ciphertext data file name, ciphertext data hash value, storage period and data verification public key, which is used to upload these verification parameters to the blockchain. The StoreFee method is called by the data owner and takes as input the storage fee R. f , used to convert the storage cost R f Deposit into storage contract T1; the PayFee method is called by verification contract T3 to transfer the storage fee R in storage contract T1 f The data owner DO calls the SubmitParam method to send the ciphertext data file name Fname, ciphertext data hash value H(W), storage period Time end The data verification public key spk is stored on the blockchain, and the method StoreFee is called to deposit the storage fee R to be paid into the storage contract T1 pool f , when the storage fee R is deposited f When the transaction is written into the blockchain, the storage contract T1 is deployed successfully;

[0083] Step 5: Store data, specifically:

[0084] Step 5.1: The storage node SN verifies the received ciphertext data f and label set Φ, and uses the public key pk of the data owner DO to verify the signature of the data owner. After the verification, the ciphertext data is hashed and compared with the hash value H(W) stored by the data owner DO on the blockchain. If they are consistent, the data is proved to be complete and the storage node SN stores the data; if they are inconsistent, the storage fails.

[0085] Step 5.2: The storage node calls the SubmitParam method to send the hash value H(W) of the ciphertext data and the transaction compensation fee R g and storage period Time end Verification information is stored in compensation contract T2;

[0086] Step 6: Generate data holding proof, specifically:

[0087] Step 6.1: The storage node SN takes the ciphertext data f, the label set Φ, and the public state information τ as input to generate the storage proof Σ. In the non-interactive data integrity verification method, τ should be public to the entire network and is not controlled by the storage node SN. It will change over time. Considering the structure of the blockchain, the hash value of the last block on the blockchain is selected as the public parameter τ. The storage node SN randomly selects c elements from the set [1,n]. For any i∈[1,c], the storage node SN calculates:

[0088] s i ←η(τ||i) (4)

[0089] In formula (4), s i It is the challenge information for data verification generated according to the public parameters τ and i. The challenge information is not controlled by the storage node SN and the data owner DO. The challenge information consists of a set I = {s1, s2, ..., s c}, where k∈I,s1≤k≤s c , storage node SN calculation:

[0090] v k ←h(τ||k) (5)

[0091] In formula (5), v k It represents the verification parameter composed of the challenge information k and the public verification parameter τ. The storage node verifies the verification parameter v k and the kth data block label σ k Generate storage proof:

[0092]

[0093] In formula (6), v k is the verification parameter of the kth data block, σ k is the label of the kth data block, m k For the kth ciphertext data block, the storage node SN selects a random number r←Z p ,calculate:

[0094] ρ=e(u,v) r ,ρ∈G T (7)

[0095] and:

[0096] μ=r+γ·μ′ (8)

[0097] In formula (7), e is a bilinear map, u is an element of group G, and v = g a , r is Z p In formula (8), γ=h(ρ), γ∈Zp , taking Σ={μ,σ,ρ,τ,c} as the data possession proof of the storage node SN;

[0098] Step 6.2: The storage node SN deploys the verification contract T3. The verification contract T3 contains two methods: SubmitProof and Verify. The SubmitProof method is called by the storage node SN to store the generated storage proof Σ={μ,σ,ρ,τ,c} on the blockchain. The Verify method is called by the storage node SN to verify the storage proof Σ. The storage node SN calls the SubmitProof method to upload the generated integrity proof Σ to the blockchain;

[0099] Step 7: Verification and payment;

[0100] Step 7.1: The storage node SN calls the Verify method in the verification contract T3 for verification. The verification node on the blockchain performs the verification operation and calculates I = {η(τ||1), η(τ||2)...η(τ||c),}, {v k =h(τ||2k)} k∈I , γ=h(ρ), and then calculate according to the ciphertext data hash value H(W) uploaded to the blockchain by the data owner DO and the data verification public key spk:

[0101]

[0102] In formula (9), ρ = e(u,v) r , e is a bilinear mapping, H(W) is the hash value of the ciphertext data, u is an element of the group G, and v = g a , r is Z p The elements in , γ=h(ρ),γ∈Z p , calculate whether the results on both sides of the equation are equal.

[0103] Step 7.2: If the calculation results on both sides of the equation are equal, the verification is passed and storage continues. end After verification, contract T3 calls the PayFee method of storage contract T1 to perform payment operation, and transfers the storage fee R in the contract pool to the storage fee R in the contract pool. f Sent to the address of the storage node SN; if the calculation results on both sides of the equation are not equal, it proves that the verification failed, and the verification contract T3 calls the PayDeposit method of the compensation contract T2 to perform the payment operation, and the compensation fee R in the contract pool is g Sent to the data owner DO as compensation.

[0104] Example 1

[0105] In order to analyze the corresponding cost of the present invention, we built a prototype of the experimental environment. The specific configuration of the experiment is: the software environment of the experiment is: 64-bit Windows 10 Professional Edition operating system, the smart contract is written in Solidity language, the simulation experiment is carried out on Ethers.js installed in the Node.js environment, the development framework is Hardhat, the wallet plug-in is Metamask, and the contract is tested in the test network BscScan. The hardware environment is: Intel (R) Core (TM) 5-8400CPU (2.8GHz), 8GB, dual-channel memory, frequency is 1600MHz.

[0106] In this experiment, the smart contract was compiled and deployed on the Ethereum official test network BscScan. Since the price of the Ethereum main chain has been fluctuating, in order to facilitate the estimation of the experimental cost, the price of Ethereum in March 2024 is used for conversion: 1ether≈3700USD, 1gasPrice≈1Gwei, 1Gwei=10 9 wei=10 -9 Ether is tested by converting the consumed gas into standard ether. The experimental work uses the improved algorithm proposed in this invention to analyze the cost of the creation and execution method of the smart contract, so as to verify the feasibility of the algorithm.

[0107] Table 1 Smart contract cost

[0108]

[0109] (1) Algorithm performance evaluation

[0110] From Table 1, we can see the gas cost of this solution. The gas cost for the data owner DO to deploy the storage contract T1 on the chain is 67658, which is approximately equal to $0.25. The gas cost for the storage node SN to upload the compensation contract T2 is 67702, which is approximately equal to $0.25. The gas cost for deploying the verification contract T3 is 34150, which is approximately $0.12. Overall, it costs a certain amount of money to deploy smart contracts, but these costs are within an acceptable range, and it is necessary to spend these costs to ensure the integrity of data storage.

[0111] (2) Performance comparison

[0112] The data integrity verification process of reference [1] is similar to that of this solution. Both use smart contracts to verify the correctness and integrity of stored data. Therefore, this solution is compared with the verification function of reference [1] to evaluate whether the time cost of smart contract execution in this solution is advantageous. Reference [1] implements a data storage system based on blockchain that can be retrieved and replicated. The data owner sends the encrypted ciphertext and its copy to the storage service provider. The storage service provider subcontracts the data to the "farmer" node. The "farmer" node submits the copy data integrity proof regularly to obtain regular rewards, thus achieving fair payment between data users and "farmers". The smart contract of reference [1] is written in Solidity and deployed to the local test environment. In order to avoid gas restrictions, the verification process is divided into several sub-functions. For example, if a function needs to perform 300 multiplication operations, the sub-function is run 10 times, and each sub-function runs 30 multiplication operations. The experiment uses similar hardware equipment, test environment and the same test method to test the gas cost of verification contract T3. The number of data blocks is set to 30, 60, 90, 120, 150, 180, 210, 240, 270, and 300 respectively, and the gas cost of smart contract execution verification in the two schemes is compared.

[0113] The experimental results are as follows Figure 3 As shown in the figure, blue represents the running results of reference [1], and orange represents the test results of this solution. It can be seen that the method of calling smart contracts multiple times to perform verification will increase the total gas cost, and the gas cost continues to increase with the increase in the number of verification data blocks. However, the verification gas cost of smart contract T3 in this solution is generally lower than that in reference [1]. Therefore, the solution proposed in this chapter is more usable than that in reference [1].

[0114] (3) Storage solution function comparison

[0115] Table 2 Comparison of data storage solutions

[0116]

[0117] This section compares the decentralized data storage solutions with similar application scenarios to our solution. Reference [2] realizes decentralized storage by users contributing storage resources. Reference [3] realizes a data storage and sharing system for Internet of Vehicles based on edge computing based on alliance chain and smart contract. Reference [4] proposes a decentralized storage system for smart cities based on P2P network and uses blockchain to record storage and audit transactions. Therefore, this solution is compared with the above three data storage solutions in terms of functions: whether the data is uploaded to the chain, whether it supports non-interactive verification, and whether it realizes truly decentralized storage. Table 2 lists the functional comparison results. It can be found that from the perspective of storage, the system of reference [2] is decentralized because the content is decentralized and stored on many peer nodes, but it relies on centralized server "satellite" for communication control, which is not truly decentralized storage. All data in reference [3] is transmitted through blockchain, so the transaction burden on the chain is heavy. Reference [4] adopts a challenge-response interactive auditing scheme, which is prone to the risk of privacy leakage. This solution realizes decentralized storage based on blockchain. The data audit solution adopted does not require the help of authoritative third-party auditors for challenge-response operations. The data is stored off-chain, and only a small amount of public key information and ciphertext hash values ​​are stored on the chain, which effectively alleviates the storage pressure on the chain. The fairness of data transactions is achieved through storage contracts, and it can cope with risks such as single point failures and information leakage. In addition, the smart contracts in this solution are open, transparent and traceable on the blockchain, which also strengthens the decentralized nature of the storage solution.

[0118] (4) Safety certification:

[0119] The present invention is a verifiable data storage method based on blockchain to support fair payment. Although the execution of data integrity verification through smart contracts increases the execution cost of smart contracts, the performance comparison and function comparison show that the algorithm has certain advantages in the running cost and function design of execution verification, and can effectively solve the problems of data storage security and frequent data interaction of storage verification. This section will analyze the storage verification scheme from the perspective of correctness, anti-counterfeiting, privacy protection, and transaction fairness.

[0120] Correctness analysis: If the storage node SN honestly stores data and returns the corresponding storage proof, the storage proof can be verified by the verifier, and formula (9) is established. The proof process is as follows:

[0121] According to formulas (6) and (7), we know that ρ = e(u,v) r , The left side of formula (9) can be expressed as: From formula (3), we can know the data block label: The left side of equation (9) can also be expressed as:

[0122]

[0123] in The left side of equation (9) can be expressed as: According to the properties of bilinear mapping, we can get:

[0124]

[0125] At the same time, μ = r + γ·μ′, the left side of equation (9) can be expressed as:

[0126]

[0127] is equal to the right side of equation (9), and the proof is complete.

[0128] Anti-counterfeiting: In the data integrity verification scheme, when the data block stored in the storage node SN is damaged and an attempt is made to use other data blocks to replace the damaged data block to generate an integrity proof, the storage node SN cannot pass the verification of the verifier.

[0129] Proof: Assume that the data block m is stored in the storage node SN. c The storage node SN was damaged during the storage process. In order to conceal the m c The fact that it is damaged will c Replace with m x , then the storage node SN cannot pass the integrity verification of formula (9). The specific calculation is as follows:

[0130]

[0131] According to the properties of hash functions, s x and c The corresponding data block hash values ​​are different, so:

[0132]

[0133] If SN wants to conceal the fact that data is destroyed, it will not be able to pass the verification of the verifier.

[0134] Privacy protection analysis: Unlike existing interactive data integrity proof methods, the verification scheme proposed in this method removes the challenge stage of proof generation. In the data integrity proof process executed by the storage node SN, there is no need to accept the challenge data set. The challenge set is generated using a pseudo-random function η(·). The input of η(·) contains the hash value of the current block and cannot be controlled by the storage node SN. The challenge set generated in this way is no different from the challenge set generated by a randomly selected verifier. In addition, the data storage verification process does not require frequent data interaction between the storage node SN and the verifier, so it can avoid the problem of privacy data leakage caused by untrusted verifiers repeatedly launching challenge attacks on some data blocks in the same location.

[0135] Transaction fairness analysis: In a cloud storage service system, a malicious cloud storage service provider may refuse to provide data integrity proof after receiving the last fee. However, in this scheme, only if the storage node SN honestly fulfills all responsibilities during the service period (including submitting accurate storage proof in a timely manner), the storage fee R f If the storage node SN fails to meet these requirements, the storage fee R f It will be returned to the data owner DO. When the storage node SN stores data, there may be situations where it may not be able to provide the correct data integrity proof within the specified time frame. There are the following possibilities:

[0136] The data is damaged or incomplete, resulting in the storage node SN being unable to provide proof of data integrity.

[0137] Storage node SN submitted an incorrect integrity proof.

[0138] In the first case, the smart contract does not receive the storage proof and directly charges the storage fee R f and compensation cost R g Sent to the data owner DO, the storage node SN will lose the storage fee R f , and pay compensation R to the data owner DO g In the second case, smart contract T3 performs verification, and if the verification result is that the two sides of the equation are not equal, contract T2 is called and compensation fee R is paid to DO. g .

[0139] In summary, only when the storage node SN submits the correct data integrity proof on time will it receive the storage fee R f Otherwise, you will be subject to loss compensation fee R g Therefore, data storage transactions can achieve fair payment.

[0140] The method of the present invention introduces a non-interactive data integrity verification mechanism to replace the third-party auditor (TPA) to realize data integrity verification, avoid the privacy leakage risk in the challenge-response interaction, combine with the smart contract to realize data integrity verification, and punish the dishonest behavior of the storage service provider to maintain the fairness of storage transactions.

[0141] References:

[0142] [1]Chen D, Yuan H, Hu S, et al. BOSSA: A decentralized system for proofsofdata retrievability and replication [J]. IEEE Transactions on Paralleland Distributed Systems, 2020, 32(4): 786-798

[0143] [2] Figueiredo S, Madhusudan A, Reniers V, et al. Exploring the storjnetwork: Asecurity analysis[C], Proceedings of the 36th Annual ACM Symposium on Applied Computing. New York: Association for Computing Machinery, 2021: 257-264.

[0145] [3]Firdaus M,Rhee KH.On blockchain-enhanced secure data storage and sharing in vehicular edge computing networks[J].Applied Sciences,2021,11(1):414.

[0147] [4]Chen R, Li Y, Yu Y, et al. Blockchain-based dynamic provable data possession for smart cities [J]. IEEE Internet of Things Journal, 2020, 7(5): 4143-4154.

[0149] Example 2

[0150] A verifiable data storage method based on blockchain that supports fair payment, specifically:

[0151] Step 1: Establish a decentralized data storage system based on blockchain, and then initialize the decentralized storage system;

[0152] Step 2: Storage node registration;

[0153] Step 3: Data preprocessing;

[0154] Step 4: The data owner DO sends the data and deploys the storage contract T1;

[0155] Step 5: Store data;

[0156] Step 6: Data possession certificate generation;

[0157] Step 7: Verification and payment.

[0158] Example 3

[0159] A verifiable data storage method based on blockchain that supports fair payment, specifically:

[0160] Step 1: Establish a decentralized data storage system based on blockchain, and then initialize the decentralized storage system;

[0161] Step 1 is as follows:

[0162] Step 1.1: Establish a decentralized storage system consisting of data owner DO, storage node SN, blockchain and smart contracts;

[0163] Step 1.2: Initialize the decentralized storage system; specifically: the host registers on the Ethereum blockchain and obtains a public-private key pair (sk, pk). Ethereum randomly generates a 32-byte private key through a pseudo-random function, and uses the elliptic curve digital signature algorithm to map the private key to a 64-byte public key. The public key is then used as the input of the SHA-256 hash algorithm to obtain a hexadecimal string. The last 40 characters are taken plus the prefix "0X" as the node address. In this way, the host participates in data storage transactions as the data owner DO or the storage node SN. The transaction price and storage time are defined by the data owner DO, and the storage node SN selects appropriate data for storage based on the storage space it provides.

[0164] Step 2: Storage node registration;

[0165] Step 3: Data preprocessing;

[0166] Step 4: The data owner DO sends the data and deploys the storage contract T1;

[0167] Step 5: Store data;

[0168] Step 6: Data possession certificate generation;

[0169] Step 7: Verification and payment.

Claims

1. A verifiable data storage method based on blockchain to support fair payment, characterized in that: Specifically: Step 1: Establish a decentralized data storage system based on blockchain, and then initialize the decentralized storage system; Step 2: Storage node registration; Step 3: Data preprocessing; Step 4: The data owner DO sends the data and deploys the storage contract T1; Step 5: Store data; Step 6: Data possession certificate generation; Step 7: Verification and payment.

2. The verifiable data storage method based on blockchain supporting fair payment according to claim 1 is characterized in that: Step 1 is as follows: Step 1.1: Establish a decentralized storage system consisting of data owner DO, storage node SN, blockchain and smart contracts; Step 1.2: Initialize the decentralized storage system; specifically: the host registers on the Ethereum blockchain and obtains a public-private key pair (sk, pk). Ethereum randomly generates a 32-byte private key through a pseudo-random function, and uses the elliptic curve digital signature algorithm to map the private key to a 64-byte public key. The public key is then used as the input of the SHA-256 hash algorithm to obtain a hexadecimal string. The last 40 characters are taken plus the prefix "0X" as the node address. In this way, the host participates in data storage transactions as the data owner DO or the storage node SN. The transaction price and storage time are defined by the data owner DO, and the storage node SN selects appropriate data for storage based on the storage space it provides.

3. The verifiable data storage method based on blockchain supporting fair payment according to claim 2 is characterized in that: Step 2 is as follows: The storage node SN deploys the compensation contract T2 on the blockchain. The compensation contract T2 is deployed by the storage node SN and contains three methods: Registration, SubmitParam and PayDeposit. The Registration method is called by the storage node SN and the input is the storage deposit R V , used to store the deposit R V Stored in the compensation contract T2; the SubmitParam method is called by the storage node SN, and the input is the hash value of the ciphertext data and the transaction compensation fee R g and storage period, which is used by the storage node SN to submit the storage data proof. PayDeposit is called by the verification contract T3, and the input is the compensation fee R g , used to pay compensation to the data owner DO for incorrectly storing data; the storage node SN calls the Registration method to submit a storage deposit R that matches the storage space to the compensation contract T2 V , the amount in the contract increases by R V ; R V It indicates the pre-set deposit amount corresponding to the available storage space. If the storage node SN does not store the data correctly, the verification contract T3 calls the compensation contract T2 to pay compensation to the data owner DO. V If the transaction is written to the Ethereum blockchain, it means that the storage node SN is successfully registered.

4. The verifiable data storage method based on blockchain supporting fair payment according to claim 3 is characterized in that: Step 3 is as follows: Step 3.1: The data owner DO has the plaintext data F and uses the symmetric encryption algorithm AES-128 to encrypt the plaintext data F: f=Enc AES (F,Key) (1) In formula (1), f represents the ciphertext data after symmetrical encryption, F represents the plaintext data, and Key represents the encryption key. After encryption, the ciphertext data f is divided into blocks: f={m i },1≤i≤n (2) In formula (2), f represents the encrypted ciphertext data. The encrypted ciphertext data f is divided into n data blocks, m i Represents the i-th data block; Step 3.2: For data block m i Generate tags: First, introduce the bilinear mapping to construct the encryption and decryption algorithm, e:G×G→G T is a bilinear map, G and G T Both are multiplicative cyclic groups of prime order p, g is the generator of G, and two hash functions: H(·):{0,1} * →G,h(·):G T →Z p , H(·) is to uniformly map any string to the G group; h(·) is to map G T Mapping to group Z p , Z p is the set of integers modulo p; function η(·): {0,1} * →[0,1] is a secure pseudo-random function that maps any value to the integer range [0,1]; the data owner DO first p Select a random number a←Z p , choose u←G on the group G, and calculate v=g a , generate a public-private key pair (ssk, spk) for verification, where private key ssk = (sk, a), public key spk = (pk, g, u, v, e, H (·), h (·), η (·)), calculate the data block m i Tags: In formula (3), σ i is the data block m i W = Fname||i is the concatenation of Fname and i, Fname is the file identifier; H(W) is the hash value of the ciphertext data, u is an element of the group G, m i is the i-th data block, a is in the set Z p The random number selected above, is the label σ i To ensure the correctness of the file identifier, the data owner DO signs the file identifier Fname with the private key sk and generates t←Fname||Sig sk (Fname) is used as the identifier of the ciphertext data f; the data owner DO combines the data block label and the ciphertext data identifier t into a label set 5. The verifiable data storage method based on blockchain supporting fair payment according to claim 4 is characterized in that: Step 4 is as follows: Step 4.1: The data owner DO uses the private key sk to encrypt the ciphertext data f and the label set Sign and generate Sig sk (f,Φ), is sent to the physical address specified by the storage node SN through the off-chain method; Step 4.2: The data owner DO deploys the storage contract T1. The storage contract T1 contains three methods: SubmitParam, StoreFee and PayFee. The SubmitParam method is called by the data owner and takes as input the ciphertext data file name, ciphertext data hash value, storage period and data verification public key, which is used to upload these verification parameters to the blockchain. The StoreFee method is called by the data owner and takes as input the storage fee R. f , used to convert the storage cost R f Deposit into storage contract T1; the PayFee method is called by verification contract T3 to transfer the storage fee R in storage contract T1 f The data owner DO calls the SubmitParam method to send the ciphertext data file name Fname, ciphertext data hash value H(W), storage period Time end The data verification public key spk is stored on the blockchain, and the method StoreFee is called to deposit the storage fee R to be paid into the storage contract T1 pool f , when the storage fee R is deposited f When the transaction is written into the blockchain, the storage contract T1 is deployed successfully.

6. The method for storing verifiable data based on blockchain supporting fair payment according to claim 5, characterized in that: Step 5 is as follows: Step 5.1: The storage node SN verifies the received ciphertext data f and label set Φ, and uses the public key pk of the data owner DO to verify the signature of the data owner. After the verification, the ciphertext data is hashed and compared with the hash value H(W) stored by the data owner DO on the blockchain. If they are consistent, the data is proven to be complete, and the storage node SN stores the data. If they are inconsistent, the storage fails; Step 5.2: The storage node calls the SubmitParam method to send the hash value H(W) of the ciphertext data and the transaction compensation fee R g and storage period Time end The verification information is stored in the compensation contract T2.

7. The verifiable data storage method based on blockchain supporting fair payment according to claim 6 is characterized in that: Step 6 is as follows: Step 6.1: The storage node SN takes the ciphertext data f, the label set Φ, and the public state information τ as input to generate the storage proof Σ. In the non-interactive data integrity verification method, τ should be public to the entire network and is not controlled by the storage node SN. It will change over time. The hash value of the last block on the blockchain is selected as the public parameter τ. The storage node SN randomly selects c elements from the set [1,n]. For any i∈[1,c], the storage node SN calculates: s i ←η(τ||i) (4) In formula (4), s i It is the challenge information for data verification generated according to the public parameters τ and i. The challenge information is not controlled by the storage node SN and the data owner DO. The challenge information consists of a set I = {s1, s2, ..., s c }, where k∈I,s1≤k≤s c , storage node SN calculation: v k ←h(τ||k) (5) In formula (5), v k It represents the verification parameter composed of the challenge information k and the public verification parameter τ. The storage node verifies the verification parameter v k and the kth data block label σ k Generate storage proof: In formula (6), v k is the verification parameter of the kth data block, σ k is the label of the kth data block, m k For the kth ciphertext data block, the storage node SN selects a random number r←Z p ,calculate: ρ=e(u,v) r ,ρ∈G T (7) and: μ=r+γ·μ′ (8) In formula (7), e is a bilinear map, u is an element of group G, and v = g a , r is Z p The elements in; in formula (8), γ=h(ρ), γ∈Z p , taking Σ={μ,σ,ρ,τ,c} as the data possession proof of the storage node SN; Step 6.2: The storage node SN deploys the verification contract T3. The verification contract T3 contains two methods: SubmitProof and Verify. The SubmitProof method is called by the storage node SN to store the generated storage proof Σ={μ,σ,ρ,τ,c} on the blockchain. The Verify method is called by the storage node SN to verify the storage proof Σ. The storage node SN calls the SubmitProof method to upload the generated integrity proof Σ to the blockchain.

8. The verifiable data storage method based on blockchain supporting fair payment according to claim 7 is characterized in that: Step 7 is as follows: Step 7.1: The storage node SN calls the Verify method in the verification contract T3 for verification. The verification node on the blockchain performs the verification operation and calculates I = {η(τ||1), η(τ||2)...η(τ||c),}, {v k =h(τ||k)} k∈I , γ=h(ρ), and then calculate according to the ciphertext data hash value H(W) uploaded to the blockchain by the data owner DO and the data verification public key spk: In formula (9), ρ = e(u,v) r , e is a bilinear mapping, H(W) is the hash value of the ciphertext data, u is an element of the group G, and v = g a , r is Z p The elements in , γ=h(ρ),γ∈Z p , calculate whether the results on both sides of the equation are equal; Step 7.2: If the calculation results on both sides of the equation are equal, the verification is passed and storage continues; when the storage time reaches the deadline Time end After verification, contract T3 calls the PayFee method of storage contract T1 to perform payment operation, and transfers the storage fee R in the contract pool to the storage fee R in the contract pool. f The address sent to the storage node SN; If the calculation results on both sides of the equation are not equal, it proves that the verification has failed. The verification contract T3 calls the PayDeposit method of the compensation contract T2 to perform the payment operation and transfers the compensation fee R in the contract pool to the original contract. g Sent to the data owner DO as compensation.