Table of Contents
Fetching ...

FairRelay: Fair and Cost-Efficient Peer-to-Peer Content Delivery through Payment Channel Networks

Jingyu Liu, Yingjie Xue, Zifan Peng, Chao Lin, Xinyi Huang

TL;DR

FairRelay tackles the fair payment problem in P2P content delivery by transforming relay compensation into a multi-party fee-secret exchange. It introduces Accumulative Hashed TimeLock Contracts (A-HTLC) and Enforceable A-HTLC to guarantee atomicity across single and multi-path deliveries, with a Judge Contract on-chain to punish misbehavior. The protocol minimizes on-chain costs in optimistic executions and bounds on-chain dispute costs in pessimistic cases, while maintaining strong confidentiality through keyed encryption and masking with proofs of misbehavior. Implementation and evaluation demonstrate practical efficiency, including zk-SNARK proof costs and off-chain encryption throughput, supporting deployment in real PCN settings. Overall, FairRelay provides a scalable, secure framework for fair relay payments in multi-hop and multi-path P2P content delivery systems, with potential extensions to fault tolerance and front-running defenses.

Abstract

Peer-to-Peer (P2P) content delivery, known for scalability and resilience, offers a decentralized alternative to traditional centralized Content Delivery Networks (CDNs). A significant challenge in P2P content delivery remains: the fair compensation of relayers for their bandwidth contributions. Existing solutions employ blockchains for payment settlements, however, they are not practical due to high on-chain costs and over-simplified network assumptions. In this paper, we introduce FairRelay, a fair and cost-efficient protocol that ensures all participants get fair payoff in complex content delivery network settings. We introduce a novel primitive, Enforceable Accumulative Hashed TimeLock Contract (Enforceable A-HTLC), designed to guarantee payment atomicity - ensuring all participants receive their payments upon successful content delivery. The fairness of FairRelay is proved using the Universal Composability (UC) framework. Our evaluation demonstrates that, in optimistic scenarios, FairRelay employs zero on-chain costs. In pessimistic scenarios, the on-chain dispute costs for relayers and customers are constant, irrespective of the network complexity. Specifically, empirical results indicate that the on-chain dispute costs for relayers and customers are 24,902 gas (equivalent to 0.01 USD on Optimism L2) and 290,797 gas (0.07 USD), respectively. In a 10-hop relay path, FairRelay introduces less than 1.5% additional overhead compared to pure data transmission, showcasing the efficiency of FairRelay.

FairRelay: Fair and Cost-Efficient Peer-to-Peer Content Delivery through Payment Channel Networks

TL;DR

FairRelay tackles the fair payment problem in P2P content delivery by transforming relay compensation into a multi-party fee-secret exchange. It introduces Accumulative Hashed TimeLock Contracts (A-HTLC) and Enforceable A-HTLC to guarantee atomicity across single and multi-path deliveries, with a Judge Contract on-chain to punish misbehavior. The protocol minimizes on-chain costs in optimistic executions and bounds on-chain dispute costs in pessimistic cases, while maintaining strong confidentiality through keyed encryption and masking with proofs of misbehavior. Implementation and evaluation demonstrate practical efficiency, including zk-SNARK proof costs and off-chain encryption throughput, supporting deployment in real PCN settings. Overall, FairRelay provides a scalable, secure framework for fair relay payments in multi-hop and multi-path P2P content delivery systems, with potential extensions to fault tolerance and front-running defenses.

Abstract

Peer-to-Peer (P2P) content delivery, known for scalability and resilience, offers a decentralized alternative to traditional centralized Content Delivery Networks (CDNs). A significant challenge in P2P content delivery remains: the fair compensation of relayers for their bandwidth contributions. Existing solutions employ blockchains for payment settlements, however, they are not practical due to high on-chain costs and over-simplified network assumptions. In this paper, we introduce FairRelay, a fair and cost-efficient protocol that ensures all participants get fair payoff in complex content delivery network settings. We introduce a novel primitive, Enforceable Accumulative Hashed TimeLock Contract (Enforceable A-HTLC), designed to guarantee payment atomicity - ensuring all participants receive their payments upon successful content delivery. The fairness of FairRelay is proved using the Universal Composability (UC) framework. Our evaluation demonstrates that, in optimistic scenarios, FairRelay employs zero on-chain costs. In pessimistic scenarios, the on-chain dispute costs for relayers and customers are constant, irrespective of the network complexity. Specifically, empirical results indicate that the on-chain dispute costs for relayers and customers are 24,902 gas (equivalent to 0.01 USD on Optimism L2) and 290,797 gas (0.07 USD), respectively. In a 10-hop relay path, FairRelay introduces less than 1.5% additional overhead compared to pure data transmission, showcasing the efficiency of FairRelay.
Paper Structure (39 sections, 19 theorems, 7 equations, 30 figures, 2 tables)

This paper contains 39 sections, 19 theorems, 7 equations, 30 figures, 2 tables.

Key Result

Lemma 1

For any mask commitment $com_{mask}$ correctly signed by a public key $iPk$, and the secret $s$ is correctly revealed: If $com_{mask}$ is accurately generated from function $MCOM.Gen()$, the correct encryption key $sk$ committed by $com_{mask}.h_{sk}$ can be extracted. Otherwise, a valid $\pi_{pomm}

Figures (30)

  • Figure 1: A digital content delivery process with multiple pathways succeeds only if all relayers are paid.
  • Figure 2: Multi-party Money-Secret Exchange
  • Figure 3: A-HTLC Workflow
  • Figure 4: Protocol Overview
  • Figure 5: Ideal Functionality of Ledger
  • ...and 25 more figures

Theorems & Definitions (43)

  • Definition 3.1: Fairness for $\mathcal{P}$
  • Definition 3.2: Fairness for $\mathcal{C}$
  • Definition 3.3: Fairness for $\mathcal{R}$
  • Definition 3.4: Confidentiality
  • Lemma 1
  • proof
  • Lemma 2
  • proof
  • Lemma 3
  • proof
  • ...and 33 more