From bastien at acinq.fr Wed Sep 22 06:58:18 2021 From: bastien at acinq.fr (Bastien TEINTURIER) Date: Wed, 22 Sep 2021 08:58:18 +0200 Subject: [Lightning-dev] Opening balanced channels using PSBT In-Reply-To: References: Message-ID: Hi, This is exactly what the dual funding proposal provides: https://github.com/lightningnetwork/lightning-rfc/pull/851 Cheers, Bastien Le mer. 22 sept. 2021 ? 07:29, Ole Henrik Skogstr?m a ?crit : > Hi > > I have found a way of opening balanced channels using LND's psbt option > when opening channels. What I'm doing is essentially just joining funded > PSBTs before signing and submitting them. This makes it possible to open a > balanced channel between two nodes or open a ring of balanced channels > between multiple nodes (ROF). > > I found this interesting, however I don't know if this is somehow unsafe > or for some other reason a bad idea. If not, then it could be an > interesting alternative to only being able to open unbalanced channels. > > To do this efficiently, nodes need to collaborate by sending PSBTs back > and forth to each other and doing this manually is a pain, so if this makes > sense to do, it would be best to automate it through a client. > > ---------------------- > --- Here is an example of the complete flow for a single channel: > ---------------------- > > ** Node A: generates a new address and sends address to Node B *(lncli > newaddress p2wkh) > > ** Node A starts an Interactive channel **open** to Node B* *using psbt* > (lncli openchannel --psbt 2000000 1000000) > > ** Node A funds the channel address *(bitcoin-cli walletcreatefundedpsbt > [] '[{"":0.02}]') > > ** Node B funds the refund transaction to Node A and sends PSBT back to > Node A (*bitcoin-cli walletcreatefundedpsbt [] > '[{"":0.01}]') > > * *Node A joins the two PSBTs and sends it back to Node B (*bitcoin-cli > joinpsbts '["", ""]') > > ** Node B verifies the content and signs the joined PSBT before sending it > back to Node A *(bitcoin-cli walletprocesspsbt ) > > ** Node A: Verifies the content and signs the joined PSBT *(bitcoin-cli > walletprocesspsbt ) > > ** Node A: Completes channel open by publishing the fully signed PSBT* > > > ---------------------- > --- Here is an example of the complete flow for a ring of channels between > multiple nodes: > ---------------------- > > ** Node A starts an Interactive open channel to Node B using psbt* (lncli > openchannel --psbt --no_publish 2000000 1000000) > ** Node A funds the channel address* (bitcoin-cli walletcreatefundedpsbt > [] '[{"":0.02}]') > > ** Node B starts an Interactive open channel to Node C using psbt* (lncli > openchannel --psbt --no_publish 2000000 1000000) > ** Node B funds the channel address* (bitcoin-cli walletcreatefundedpsbt > [] '[{"":0.02}]') > > ** Node C starts an Interactive open channel to Node A using psbt* (lncli > openchannel --psbt 2000000 1000000) > ** Node C funds the channel address *(bitcoin-cli walletcreatefundedpsbt > [] '[{"":0.02}]') > > ** Node B and C sends Node A their PSBTs* > > ** Node A joins all the PSBTs* (bitcoin-cli joinpsbts > '["", "", > ""]') > > Using (bitcoin-cli walletprocesspsbt ): > > > > ** Node A verifies and signs the PSBT and sends it to Node B (1/3 > signatures)* Node B verifies and signs the PSBT and sends it to Node C (2/3 > signatures)* Node C verifies and signs the PSBT (3/3 signatures) before > sending it to Node A and B.* > > > ** Node A completes channel open (no_publish)* Node B completes channel > open (no_publish)* Node C completes channel open and publishes the > transaction.* > > -- > Ole Henrik Skogstr?m > > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: