Skip to main content

Fair Peer-to-Peer Content Delivery via Blockchain

  • 2309 Accesses

Part of the Lecture Notes in Computer Science book series (LNSC,volume 12972)


In comparison with conventional content delivery networks, peer-to-peer (p2p) content delivery is promising to save cost and handle high peak-demand, and can also complement the decentralized storage networks such as Filecoin. However, reliable p2p delivery requires proper enforcement of delivery fairness, i.e., the deliverers should be rewarded according to their in-time delivery. Unfortunately, most existing studies on delivery fairness are based on non-cooperative game-theoretic assumptions that are arguably unrealistic in the ad-hoc p2p setting.

We for the first time put forth an expressive yet still minimalist security notion for desired fair p2p content delivery, and give two efficient solutions \(\mathsf {FairDownload}\) and \(\mathsf {FairStream}\) via the blockchain for p2p downloading and p2p streaming scenarios, respectively. Our designs not only guarantee delivery fairness to ensure deliverers be paid (nearly) proportional to their in-time delivery but also ensure the content consumers and content providers are fairly treated. The fairness of each party can be guaranteed when the other two parties collude to arbitrarily misbehave. Moreover, the systems are efficient in the sense of attaining nearly asymptotically optimal on-chain costs and deliverer communication.

We implement the protocols and build the prototype systems atop the Ethereum Ropsten network. Extensive experiments done in LAN and WAN settings showcase their high practicality.


  • Content delivery
  • Fairness
  • P2P
  • Blockchain application

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-030-88418-5_17
  • Chapter length: 22 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
USD   89.00
Price excludes VAT (USA)
  • ISBN: 978-3-030-88418-5
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   119.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.
Fig. 3.
Fig. 4.
Fig. 5.
Fig. 6.


  1. 1.

    More thorough discussions about the insufficiencies of some pertinent studies (including gradual-release based fair exchange [7, 10], blockchain-based fair exchange/MPC [6, 9, 12, 25, 31], fair off-chain payment channels [11, 33], and some known decentralized content delivery schemes [2, 19]) are provided in the online full version [21].

  2. 2.

    Code availability:

  3. 3.

    To defend against replay attack in concurrent sessions, it is trivial to let the authenticated messages include a session id sid field, which, for example, can be instantiated by the hash of the transferred data identifier \(\mathsf {root}_m\), the involved parties’ addresses and an increasing-only nonce, namely \(sid := \mathcal {H}(\mathsf {root}_m||\mathcal {V}\_address||pk_{\mathcal {S}}||pk_{\mathcal {R}}||nonce)\).

  4. 4.

    Remark that the content m is dividable in the sense that each chunk is independent to other chunks, e.g., the chunk is a small 10-s video fragment.

  5. 5.

    Throughout this paper, we consider \(\phi \) is in the form of \(\phi (m) = [\mathsf {root}(\mathsf {BuildMT}(m)) \equiv \mathsf {root}_m]\), where \(\mathsf {root}\) is the Merkle tree root of m. In practice, it can be acquired from a semi-trusted third party, e.g., VirusTotal [23] or BitTorrent forum sites [28].

  6. 6.

    \(\mathcal {P}\) can retrieve the deposits of and back if no deliverers respond timely.

  7. 7.

    W.l.o.g., we assume \(n = 2 ^ k\) for \(k \in \mathbb {Z}\) for presentation simplicity.

  8. 8.

      can be required proportional to in case \(\mathcal {P}\) deliberately lowers it.

  9. 9.

  10. 10.

  11. 11.

  12. 12.

    The experimental configuration details are described in the full version [21].


  1. Akamai: Akamai (2021).

  2. Almashaqbeh, G.: CacheCash: a cryptocurrency-based decentralized content delivery network. Ph.D. thesis, Columbia University (2019)

    Google Scholar 

  3. Anjum, N., Karamshuk, D., Shikh-Bahaei, M., Sastry, N.: Survey on peer-assisted content delivery networks. Comput. Netw. 116, 79–95 (2017)

    CrossRef  Google Scholar 

  4. Asokan, N., Shoup, V., Waidner, M.: Optimistic fair exchange of digital signatures. IEEE J. Sel. Areas Commun. 18, 593–610 (2000)

    CrossRef  Google Scholar 

  5. Benet, J.: IPFS-content addressed, versioned, p2p file system. arXiv preprint arXiv:1407.3561 (2014)

  6. Bentov, I., Kumaresan, R.: How to use bitcoin to design fair protocols. In: Garay, J.A., Gennaro, R. (eds.) CRYPTO 2014. LNCS, vol. 8617, pp. 421–439. Springer, Heidelberg (2014).

    CrossRef  Google Scholar 

  7. Blum, M.: How to exchange (secret) keys. In: Proceedings of the ACM STOC 1983, pp. 440–447 (1983)

    Google Scholar 

  8. Camenisch, J., Shoup, V.: Practical verifiable encryption and decryption of discrete logarithms. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, pp. 126–144. Springer, Heidelberg (2003).

    CrossRef  Google Scholar 

  9. Choudhuri, A.R., Green, M., Jain, A., Kaptchuk, G., Miers, I.: Fairness in an unfair world: fair multiparty computation from public bulletin boards. In: Proceedings of the ACM CCS, pp. 719–728 (2017)

    Google Scholar 

  10. Damgård, I.B.: Practical and provably secure release of a secret and exchange of signatures. J. Cryptol. 8, 201–222 (1995).

    CrossRef  MATH  Google Scholar 

  11. Dziembowski, S., Eckey, L., Faust, S., Malinowski, D.: Perun: virtual payment hubs over cryptocurrencies. In: Proceedings of the IEEE S&P 2019, pp. 106–123 (2019)

    Google Scholar 

  12. Dziembowski, S., Eckey, L., Faust, S.: FairSwap: how to fairly exchange digital goods. In: Proceedings of the ACM CCS, pp. 967–984 (2018)

    Google Scholar 

  13. ENISA: ENISA threat landscape 2020 -botnet (2020).

  14. Fan, B., Lui, J.C., Chiu, D.M.: The design trade-offs of BitTorrent-like file sharing protocols. IEEE/ACM Trans. Network. 17, 365–376 (2008)

    CrossRef  Google Scholar 

  15. Feldman, M., Lai, K., Stoica, I., Chuang, J.: Robust incentive techniques for peer-to-peer networks. In: Proceedings of the ACM EC (2004)

    Google Scholar 

  16. Fiat, A., Shamir, A.: How to prove yourself: practical solutions to identification and signature problems. In: Odlyzko, A.M. (ed.) CRYPTO 1986. LNCS, vol. 263, pp. 186–194. Springer, Heidelberg (1987).

    CrossRef  Google Scholar 

  17. Filecoin: Filecoin: a decentralized storage network.

  18. Filecoin: Filecoin spec. (2020).

  19. Goyal, P., Netravali, R., Alizadeh, M., Balakrishnan, H.: Secure incentivization for decentralized content delivery. In: 2nd USENIX Workshop on Hot Topics in Edge Computing (2019)

    Google Scholar 

  20. Hardin, G.: The tragedy of the commons. J. Nat. Resour. Policy Res. 1, 243–253 (2009)

    CrossRef  Google Scholar 

  21. He, S., Lu, Y., Tang, Q., Wang, G., Wu, C.Q.: Fair peer-to-peer content delivery via blockchain. arXiv preprint arXiv:2102.04685 (2021)

  22. IBM: Internet connection and recommended encoding settings.

  23. Janin, S., Qin, K., Mamageishvili, A., Gervais, A.: FileBounty: fair data exchange. In: IEEE (EuroS&PW), pp. 357–366 (2020)

    Google Scholar 

  24. Katz, J., Lindell, Y.: Introduction to Modern Cryptography. CRC Press (2014)

    Google Scholar 

  25. Kiayias, A., Zhou, H.-S., Zikas, V.: Fair and robust multi-party computation using a global transaction ledger. In: Fischlin, M., Coron, J.-S. (eds.) EUROCRYPT 2016. LNCS, vol. 9666, pp. 705–734. Springer, Heidelberg (2016).

    CrossRef  Google Scholar 

  26. Koblitz, N.: Elliptic Curve Cryptosystems. Mathematics of Computation, pp. 203–209 (1987)

    Google Scholar 

  27. Kosba, A., Miller, A., Shi, E., Wen, Z., Papamanthou, C.: Hawk: the blockchain model of cryptography and privacy-preserving smart contracts. In: Proceedings of the IEEE (S&P), pp. 839–858 (2016)

    Google Scholar 

  28. Küpçü, A., Lysyanskaya, A.: Usable optimistic fair exchange. In: Pieprzyk, J. (ed.) CT-RSA 2010. LNCS, vol. 5985, pp. 252–267. Springer, Heidelberg (2010).

    CrossRef  Google Scholar 

  29. Levin, D., LaCurts, K., Spring, N., Bhattacharjee, B.: Bittorrent is an auction: analyzing and improving bittorrent’s incentives. ACM SIGCOMM Comput. Commun. Rev. 38, 243–254 (2008)

    Google Scholar 

  30. Locher, T., Moore, P., Schmid, S., Wattenhofer, R.: Free riding in bittorrent is cheap. In: HotNets (2006)

    Google Scholar 

  31. Maxwell, G.: The first successful zero-knowledge contingent payment (2016).

  32. Mehar, M.I., et al.: Understanding a revolutionary and flawed grand experiment in blockchain: the DAO attack. J. Cases Inf. Technol. 21, 19–32 (2019)

    CrossRef  Google Scholar 

  33. Miller, A., Bentov, I., Bakshi, S., Kumaresan, R., McCorry, P.: Sprites and state channels: payment networks that go faster than lightning. In: Goldberg, I., Moore, T. (eds.) FC 2019. LNCS, vol. 11598, pp. 508–526. Springer, Cham (2019).

    CrossRef  Google Scholar 

  34. Miller, A., Juels, A., Shi, E., Parno, B., Katz, J.: Permacoin: repurposing bitcoin work for data preservation. In: Proceedings of the IEEE S&P, pp. 475–490 (2014)

    Google Scholar 

  35. Piatek, M., Isdal, T., Anderson, T., Krishnamurthy, A., Venkataramani, A.: Do incentives build robustness in bittorrent. In: Proceedings of the NSDI (2007)

    Google Scholar 

  36. Reitwiessner, C.: EIP-196: precompiled contracts for addition and scalar multiplication on the elliptic curve alt\(\_\)bn128. Ethereum Improvement Proposals, No. 196 (2017).

  37. Schnorr, C.P.: Efficient identification and signatures for smart cards. In: Quisquater, J.-J., Vandewalle, J. (eds.) EUROCRYPT 1989. LNCS, vol. 434, pp. 688–689. Springer, Heidelberg (1990).

    CrossRef  Google Scholar 

  38. Sherman, A., Nieh, J., Stein, C.: FairTorrent: a deficit-based distributed algorithm to ensure fairness in peer-to-peer systems. IEEE/ACM TON 20, 1361–1374 (2012)

    CrossRef  Google Scholar 

  39. Shin, K., Joe-Wong, C., Ha, S., Yi, Y., Rhee, I., Reeves, D.S.: T-chain: a general incentive scheme for cooperative computing. IEEE/ACM TON 25, 2122–2137 (2017)

    CrossRef  Google Scholar 

  40. Sirivianos, M., Park, J.H., Yang, X., Jarecki, S.: Dandelion: cooperative content distribution with robust incentives. In: Proceedings of the USENIX ATC (2007)

    Google Scholar 

  41. StorJ: Storj (2018).

  42. Swarm (2020).

  43. Wood, G., et al.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum project yellow paper, pp. 1–32 (2014)

    Google Scholar 

Download references


Yuan Lu is supported in part by the National Natural Science Foundation of China (No. 62102404). This work was also supported in part by NSF #1801492 and FHWA 693JJ320C000021. The authors would like to thank the anonymous reviewer for their valuable comments and suggestions.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Yuan Lu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

He, S., Lu, Y., Tang, Q., Wang, G., Wu, C.Q. (2021). Fair Peer-to-Peer Content Delivery via Blockchain. In: Bertino, E., Shulman, H., Waidner, M. (eds) Computer Security – ESORICS 2021. ESORICS 2021. Lecture Notes in Computer Science(), vol 12972. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-88417-8

  • Online ISBN: 978-3-030-88418-5

  • eBook Packages: Computer ScienceComputer Science (R0)