TL;DR
This paper introduces the first competitive online algorithms for managing liquidity in Payment Channel Networks (PCNs) like Bitcoin's Lightning Network. By framing admission control, off-chain rebalancing, and on-chain recharging as an online optimization problem, the authors provide algorithms with provable worst-case performance guarantees against unpredictable transaction streams.
What Problem Does This Paper Address?
While Payment Channel Networks (PCNs) solve blockchain scalability by allowing off-chain transactions, they suffer from a fundamental structural flaw: channel depletion.
When two users open a channel, they lock up a fixed amount of funds. Every transaction moves the local balance from the payer to the payee. If traffic flows primarily in one direction, the payer’s balance quickly drops to zero, freezing any further transactions in that direction.
To keep channels alive, routing nodes have three choices, each carrying a cost:
- On-chain recharging: Close and reopen the channel with more funds (incurs high blockchain transaction fees and delays).
- Off-chain rebalancing: Circularly shift funds through a cycle of alternative channels in the network (incurs routing fees).
- Rejection: Turn away the transaction (incurs an opportunity cost from lost routing fees).
The core challenge is that routing nodes must make these decisions online—as transactions arrive over time—without knowing future demand. This paper provides a formal algorithmic framework to balance these trade-offs optimally.
Methods
The authors approach this using competitive analysis, comparing their online algorithms against an omniscient offline optimal algorithm ($\text{OFF}$) that knows the entire transaction sequence in advance.
They break the problem down into three progressively complex scenarios:
- Unidirectional without rejection: Transactions flow one way, and the node must accept them all. The authors present a 2-competitive algorithm that recharges the channel whenever the online fund requirement exceeds the current capacity.
- Unidirectional with rejection: Transactions flow one way, but the node can choose to reject them. The algorithm achieves a competitive ratio of $2 + \frac{\sqrt{5}-1}{2} \approx 2.618$.
- Bidirectional stream (The General Problem): Transactions arrive from both directions. The authors design a sophisticated bucket-based algorithm ($\text{ON}$). It uses a tracking subroutine called
Fundsto estimate what $\text{OFF}$ would do, recharges on-chain to match a multiple of $\text{OFF}$'s capacity, and segments channel funds into prioritized "buckets" based on transaction sizes. Small transactions trigger cheap off-chain rebalancing, while larger ones are allocated to specific buckets or rejected if capacity is tight.
To bridge the gap between theoretical worst-case bounds and practical performance, they also introduce two practical heuristics, $\text{ON-I}$ and $\text{ON-II}$, which relax the strict bucket boundaries to improve average-case throughput.
Datasets
The paper evaluates the algorithms using two data sources:
- Synthetic Transactions: Randomly generated transaction sequences (50 sequences of length 50) where sizes are sampled from a folded normal distribution and directions are chosen uniformly or via a Bernoulli distribution (to simulate traffic asymmetry).
- Lightning Network Topology Snapshot: A real-world dataset from September 2021 containing 117,894 channels. This was used to empirically estimate the average shortest cycle length ($C$) available for off-chain rebalancing.
Key Insights and Ideas
- PCNs vs. Classic Networks: In traditional communication networks, link capacity is transiently consumed by active flows and independent across directions. In PCNs, capacity is a zero-sum local balance: transactions permanently deplete capacity in one direction while replenishing it in the opposite direction. This makes rebalancing a unique algorithmic challenge.
- The Power of Tracking $\text{OFF}$: Instead of guessing future demand, the online algorithms dynamically compute what the optimal offline strategy would have spent up to the current step. This historical benchmark serves as a highly robust trigger for when to scale up channel capacity.
- Bucket Segmentation Prevents Starvation: In the bidirectional setting, dividing funds into log-scale buckets ensures that a sudden flood of medium-sized transactions cannot completely deplete the liquidity reserved for handling highly profitable large transactions or highly efficient small transactions.
Key Results
- Theoretical Guarantees: The bidirectional online algorithm achieves a competitive ratio of $7 + 2\lceil \log C \rceil$, where $C+1$ is the length of the rebalancing cycle.
- Lower Bounds: The authors prove that no deterministic algorithm can achieve a competitive ratio better than $O(\sqrt{\log C})$, establishing a fundamental limit on how well any online strategy can perform against an adversary.
- Average-Case Performance: In simulations, the algorithms vastly outperformed their conservative theoretical upper bounds. The optimized heuristic $\text{ON-II}$ cut costs significantly by halving the number of unnecessary on-chain recharges compared to $\text{ON-I}$.
- Real-World Feasibility: Analysis of the Lightning Network snapshot revealed that the average shortest cycle length is $4.15$, meaning $C \approx 3.15$. Plugging this into their formula yields a highly practical worst-case competitive ratio in real networks.
Limitations and Future Work
- Simplified Fee Structure: For the bidirectional proof, the authors assumed a simplified cost model where the transaction fee rate ($R$) is zero, meaning rejections only incur a constant base fee ($f_2$). Extending the strict competitive ratio proof to fully linear fee functions remains open.
- The Competitive Gap: A theoretical gap remains between the algorithm's upper bound ($O(\log C)$) and the proven lower bound ($O(\sqrt{\log C})$).
- Deterministic Focus: The study is limited to deterministic strategies. The authors suggest that exploring randomized online algorithms could unlock even lower competitive ratios.
Summary updated