Efficient file sharing interactive verification method and file sharing method based thereon
By introducing an interactive space-time proof mechanism into the P2P file sharing system and using Merkle tree and PL-PoW to verify file sharing qualifications, the security and resource waste problems of the P2P file sharing system are solved, and efficient and secure file sharing verification is achieved.
Patent Information
- Application Number
- CN202110953891.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-19
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-08-19
AI Technical Summary
Existing P2P file sharing systems are subject to security issues such as malicious user attacks, centralized server single point failure, and data tampering. In addition, existing interactive verification protocols cannot effectively verify the relevance of file content to downloader needs, resulting in resource waste and low verification efficiency.
An interactive space-time proof mechanism is used to associate file content with a verification protocol. Through mutual verification between file sharers, Merkle trees and proof of work with limited parallel computing (PL-PoW) are used to ensure the verification of file sharing qualifications, avoid reliance on third parties, and ensure that file downloaders have what they need.
It achieves efficient verification of file sharing qualifications, reduces computational complexity, ensures that the files required by file downloaders are correctly shared without leaking privacy information, and avoids resource waste and security risks.
Smart Images

Figure CN115712915B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of blockchain technology and file sharing, and in particular to an efficient file sharing interactive verification method and a file sharing method based thereon. Background Art
[0002] Distributed file sharing based on P2P technology is widely used on the internet. Common applications include BitTorrent, eDonkey, eMule, μTorrent, Napster, and KaZaA. These applications rely on online nodes to transfer files to each other, greatly improving file sharing efficiency. To ensure that resources in P2P file sharing networks are not depleted, a large number of online users must continuously share files. Therefore, an incentive mechanism that attracts more users to participate in file sharing is crucial for the normal operation of P2P file sharing systems. Traditional incentive mechanisms rely on honest nodes in the network or centralized servers to calculate rewards and penalties, which poses security risks such as malicious user attacks, single point failure of centralized servers, and data tampering.
[0003] An effective solution to these problems is to combine blockchain technology with P2P file sharing systems, using digital currency to reward users who share files. Blockchain's interactive verification protocol ensures that users participating in file sharing are qualified to share files, while its distributed and tamper-resistant nature prevents single points of failure and information tampering. Currently, research on blockchain-based file sharing technology is divided into two directions.
[0004] One approach is to integrate P2P file sharing systems with mature blockchain technologies, such as BTFS, BlockIPFS, Siacoin, and Storj. This approach focuses on integrating the file sharing process with existing blockchain interactive verification protocols, relying on existing blockchain interactive verification protocols to verify a user's file sharing eligibility. To earn token rewards by sharing a file, the user must save the file and possess the other capabilities required to complete the interactive verification protocol, such as robust computing power, extensive proof-of-stake, and ample storage space. These requirements not only waste resources, but also make it difficult to verify that the shared file is indeed what the downloader wants, as the interactive verification protocol is not tied to the content of the shared file.
[0005] Another area of research is interactive verification protocols for file sharing scenarios. These protocols use storage resources as credentials to verify file sharing eligibility. For example, Proof of Space (PoSpace) verifies eligibility by proving to the outside world that a certain amount of disk space is occupied, and Simple Proof of Spacetime (PoST) allows users to prove to the outside world that they have stored a certain amount of files over a period of time. However, these interactive verification protocols only consider file size and cannot be linked to file content, making it difficult to verify whether the file is the one the downloader needs. Filecoin is a popular blockchain-based file system (primarily used for file storage, but also for file sharing). Its interactive verification protocol is linked to file content. Filecoin uses Proof of Replication (PoRep) and Proof of Spacetime (PoST) to prove to the verifier that a user has indeed stored a specific file for a certain period of time. It also uses a more complex zero-knowledge proof, zk-SNARKs, to ensure that private information is not leaked during the verification process. However, in actual use, zk-SNARKs has low operating efficiency and relies on a trusted third party to generate public parameters, which will lead to new security risks.
[0006] Published patent application CN111950027A provides a file sharing method based on blockchain smart contracts. The implementation process is as follows: the sharer logs into the DAPP, selects the local file to be shared, selects / enters the DAPP account of the sharer, and the smart contract stores the shared file and the sharer on the chain, returns the chain ID of the shared file, generates a sharing link based on the chain ID, and sends it out. The recipient of the shared link opens the sharing link and is prompted to log in to the DAPP. If the recipient is verified to be the sharer, the recipient is allowed to view / download the shared file. However, interaction between the sender and the receiver is required.
[0007] Published patent application CN112100144A provides a blockchain-based file sharing method. The implementation process is as follows: encrypting a source file according to a target encryption method; segmenting the encrypted source file to obtain at least one segmented file; and uploading the segmented file to a blockchain network for storage. The segmented file includes an authentication sequence generated based on an encryption key, used by the file recipient to verify that the received file is the target segmented file. The encryption key is the key used for the target encryption method. However, this method does not allow other user nodes to verify the correctness of the file. Summary of the Invention
[0008] In response to the technical problems existing in existing solutions, the present invention discloses an efficient file sharing interactive verification method and a file sharing method based on the method. The core idea is to associate file content and protocol, and use interactive space-time proof to complete file sharing qualification verification. Users can prove to the outside world that a specific file has indeed been stored for a period of time.
[0009] The technical solutions of the present invention are as follows:
[0010] An efficient file sharing interactive verification method, comprising the following steps:
[0011] 1) File sharer P generates an initial proof file and broadcasts the user ID P Random sampling of the initial proof documents, so that any file sharer V who saves the shared file can generate a random challenge ch;
[0012] 2) Sending the response generated for the random challenge ch to the file sharer V, so that after the file sharer V verifies the response, the file sharer P is qualified to share the file.
[0013] Furthermore, the initial certification documents are generated through the following steps:
[0014] 1) Divide the shared file F into blocks and calculate the message digest H of each block B[k] B [k];
[0015] 2) Each message digest H B [k] is divided into p slices, and a node list N[i] is generated for each slice P;
[0016] 3) Get the node list N[i] that meets the set conditions by trying different random numbers;
[0017] 4) Based on the node list N[i] that meets the set conditions, the proof phase is performed using a fixed random challenge ch′ to generate an initial proof document.
[0018] Furthermore, the response is generated by the following steps:
[0019] 1) Based on the total number of node lists, calculate the index j and generate an array CH of size m according to the random challenge ch, where each element CH[i] in the array occupies j-1 bits;
[0020] 2) Select the node list N[i] using the value of element CH[i] as the sequence number, connect the selected node list N[i], and calculate the summary value D;
[0021] 3) After concatenating the summary value D with all the node lists N[i], calculate the hash value HD[i];
[0022] 4) Each hash value HD[i] is used as a leaf node g to construct a Merkle tree. The value of the parent node in the Merkle tree is obtained by concatenating the two child nodes and performing a random prediction. The root label of the Merkle tree is represented by nroot.
[0023] 5) Calculate the index x based on the total number of leaf nodes, and after making a random prediction for the root label nroot, cut it into a set of arrays E of size q;
[0024] 6) Calculate the path π from each leaf node g to the root node g , where the path π g Contains the nonce of the corresponding node; when E[g] is an odd number, the path π g Contains the path from the leaf node N[E[g]] to the root node, E[g] represents the g-th element of the array E; when E[g] is an even number, the path π g Contains the path from leaf node N[E[g]] and leaf node N[E[g]-1] to the root node;
[0025] 7) Output response X = {nroot,π1,π2,…,π g}.
[0026] Furthermore, the array CH is generated by the following steps:
[0027] 1) Use the hash algorithm to calculate the hash value of the random challenge ch;
[0028] 2) Cut the hash value to generate an array CH.
[0029] Furthermore, the random oracle method includes: a hash-based message authentication code algorithm.
[0030] Furthermore, the response is verified by the following steps:
[0031] 1) Generate an array CH of size m based on the random challenge ch;
[0032] 2) Select a block based on the value of each element in the array CH′, connect the selected blocks and calculate the summary D;
[0033] 3) After randomly predicting the root label nroot, cut it into a set of arrays of size q;
[0034] 4) According to the value of E[g], calculate the index of the selected block, thereby obtaining the corresponding block B[k] and calculating the corresponding summary H B [k];
[0035] 5) In Abstract H B[k], where the shard P[g] corresponds to the node list N[g];
[0036] 6) Verify path π g The validity of each leaf node in;
[0037] 7) If the leaf node is valid, verify the value of array HD[j];
[0038] 8) If the value of array HD[j] is correct, then when g is an odd number, verify the path π g is a valid Merkle path from the leaf node HD[P[g]] to the root node; when g is an even number, verify the path π g Contains a valid Merkle path from leaf nodes HD[P[g]] and HD[P[g]-1] to the root node;
[0039] 9) If the path π g If valid, the response is verified.
[0040] A storage medium stores a computer program, wherein the computer program is configured to execute the above method when running.
[0041] An electronic device includes a memory and a processor, wherein the memory stores a program for executing the above method.
[0042] A file sharing method based on interactive verification of file sharing, comprising:
[0043] 1) The file downloader publishes an order containing the required file in the sharing market;
[0044] 2) Through any of the above methods, the file sharer P who saves the required file proves that he has the file sharing qualification of the required file;
[0045] 3) The file sharer P who completes the file sharing qualification certificate first shares the required files.
[0046] Furthermore, the order also includes several tokens, including consumption tokens, reward tokens and downloader mortgage tokens. Consumption tokens are used to upload data to the chain, reward tokens are used to reward legal file sharers, and downloader mortgage tokens are used to ensure the legitimacy of file downloaders. When the file sharer P proves that he has the file sharing qualifications for the required file, he needs to pay the sharer mortgage tokens. After sharing the required file, the file sharer P obtains consumption tokens.
[0047] Compared with the existing technology, the efficient file sharing interactive verification protocol of the present invention has the following advantages:
[0048] 1. The present invention provides an efficient interactive verification protocol for file sharing. It links file content with an interactive verification protocol and uses interactive space-time proof to verify file sharing qualifications. By mutual verification between file sharers, it ensures that the file is indeed what the file downloader needs. The consensus process of the protocol does not disclose the file's privacy information and does not rely on a third party.
[0049] 2. The present invention provides an efficient file sharing interactive verification protocol, which has lower computational complexity in the proof and verification stages and can meet certain security strengths. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is the flow chart of the space-time proof of the present invention.
[0051] Figure 2 This is an efficient file sharing interactive verification protocol prover initialization phase of the present invention.
[0052] Figure 3 This is an efficient prover proving stage of the file sharing interactive verification protocol of the present invention.
[0053] Figure 4 This is a new blockchain-based file sharing model of the present invention.
[0054] Figure 5 The invention is an efficient file sharing interactive verification protocol to prove the efficiency of file generation.
[0055] Figure 6 The invention discloses an efficient file sharing interactive verification protocol for generating a file size test chart.
[0056] Figure 7 This is a test chart of the time consumption in the generation and verification phases of an efficient file sharing interactive verification protocol of the present invention. DETAILED DESCRIPTION
[0057] The file sharing interactive verification protocol proposed in the present invention is mainly based on time-space proof. The specific implementation method of this proof is given below.
[0058] The file sharing interactive verification method of the present invention is a method in which file sharers who save the same file mutually verify whether the other party has stored a specific file within a certain period of time: an interactive protocol. It is specifically described as follows: first, the prover P generates an initial proof document based on the user identification and the shared file, and the prover P sends the user identification and a random sampling of the initial proof document to the verifier V; after receiving the user identification and the random sampling of the proof document, the verifier V sends a random challenge to the prover P, and the prover P generates a response to the random challenge and sends it to the verifier V; the verifier V verifies the response. If the verifier successfully verifies, the prover will obtain the transaction reward; otherwise, if the verifier fails to verify, the prover loses the reward. Therefore, the verifier does not need to return the verification result to the prover.
[0059] Proof of Spacetime (PoST) is a method for file sharers to prove to the outside world that a file has been stored continuously for a period of time. Specifically, all sharers who store the same file verify each other using a "challenge-response" interactive protocol. The sharer who stores the file acts as the prover P, and other file sharers who verify P's qualifications act as verifiers V.
[0060] At the same time, in order to guide file sharers to use storage resources instead of computing resources, the present invention limits the parallelism of computing to a certain extent and proposes a method to limit the generation of proof files that cannot be accelerated by parallel computing: Parallel Limited Proof of Work (PL-PoW). A relatively simple PL-PoW is to output feedback random oracle:
[0061] {H[i]=H(H[i-1]‖x)|H[-1]=0,i≥0,x∈{0,1} k ,H[i] <p}
[0062] Where p is a parameter that controls the difficulty of proof-of-work, x is a random number, k is the length of the random number, and H is the hash algorithm. The calculation process of the i-th random oracle depends on the results of the i-1 random oracle, thus limiting parallel operations.
[0063] The space-time proof process of the present invention is as follows: Figure 1 As shown, it consists of three stages:
[0064] 1) Initialization phase, such as Figure 2 As shown:
[0065] This stage is performed by the prover P, and the input prover P identity id∈{0,1} * , share files F∈{0,1} * , the size of the shared file is l. This stage includes the following steps:
[0066] ① Divide F into blocks and represent it with array B, where The length of each element in array B is s, and the part that is not a whole block is filled in the end;
[0067] ②For each block, calculate its message digest, that is Where CRH is a collision-resistant hash function, H B [k] is the message digest of the k-th element in array B;
[0068] ③For each H B [k], cut it into p slices, where H B (k) = P[k·p] ‖ P[k·p+1] ‖…‖ P[(k+1)·p-1], where the length of the elements in P is t, and if it is not enough, the complement is performed;
[0069] ④ For each P element, generate a node list, represented by array N, that is, {N[i]=H PL-PoW (id||N[i-1]||nonce)|N[-1]=0,0≤i<(k+1)·p}, H PL-PoW To limit the workload proof function for parallel computation, the first t bits of N[i] are equal to P[i], and nonce is a random number. When generating N[i], it is necessary to ensure that the first t bits of N[i] are equal to P[i]. The length of t determines the difficulty of limiting the workload proof for parallel computation. This value can be adjusted dynamically. In order to obtain N[i] that meets this condition, the prover needs to try different nonce values. This operation makes the actual cost of the prover continuously saving the proof file lower than the cost of recalculating using PL-PoW resources, which encourages the prover to be more willing to save the proof file;
[0070] ⑤ Use a fixed ch to execute the proof phase (for example, ch = 0) to generate an initial proof file. The prover will store the initial proof file locally (this step consumes time and space resources). The prover can then make a correct response to the verifier at a lower computational cost.
[0071] ⑥ Broadcast the metadata of the shared file, the prover's identity ID and the initial proof file. The file metadata includes identification information such as file name, file hash value, file size, etc., without disclosing the file content.
[0072] 2) Proof stage, such as Figure 3 As shown:
[0073] This phase is performed by the prover P. When the prover P receives a random challenge ch from the verifier V, the specific steps are as follows:
[0074] ① According to the total number of nodes (k+1)·p-1, calculate the index j, which is expressed as 2 j-1 ≤(k+1)·p-1<2 j , then cut H(ch) (H is the hash algorithm) into a set of arrays of size m, where each element CH[i] of the array occupies j-1 bits;
[0075] ② Select nodes using the value of element CH[i] as the sequence number, connect these selected nodes and calculate their summary value {D = H(N[CH[0]] ‖ N[CH[1]] ‖… ‖ N[CH[m-1]])};
[0076] ③ Concatenate D with all nodes N[i] and calculate its hash value HD[i] = H(N[i]‖D)|i∈Z, 0≤i<(k+1)·p-1;
[0077] ④ Construct a Merkle tree whose leaf nodes are HD arrays. The value of the parent node in the Merkle tree is calculated by concatenating the two child nodes and then calculating the random oracle H. ch Get (H ch It is a hash-based message authentication code algorithm (Hmac), the key is ch), and nroot is used to represent the root label of the Merkle tree. Since the prover cannot obtain the challenge value ch in advance, this step must be performed after receiving the challenge value. If the prover saves the initial proof file, the Merkle tree construction process is efficient. Otherwise, the prover must rerun the initialization phase to generate the proof file. In order to save resources, the prover prefers to keep the proof file instead of regenerating it;
[0078] ⑤ According to the total number of Merkle tree child nodes, calculate the index x, which is expressed as 2 x-1 ≤(k+1)·p-1<2 x , then H ch (nroot) is cut into a set of arrays E of size q, where each element occupies x-1 bits and can be represented as Where E[g] represents the g-th element of array E;
[0079] ⑥Use π g Represents the Merkle path from the selected leaf node to the root node. If |E[g]| is an odd number, that is, the number of selected leaf nodes is an odd number, then π g Contains the path from N[E[g]] to the root nroot; if |E[g]| is an even number, that is, the number of selected leaf nodes is an even number, π gContains the path from N[E[g]] and N[E[g]-1] to the root nroot. The path also contains the nonce of the corresponding node;
[0080] ⑦ Output nroot,π1,π2,…,π g .
[0081] 3) Verification phase:
[0082] This phase is performed by the verifier V, which generates a random challenge ch and sends it to the prover P, waiting to receive nroot,π1,π2,…,π from the prover P. g , the specific steps are as follows:
[0083] ① According to the value of ch, calculate the value of H(ch) and cut it into a set of arrays CH of size m (the same as the prover P);
[0084] ② Select blocks based on the value of each element of the CH array, connect these selected blocks and calculate the summary D (the same as the prover P);
[0085] ③H ch (nroot) is split into a set of arrays E of size q (the same as the prover P);
[0086] ④ When g∈{0,…,q-1}, calculate the index of its related block according to the value of E[g], get the value of B[k], and calculate its summary H B [k]; in Abstract H B Select block P[g] from [k], P[g] corresponds to node N[g]; verify π g Is the node valid? Calculate N[E[g]]=H PL-PoW (id||N[E[g]-1]||nonce), check whether the first t bits of N[E[g]] are equal to P[E[g]], if g is an even number, calculate N[E[g]-1] = H (PL-PoW) (id||E[P[g]-2]||nonce), check whether the first t bits of N[E[g]-1] are equal to P[E[g]-1]; after the node is valid, verify the value of HD[j]; finally verify π g is a valid Merkle path from node HD[P[g]] to root nroot. If g is an even number, the validity of the Merkle path from node HD[P[g]-1] to root nroot must also be verified.
[0087] Based on the above method, a file sharing market with token circulation is constructed, such as Figure 4As shown, this file sharing application scenario includes two types of users: file downloaders and file sharers. File downloaders use interactive proofs to verify whether the file sharer actually stores the file and pay tokens to download the required file. File sharers spend storage resources to store the proof file and obtain tokens by sharing the file. Generating the proof file consumes computing power and takes a long time, while the actual cost of storing the proof file is low, and the correctness of the proof file is easy to verify. The steps include:
[0088] 1) File downloaders place a file download order on the sharing market and deposit a certain number of tokens in the order. The deposited tokens cannot be redeemed before the order expires. Tokens are divided into three parts: consumption, reward, and mortgage. Consumption tokens are used to upload data to the chain, reward tokens are used to reward legitimate file sharers, and mortgage tokens are used to ensure the legitimacy of file downloaders. Mortgage tokens can be fully redeemed after the file is successfully transferred.
[0089] 2) The file sharer stores the files that the file downloader needs. In order to participate in file sharing, the file sharer spends an appropriate "cost", that is, a proof of time and space, to prove that the file has indeed been stored for a period of time;
[0090] 3) When the corresponding order appears in the market, all sharers who have saved files consistent with the description in the order need to pay a certain amount of collateral tokens to the order, indicating that they are willing to join a "cluster" to share files and obtain rewards. The file sharer's collateral tokens cannot be redeemed before the order deadline;
[0091] 4) Multiple file sharers holding the same file compete for file sharing qualifications through a consensus protocol. The sharer who completes the time-space proof first will obtain the sharing qualification, and the remaining file sharers redeem the mortgage tokens;
[0092] 5) After the order is closed, the file sharer receives the file downloader's reward tokens and redeems his or her own mortgage tokens.
[0093] The file sharing interactive verification method of the present invention was used to conduct corresponding efficiency tests:
[0094] During the prover initialization phase, the program divides the file into multiple blocks, calculates the hash value of each block, and concatenates these hash values into block files. The block file sizes are 1KB, 5KB, 50KB, 500KB, 0.98MB, 1.95MB, 2.93MB, 3.90MB, and 4.88MB. Next, the program generates a proof file based on the block file. Depending on the value of t, the efficiency of proof file generation is as follows: Figure 5 For ease of display, Figure 5The displayed elapsed time is log2(t). Experimental results show that the elapsed time is linearly related to the size of the block file and exponentially related to the value of t.
[0095] The relationship between the size of the proof file and the block file is as follows Figure 6 As shown in Figure 2, experimental results show that the size of the proof file is linearly related to the size of the block file. As the value of t increases, the growth rate of the proof file size decreases. At this stage, generating the proof file requires a certain amount of computing resources. Due to the PL-PoW algorithm used, it is difficult to accelerate this process by increasing parallel computing methods. Therefore, file sharers are more willing to spend a certain amount of computing resources to generate and continuously save the proof file in advance.
[0096] During the prover's proof phase, the experimental program tested the time it takes for the prover to generate a response when it receives a challenge from the verifier. The challenge value is a 256-bit random string. Whenever a challenge is received, the prover uses the challenge value as a key to construct a new Merkel tree based on the pre-saved proof file. The complexity of constructing the Merkel tree is linearly related to the number of nodes, and the size of the newly generated Merkel tree is the same as the size of the proof file. If the prover does not generate the proof file in advance, but instead generates the proof file after receiving the challenge, this phase will be very time-consuming and ultimately lead to response failure. The relationship between the time consumed by the prover's proof phase and the block size is shown in the figure below. Figure 7 As shown in Figure 2, the experimental results show that when the t value increases, the time consumed in this stage will decrease. The reason is that when the t value increases, the proof file will become smaller.
[0097] The relationship between the time consumed by the verifier verification phase and the block size is as follows: Figure 7 As shown in the figure, the average verification time of the experiment is 199ms. ch (nroot) The efficiency of selecting leaf nodes has little to do with the size of the shared file, so the time consumed in this stage is relatively stable.
[0098] The above algorithm is only used to illustrate the technical solution of the present invention and does not limit it. Ordinary technicians in this field can modify or replace the technical solution of the present invention with equivalents without departing from the spirit and scope of the present invention. The scope of protection of the present invention shall be based on the claims.
Claims
1. An efficient file sharing interactive verification method, comprising the following steps: 1) File sharer P generates an initial proof file and broadcasts the user ID P Random sampling of the initial proof document is performed to enable any file sharer V who stores the shared file to generate a random challenge ch; wherein the initial proof document is generated by the following steps: Divide the shared file F into blocks and calculate the message digest H of the kth block B[k] B [k]; Each message digest H B [k] is divided into p slices, and a node list N[i] is generated for each slice p, 0≤i<(k+1)·p; By trying different random numbers, obtain the node list N[i] that meets the set conditions; Based on the node list N[i] that meets the set conditions, a fixed random challenge ch′ is used to perform the proof phase and generate the initial proof file; 2) Sending the response generated for the random challenge ch to the file sharer V, so that after the file sharer V verifies the response, the file sharer P is qualified to share the file; wherein the response is generated by the following steps: According to the total number of node lists, calculate the index j, and generate an array CH of size m based on the random challenge ch, where each element CH[i] in the array occupies j-1 bits; Select the node list N[i] using the value of element CH[i] as the serial number, connect the selected node list N[i], and calculate the summary value D; After concatenating the summary value D with all the node lists N[i], calculate the hash value HD[i]; Take each hash value HD[i] as a leaf node g and construct a Merkle tree. The value of the parent node in the Merkle tree is obtained by concatenating two child nodes and performing a random prediction. The root label of the Merkle tree is represented by nroot. According to the total number of leaf nodes, calculate the index x, and after randomly predicting the root label nroot, cut it into a set of arrays E of size q; Calculate the path π from each leaf node g to the root node g , where the path π g Contains the nonce of the corresponding node; when E[g] is an odd number, the path π g Contains the path from the leaf node N[E[g]] to the root node, E[g] represents the g-th element of the array E; when E[g] is an even number, the path π g Contains the path from leaf node N[E[g]] and leaf node N[E[g]-1] to the root node; Output response X={nroot,π1,π2,…,π g }.
2. The method according to claim 1, wherein Generate the array CH by following the steps below: 1) Use the hash algorithm to calculate the hash value of the random challenge ch; 2) Cut the hash value to generate an array CH.
3. The method according to claim 1, wherein Random oracle methods include: Hash-based message authentication code algorithm.
4. The method according to claim 1, wherein Verify the response by following these steps: 1) Generate an array CH of size m based on the random challenge ch; 2) Select a block based on the value of each element in array CH, concatenate the selected blocks and calculate the summary D; 3) After randomly predicting the root label nroot, cut it into a set of arrays of size q; 4) According to the value of E[g], calculate the index of the selected block, thereby obtaining the corresponding block B[k] and calculating the corresponding summary H B [k]; 5) In Abstract H B [k], where the shard P[g] corresponds to the node list n[g]; 6) Verify path π g The validity of each leaf node in; 7) If the leaf node is valid, verify the value of array HD[j]; 8) If the value of array HD[j] is correct, then when g is an odd number, verify the path π g is a valid Merkle path from the leaf node HD[P[g]] to the root node; when g is an even number, verify the path π g Contains a valid Merkle path from leaf nodes HD[P[g]] and GD[P[g]-1] to the root node; 9) If the path π g If valid, the response is verified.
5. A storage medium storing a computer program, wherein: The computer program is configured to execute the method according to any one of claims 1 to 4 when executed.
6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.
7. A file sharing method based on interactive verification of file sharing, comprising: 1) The file downloader publishes an order containing the required file in the sharing market; 2) The file sharer P who stores the required file proves that he has the file sharing qualification of the required file by any method of claims 1-4; 3) The file sharer P who completes the file sharing qualification certificate first shares the required files.
8. The method according to claim 7, wherein The order also includes several tokens, including consumption tokens, reward tokens and downloader mortgage tokens. Consumption tokens are used to upload data to the chain, reward tokens are used to reward legal file sharers, and downloader mortgage tokens are used to ensure the legitimacy of file downloaders. When the file sharer P proves that it has the file sharing qualifications for the required file, it needs to pay the sharer mortgage tokens. After sharing the required file, the file sharer P obtains consumption tokens.