# Rentable CDN Using Blockchain and Proof of Provenance
## 2 Limitations of Rentable CDNs  
The main problem for rentable CDN is finding a secure and trustable payment scheme based on p2p network usage. In traditional CDN, like cloud based CDNs, the user pays the CDN based on the network usage that CDN provides. On the other hand, payment is a bit trickier in p2p based CDNs like rentable CDN, because there is no third party that can verify the network usage. Figure 1 graphically shows the payment process of the traditional CDN and rentable CDN. Payment in rentable CDN is determined using the claim and the acknowledgment made by the downloader and uploader, respectively. However, \"claiming\" you sent a content or conversely not acknowledging that you received a content is trivial. Existing work solve this by putting constraints on the content delivery process and penalizing malicious party. For example, SLIVER.TV (see the whitepaper published in [[https://www.thetatoken.org/](https://www.thetatoken.org/)]([https://www.thetatoken.org/](https://www.thetatoken.org/)), downloadable at [[https://s3.us-east-2.amazonaws.com/assets.thetatoken.org/Theta-white-paper-latest.pdf?v=1597976373.104](https://s3.us-east-2.amazonaws.com/assets.thetatoken.org/Theta-white-paper-latest.pdf?v=1597976373.104)]([https://s3.us-east-2.amazonaws.com/assets.thetatoken.org/Theta-white-paper-latest.pdf?v=1597976373.104](https://s3.us-east-2.amazonaws.com/assets.thetatoken.org/Theta-white-paper-latest.pdf?v=1597976373.104))) is the most recent state of the art p2p based CDN using Theta Network (Blockchain) with multi-level BFT as the consensus mechanism. Figure 2 graphically describes how the payment is transferred. First, the downloader makes a deposit to Blockchain in the case of double spending, then they send a partially signed payment receipt to all the uploaders. When the uploader sends a part of the content to the downloader, the downloader sends another partially signed payment receipt. This is repeated until the content is downloaded fully. To get paid, the uploader can sign the partially signed payment receipt and send it to Blockchain. Note that only the first partially signed payment receipt is given freely by the downloader and additional receipts are given only to the uploader who has sent part of the content. Figure 1: CDN usage based payment comparison. (**a**) charging based on CDN server network usage: content delivery cost is determined using measured usage reported by the server; (**b**) charging based on p2p network usage: content delivery cost is determined using delivery claim (Uploader) and delivery acknowledgement (Downloader). They explain that there are two cases for collusion. In the first case, the downloader colludes with an uploader and gives them more partially signed payment receipts than what they deserve. This double spending is easily detected as a total claim from uploaders will exceed the content's worth and the downloader pays the excess from the deposit. Thus, double spending is useless as long as the deposit is more than the sum of the false claims. In the second case, the malicious uploader does not deliver the content after receiving the partially signed payment receipts. Only the first partially signed payment receipt is sent without any conditions, and the subsequent partially signed payment receipts are sent only if the downloader receives a part of the content. Thus, the downloader is expected to lose only a little bit as payment from a single payment receipt is very small. However, unlike their claims, their service is vulnerable to collusion attacks. Their protection against collusion and double spending is based on the fact that adversary gain is small. But what if the network is flooded with many malicious accounts controlled by one adversary? Since small loss is determined to be a normal behavior, it is impossible to identify the malicious uploader; malicious uploaders will drain the funds from the downloader (the same argument works for the malicious downloader colluding with a malicious uploader).