Rebalancing in the Lightning Network:
Analysis and Implications
Sebastián Reca
Research Scientist at muun
Scaling Bitcoin, 2018

Financial Costs● Routing nodes will incur in financial costs by having their money locked.
● Financial costs depend on how much money is locked and the time it islocked.
● Financial costs do NOT depend on routing payments.
The node can decide how to translate these into fees.

Financial Costs
N = total amount of money locked, r = annual interest rate
Financial costs = NrStrategies:● All payments equal, P ≅ expected number of payments in a year○○

Fee = Nr/P.
Penalizes small payments.

● Payments by size, A ≅ expected amount of btc routed per year○○

Fee = zNr/A, where z is the payment amount.
Penalizes big payments.

The more payments (or money) routed, the cheaper the fees can be.

Rebalancing: increasing our balance in some channels at the expense ofdecreasing our balance in some other channels.

Rebalancing: Splicing

Rebalancing: Splicing

Rebalancing: Splicing

Rebalancing: Circular Payments

Rebalancing: Circular Payments

Rebalancing: Circular Payments

Rebalancing: Circular Payments

Network Routing Capacity

Network Routing Capacity

Rebalancing Problem● Rebalancing channels costs money.
● Optimization problem: how to route the largest amount of money (orpayments) while minimizing the rebalancing costs.
The rebalancing problem can be divided into three smaller problems:
1. Prediction of payments
2. Optimization of money distribution

Rebalancing Problem
Optimization of money distribution for 2 nodes
Branzei, Segal-Halevi and Zohar answer this question for the case:● 2 peer nodes transact following a random process● One node makes the next payment with probability p and the other one withprobability 1 - p.
● All payments of equal size.

Rebalancing Problem● Rebalancing channels costs money.
● Optimization problem: how to route the largest amount of money (orpayments) while minimizing the rebalancing costs.
The rebalancing problem can be divided into three smaller problems:
1. Prediction of payments
2. Optimization of money distribution
3. Rebalancing

Simulation model
Input:● N btc to lock
● Connected to M nodes● Peer nodes transact with each other following a payment rate matrix R, whereRi,j = probability of node i making the next payment to node j.
● Payment amounts follow certain given distribution.

Output:● Amount of routed money● Amount of routed payments● Rebalancing operations needed, that is, on-chain hits.

How does the amount of money locked impact the need for rebalancing?
Nodes = 4
Distribution = Pareto (scale 2)

How does rebalancing costs add to the total costs of having a routing node?
Total costs
Rebalancing costs
Financial costs

How does the Bitcoin fee impact the optimal amount of money locked in nodes?
BiasedUnbiased

How does the Bitcoin fee impact the lightning fees?
BiasedUnbiased

Conclusions●●●●All routing nodes in the LN will face the rebalancing problem and its costs.
Routing nodes will be economically incentivized to correctly predict payments.
Linear fees make sense in the LN
The optimal amount of money to be locked inside channels will grow withBitcoin fees.
● Lightning fees will grow with Bitcoin fees.