Improving Routing in the Lightning Network with Trampoline Payments
Scaling Bitcoin 2019
Bastien Teinturier (ACINQ)@acinq_co @realtbast
The Lightning Network, a Payment Channels Network
Alice Bob
You can pay anyone you can find a route to!
Payment Routing: Fees and Lock Time
Intermediate channels advertise a fee rate:
● base fee● proportional fee
And a lock time delta:
● to protect their funds● and avoid locking capacity for
too long
Gossiped via staggered broadcast.
AliceBob
fb = 0.1 BTCf% = 1%Δ = 14
Carol
? BTC ? BTC ? BTC ? BTC
8 BTC5 BTC
2 BTCExpiry: 1105
2.12 BTCExpiry: 1119
Payment Routing Features
Powerful features
● Optimal path (source routing)● Trustless (HTLCs)● Private (onion encryption)
But at a cost…
● Bandwidth● Memory● CPU● Which impacts mobile UX
sender recipient
Does not know its position in the route .i.e
● Does not know who the sender is● Does not know who the final recipient is
1000 satExpiry: 9
1005 satExpiry: 18
1008 satExpiry: 25
Lightning Payment Triangle of Success ©
Privacy
Route cost optimum Performance
we’re here!
We really don’t want to be there...
this side looks interesting too...
Let a billion payment channels bloom...
A phone isn’t a server (duh):
● not always online● unreliable connections● limited performance● handy payment method
What if?
● sync smaller graph● and special nodes● trade fees for performance
Trampoline Routing
Partial source routing:
● select trampoline nodes● route to first one
Routing between trampoline nodes is deferred to the trampoline nodes themselves.
Powered by variable-length onions (onion nesting FTW).
1
2
Gossip Filters
Reduce bandwidth usage:
● channel_update filters○ n-radius○ channel capacity
● node_update filters○ fee rate○ lock time○ probabilistic (distance to block hash?)
Applied before forwarding gossip.
Without BIP 37 drawbacks!
init
channel_update_filter
node_update_filter
…...
channel_update_filter
Alice Bob
Fee Estimation
Trampoline nodes broadcast aggregated trampoline fees and lock time (node_update).
Mobile nodes may build a reputation score DB to prune unreliable trampoline nodes.
Custom heuristics may be added depending on node connectivity and performance.
f = 5, % = 0.5, Δ = 12
f = 2,
% =
0.1,
Δ =
9
f = 3, % = 0.2, Δ = 6
f = 10, % = 0.01, Δ = 3
f = 0, % = 0.1, Δ = 3
f = 2,
% =
0.05,
Δ = 5
f = 12, % = 0.5, Δ = 15
AMP 💙 Trampoline
0.5 BTC0.4 BTC
0.1 BTC0.1 BTC
0.25 BTC
0.1 BTC
0.1
BTC
0.1 BTC
0.15 BTC 0.15 BTC
#reckless
To Infinity and BeyondIncremental change to payment infrastructure.
Easy to rollout.
Coming to eclair soon.
Incremental step towards hierarchical systems.
Feedback wanted!https://github.com/lightningnetwork/lightning-rfc/pull/654https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-August/002100.html
Questions?