# Rentable CDN Using Blockchain and Proof of Provenance
## 3 Proposed Method
### Content Delivery  
Once the content registration contract is successfully added to Blockchain, Downloader can send the content delivery contract to Manager to be verified and signed before uploading it to Blockchain to initiate the content delivery process. The content delivery contract contains the contract id of the \begin{table}
\begin{tabular}{p{42.7 pt} p{341.4 pt}} \hline \hline
**Roles** & **Description** \\ \hline Manager & Protects the content using **DRM** server, supports p2p communications by hosting **Tracker**, stores content in **Storage**, and verifies \& signs transactions related to the content delivery using **Verifier**. Supports content control such as removing illegal contents by destroying content registration contract from **Blockchain**. \\ \hline Creator & Uploads content to the **DRM** server, sets appropriate fee rates for their content, and signs and uploads the content registration contract to **Blockchain**. \\ \hline Uploader & Stores the content in **Storage** and delivers them to Downloaders. Sign and send proof of piece given by a Downloader to **Verifier** to get paid. \\ \hline Downloader & Uploads the content delivery contract to **Blockchain**. Checks proof of provenance of Uploader via **Blockchain**, and sends them a partially signed proof of piece for downloading pieces of the content to **Storage**. Pays appropriate fees to Manager, Creator, and Uploader using **Blockchain**. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Description of roles in rentable CDN. Figure 3: Four roles in Rentable CDN and their respective subsystems. Under the proposed method, it is possible to have multiple Uploaders for downloading one content. content registration contract, all the appropriate fees outlined in the content registration contract, and Downloader and Manager's signature. It should be noted that all fees should be paid as the content delivery contract is added to Blockchain or fee payment can be added as a function and Uploader can validate that all fees have been paid before start uploading the content to Downloader. This will ensure that all fees are automatically paid to the appropriate party after the content has been downloaded. The exact implementation is dependent on the type of Blockchain. The content is downloaded using a p2p file transfer protocol, such as BitTorrent, with additional constraints. First, Tracker, which is maintained by Manager, checks that there is a valid download request by Downloader in Blockchain; then, Tracker can send swarm information to Downloader, which can then be used to initiate handshakes with Uploaders. The handshake initialization process is shown in Figure 5.  
During the handshake, Uploader sends proof of provenance for the content to Downloader and Downloader verifies it over Blockchain before requesting pieces to download. The content delivery protocol is designed to ensure that the parties involved are paid fairly. The content is first divided into pieces and transferred using a p2p protocol. Pieces are requested using a piece identifier, such as hash, and Uploader sends an appropriate piece to Downloader. Figure 4: Content registration step. Figure 5: Handshake initiation process is required to download the content. Example of the content delivery process is shown in Figure 6. In this example, Downloader requests pieces from Uploader 1 and Uploader N. When Downloader receives a piece, it validates, sends a signed proof of piece to Uploader, and a piece received ACK (acknowledgment) as well. The description of the proof of piece is summarized in Table 2.  
The proof of piece contains content delivery contract id, total number of new pieces, total number of duplicate pieces, proof of provenance of Uploader for this content, and signatures of Downloader and Uploader. When Downloader sends the signed proof of piece to Uploader, the piece received ACK is sent as well. The piece received ACK, which contains the unique piece identifier, can be used by Uploader to track which pieces have been received by Downloader.