Skip to main content
QUICK REVIEW

[Paper Review] DyFEn: Agent-Based Fee Setting in Payment Channel Networks

Kiana Asgari, Aida Afshar Mohammadian|arXiv (Cornell University)|Oct 15, 2022
Blockchain Technology Applications and SecurityComputer Science9 citations
TL;DR

This paper introduces DyFEn, an open-source reinforcement learning environment for simulating dynamic fee setting in Bitcoin's Lightning Network. By modeling fee optimization as a Markov Decision Process and training DRL agents like PPO, DyFEn enables agents to achieve up to tenfold higher income than heuristic strategies, demonstrating the feasibility of RL for real-world blockchain fee optimization.

ABSTRACT

In recent years, with the development of easy to use learning environments, implementing and reproducible benchmarking of reinforcement learning algorithms has been largely accelerated by utilizing these frameworks. In this article, we introduce the Dynamic Fee learning Environment (DyFEn), an open-source real-world financial network model. It can provide a testbed for evaluating different reinforcement learning techniques. To illustrate the promise of DyFEn, we present a challenging problem which is a simultaneous multi-channel dynamic fee setting for off-chain payment channels. This problem is well-known in the Bitcoin Lightning Network and has no effective solutions. Specifically, we report the empirical results of several commonly used deep reinforcement learning methods on this dynamic fee setting task as a baseline for further experiments. To the best of our knowledge, this work proposes the first virtual learning environment based on a simulation of blockchain and distributed ledger technologies, unlike many others which are based on physics simulations or game platforms.

Motivation & Objective

  • To address the lack of realistic, open-source benchmarks for training and evaluating reinforcement learning in payment channel networks.
  • To model dynamic fee setting in the Lightning Network as a Markov Decision Process for optimal profit maximization.
  • To evaluate the performance of deep reinforcement learning algorithms against existing heuristic fee strategies in a simulated, real-world-like environment.
  • To demonstrate that DRL can outperform static and heuristic fee policies in terms of income and robustness to initial balance variations.
  • To provide a scalable, extensible testbed (DyFEn) built on LEViN for future research on layer-2 blockchain protocols.

Proposed method

  • DyFEn is built on LEViN, a high-performance simulator for off-chain payment channel networks, enabling accurate modeling of LN topology and transaction routing.
  • The fee setting problem is formalized as a Markov Decision Process where actions are fee rates and base fees for a node’s channels.
  • The environment uses localization to focus on a node’s local network neighborhood, improving training efficiency and capturing topological dependencies.
  • Five deep reinforcement learning algorithms—PPO, DQN, DDPG, SAC, and TD3—are trained and evaluated on DyFEn to compare performance.
  • Reward is sparse and based on cumulative income from routed payments, with income calculated as the sum of fees collected over episodes.
  • Experiments use real LN snapshots and vary initial channel balances to test robustness and generalization of learned policies.

Experimental results

Research questions

  • RQ1Can deep reinforcement learning outperform heuristic fee strategies in maximizing income from payment routing in the Lightning Network?
  • RQ2How does the localization size of a node’s network neighborhood affect the performance and convergence of DRL agents in fee setting?
  • RQ3How sensitive are DRL-based fee policies to variations in initial channel balances compared to heuristic methods?
  • RQ4Which DRL algorithm achieves the highest income and most stable performance in the DyFEn environment?
  • RQ5Can a simulated environment like DyFEn serve as a reliable benchmark for evaluating RL methods in real-world blockchain applications?

Key findings

  • The PPO agent trained on DyFEn with a localization size of L=100 achieved significantly higher income than other algorithms, demonstrating superior performance.
  • PPO showed consistent and fast convergence across multiple random initializations, indicating strong training stability.
  • The PPO agent achieved nearly ten times higher income than the best-performing heuristic baseline (proportional strategy), especially under varying initial balance conditions.
  • Smaller localization sizes (L=100) led to better income outcomes than larger ones (L=500), highlighting the importance of local topological structure in fee optimization.
  • The proportional heuristic strategy was highly sensitive to initial balances and often resulted in zero income, while DRL agents maintained high performance across all initializations.
  • On-policy algorithms like PPO outperformed off-policy methods such as DDPG and SAC in both income and convergence speed, suggesting suitability for this task.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.