Batch exchange withdrawal to lightning requires covenants

Posted by David A. Harding

Oct 24, 2023/04:41 UTC

In an email sent by Bastien TEINTURIER via bitcoin dev, the discussion revolves around the use of swap-in-potentiam (SiP) as an option. The scenario presented is that Exchange E wants to pay users A, B, and C, who each have different counterparties. To facilitate this, E would obtain a public key from each user's counterparty (e.g., D, E, F). E would then confirm a transaction that pays three SiP outputs, one for each pair {A,D}, {B,E}, {C,F}.

The parties involved would subsequently offchain spend the SiP outputs into a standard LN-penalty channel construction and start using it. Ideally, before the SiP expires, each party would be able to drain the channel into their other channels and mutually settle it with just an onchain spend of the SiP output. However, in non-ideal situations, the previously offchain spend of the SiP output that established the LN-penalty channel would be put onchain.

The best-case scenario described involves four transactions: E's one-input, four-output batch withdrawal (including E's change), and three separate one-input, one-output transactions to settle the SiP outputs. It is noted that this is approximately the same number and size of transactions as the SIGHASH_ANYPREVOUT|SIGHASH_SINGLE solution outlined in the email thread. However, the SiP solution has an expiry, while the mentioned solution allows the channels to remain open indefinitely.

The author also acknowledges that Eclair already utilizes SiP, but includes the reference for other readers.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from authoritative bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiBitcoin Transcripts Review
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project?

Give Feedback