Point-to-point content distribution downloading method based on block chain
By introducing blockchain technology into the peer-to-peer content distribution network, using smart contracts and security protocols, the problems of single-point problems, insufficient fairness and poor content confidentiality in the existing technology are solved, and an efficient, secure and fair content distribution process is achieved.
Patent Information
- Application Number
- CN202510050646.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-13
AI Technical Summary
The existing point-to-point content distribution network has problems such as single point problems, insufficient fairness and poor content confidentiality, which leads to the failure of participants to get the results they deserve and the storage and calculation costs are too high.
The blockchain-based peer-to-peer content distribution and download method is adopted to coordinate the content exchange process through smart contracts and security protocols to ensure completion, confidentiality, robustness and efficiency. The method includes the preparation phase, the download transmission phase and the decryption phase, using blockchain as a decentralized trusted third party to ensure fairness and security of content distribution.
It realizes fairness and security in the content distribution process, avoids single-point problems and content leakage, reduces storage and computing costs, and improves the efficiency and reliability of content distribution.
Smart Images

Figure CN119892846A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and in particular to a peer-to-peer content distribution and downloading method based on blockchain. Background Art
[0002] With the rapid growth of online interactive activities on the Internet, the demand for efficient content transmission is particularly urgent. In 2022, video traffic has accounted for 82% of Internet traffic. At the same time, according to the "Digital China Development Report (2020)", my country's mobile Internet access traffic has increased from 4.19 billion GB at the end of 2015 to 165.6 billion GB in 2020. This growing transmission of big data requires the support of content distribution networks. In traditional centralized content distribution networks, the edge cache servers for content transmission are deployed by centralized content distributors. Its shortcomings are: (1) Centralized content distribution services have single-point problems and are easily targeted by network attacks; (2) Users need to purchase pre-set bandwidth in advance to handle peak requests, and many idle service resources are wasted. These consumptions will be shared by users, resulting in high prices. To solve this problem, distributed peer-to-peer content distribution network technology has become a promising alternative. It can use the distributed network built by ordinary nodes and idle bandwidth to provide content distribution services. The peer-to-peer content distribution model is as follows: Figure 1 As shown in Figure 1, it mainly includes three roles: content provider, content distributor and content consumer. Figure 1 As shown, the relationship between the three roles is: the content provider provides content, pays fees to the content distributor for content distribution, and obtains fees paid by the content consumer for purchasing content; the content distributor sends content to the content consumer on behalf of the content provider, and obtains fees paid by the content provider; the content consumer obtains the content and pays fees to the content provider. In the content distribution process, the most important thing is to ensure the efficiency of distribution and that each participant obtains the results they deserve. However, typical attacks (for example, the content distributor may collude with the content consumer to obtain payment from the content provider without actually sending the content; the content provider may collude with the content consumer to prevent the distributor from obtaining the payment they deserve) are likely to cause some participants to not get the results they deserve, and these participants may leave the peer-to-peer network, eventually leading to the collapse of the entire peer-to-peer content distribution network. To this end, this patent combines blockchain as a decentralized trusted third party to coordinate the entire peer-to-peer content distribution process, based on smart contracts and security protocol design, to ensure the security and efficiency of the peer-to-peer content distribution download process.
[0003] Existing peer-to-peer content downloading methods are classified into the following categories:
[0004] (1) General peer-to-peer information exchange methods. There are many peer-to-peer information exchange methods, including the popular BitTorrent protocol. The well-known disadvantage of this type of method is that it cannot strictly guarantee fairness, which may lead to a serious imbalance between the input and output of participants, and eventually leave the content distribution network.
[0005] (2) Fair exchange protocol. A large number of fair exchange methods have been studied to ensure strict fairness. However, in the peer-to-peer content distribution scenario, the traditional definition of fairness is not sufficient to ensure the fairness of content distribution.
[0006] (3) Other related decentralized content distribution solutions. This type of method mainly has the problem of not being able to meet the confidentiality of the content, that is, during the distribution process, the content may be leaked to attackers. In addition, directly using existing methods will result in excessively high storage and computing costs on the blockchain, which is not practical. Summary of the invention
[0007] The purpose of the present invention is to provide a peer-to-peer content distribution and downloading method based on blockchain, which ensures completeness (any honest participant in the peer-to-peer content distribution network can get what he deserves. Specifically, the content distributor will receive a reward corresponding to the consumed bandwidth, the content consumer will obtain the correct content and pay the fee, and the content provider will provide the correct content and receive the corresponding reward), confidentiality (the content will not leak private information to attackers during transmission), robustness (using blockchain as a decentralized trusted third party to coordinate the content exchange process and resist attacks such as single point problems) and efficiency (the message load sent to the blockchain is small, achieving low storage and computing consumption on the blockchain; at the same time, the communication rounds are optimal, which is only related to the number of content blocks n, and no additional steps are required).
[0008] To achieve the above-mentioned purpose, the present invention provides a peer-to-peer content distribution and downloading method based on blockchain, which includes three stages: preparation stage, download transmission stage, and decryption stage;
[0009] Preparation phase: The content provider deploys the smart contract. After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The content provider selects one from the participating distributors. The content distributor receives the pair sequence of the content block sent by the content provider, verifies its signature, saves it locally after passing, and then sends a confirmation to the blockchain, indicating that the content distribution is ready. The pair sequence includes multiple "pairs", each of which includes the content block ciphertext and the content block ciphertext signature.
[0010] Download and transmission phase: Content consumers send download requests to the blockchain. After seeing the download request, the content distributor executes a verifiable fair distribution agreement with the content consumer. The content distributor then submits the "receipt" proof to the blockchain smart contract, thereby obtaining the content distribution fee paid by the blockchain to the content distributor.
[0011] Decryption phase: The content provider sends the encrypted decryption key array to the blockchain. The content consumer obtains the decryption key from the blockchain and decrypts the content. The content consumer then sends a confirmation to the blockchain. After receiving the confirmation, the blockchain will automatically pay the content provider the fee for providing the content immediately or after a period of time if no confirmation is received.
[0012] Preferably, the preparation stage comprises the following steps:
[0013] The content provider deploys a smart contract, where the contract parameters include the provider's public key pk_P, the unique identifier of the content H_m, the number of content blocks n, the confirmation time T_cf, the fee B_p that the provider will pay to the distributor for each content block distributed, and the fee B_c that the provider will charge to the content consumer for each content block;
[0014] After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The message includes the distributor's public key pk_D.
[0015] The content provider selects one from the participating distributors and then performs the following operations: randomly generates a master key mk, and calls the key tree generation algorithm KTGen to obtain the key tree KT according to the hash value H_mk of the master key and the number of content blocks n. The content provider stores mk and KT locally; uses the n leaf nodes of KT as the secret key to encrypt each content block, and then signs each encrypted content block to obtain the pair sequence of the content block, and sends the pair sequence to the selected content distributor;
[0016] The content distributor receives the sequence of content blocks sent by the content provider, verifies their signatures, saves them locally after passing, and then sends a confirmation to the blockchain, indicating that the content is ready for distribution.
[0017] Preferably, the download transmission stage includes the following steps:
[0018] The content consumer sends a download request to the blockchain. The parameters included in the message are the content consumer's public key pk_C and the initial download content block subscript ζ. By default, ζ = 1, indicating that the download starts from the first content block.
[0019] The content distributor and the content consumer execute a verifiable fair distribution protocol to transfer content. At the end, the content consumer obtains a pair sequence of content blocks, and the content distributor receives a "receipt" for the distributed content blocks.
[0020] The content distributor submits the latest "receipt" to the blockchain, and the smart contract verifies the receipt. If it passes, it automatically calculates the number of content blocks ctr distributed based on the subscript of the content block in the "receipt" and the subscript of the content block initially downloaded, and then automatically sends the corresponding fee ctr*B_p to the content distributor.
[0021] Preferably, the decryption stage includes the following steps:
[0022] The content provider calls the secret key element revealing algorithm RevealKeys according to the number of content blocks n, the initial content block subscript ζ, the number of distributed content blocks ctr calculated on the chain, and the master key hash value H_mk, generates the secret key element array RKArray that needs to be revealed, and then encrypts it with the asymmetric public key pk_C, and sends the ciphertext to the chain;
[0023] The content consumer obtains the encrypted key element array RKArray from the chain, and can preliminarily verify whether ctr decryption keys can be recovered. After that, it uses the private key corresponding to pk_C to decrypt, thereby obtaining the key element array, calling the recovery key algorithm RecoverKeys, and obtaining the key used to decrypt ctr content blocks. Then, the encrypted content block is decrypted to obtain the content block plaintext, and a confirmation is sent to the smart contract. The smart contract sends the corresponding fee ctr*B_c to the content provider, and the download process is completed.
[0024] Preferably, a verifiable fair distribution protocol may include:
[0025] For a sequence of n pairs, after receiving each content block ciphertext and content block ciphertext signature pair sent by the sender, the receiver verifies the ciphertext digital signature and sends back a "receipt" containing the content consumer's signature to confirm the sender's bandwidth contribution. After verifying the legitimacy of the "receipt", the sender continues to send the next content block. Either party may terminate the sending process.
[0026] By dividing the content into equal-sized chunks and numbering them, the sender always uses the latest receipt to calculate how many chunks were transferred in total and prove its total bandwidth contribution to any validator.
[0027] Preferably, the key tree generation algorithm KTGen obtains the key tree KT, inputs the number of content blocks n, the hash value H_mk of the randomly selected master key mk, and outputs a key tree. The key tree has n leaf nodes, and the structure is specifically as follows:
[0028] Initialize an array KT of length 2n-1. The first value of KT is H_mk. If n is 1, stop calculating. Otherwise, from 0 to n-2, calculate the left child node KT[2i+1] of the node as H(KT[i]||0), and the right child node KT[2i+2] as H(KT[i]||1), and then return the entire key tree KT.
[0029] Preferably, the secret key element revealing algorithm RevealKeys, inputs the number of content blocks n, the starting content block subscript ζ, the number of secret keys to be revealed ctr, the master key hash value H_mk, and outputs an array RKArray for storing the decryption key to be sent to the blockchain for recovery. The structure is specifically as follows:
[0030] Execute the key tree generation algorithm KTGen to obtain the key tree KT, calculate the subscript start=n+ζ-2 of the starting content block in the key tree, if only one content block needs to be decrypted, that is, ctr is 1, then add (start, KT[start]) to the result array RKArray and return;
[0031] If ctr is 2, then further determine the parity of start. If it is an odd number, add ((start-1) / 2, KT[(start-1) / 2]) to the result array RKArray. If it is an even number, then both nodes must be leaf nodes. Add (start, KT[start]) and (start+1, KT[start+1]) to the result array RKArray and return it.
[0032] If the number of content blocks that need to be decrypted ctr is greater than 2, the top nodes of these ctr elements in the key tree KT from the leaf node to the root node are calculated iteratively, and then these nodes are added to RKArray and returned.
[0033] Preferably, the recovery key algorithm RecoverKeys inputs the number of content blocks n, the number of content blocks to be decrypted ctr and the array RKArray returned by the key element revealing algorithm, and outputs an array KeyArray of length ctr for storing the key for decrypting the content blocks. The specific structure is:
[0034] For each element in the array RKArray, the key recovery algorithm KTGen is executed to recover its leaf node in the key tree KT, and the value of the leaf node is added to the result array KeyArray and returned.
[0035] Therefore, the present invention adopts the above-mentioned peer-to-peer content distribution and downloading method based on blockchain, and the technical effects are as follows:
[0036] (1) The present invention provides a peer-to-peer content distribution and downloading method based on blockchain. Compared with the traditional centralized content distribution network, it has the advantages of solving the single point problem, not requiring the purchase of excess bandwidth in advance to handle peak requests, and making full use of node bandwidth, which plays an important role in the rapid transmission of content on the Internet;
[0037] (2) The present invention provides a verifiable fair distribution mechanism that can accurately quantify the bandwidth contribution of distributors in a peer-to-peer content distribution network, and the fairness of content distributors can be guaranteed, that is, the content distributor will only lose the bandwidth of sending one content block at most, and the communication rounds of the distribution process are optimal and efficient;
[0038] (3) The present invention provides an efficient key derivation method for optimizing storage consumption on the blockchain in a peer-to-peer content distribution network. It can achieve the optimal on-chain storage and computing consumption while ensuring the confidentiality of content during the content distribution process. Therefore, it is practical and provides technical and design ideas for the implementation of blockchain in a wide range of decentralized application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 for system roles and their relationships;
[0040] Figure 2 A flowchart of a peer-to-peer content distribution and downloading method based on blockchain;
[0041] Figure 3 A verifiably fair distribution protocol;
[0042] Figure 4 It is an example of the key derivation method;
[0043] Figure 5 The total on-chain Gas consumption of each participant in the method process;
[0044] Figure 6 Gas consumption on the chain when transmitting different content block sizes;
[0045] Figure 7 The on-chain Gas consumption when the number of elements revealed on the chain is different. DETAILED DESCRIPTION
[0046] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0047] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0048] Embodiment 1
[0049] like Figure 2 As shown, the present invention provides a peer-to-peer content distribution and downloading method based on blockchain, including a preparation stage, a download transmission stage, and a decryption stage;
[0050] Preparation phase: The content provider deploys the smart contract. After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The content provider selects one from the participating distributors. The content distributor receives the sequence of content blocks sent by the content provider, verifies its signature, saves it locally after passing, and then sends a confirmation to the blockchain, indicating that the content distribution is ready. The specific steps include:
[0051] The content provider deploys a smart contract, where the contract parameters include the provider's public key pk_P, the unique identifier of the content H_m, the number of content blocks n, the confirmation time T_cf, the fee B_p that the provider will pay to the distributor for each content block distributed, and the fee B_c that the provider will charge to the content consumer for each content block;
[0052] After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The message includes the distributor's public key pk_D.
[0053] The content provider selects one from the participating distributors and then performs the following operations: randomly generates a master key mk, and calls the key tree generation algorithm KTGen to obtain the key tree KT according to the hash value H_mk of the master key and the number of content blocks n. The content provider stores mk and KT locally; uses the n leaf nodes of KT as the secret key to encrypt each content block, and then signs each encrypted content block to obtain the pair sequence of the content block, and sends the pair sequence to the selected content distributor;
[0054] The content distributor receives the sequence of content blocks sent by the content provider, verifies their signatures, saves them locally after passing, and then sends a confirmation to the blockchain, indicating that the content is ready for distribution.
[0055] Download and transmission phase: The content consumer sends a download request to the blockchain. After seeing the download request, the content distributor executes a verifiable fair distribution agreement with the content consumer. The content distributor then submits the "receipt" proof to the blockchain smart contract, thereby obtaining the content distribution fee paid by the blockchain to the content distributor. The process includes the following steps:
[0056] The content consumer sends a download request to the blockchain. The parameters included in the message are the content consumer's public key pk_C and the initial download content block subscript ζ. By default, ζ = 1, indicating that the download starts from the first content block.
[0057] The content distributor and the content consumer execute a verifiably fair distribution protocol to transmit content. At the end, the content consumer obtains a sequence of (content block ciphertext, content block ciphertext signature) pairs of the content block, and the content distributor receives a "receipt" for the distributed content block.
[0058] The content distributor submits the latest "receipt" to the blockchain, and the smart contract verifies the receipt. If it passes, it automatically calculates the number of content blocks ctr distributed based on the subscript of the content block in the "receipt" and the subscript of the content block initially downloaded, and then automatically sends the corresponding fee ctr*B_p to the content distributor.
[0059] Decryption phase: The content provider sends the encrypted decryption key array to the blockchain. The content consumer obtains the decryption key from the blockchain and decrypts the content. The content consumer then sends a confirmation to the blockchain. Upon receiving the confirmation, the blockchain will automatically pay the content provider the fee for providing the content immediately or after a period of time if no confirmation is received. This includes the following steps:
[0060] The content provider calls the secret key element revealing algorithm RevealKeys according to the number of content blocks n, the initial content block subscript ζ, the number of distributed content blocks ctr calculated on the chain, and the master key hash value H_mk, generates the secret key element array RKArray that needs to be revealed, and then encrypts it with the asymmetric public key pk_C, and sends the ciphertext to the chain;
[0061] The content consumer obtains the encrypted key element array RKArray from the chain, and can preliminarily verify whether ctr decryption keys can be recovered. After that, it uses the private key corresponding to pk_C to decrypt, thereby obtaining the key element array, calling the recovery key algorithm RecoverKeys, and obtaining the key used to decrypt ctr content blocks. Then, the encrypted content block is decrypted to obtain the content block plaintext, and a confirmation is sent to the smart contract. The smart contract sends the corresponding fee ctr*B_c to the content provider, and the download process is completed.
[0062] (1) Verifiably fair protocol
[0063] In order to achieve fairness guarantee for content distributors, it is necessary to quantify the contribution of content distribution. Therefore, a verifiable fair distribution protocol is designed to ensure the quantification of the distributor's bandwidth contribution. The process of this protocol is as follows: Figure 2As shown in the figure, the core idea is: for a sequence of n (content block ciphertext, ciphertext digital signature) pairs, the receiver (i.e., content consumer) verifies the ciphertext digital signature after receiving each sequence of (content block ciphertext, ciphertext digital signature) sent by the sender (i.e., content distributor), and sends back a "receipt" containing the content distributor's signature to confirm the sender's bandwidth contribution; after verifying the legitimacy of the "receipt", the sender continues to send the next content block; either party may terminate during the sending process. Considering that the content is divided and numbered according to the same size, the sender can always use the latest receipt to calculate how many blocks have been transmitted in total and prove its total bandwidth contribution to any verifier.
[0064] (2) Efficient key derivation method
[0065] When some blocks are sent to consumers, they can decrypt and obtain the blocks through the decryption key of the content provider. However, directly transmitting the decryption keys of n content blocks will result in linear storage costs on the chain. In order to optimize the storage consumption on the blockchain, an efficient key derivation method is proposed, which mainly includes three algorithms:
[0066] The key tree generation algorithm KTGen obtains the key tree KT, inputs the number of content blocks n, the hash value H_mk of the randomly selected master key mk, and outputs a key tree with n leaf nodes. The specific construction is:
[0067] Initialize an array KT of length 2n-1. The first value of KT is H_mk. If n is 1, stop calculating. Otherwise, from 0 to n-2, calculate the left child node KT[2i+1] of the node as H(KT[i]||0), and the right child node KT[2i+2] as H(KT[i]||1), and then return the entire key tree KT.
[0068] The secret key element revealing algorithm RevealKeys, inputs the number of content blocks n, the starting content block subscript ζ, the number of secret keys to be revealed is ctr, the master key hash value H_mk, and outputs an array RKArray for storing the decryption key to be sent to the blockchain for recovery. The specific construction is:
[0069] Execute the key tree generation algorithm KTGen to obtain the key tree KT, calculate the subscript start=n+ζ-2 of the starting content block in the key tree, if only one content block needs to be decrypted, that is, ctr is 1, then add (start, KT[start]) to the result array RKArray and return;
[0070] If ctr is 2, then further determine the parity of start. If it is an odd number, add ((start-1) / 2, KT[(start-1) / 2]) to the result array RKArray. If it is an even number, then both nodes must be leaf nodes. Add (start, KT[start]) and (start+1, KT[start+1]) to the result array RKArray and return it.
[0071] If the number of content blocks that need to be decrypted ctr is greater than 2, the top nodes of these ctr elements in the key tree KT from the leaf node to the root node are calculated iteratively, and then these nodes are added to RKArray and returned.
[0072] The recovery key algorithm RecoverKeys inputs the number of content blocks n, the number of content blocks to be decrypted ctr and the array RKArray returned by the key element disclosure algorithm, and outputs an array KeyArray of length ctr, which is used to store the secret key for decrypting the content blocks. The specific structure is:
[0073] For each element in the array RKArray, the key recovery algorithm KTGen is executed to recover its leaf node in the key tree KT, and the value of the leaf node is added to the result array KeyArray and returned.
[0074] Figure 3 The process of efficient key derivation method is illustrated by an example. In which: the number of content blocks n = 8, the number of content blocks to be decrypted ctr is 4 (left) and 6 (right), and the subscript ζ of the starting content block is 1 (left) and 2 (right).
[0075] The above method was implemented on-chain based on Solidity, the programming language of Ethereum smart contracts. Python was used to implement the interaction program between each participant and the chain, and it was tested on the Ethereum test network. The experimental results are as follows:
[0076] like Figure 5 As shown, the on-chain Gas consumption of different participants (i.e., content providers, content distributors, and content consumers) during the entire method process is shown. It can be seen that the on-chain Gas consumption of each participant is low.
[0077] like Figure 6 As shown in the figure, the Gas consumption on the chain is shown when transmitting different content block sizes. When all participants are honest participants, the consumption on the chain is mainly to verify the "receipt" submitted by the content distributor on the chain. At this time, regardless of the size of the off-chain content block, the on-chain consumption remains unchanged and the consumption is relatively small.
[0078] like Figure 7As shown in the figure, the Gas consumption on the chain is shown when sending decryption key arrays of different sizes to the blockchain. As the number of elements increases, the on-chain consumption also increases accordingly due to the need for storage, but overall the number of elements on the chain is at most O(log(n)), where n is the total number of content blocks.
[0079] Therefore, the present invention adopts the above-mentioned blockchain-based peer-to-peer content distribution and downloading method to achieve optimized on-chain storage and computing consumption while ensuring the confidentiality of content during content distribution. This is practical and provides technical and design ideas for blockchain to be implemented in a wide range of decentralized application scenarios.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A peer-to-peer content distribution and downloading method based on blockchain, characterized in that: It includes three stages: preparation stage, download and transmission stage, and decryption stage; Preparation phase: The content provider deploys the smart contract. After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The content provider selects one from the participating distributors. The content distributor receives the pair sequence of the content block sent by the content provider, verifies its signature, saves it locally after passing, and then sends a confirmation to the blockchain, indicating that the content distribution is ready. The pair sequence includes multiple "pairs", each of which includes the content block ciphertext and the content block ciphertext signature. Download and transmission phase: Content consumers send download requests to the blockchain. After seeing the download request, the content distributor executes a verifiable fair distribution agreement with the content consumer. The content distributor then submits the "receipt" proof to the blockchain smart contract, thereby obtaining the content distribution fee paid by the blockchain to the content distributor. Decryption phase: The content provider sends the encrypted decryption key array to the blockchain. The content consumer obtains the decryption key from the blockchain and decrypts the content. The content consumer then sends a confirmation to the blockchain. After receiving the confirmation, the blockchain will automatically pay the content provider the fee for providing the content immediately or after a period of time if no confirmation is received.
2. According to a peer-to-peer content distribution and downloading method based on blockchain according to claim 1, it is characterized in that: The preparation phase includes the following steps: The content provider deploys a smart contract, where the contract parameters include the provider's public key pk_P, the unique identifier of the content H_m, the number of content blocks n, the confirmation time T_cf, the fee B_p that the provider will pay to the distributor for each content block distributed, and the fee B_c that the provider will charge to the content consumer for each content block; After the contract is successfully deployed, the content distributor joins the distribution by sending a message to the blockchain. The message includes the distributor's public key pk_D. The content provider selects one from the participating distributors and then performs the following operations: randomly generates a master key mk, and calls the key tree generation algorithm KTGen to obtain the key tree KT according to the hash value H_mk of the master key and the number of content blocks n. The content provider stores mk and KT locally; uses the n leaf nodes of KT as the secret key to encrypt each content block, and then signs each encrypted content block to obtain the pair sequence of the content block, and sends the pair sequence to the selected content distributor; The content distributor receives the sequence of content blocks sent by the content provider, verifies their signatures, saves them locally after passing, and then sends a confirmation to the blockchain, indicating that the content is ready for distribution.
3. According to a peer-to-peer content distribution and downloading method based on blockchain according to claim 1, it is characterized in that: The download transfer phase includes the following steps: The content consumer sends a download request to the blockchain. The parameters included in the message are the content consumer's public key pk_C and the initial download content block subscript ζ. By default, ζ = 1, indicating that the download starts from the first content block. The content distributor and content consumer execute a verifiable fair distribution protocol to transfer content. At the end, the content consumer obtains a pair sequence of content blocks, and the content distributor receives a "receipt" for the distributed content blocks. The content distributor submits the latest "receipt" to the blockchain, and the smart contract verifies the receipt. If it passes, it automatically calculates the number of content blocks ctr distributed based on the subscript of the content block in the "receipt" and the subscript of the content block initially downloaded, and then automatically sends the corresponding fee ctr*B_p to the content distributor.
4. According to a blockchain-based peer-to-peer content distribution and downloading method according to claim 1, it is characterized in that: The decryption phase consists of the following steps: The content provider calls the secret key element revealing algorithm RevealKeys according to the number of content blocks n, the initial content block subscript ζ, the number of distributed content blocks ctr calculated on the chain, and the master key hash value H_mk, generates the secret key element array RKArray that needs to be revealed, and then encrypts it with the asymmetric public key pk_C, and sends the ciphertext to the chain; The content consumer obtains the encrypted key element array RKArray from the chain, and can preliminarily verify whether ctr decryption keys can be recovered. After that, it uses the private key corresponding to pk_C to decrypt, thereby obtaining the key element array, calling the recovery key algorithm RecoverKeys, and obtaining the key used to decrypt ctr content blocks. Then, the encrypted content block is decrypted to obtain the plaintext of the content block, and a confirmation is sent to the smart contract. The smart contract sends the corresponding fee ctr*B_c to the content provider, and the download process is completed.
5. According to a blockchain-based peer-to-peer content distribution and downloading method according to claim 3, it is characterized in that: Verifiably fair distribution protocol, including: For the pair sequence, after receiving each content block ciphertext and content block ciphertext signature pair sent by the sender, the receiver verifies the ciphertext digital signature and sends back a "receipt" containing the content consumer's signature to confirm the sender's bandwidth contribution. After verifying the legitimacy of the "receipt", the sender continues to send the next content block. Either party may terminate the sending process. By dividing the content into equal-sized chunks and numbering them, the sender always uses the latest receipt to calculate how many chunks were transferred in total and prove its total bandwidth contribution to any validator.
6. According to a blockchain-based peer-to-peer content distribution and downloading method according to claim 1, it is characterized in that: The key tree generation algorithm KTGen obtains the key tree KT, inputs the number of content blocks n, the hash value H_mk of the randomly selected master key mk, and outputs a key tree with n leaf nodes. The specific construction is: Initialize an array KT of length 2n-1. The first value of KT is H_mk. If n is 1, stop calculating. Otherwise, from 0 to n-2, calculate the left child node KT[2i+1] of the node as H(KT[i]||0), and the right child node KT[2i+2] as H(KT[i]||1), and then return the entire key tree KT.
7. According to claim 4, a peer-to-peer content distribution and downloading method based on blockchain is characterized in that: The secret key element revealing algorithm RevealKeys, inputs the number of content blocks n, the starting content block subscript ζ, the number of secret keys to be revealed ctr, the master key hash value H_mk, and outputs an array RKArray for storing the decryption key to be sent to the blockchain for recovery. The specific construction is: Execute the key tree generation algorithm KTGen to obtain the key tree KT, calculate the subscript start=n+ζ-2 of the starting content block in the key tree, if only one content block needs to be decrypted, that is, ctr is 1, then add (start, KT[start]) to the result array RKArray and return; If ctr is 2, then further determine the parity of start. If it is an odd number, add ((start-1) / 2, KT[(start-1) / 2]) to the result array RKArray. If it is an even number, then both nodes must be leaf nodes. Add (start, KT[start]) and (start+1, KT[start+1]) to the result array RKArray and return it. If the number of content blocks that need to be decrypted ctr is greater than 2, the top nodes of these ctr elements in the key tree KT from the leaf node to the root node are calculated iteratively, and then these nodes are added to RKArray and returned.
8. According to a blockchain-based peer-to-peer content distribution and downloading method according to claim 4, it is characterized in that: The recovery key algorithm RecoverKeys inputs the number of content blocks n, the number of content blocks to be decrypted ctr and the array RKArray returned by the key element disclosure algorithm, and outputs an array KeyArray of length ctr, which is used to store the secret key for decrypting the content blocks. The specific structure is: For each element in the array RKArray, the key recovery algorithm KTGen is executed to recover its leaf node in the key tree KT, and the value of the leaf node is added to the result array KeyArray and returned.
Citation Information
Patent Citations
Method and system for distribution of digital content in peer-to-peer network
CN107770115A
A cloud data security sharing method based on a block chain
CN109559124A
Blockchain-based privacy protection method for content centric network (CCN)
US20230043852A1