Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol Feature Request: Shift balance between multiple channels with the same peer #939

Open
C-Otto opened this issue Nov 23, 2021 · 1 comment

Comments

@C-Otto
Copy link
Contributor

C-Otto commented Nov 23, 2021

This is a follow-up from lightningnetwork/lnd#5795.

If I have more than one channel with the same peer, I might want to move my balance from one channel to another:

Before:

  • 10M sat on my side of channel A, 5M sat on my side of channel B

After:

  • 15M sat on my side of channel A, nothing on my side of channel B

While routing nodes are free to pick any of the parallel channels to serve a forwarding request (lnd currently picks a random suitable channel), re-organizing the balances directly might be beneficial. One could close channels without changing the overall balance, one could "optimize" two balanced channels by having more sats bundled on each side (to be able to serve larger forwarding requests), or do other kinds of optimizations. The peers might agree to do this free of charge, or charge a fee for this kind of operation.

From a technical point of view I believe this corresponds to a X-Y-X routing request, where the channel for the last hop needs to be used strictly as specified (i.e. not left at the discretion of Y).

@cdecker
Copy link
Collaborator

cdecker commented Dec 11, 2021

Notice that the only way we currently can perform atomic cross-channel is through HTLCs. Since the swap from one channel to another needs to be atomic we likely must actually route the rebalancing payment, otherwise we can end up in a situation where partial swaps may be performed.

This also means that all the potential issues around such a swap/rebalance are already handled (reserve, etc), we just need to signal a rebalance to the peer (so they don't charge fees), and hint that we want a specific channel (TLV signature by the initiating node so we can't get tricked to believe a normal forward is a rebalance, and a flag "please use this exact channel").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants