Storage proof method and device

By sending multiple challenges to storage nodes and calculating verification values, the cost of verification nodes reconstructing Merkel trees is increased, solving the problem that verification nodes are prone to evil, and improving the security of blockchain network.

CN115913566BActive Publication Date: 2025-08-19WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211338546.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-28
Publication Date
2025-08-19
Estimated Expiration
2042-10-28

AI Technical Summary

Technical Problem

In blockchain networks, verification nodes are prone to committing evil by building Merkel trees, resulting in poor network security.

Method used

The verification node sends n challenges to the storage node. The storage node secretly selects a target challenge to generate storage proofs. The verification node needs to calculate n verification values ​​to determine the target challenge, which increases the cost of refactoring the Merkel tree.

Benefits of technology

It increases the difficulty of verifying nodes to do evil and enhances the security of blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913566B_ABST
    Figure CN115913566B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention relates to a storage proof method and device. The method includes: a verification node sends n challenges corresponding to n storage data to a storage node; the challenges are used to verify whether the storage node stores the corresponding storage data; the verification node receives the storage proof sent by the storage node; the storage proof is generated by the storage node based on a target challenge among the n challenges; the target challenge is a challenge corresponding to the target storage data stored by the storage node itself; the verification node calculates n verification values of the storage proof and the n challenges respectively, determines the target challenge among the n challenges based on the n verification values; and determines whether the target storage data is stored in the storage node based on the target challenge. This increases the time cost and computational cost of the verification node in determining the target challenge corresponding to the storage proof, and increases the cost of the verification node in reconstructing the Merkle tree. Therefore, the possibility of the verification node doing evil is reduced, and the security of the blockchain network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of blockchain technology, and in particular to a storage proof method, apparatus, computing device, and computer-readable storage medium. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.

[0003] In a blockchain network, if every storage node stores the complete data, it would increase the storage space occupied by each node. Therefore, the proposal is to shard the complete data into multiple shards, storing each shard in different storage nodes to reduce the storage pressure on each storage node. To determine whether a storage node stores shard data, the verification node will challenge the storage node. In response to the challenge, the storage node will provide a storage proof that the shard data is stored and send the storage proof to the verification node. The verification node can then use the storage proof to determine whether the storage node stores the shard data.

[0004] Specifically, any node in the blockchain network builds a Merkle tree based on the hash value of each shard data, stores the root of the Merkle tree in the blockchain ledger, and sends each shard data to different storage nodes, and sends the Merkle tree to each storage node. For example, any node in the blockchain network builds a Merkle tree based on the hash value hA of shard data A, the hash value hB of shard data B, the hash value hC of shard data C, and the hash value hD of shard data D. Figure 1a A possible Merkle tree is shown; the root of the Merkle tree is stored in the blockchain ledger; shard data A and the Merkle tree are sent to storage node 1 for storage, shard data B and the Merkle tree are sent to storage node 2 for storage, shard data C and the Merkle tree are sent to storage node 3 for storage, and shard data D and the Merkle tree are sent to storage node 4 for storage.

[0005] The verification node does not store the data of each shard, but only stores the hash value hA, hash value hB, hash value hC and hash value hD of each shard. It is difficult to construct a Merkle tree that is exactly the same as the Merkle tree constructed by any node in the previous blockchain network based on the hash value hA, hash value hB, hash value hC and hash value hD. Figure 1a Merkle tree. Because the verification node may construct Figure 1b The Merkle tree shown.

[0006] If the verification node challenges storage node 4 based on the hash value hA of shard data A, without first determining what shard data is stored in storage node 4, and storage node 4 determines that it does not store shard data A, it will not provide any proof to the verification node and will instead send a message stating that it does not store shard data A. If the verification node challenges storage node 4 based on the hash value hD of shard data D, and storage node 4 determines that it stores shard data D, it will determine the Merkle proof corresponding to shard data D in the Merkle tree and send it to the verification node. For example, the Merkle proofs are hC and hAB.

[0007] The verification node calculates the Merkle proof and hash value hD to obtain the calculated root of the Merkle tree. It then compares the calculated root with the root of the Merkle tree stored in the blockchain ledger. If they are consistent, it is determined that the shard data D is indeed stored in the storage node 4. Therefore, if a user wants to obtain the shard data D, they can pay the storage node 4 to obtain the shard data D.

[0008] In the above scheme, during the verification process, the validator obtains the Merkle proofs, which are hash values of certain nodes in the Merkle tree. For example, the Merkle proofs provided by storage node 4 are hC and hAB. If the validator issues multiple challenges, it can easily construct a Merkle tree identical to the one previously constructed by any node in the blockchain network. However, the validator itself does not store any shard data. Therefore, having access to the Merkle tree, the validator possesses the ability to commit malicious acts, posing as a storage node. For example, let's say the validator that has become a storage node is Verifier W. When other validators challenge Verifier W for any shard data, Verifier W can provide the corresponding Merkle proof based on its Merkle tree, which the other validators verify. Users want to download shard data from Verifier W and pay Verifier W, but Verifier W is unable to provide shard data to other users.

[0009] In summary, the above verification method of whether the storage node stores shard data makes it easy for the verification node to do malicious things, and the security of the blockchain network is poor. Summary of the Invention

[0010] The embodiment of the present invention provides a storage proof method to increase the cost of reconstructing the Merkle tree for the verification node, reduce the possibility of the verification node doing malicious things, and improve the security of the blockchain network.

[0011] In a first aspect, an embodiment of the present invention provides a storage certification method, comprising:

[0012] The verification node sends n challenges corresponding to n stored data to the storage node, wherein the challenges are used to verify whether the storage node stores the corresponding stored data; n is an integer greater than 1;

[0013] The verification node receives the storage proof sent by the storage node; the storage proof is generated by the storage node based on the target challenge among the n challenges; the target challenge is the challenge corresponding to the target storage data stored by the storage node itself;

[0014] The verification node calculates n verification values of the storage proof and the n challenges respectively, determines the target challenge among the n challenges according to the n verification values; and determines whether the target storage data is stored in the storage node according to the target challenge.

[0015] In the above technical solution, the verification node sends n challenges to the storage node; the storage node determines the target challenge among the n challenges based on the target storage data stored in itself, and generates a storage proof based on the target challenge; the verification node cannot determine which challenge among the n challenges the storage proof is for, so it is necessary to calculate n verification values for the storage proof and the n challenges respectively, and determine the target challenge among the n challenges based on the n verification values. In this way, it can be determined that the target storage data is indeed stored in the storage node based on the target challenge. The verification node cannot determine the target challenge corresponding to the storage proof after obtaining the storage proof, but needs to calculate n verification values. This increases the time cost and computing cost of the verification node in determining the target challenge corresponding to the storage proof, and increases the cost of the verification node reconstructing the Merkle tree. Therefore, the possibility of the verification node doing evil is reduced, and the security of the blockchain network is improved.

[0016] In some embodiments, the verification node sends n challenges corresponding to n stored data to the storage node, including:

[0017] The verification node sends n challenge index values corresponding to n stored data to the storage node; the storage node is used to select any selected index value from the n index values, encrypt the selected index value, and then send it to the verification node;

[0018] The verification node encrypts the n challenges according to the encrypted selection index value and sends the encrypted n challenges to the storage node; the storage node is used to determine the selection challenge corresponding to the selection index value among the n encrypted challenges, and if it is determined that it stores the storage data corresponding to the selection challenge, it determines the selection challenge as the target challenge.

[0019] In the above technical solution, the verification node does not send n challenges directly to the storage node, but sends the index values of n challenges. In this way, the storage node can select any selection index value from the n index values and only obtain the selection challenge corresponding to the selection index value, without being able to extract the available information of other challenges. In this way, the effect of hiding the other challenges of the verification node is achieved, ensuring the security of other challenges sent by the verification node.

[0020] In some embodiments, the verification node encrypts the n challenges according to the encrypted selection index value and sends the encrypted n challenges to the storage node, including:

[0021] The verification node receives a first ciphertext sent by the storage node; the first ciphertext is obtained by the storage node encrypting the selection index value using a first key;

[0022] The verification node calculates the challenge corresponding to the index value using the second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges;

[0023] The verification node sends the n second ciphertexts to the storage node; the storage node is used to use the first key to calculate the n second ciphertexts respectively to obtain n challenge values, and determine the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

[0024] In the above technical solution, the storage node encrypts the selected index value based on the first key to obtain the first ciphertext, and sends the first ciphertext to the verification node. In this way, the verification node cannot know which challenge the storage node has selected. If the storage node later provides a storage proof, the verification node will not immediately determine which challenge the storage proof corresponds to, and cannot quickly construct the Merkle tree, reducing the possibility of the verification node doing malicious things. In addition, the verification node uses the second key, the first ciphertext and the index value of any challenge among the n challenges to calculate the challenge corresponding to the index value to obtain n second ciphertexts corresponding to the n challenges. In this way, the storage node obtains n second ciphertexts but cannot obtain n challenges. It can only calculate the n second ciphertexts separately using the first key to obtain n challenge values. Since the first key is determined by the storage node, the storage node encrypts the selected index value using the first key to obtain the first ciphertext, and the first ciphertext is also used in the determination of the n second ciphertexts. Therefore, only the challenge value corresponding to the selected index value determined by the storage node meets the preset conditions. Then, the storage node obtains the selected challenge corresponding to the selected index value, and in the entire process, the storage node cannot know other challenges except the selected challenge, which plays a role in protecting other challenges except the selected challenge and improves the security of the blockchain system.

[0025] In some embodiments, the verification node sends n challenges corresponding to n stored data to the storage node, including:

[0026] The verification node sends the number n of challenges to the storage node; the storage node is used to generate a random number greater than 0 and less than or equal to n as a selection index value, encrypt the selection index value and send it to the verification node.

[0027] In a second aspect, an embodiment of the present invention provides a storage certification method, including:

[0028] The storage node receives n challenges corresponding to n storage data respectively sent by the verification node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; n is an integer greater than 1;

[0029] The storage node determines a target challenge from the n challenges; the target challenge is a challenge corresponding to the target storage data stored by the storage node itself;

[0030] The storage node generates a storage certificate based on the target challenge;

[0031] The storage node sends the storage proof to the verification node; the verification node is used to calculate n verification values of the storage proof and the n challenges respectively, determine the target challenge among the n challenges according to the n verification values, and determine whether the target storage data is stored in the storage node according to the target challenge.

[0032] In some embodiments, the storage node receives n challenges corresponding to n stored data respectively from the verification node, including:

[0033] The storage node receives index values of n challenges corresponding to n stored data respectively, sent by the verification node;

[0034] The storage node determines a target challenge from the n challenges, including:

[0035] The storage node selects any selected index value from the n index values, encrypts the selected index value, and sends it to the verification node; the verification node is used to encrypt the n challenges according to the encrypted selected index value, and send the encrypted n challenges to the storage node;

[0036] The storage node determines the selection challenge corresponding to the selection index value from the encrypted n challenges;

[0037] If the storage node determines that it stores the storage data corresponding to the selected challenge, it determines the selected challenge as the target challenge.

[0038] In some embodiments, the storage node encrypts the selected index value and sends it to the verification node, including:

[0039] The storage node encrypts the selected index value using a first key to obtain a first ciphertext; the first ciphertext is sent to the verification node; the verification node is configured to encrypt the challenge corresponding to the index value using a second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges, and send the n second ciphertexts to the storage node;

[0040] The storage node determines the selection challenge corresponding to the selection index value from the encrypted n challenges, including:

[0041] The storage node uses the first key to calculate the n second ciphertexts respectively to obtain n challenge values, and determines the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

[0042] In some embodiments, the storage node encrypts the selected index value using a first key to obtain a first ciphertext, including:

[0043] The storage node encrypts the selected index value using the first key and the third key to obtain a first ciphertext.

[0044] The security of the first ciphertext is improved, and the difficulty for the verification node to obtain the selected index value is increased; at the same time, because the n second ciphertexts are also encrypted by the first ciphertext, it is also more difficult for the storage node to obtain other challenges except the selected challenge.

[0045] In some embodiments, further comprising:

[0046] If the storage node determines that it does not store the storage data corresponding to the selected challenge, it sends a feedback message to the verification node indicating that it does not store the storage data corresponding to the current selected challenge.

[0047] In a third aspect, an embodiment of the present invention further provides a storage certification device, comprising:

[0048] A first sending unit is configured to send n challenges corresponding to n storage data to a storage node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; wherein n is an integer greater than 1;

[0049] A first receiving unit is configured to receive a storage certificate sent by the storage node; the storage certificate is generated by the storage node based on a target challenge among the n challenges; the target challenge is a challenge corresponding to the target storage data stored by the storage node itself;

[0050] The first processing unit is used to calculate n verification values of the storage proof and the n challenges respectively, determine the target challenge among the n challenges according to the n verification values; and determine whether the target storage data is stored in the storage node according to the target challenge.

[0051] In a fourth aspect, an embodiment of the present invention further provides a storage certification device, comprising:

[0052] a second receiving unit, configured to receive n challenges corresponding to n storage data respectively, sent by the verification node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; wherein n is an integer greater than 1;

[0053] a second processing unit, configured to determine a target challenge from the n challenges; the target challenge being a challenge corresponding to the target storage data stored by the storage node itself; and generating a storage proof based on the target challenge;

[0054] A second sending unit is used to send the storage proof to the verification node; the verification node is used to calculate n verification values of the storage proof and the n challenges respectively, determine the target challenge among the n challenges according to the n verification values, and determine whether the target storage data is stored in the storage node according to the target challenge.

[0055] In a fifth aspect, an embodiment of the present invention further provides a computing device, including:

[0056] memory for storing computer programs;

[0057] The processor is used to call the computer program stored in the memory and execute the storage certification method listed in any of the above methods according to the obtained program.

[0058] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute any of the storage proof methods listed in the above manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0060] Figure 1a A schematic diagram of a possible Merkle tree provided by an embodiment of the present invention;

[0061] Figure 1b A schematic diagram of a possible Merkle tree provided by an embodiment of the present invention;

[0062] Figure 1c A schematic diagram of a possible system architecture provided by an embodiment of the present invention;

[0063] Figure 1d A schematic diagram of a possible application scenario provided by an embodiment of the present invention;

[0064] Figure 1e A schematic diagram of a possible Merkle tree provided by an embodiment of the present invention;

[0065] Figure 2 A schematic diagram of a possible interaction process between a verification node and a storage node provided in an embodiment of the present invention;

[0066] Figure 3 A schematic diagram of a storage proof method provided by an embodiment of the present invention;

[0067] Figure 4 A schematic diagram of a storage proof method provided by an embodiment of the present invention;

[0068] Figure 5 A schematic diagram of a specific method for determining a selection challenge provided by an embodiment of the present invention;

[0069] Figure 6 A flowchart of a method for determining a selection challenge provided by an embodiment of the present invention;

[0070] Figure 7 A flowchart of a method for determining a selection challenge provided by an embodiment of the present invention;

[0071] Figure 8 A directed acyclic graph provided by an embodiment of the present invention;

[0072] Figure 9 A schematic diagram of the structure of a storage certification device provided by an embodiment of the present invention;

[0073] Figure 10A schematic diagram of the structure of a storage certification device provided by an embodiment of the present invention;

[0074] Figure 11 A schematic structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0075] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0076] All other embodiments derived by persons of ordinary skill in the art based on the exemplary embodiments described herein without inventive effort are within the scope of protection of the claims appended hereto. Furthermore, although the disclosure herein is presented based on one or more exemplary embodiments, it should be understood that each aspect of the disclosure may constitute a complete embodiment on its own.

[0077] It should be noted that the brief descriptions of terms in this application are only for the purpose of facilitating the understanding of the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and usual meanings.

[0078] In the specification and claims of this application and the drawings, the terms "first," "second," "third," etc. are used to distinguish similar or similar objects or entities, and are not necessarily intended to limit a particular order or precedence, unless otherwise indicated. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances, for example, the embodiments of this application can be implemented in an order other than those shown or described in the drawings.

[0079] In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0080] To facilitate understanding of the solutions of the embodiments of the present invention, the terms involved in the embodiments of the present invention are explained below.

[0081] 1. Original data: data that has not been encoded, encrypted, or obfuscated and can be directly obtained by users.

[0082] 2. Data sharding: Split the data into data segments of uniform size for data compression, distribution and storage.

[0083] 3. Transaction hash: The return value when a user calls a smart contract or initiates a transfer in the blockchain.

[0084] 4. Blockchain ledger: A space used to store proof of existence of original data, usually represented in the form of key-value pairs.

[0085] 5. Verification node: a third party that initiates data storage proof.

[0086] 6. Proof Node: The storage party that provides proof of data storage.

[0087] 7. Merkle tree and Merkle proof: data structures widely used to store transactions in blockchain.

[0088] 8. Skip list: The full name of skip list is jump list, which allows fast query, insertion and deletion of a data linked list structure of ordered continuous elements.

[0089] Figure 1c A possible system architecture diagram provided by an embodiment of the present invention is as follows: Figure 1c As shown, the system architecture includes a blockchain network 100 and a user terminal 110; wherein, the blockchain network 100 can be connected to the user terminal 110 respectively, for example, by wired connection or wireless connection, without limitation.

[0090] like Figure 1c As shown, one or more blockchain nodes can be set in the blockchain network 100, and any two of the one or more blockchain nodes are communicatively connected to jointly maintain the blockchain network. For example, the blockchain network 100 is provided with blockchain node 1001, blockchain node 1002, blockchain node 1003 and blockchain node 1004, and any two of the blockchain nodes 1001 to blockchain node 1004 can be communicatively connected.

[0091] In an embodiment of the present invention, the blockchain nodes in the blockchain network 100 may have multiple functions, such as routing, transaction, blockchain, and consensus functions. The routing function means that the blockchain node can transmit transaction information transmitted by the client to other blockchain nodes in the blockchain network 100 to achieve communication between the various blockchain nodes. The transaction and consensus functions mean that the blockchain node can support transactions with users or other blockchain nodes through consensus, and can also record all transactions executed in the blockchain node (or blockchain network 100). The blockchain function means that the blockchain node can generate new blocks in the blockchain network 100 based on the execution of transactions. Among them, the routing function is a function that each blockchain node in the blockchain network 100 must have, and other functions can be configured by those skilled in the art according to actual needs.

[0092] It should be noted that the blockchain node illustrated in the above diagram can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. A blockchain node can also specifically refer to a process or a series of processes running on a server. For example, blockchain node 1001 can be a process running on a server, or it can also refer to a server, without specific limitation.

[0093] It should be noted that Figure 1c This is only an exemplary description and does not constitute a limitation of this solution.

[0094] In the embodiment of the present invention, the storage node can be any number of blockchain nodes in the blockchain network 100. The storage node is used to store the original data or the sharded data obtained by sharding the original data. The verification node can be any number of blockchain nodes in the blockchain network 100. The verification node does not store the original data. The verification node is used to challenge the storage node to verify whether the storage node stores the original data or the sharded data obtained by sharding the original data. When the verification is completed, the verification node can broadcast the verification result to other nodes in the blockchain network. The same node cannot be both a storage node and a verification node. For example, in Figure 1c In the example, blockchain node 1001 and blockchain node 1002 are storage nodes, and blockchain node 1003 and blockchain node 1004 are verification nodes.

[0095] After verification, if the verification node confirms that a certain storage node does store a certain shard data, it can send the verification result to the user terminal 110. The user terminal 110 can then send a request to the storage node to obtain the shard data and pay a fee. After receiving the request, the storage node can send the shard data to the user terminal. The shard data here can be the shard data obtained by sharding a file, or the shard data obtained by sharding a song, etc., which are not listed here one by one.

[0096] Figure 1d A possible application scenario to which the embodiment of the present invention is applicable is shown.

[0097] Any node in the blockchain (hereinafter referred to as the upload node for simplicity) uploads the original data, encodes the original data and shards it, or directly shards the original data, resulting in multiple shards. The upload node calculates the hash value of each shard. The upload node constructs a Merkle tree based on the hash value of each shard. The upload node uploads the root of the constructed Merkle tree to the blockchain ledger, making it accessible to any node in the blockchain. The upload node sends each shard to each storage node, and sends the Merkle tree to each storage node. Thus, each storage node in the blockchain stores the corresponding shard data and Merkle tree. For example, storage node 1 stores shard data A and a Merkle tree; storage node 2 stores shard data B and a Merkle tree; storage node 3 stores shard data C and a Merkle tree; and storage node 4 stores shard data D and a Merkle tree.

[0098] The process of the verification node verifying whether a storage node stores shard data is as follows: the verification node stores the hash value of each shard data, and challenges the storage node based on the hash value of the shard data. If the storage node stores the shard data, it provides a Merkle proof based on the Merkle tree stored in itself. The Merkle proof specifically includes the hash values of the adjacent nodes of the shard data and the hash values of the adjacent non-leaf nodes.

[0099] For example, if the Merkle tree constructed is Figure 1a As shown in the figure, when the verification node sends the hash value hA of shard data A to storage node 1, storage node 1 determines that it stores shard data A, and sends hB and hCD as Merkle proof to the verification node; the verification node calculates the hash value hAB based on hA and hB, and calculates the hash value hAB and hCD to obtain the calculation root of the Merkle tree, and compares the calculation root with the root of the Merkle tree stored in the blockchain ledger. If they are consistent, it is determined that shard data A is indeed stored in storage node 1.

[0100] For example, if the constructed Merkle tree is Figure 1eAs shown, when the verification node sends the hash value 1 of shard data A to storage node 1, storage node 1 determines that it stores shard data A, and sends 2, 10, and 14 as Merkle proofs to the verification node; the verification node calculates the hash value 9 based on 1 and 2, calculates the hash value 13 based on 9 and 10, and calculates the hash value 13 and 14 based on the Merkle tree root. The calculated root is compared with the root of the Merkle tree stored in the blockchain ledger. If they are consistent, it is determined that shard data A is indeed stored in storage node 1.

[0101] In the above scheme, the Merkle proof obtained by the validating node during the verification process is the hash value of several nodes in the Merkle tree. If the validating node issues multiple challenges, it can easily construct a Merkle tree that is exactly the same as the Merkle tree constructed by any node in the blockchain network. Figure 2 The figure shows a possible interaction flow between a verification node and a storage node. A verification node w can challenge different storage nodes multiple times to obtain Merkle proofs from each storage node. As shown in the figure, only four challenges are needed to construct a Merkle tree identical to the one previously constructed by the upload node.

[0102] However, the validator itself does not store any shard data. Therefore, since it has access to the Merkle tree, it has the ability to commit malicious acts, and can act as a storage node. For example, let's say the validator acting as a storage node is w. When other validators challenge w for any shard data, w can provide a corresponding Merkle proof based on its own Merkle tree, and other validators will verify the Merkle proof. Users want to download shard data from w and pay it, but w cannot provide shard data to other users.

[0103] Assuming there are N shards, meaning N Merkle tree nodes, the total number of Merkle tree nodes is calculated to be 2N-1. When a validator traverses the validation shards, the proving node must provide the hash values of √N Merkle tree nodes. Therefore, the validator can complete the Merkle tree reconstruction in approximately O(√N). This shows that the low cost of Merkle tree reconstruction by the validator increases the possibility of malicious behavior by the validator, resulting in poor security for the blockchain network.

[0104] Research has found that by issuing multiple challenges, the validator can easily reconstruct a Merkle tree identical to the one previously constructed. The "easily" here is reflected in the following: each time the validator issues a challenge regarding the hash value of a shard, if the storage node stores the shard data corresponding to that hash value, the storage node will generate a Merkle proof and send it to the validator. Once the validator obtains the Merkle proof, it can immediately determine which challenge the Merkle proof corresponds to and quickly reconstruct a portion of the Merkle tree. For example, if the validator issues a challenge regarding hA, and storage node 1 determines that shard data A is stored, it will generate a Merkle proof (specific nodes in the Merkle tree). Upon receiving the Merkle proof, the validator can determine that it corresponds to hA. Once the root obtained by calculating hA and the Merkle proof is the same as the root of the Merkle tree in the blockchain, a portion of the Merkle tree can be reconstructed.

[0105] Therefore, an embodiment of the present invention provides a storage proof method, in which a verification node proposes n challenges to a storage node. The storage node secretly selects a challenge to prove and sends the Merkle proof of the secretly selected challenge to the verification node. The verification node cannot know which challenge the Merkle proof provided by the storage node corresponds to and needs to go through multiple experiments to find out, thereby increasing the cost of reconstructing the Merkle tree and enhancing the security of the blockchain.

[0106] Figure 3 A storage certification method provided in an embodiment of the present invention includes:

[0107] In step 301 , the verification node sends n challenges corresponding to n stored data to the storage node, where the challenges are used to verify whether the storage node stores the corresponding stored data.

[0108] In step 302 , the storage node receives n challenges sent by the verification node, each corresponding to n stored data.

[0109] Step 303: The storage node determines a target challenge from the n challenges; the target challenge is a challenge corresponding to the target storage data stored by the storage node itself.

[0110] Step 304: The storage node generates a storage certificate based on the target challenge.

[0111] Step 305: The storage node sends the storage certificate to the verification node.

[0112] Step 306: The verification node receives the storage certificate sent by the storage node.

[0113] In step 307, the verification node calculates n verification values of the storage proof and the n challenges respectively, determines the target challenge among the n challenges according to the n verification values; and determines whether the target storage data is stored in the storage node according to the target challenge.

[0114] In step 301, the verification node sends n challenges corresponding to n stored data to the storage node. For example, the verification node stores the hash values of shard data A, shard data B, shard data C, and shard data D, which are hA, hB, hC, and hD respectively. The n challenges are the hash values of these shard data, that is, the verification node sends 4 challenges corresponding to the 4 stored data to the storage node: hA, hB, hC, and hD. Among them, hA is used to verify whether the storage node stores shard data A, hB is used to verify whether the storage node stores shard data B, hC is used to verify whether the storage node stores shard data C, and hD is used to verify whether the storage node stores shard data D.

[0115] In step 303 , the storage node selects a target challenge from the n challenges.

[0116] One possible approach is for a storage node to directly select a target challenge based on the target storage data it stores. For example, if a storage node stores shard data A, it will select hA as the target challenge from the four challenges hA, hB, hC, and hD.

[0117] In step 304, the storage node generates a storage proof based on the target challenge.

[0118] After determining the target challenge, the storage node can provide a corresponding storage proof, such as a Merkle proof. The specific method and examples for providing a Merkle proof have been described previously and will not be repeated here. For example, the Merkle proofs provided by the storage node for the target challenge hA are hB and hCD.

[0119] In step 307, after receiving the storage proof, the verification node does not know which challenge among the n challenges the storage proof corresponds to, and is unable to quickly reconstruct the Merkle tree.

[0120] The verification node needs to calculate n verification values by combining the storage proof with n challenges respectively, and determine the target challenge corresponding to the storage proof based on the n verification values, thereby confirming that the target storage data is indeed stored in the storage node.

[0121] For example, the validator node hashes the storage proof and challenge hA to obtain a computational root; hashes the storage proof and challenge hB to obtain a computational root; hashes the storage proof and challenge hC to obtain a computational root; and hashes the storage proof and challenge hD to obtain a computational root. These four computational roots are compared with the root of the Merkle tree in the blockchain ledger. If they match, the challenge corresponding to the storage proof is the challenge corresponding to that computational root. For example, if the computational root calculated based on challenge hA matches the root of the Merkle tree in the blockchain ledger, and the remaining computational roots do not match the root of the Merkle tree in the blockchain ledger, then the target challenge corresponding to the storage proof is challenge hA.

[0122] And since the challenge hA is consistent with the root of the Merkle tree in the blockchain ledger, it means that the shard data A is indeed stored in the storage node.

[0123] If all n computation roots are inconsistent with the root of the Merkle tree in the blockchain ledger, it means that the storage proof given by the storage node is incorrect and does not correspond to any of the n challenges.

[0124] In the above technical solution, the verification node sends n challenges to the storage node; the storage node determines the target challenge among the n challenges based on the target storage data stored in itself, and generates a storage proof based on the target challenge; the verification node cannot determine which challenge among the n challenges the storage proof is for, so it is necessary to calculate n verification values for the storage proof and the n challenges respectively, and determine the target challenge among the n challenges based on the n verification values. In this way, it can be determined that the target storage data is indeed stored in the storage node based on the target challenge. The verification node cannot determine the target challenge corresponding to the storage proof after obtaining the storage proof, but needs to calculate n verification values. This increases the time cost and computing cost of the verification node in determining the target challenge corresponding to the storage proof, and increases the cost of the verification node reconstructing the Merkle tree. Therefore, the possibility of the verification node doing evil is reduced, and the security of the blockchain network is improved.

[0125] In this embodiment of the present invention, the verification node initiates n challenges, and the storage node secretly selects a challenge to prove, so that the verification node cannot know which challenge the proof node's storage proof corresponds to, which plays a role in obfuscation. The verification node needs to verify multiple times before knowing the target challenge corresponding to the storage proof, which increases the cost of reconstructing the Merkle tree for the verification node. After calculation, the cost of reconstructing the Merkle tree is Therefore, the security of the blockchain is enhanced.

[0126] In the above scheme, the verification node directly sends n challenges to the storage node, and the storage node selects the target challenge from these n challenges. This makes the verification node's n challenges easily leaked, and the security of n challenges is poor. For example, if the verification node directly sends hA, hB, hC, and hD to the storage node, the storage node can directly determine the four hash values, resulting in the leakage of all four hash values.

[0127] Based on the above problems, Figure 4 Another storage proof method provided by an embodiment of the present invention is shown, including:

[0128] Step 401: The verification node sends index values of n challenges corresponding to n stored data to the storage node.

[0129] In step 402 , the storage node receives index values of n challenges corresponding to n stored data respectively, sent by the verification node.

[0130] In step 403, the storage node selects any selected index value from the n index values, encrypts the selected index value, and sends it to the verification node.

[0131] Step 404: The verification node encrypts the n challenges according to the encrypted selection index value, and sends the encrypted n challenges to the storage node.

[0132] Step 405: The storage node determines the selection challenge corresponding to the selection index value among the n encrypted challenges.

[0133] Step 406: If the storage node determines that it has stored data corresponding to the selected challenge, it determines the selected challenge as the target challenge.

[0134] Step 407: The storage node generates a storage certificate based on the target challenge.

[0135] In step 408, the storage node sends the storage certificate to the verification node.

[0136] Step 409: The verification node receives the storage certificate sent by the storage node.

[0137] In step 410, the verification node calculates n verification values of the storage proof and the n challenges respectively, determines the target challenge among the n challenges based on the n verification values; and determines whether the target storage data is stored in the storage node based on the target challenge.

[0138] In step 401, the verification node sends n index values to the storage node. For example, the verification node stores hA, hB, hC, and hD. However, hA, hB, hC, and hD are not sent directly to the storage node. Instead, an index value is determined for each of hA, hB, hC, and hD. For example, the index value determined for hA is 01, the index value determined for hB is 02, the index value determined for hC is 03, and the index value determined for hD is 04. The verification node sends the index values 01, 02, 03, and 04 to the storage node.

[0139] In step 403, the storage node selects any selected index value from the n index values, encrypts the selected index value, and sends it to the verification node.

[0140] For example, the storage node selects a selection index of 04. To prevent the verification node from knowing the selection index, the storage node encrypts the selection index. This is because if the verification node knows the selection index, once the storage node sends the storage proof, the verification node can determine the target challenge corresponding to the storage proof without requiring multiple rounds of verification.

[0141] Another possible approach is that in step 401, the verification node sends the number of challenges, n, to the storage node. In step 403, the storage node generates a random number greater than 0 and less than or equal to n as the selection index. For example, if the verification node sends the number of challenges, 4, to the storage node, the storage node generates the random number 4, indicating that the challenge selected by the storage node is the fourth of four challenges. The storage node then encrypts the selection index 4 and sends it to the verification node.

[0142] In step 404, the verification node encrypts the n challenges according to the encrypted selection index value, and sends the encrypted n challenges to the storage node.

[0143] Since the verification node only obtains the encrypted selection index value and cannot decrypt the encrypted selection index value, it does not know which challenge the storage node has selected. It can only use the encrypted selection index value to encrypt all n challenges and send the encrypted n challenges to the storage node.

[0144] In step 405, the storage node determines the selection challenge corresponding to the selection index value among the n encrypted challenges.

[0145] Since the storage node receives n encrypted challenges, it cannot directly obtain n challenges. However, since the n challenges are encrypted according to the encrypted selection index value, the storage node can decrypt the challenge corresponding to the selected index value it selected but cannot decrypt other challenges, thus ensuring the security of other challenges.

[0146] For example, the storage node determines the selected index value to be 04, encrypts it, and sends it to the verification node. The verification node then uses the encrypted value 04 to encrypt four challenges: hA, hB, hC, and hD. These four challenges, encrypted with 04, are then sent to the storage node. The storage node decrypts these four encrypted challenges and only decrypts the challenge corresponding to 04 as hD, but is unable to decrypt the other three encrypted challenges. This ensures the security of the other three challenges. Here, the storage node determines that the selected challenge corresponding to the selected index value is hD among the four encrypted challenges.

[0147] In step 406 , if the storage node determines that it has stored data corresponding to the selected challenge, it determines the selected challenge as the target challenge.

[0148] For example, if the selected challenge is hD, the storage node determines that it does not store shard data D and therefore does not use hD as the target challenge. Instead, it sends a feedback message to the verification node stating that it does not store the data corresponding to this selected challenge. The verification node then sends the index values of n challenges to the storage node again, repeating steps 401-410.

[0149] For example, if the selected challenge is hA, the storage node determines that it stores shard data A, so it uses hA as the target challenge.

[0150] The specific implementation of steps 407 to 410 is the same as that of steps 304 to 307 and will not be repeated here.

[0151] In the above technical solution, the verification node does not send n challenges directly to the storage node, but sends the index values of n challenges. In this way, the storage node can select any selection index value from the n index values and only obtain the selection challenge corresponding to the selection index value, but cannot obtain other challenges. In this way, the effect of hiding the other challenges of the verification node is achieved, ensuring the security of other challenges sent by the verification node.

[0152] Figure 5 An embodiment of a specific method for determining a selection challenge provided by an embodiment of the present invention is illustrated, including:

[0153] Step 501: The verification node sends index values of n challenges corresponding to n stored data to the storage node.

[0154] For example, the verification node sends 4 index values corresponding to 4 stored data to the storage node, which are 1, 2, 3 and 4 respectively. Figure 6 A specific interactive process for determining and selecting a challenge is shown.

[0155] In step 502 , the storage node selects any selected index value from the n index values, encrypts the selected index value using a first key to obtain a first ciphertext, and sends the first ciphertext to the verification node.

[0156] For example, the storage node selects an index value s=4 from the four index values, generates a first key r, and uses the formula y=r×s to obtain a first ciphertext y. The first ciphertext y is sent to the verification node.

[0157] In step 503, the verification node uses the second key, the first ciphertext, and the index value of any of the n challenges to calculate the challenge corresponding to the index value, obtains n second ciphertexts corresponding to the n challenges, and sends the n second ciphertexts to the storage node.

[0158] For example, the verification node generates a second key k and uses the second key k, the first ciphertext y, and the index value of any challenge to calculate n challenges. For example, the n challenges are calculated using the formula a = k, b = m * y * k / i, where m is any challenge and i is the index value corresponding to any challenge.

[0159] For the first challenge, calculate a1 = k, b1 = (hA) * y * k / 1; for the second challenge, calculate a2 = k, b2 = (hB) * y * k / 2; for the third challenge, calculate a3 = k, b3 = (hC) * y * k / 3; for the fourth challenge, calculate a4 = k, b4 = (hD) * y * k / 4; the four second ciphertexts are: (a1, b1), (a2, b2), (a3, b3), and (a4, b4). Send the four second ciphertexts to the storage node.

[0160] In step 504 , the storage node uses the first key to respectively calculate the n second ciphertexts to obtain n challenge values, and determines the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

[0161] For example, the storage node performs the following calculation on the four second ciphertexts: c = b / (a*r), where r is the first key, and obtains four challenge values c1, c2, c3, and c4. Figure 6 As shown in the figure, only c4 can get the hash value hD. The remaining c1, c2, and c3 are not real hash values, but hash values multiplied by a number. Specifically, the number of digits does not conform to the preset hash value rules, or directly displays garbled characters.

[0162] It can be imagined that when the selection index value selected by the storage node is 01, only the first challenge value hA can be solved, and the remaining three challenge values do not meet the preset conditions, and the storage node will not know the specifics of the remaining three challenges.

[0163] In the above technical solution, the storage node encrypts the selected index value based on the first key to obtain the first ciphertext, and sends the first ciphertext to the verification node. In this way, the verification node cannot know which challenge the storage node has selected. If the storage node later provides a storage proof, the verification node will not immediately determine which challenge the storage proof corresponds to, and cannot quickly construct the Merkle tree, reducing the possibility of the verification node doing malicious things. In addition, the verification node uses the second key, the first ciphertext and the index value of any challenge among the n challenges to calculate the challenge corresponding to the index value to obtain n second ciphertexts corresponding to the n challenges. In this way, the storage node obtains n second ciphertexts but cannot obtain n challenges. It can only calculate the n second ciphertexts separately using the first key to obtain n challenge values. Since the first key is determined by the storage node, the storage node encrypts the selected index value using the first key to obtain the first ciphertext, and the first ciphertext is also used in the determination of the n second ciphertexts. Therefore, only the challenge value corresponding to the selected index value determined by the storage node meets the preset conditions. Then, the storage node obtains the selected challenge corresponding to the selected index value, and in the entire process, the storage node cannot know other challenges except the selected challenge, which plays a role in protecting other challenges except the selected challenge and improves the security of the blockchain system.

[0164] Optionally, the storage node encrypts the selected index value using the first key and the third key to obtain a first ciphertext. For example, the third key is a random number p, and the first ciphertext is obtained by the following formula: y = r × s × mod (p).

[0165] In this way, the security of the first ciphertext is improved, and the difficulty for the verification node to obtain the selected index value is increased; at the same time, because the n second ciphertexts are also encrypted using the first ciphertext, it is also more difficult for the storage node to obtain other challenges except the selected challenge.

[0166] Figure 7 Shows the Figure 6 Another possible interactive process for determining the selection challenge.

[0167] Figure 7 In [1], the verification node selects two generators g and h of G and generates p, where p represents the prime order of G's elliptic curve and should be as close to 2 to the power of 256 as possible. {g, h, p, n} is sent to the storage node. n is the number of challenges, for example, n is 4.

[0168] The storage node generates a random number s, which is greater than 0 and less than or equal to 4. s indicates that the storage node selects the sth challenge. The storage node generates the first key r, where r∈G. By the following formula y=g r ·h s(modp) obtains the first ciphertext y and sends y to the verification node.

[0169] The verification node encrypts the n challenges using the first ciphertext y, g, h and the index value corresponding to each challenge. Encryption is performed using the following formula:

[0170]

[0171] Obtain n second ciphertexts. For example, if n is 4, then obtain four second ciphertexts: (a1, b1), (a2, b2), (a3, b3), and (a4, b4). Send these four second ciphertexts to the storage node.

[0172] After receiving n second ciphertexts, the storage node uses the first key r to calculate the challenge value of each second ciphertext. The challenge value c is calculated by the following formula s :

[0173]

[0174] For example, after calculating c1, c2, c3, and c4, if the storage node selects the second challenge value, it can only solve c2, and the value corresponding to c2 is the hash value hB. It cannot solve the remaining three challenges because none of the remaining three challenges meet the preset conditions, such as the number of digits not meeting the preset rules or directly displaying garbled characters. If the storage node selects the third challenge value, it can only solve c3, and the value corresponding to c3 is the hash value hB. It cannot solve the remaining three challenges because none of the remaining three challenges meet the preset conditions, such as the number of digits not meeting the preset rules or directly displaying garbled characters.

[0175] If the storage node receives a selection challenge of hB, and the target storage data it stores is shard data A, it will not determine the selection challenge as the target challenge and will not present the storage proof; if the storage node receives a selection challenge of hA, and the target storage data it stores is shard data A, it will determine the selection challenge as the target challenge and present the storage proof.

[0176] As can be seen in the above scheme, because the n challenges are kept secret from the storage node, the storage node needs to determine the target challenge in multiple rounds. This means that multiple random numbers s are generated and multiple rounds of interaction are conducted before the selected challenge is likely to be the target challenge. This increases the time and number of times the storage node needs to obtain the target challenge, and the cost for the verification node to reconstruct the Merkle tree increases.

[0177] Furthermore, because the challenge selected by the storage node is kept secret from the verification node, the verification node also needs to verify the corresponding challenge through multiple rounds of verification. This also increases the time and number of times for the storage node to obtain the target challenge, and the cost of reconstructing the Merkle tree for the verification node. This reduces the possibility of malicious behavior by the verification node and improves the security of the blockchain.

[0178] Optionally, when the upload node sends shard data to each storage node, it can send encoded shard data. Specifically, the original data is sharded to obtain multiple shard data, and each shard data is encoded to obtain encoded data for each shard data. When encoding each shard data, a directed acyclic graph is used, which makes the encoding more regular and structured.

[0179] Figure 8 shows a possible directed acyclic graph, according to Figure 8 The DAG shown in the figure is encoded. This encoding method draws on the data structure of a skip list to quickly locate shard data and reorganize the data relationships between shards. The resulting data is stored in an adjacency matrix or adjacency list to store the corresponding relationship between shards and arcs.

[0180] For example, when encoding, the encoding data corresponding to each fragment data is stored, and the Figure 8 The directed acyclic graph shown in the figure. After obtaining the encoded data of a shard data through a storage node, the parent node of the encoded data can be queried in the directed acyclic graph, and the encoded data can be decoded through the parent node of the encoded data to obtain the shard data.

[0181] The above method improves the efficiency of obtaining sharded data and improves the operating efficiency of the blockchain network.

[0182] Based on the same technical concept, Figure 9 The structure of a storage proof device provided by an embodiment of the present invention is exemplarily shown, and the structure can execute the storage proof process.

[0183] like Figure 9 As shown, the device specifically includes:

[0184] A first sending unit 901 is configured to send n challenges corresponding to n storage data to a storage node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; n is an integer greater than 1;

[0185] A first receiving unit 902 is configured to receive a storage certificate sent by the storage node; the storage certificate is generated by the storage node based on a target challenge among the n challenges; the target challenge is a challenge corresponding to the target storage data stored by the storage node itself;

[0186] The first processing unit 903 is used to calculate n verification values of the storage proof and the n challenges respectively, determine the target challenge among the n challenges according to the n verification values; and determine whether the target storage data is stored in the storage node according to the target challenge.

[0187] In some embodiments, the first sending unit 901 is specifically configured to:

[0188] Sending n challenge index values corresponding to n stored data to the storage node; the storage node is used to select any selected index value from the n index values, encrypt the selected index value, and send it to the verification node;

[0189] The n challenges are encrypted according to the encrypted selection index value, and the encrypted n challenges are sent to the storage node; the storage node is used to determine the selection challenge corresponding to the selection index value among the n encrypted challenges, and if it is determined that it has stored the storage data corresponding to the selection challenge, the selection challenge is determined as the target challenge.

[0190] In some embodiments, the first sending unit 901 is specifically configured to:

[0191] receiving a first ciphertext sent by the storage node; the first ciphertext is obtained by the storage node encrypting the selection index value using a first key;

[0192] Calculating the challenge corresponding to the index value using the second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges;

[0193] The n second ciphertexts are sent to the storage node; the storage node is used to use the first key to calculate the n second ciphertexts respectively to obtain n challenge values, and determine the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

[0194] In some embodiments, the first sending unit 901 is specifically configured to:

[0195] The number n of challenges is sent to the storage node; the storage node is used to generate a random number greater than 0 and less than or equal to n as a selection index value, and encrypt the selection index value and send it to the verification node.

[0196] Based on the same technical concept, Figure 10 The structure of a storage proof device provided by an embodiment of the present invention is exemplarily shown, and the structure can execute the storage proof process.

[0197] like Figure 10 As shown, the device specifically includes:

[0198] The second receiving unit 1001 is configured to receive n challenges sent by the verification node, each corresponding to n storage data, where the challenges are used to verify whether the storage node stores the corresponding storage data; n is an integer greater than 1;

[0199] The second processing unit 1002 is configured to determine a target challenge from the n challenges; the target challenge being a challenge corresponding to the target storage data stored by the storage node itself; and generate a storage certificate based on the target challenge;

[0200] The second sending unit 1003 is used to send the storage proof to the verification node; the verification node is used to calculate n verification values of the storage proof and the n challenges respectively, determine the target challenge among the n challenges according to the n verification values, and determine whether the target storage data is stored in the storage node according to the target challenge.

[0201] In some embodiments, the second receiving unit 1001 is specifically configured to:

[0202] Receiving index values of n challenges corresponding to n stored data respectively, sent by the verification node;

[0203] The second processing unit 1002 is specifically configured to:

[0204] Selecting any selected index value from the n index values, encrypting the selected index value and sending it to the verification node; the verification node is used to encrypt the n challenges according to the encrypted selected index value, and sending the encrypted n challenges to the storage node;

[0205] Determining a selection challenge corresponding to the selection index value among the encrypted n challenges;

[0206] If it is determined that the storage data corresponding to the selected challenge is stored, the selected challenge is determined as the target challenge.

[0207] In some embodiments, the second sending unit 1003 is specifically configured to:

[0208] Encrypting the selected index value using a first key to obtain a first ciphertext; sending the first ciphertext to the verification node; the verification node is configured to encrypt the challenge corresponding to the index value using a second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges, and sending the n second ciphertexts to the storage node;

[0209] The second processing unit 1002 is specifically configured to:

[0210] The n second ciphertexts are respectively calculated using the first key to obtain n challenge values, and the challenge value that meets the preset conditions is determined as the selection challenge corresponding to the selection index value.

[0211] In some embodiments, the second processing unit 1002 is specifically configured to:

[0212] The selected index value is encrypted using the first key and the third key to obtain a first ciphertext.

[0213] In some embodiments, the second sending unit 1003 is further configured to:

[0214] If the storage node determines that it does not store the storage data corresponding to the selected challenge, it sends a feedback message to the verification node indicating that it does not store the storage data corresponding to the current selected challenge.

[0215] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Figure 11 As shown, it includes at least one processor 1101 and a memory 1102 connected to the at least one processor. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Figure 10 For example, the processor 1101 and the memory 1102 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.

[0216] In an embodiment of the present application, the memory 1102 stores instructions that can be executed by at least one processor 1101. The at least one processor 1101 can execute the steps of the above-mentioned storage proof method by executing the instructions stored in the memory 1102.

[0217] The processor 1101 is the control center of the computer device. It can connect the various components of the computer device using various interfaces and lines. It can perform storage certification by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102. In some embodiments, the processor 1101 may include one or more processing units. The processor 1101 may integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, and application programs, while the modem processor mainly handles wireless communications. It is understood that the modem processor may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.

[0218] The processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0219] Memory 1102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0220] Based on the same technical concept, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer-executable program. The computer-executable program is used to enable a computer to execute the storage proof method listed in any of the above methods.

[0221] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0222] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.

[0223] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0224] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0225] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A storage proof method, characterized in that: include: The verification node sends n challenges corresponding to n stored data to the storage node, wherein the challenges are used to verify whether the storage node stores the corresponding stored data; Said n is an integer greater than 1; The verification node receives the storage certificate sent by the storage node; The storage proof is generated by the storage node based on the target challenge among the n challenges; The target challenge is a challenge corresponding to the target storage data stored by the storage node itself; The verification node calculates the storage proof and the n verification values of the n challenges respectively to obtain n calculation roots, and compares the calculation roots with the roots in the blockchain ledger. If they are consistent, it is determined that the target storage data is stored in the storage node; The storage node secretly selects a challenge as a target challenge for proof, and the verification node receives the storage proof of the target challenge sent by the storage node, where the storage proof is a hash value of other storage nodes; The root in the blockchain account book is a tree constructed based on the hash value of each shard data. The root of the tree is stored in the blockchain account book and each storage node. The shard data is obtained by sharding the original data.

2. The method according to claim 1, wherein The verification node sends n challenges to the storage node, each corresponding to n stored data, including: The verification node sends n challenge index values corresponding to n stored data to the storage node; the storage node is used to select any selected index value from the n index values, encrypt the selected index value, and then send it to the verification node; The verification node encrypts the n challenges according to the encrypted selection index value and sends the encrypted n challenges to the storage node; the storage node is used to determine the selection challenge corresponding to the selection index value among the n encrypted challenges, and if it is determined that it stores the storage data corresponding to the selection challenge, it determines the selection challenge as the target challenge.

3. The method according to claim 2, wherein The verification node encrypts the n challenges according to the encrypted selection index value and sends the encrypted n challenges to the storage node, including: The verification node receives a first ciphertext sent by the storage node; the first ciphertext is obtained by the storage node encrypting the selection index value using a first key; The verification node calculates the challenge corresponding to the index value using the second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges; The verification node sends the n second ciphertexts to the storage node; the storage node is used to use the first key to calculate the n second ciphertexts respectively to obtain n challenge values, and determine the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

4. The method according to claim 2, wherein The verification node sends n challenges to the storage node, each corresponding to n stored data, including: The verification node sends the number n of challenges to the storage node; the storage node is used to generate a random number greater than 0 and less than or equal to n as a selection index value, encrypt the selection index value and send it to the verification node.

5. A storage proof method, characterized in that: include: The storage node receives n challenges corresponding to n storage data respectively sent by the verification node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; n is an integer greater than 1; The storage node determines a target challenge among the n challenges; The target challenge is a challenge corresponding to the target storage data stored by the storage node itself; The storage node generates a storage certificate based on the target challenge; The storage node sends the storage certificate to the verification node; The verification node is used to calculate the n verification values of the storage proof and the n challenges respectively, to obtain n calculation roots, and compare the calculation roots with the roots in the blockchain ledger. If they are consistent, it is determined that the target storage data is stored in the storage node; The storage node secretly selects a challenge as a target challenge to be proved, and sends the storage proof of the target challenge to the verification node. The storage proof is the hash value of other storage nodes. The root in the blockchain account book is a tree constructed based on the hash value of each shard data. The root of the tree is stored in the blockchain account book and each storage node. The shard data is obtained by sharding the original data.

6. The method according to claim 5, wherein The storage node receives n challenges from the verification node, each corresponding to n stored data, including: The storage node receives index values of n challenges corresponding to n stored data respectively, sent by the verification node; The storage node determines a target challenge from the n challenges, including: The storage node selects any selected index value from the n index values, encrypts the selected index value, and sends it to the verification node; the verification node is used to encrypt the n challenges according to the encrypted selected index value, and send the encrypted n challenges to the storage node; The storage node determines the selection challenge corresponding to the selection index value from the encrypted n challenges; If the storage node determines that it stores the storage data corresponding to the selected challenge, it determines the selected challenge as the target challenge.

7. The method according to claim 6, wherein The storage node encrypts the selected index value and sends the encrypted value to the verification node, including: The storage node encrypts the selected index value using a first key to obtain a first ciphertext; the first ciphertext is sent to the verification node; the verification node is configured to encrypt the challenge corresponding to the index value using a second key, the first ciphertext, and the index value of any challenge among the n challenges to obtain n second ciphertexts corresponding to the n challenges, and send the n second ciphertexts to the storage node; The storage node determines the selection challenge corresponding to the selection index value from the encrypted n challenges, including: The storage node uses the first key to calculate the n second ciphertexts respectively to obtain n challenge values, and determines the challenge value that meets the preset conditions as the selection challenge corresponding to the selection index value.

8. The method according to claim 7, wherein The storage node encrypts the selected index value using a first key to obtain a first ciphertext, including: The storage node encrypts the selected index value using the first key and the third key to obtain a first ciphertext.

9. The method according to claim 6, wherein Also includes: If the storage node determines that it does not store the storage data corresponding to the selected challenge, it sends a feedback message to the verification node indicating that it does not store the storage data corresponding to the current selected challenge.

10. A storage certification device, characterized in that: include: A first sending unit is configured to send n challenges corresponding to n storage data to a storage node, wherein the challenges are used to verify whether the storage node stores the corresponding storage data; wherein n is an integer greater than 1; A first receiving unit, configured to receive a storage certificate sent by the storage node; The storage proof is generated by the storage node based on the target challenge among the n challenges; The target challenge is a challenge corresponding to the target storage data stored by the storage node itself; A first processing unit is configured to calculate n verification values of the storage proof and the n challenges respectively to obtain n calculation roots, and compare the calculation roots with the roots in the blockchain ledger. If they are consistent, it is determined that the target storage data is stored in the storage node; The storage node secretly selects a challenge as the target challenge for proof, and the verification node receives the storage proof of the target challenge sent by the storage node, where the storage proof is the hash value of other storage nodes; The root in the blockchain account book is a tree constructed based on the hash value of each shard data. The root of the tree is stored in the blockchain account book and each storage node. The shard data is obtained by sharding the original data.

11. A storage certification device, characterized in that: include: A second receiving unit is configured to receive n challenges sent by the verification node, each corresponding to n storage data, where the challenges are used to verify whether the storage node stores the corresponding storage data; where n is an integer greater than 1; a second processing unit, configured to determine a target challenge among the n challenges; The target challenge is a challenge corresponding to the target storage data stored by the storage node itself; generating a storage proof based on the target challenge; A second sending unit, configured to send the storage proof to the verification node; The verification node is used to calculate the n verification values of the storage proof and the n challenges respectively, to obtain n calculation roots, and compare the calculation roots with the roots in the blockchain ledger. If they are consistent, it is determined that the target storage data is stored in the storage node; The storage node secretly selects a challenge as a target challenge to be proved, and sends the storage proof of the target challenge to the verification node. The storage proof is the hash value of other storage nodes. The root in the blockchain account book is a tree constructed based on the hash value of each shard data. The root of the tree is stored in the blockchain account book and each storage node. The shard data is obtained by sharding the original data.

12. A computing device, characterized in that include: memory for storing computer programs; A processor, configured to call a computer program stored in the memory and execute the method according to any one of claims 1 to 9 according to the obtained program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Cloud storage possession proving method and system based on block chain and medium

    CN111222176A