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

[feature-req] allow batch closing of multiple channels in one tx #1132

Open
xmrk-btc opened this issue Jan 29, 2024 · 0 comments
Open

[feature-req] allow batch closing of multiple channels in one tx #1132

xmrk-btc opened this issue Jan 29, 2024 · 0 comments

Comments

@xmrk-btc
Copy link

xmrk-btc commented Jan 29, 2024

It would be nice for a node A to cooperatively close multiple channels in a single onchain tx, and aggregate all funds belonging to node A to a single UTXO instead of creating one UTXO for every closed channel. For example, if A initiates such batch close of 2 channels A-B and A-C, the closing tx would have inputs:

  • channel point A-B
  • channel point A-C

And outputs:

  • A's balance in channel A-B, plus A's balance in channel B-C, minus the on-chain fee. Sent to address chosen by A.
  • B's balance in A-B, destination address chosen by B
  • C's balance in A-C, destination address chosen by C

The motivation is to allow cheap consolidation of low local balances. Especially with leasing channels on Pool or Amboss, the peers usually drain the channel but not completely because of 1% default channel reserve. Nor can I rebalance out to achieve local balance 0 - again because of reserve. So I am left with lot of such drained channels and little motivation to close them even if they see no flow.

The batch closure should only be possible for channels opened/initiated by A.

To negotiate the fee rate of batch closure, A negotiates individually with all other peers involved. Then it takes maximum of the negotiated fee rates and uses that as fee rate for batch closure. So A may overpay in the sense that it negotiated fee rate 20 sats/vB with B, but ends up paying 30 sats/vB for the whole batch closure. This is why A must be initiator of all channels being batch-closed, as A pays on-chain fee, so A can pay more but cannot force others to pay more. There could be some sanity check here to ensure that batch closure is more economical than doing individual closures, probably taking into account the cost of redeeming UTXOs created by closures (but redeeming at what fee rate? Perhaps just current fee rate to keep it simple).

This could be extended to consolidate peer's UTXOs if A is batch-closing several channels with B. That is, B would also get 1 big UTXO instead of several smaller ones.

The peers would need to be upgraded, as they currently don't expect more than 1 input or more than 2 outputs for closing tx (per BOLT#3). So the batch-closing would not be very useful until enough nodes upgrade. Perhaps it makes more sense to bite the bullet and wait for eltoo...

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

1 participant