<oembed><type>rich</type><version>1.0</version><author_name>npub1wtx5qvewc7pd6znlvwktq03mdld05mv3h5dkzfwd3dc30gdmsptsugtuyn</author_name><author_url>https://nostr.ae/npub1wtx5qvewc7pd6znlvwktq03mdld05mv3h5dkzfwd3dc30gdmsptsugtuyn</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-10-11&#xA;📝 Original message:&#xA;On Thu, Oct 11, 2018 at 3:40 AM Rusty Russell &lt;rusty at rustcorp.com.au&gt; wrote:&#xA;&#xA;&gt; &gt; * Once we have enough confirmations we merge the channels (either&#xA;&gt; &gt; automatically or with the next channel update). A new commitment tx is&#xA;&gt; &gt; being created which now spends each output of each of the two funding tx&#xA;&gt; &gt; and assigns the channel balance to the channel partners accordingly to&#xA;&gt; the&#xA;&gt; &gt; two independent channels. The old commitment txs are being invalidated.&#xA;&gt; &gt; * The disadvantage is that while splicing is not completed and if the&#xA;&gt; &gt; funder of the splicing tx is trying to publish an old commitment tx the&#xA;&gt; &gt; node will only be punished by sending all the funds of the first funding&#xA;&gt; tx&#xA;&gt; &gt; to the partner as the special commitment tx of the 2nd output has no&#xA;&gt; newer&#xA;&gt; &gt; state yet.&#xA;&gt;&#xA;&gt; Yes, this is the alternative method; produce a parallel funding tx&#xA;&gt; (which only needs to support a single revocation, or could even be done&#xA;&gt; by a long timeout) and then join them when it reaches the agreed depth.&#xA;&gt;&#xA;&gt; It has some elegance; particularly because one side doesn&#39;t have to do&#xA;&gt; any validation or store anything until it&#39;s about to splice in.  You get&#xA;&gt; asked for a key and signature, you produce a new one, and sign whatever&#xA;&gt; tx they want.  They hand you back the tx and the key you used once it&#39;s&#xA;&gt; buried far enough, and you check the tx is indeed buried and the output&#xA;&gt; is the script you&#39;re expecting, then you flip the commitment tx.&#xA;&gt;&#xA;&gt; But I chose chose not to do this because every transaction commitment&#xA;&gt; forever will require 2 signatures, and doesn&#39;t allow us to forget old&#xA;&gt; revocation information.&#xA;&gt;&#xA;&gt; And it has some strange side-effects: onchain this looks like two&#xA;&gt; channels; do we gossip about both?  We have to figure the limit on&#xA;&gt; splice-in to make sure the commitment tx stays under 400kSipa.&#xA;&gt;&#xA;&#xA;This is a lot closer to my original proposal for splicing, and I&#xA;still like it a lot more since the transition from old to new&#xA;channel is bascially atomic (not having to update state on both&#xA;pre-splice and post-splice version). The new funds will remain&#xA;unavailable for the same time, and since we allow only one&#xA;concurrent splice in your proposal we don&#39;t even lose any&#xA;additional time regarding the splice-outs.&#xA;&#xA;So pulling the splice_add_input and splice_add_output up to&#xA;signal the intent of adding funds to a splice. Splice_all_added&#xA;is then used to start moving the funds to a pre-allocated 2-of-2&#xA;output where the funds can mature. Once the funds are&#xA;matured (e.g., 6 confirmations) we can start the transition: both&#xA;parties claim the funding output, and the pre-allocated funds, to&#xA;create a new funding tx which is immediately broadcast, and we&#xA;flip over to the new channel state. No need to keep parallel&#xA;state and then disambiguating which one it was.&#xA;&#xA;The downsides of this is that we now have 2 on-chain&#xA;transactions (pre-allocation and re-open), and splice-outs are no&#xA;longer immediate if we have a splice-in in the changeset as well.&#xA;The latter can be remediatet with one more reanchor that just&#xA;considers splice-ins that were proposed.&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt; &gt; I believe splicing out is even safer:&#xA;&gt; &gt; * One just creates a spent of the funding tx which has two outputs. One&#xA;&gt; &gt; output goes to the recipient of the splice out operation and the second&#xA;&gt; &gt; output acts as a new funding transaction for the newly spliced channel.&#xA;&gt; &gt; Once signatures for the new commitment transaction are exchanged&#xA;&gt; (basically&#xA;&gt; &gt; following the protocol to open a channel) the splicing operation can be&#xA;&gt; &gt; broadcasted.&#xA;&gt; &gt;&#xA;&gt; &gt; * The old channel MUST NOT be used anymore but the new channel can be&#xA;&gt; &gt; operational right away without blockchain confirmation. In case someone&#xA;&gt; &gt; tries to publish an old state of the old channel it will be a double&#xA;&gt; spent&#xA;&gt; &gt; of the splicing operation and in the worst case will be punished and the&#xA;&gt; &gt; splicing was not successful.&#xA;&gt; &gt;&#xA;&gt; &gt;  if one publishes an old state of the new&#xA;&gt; &gt; channel everything will just work as normal even if the funding tx is not&#xA;&gt; &gt; yet mined. It could only be replaced with an old state of the previous&#xA;&gt; &gt; channel (which as we saw is not a larger risk than the usual operation&#xA;&gt; of a&#xA;&gt; &gt; lightning node)&#xA;&gt;&#xA;&gt; Right, you&#39;re relying on CPFP pushing through the splice-out tx if it&#xA;&gt; gets stuck.  This requires that we check carefully for standardness and&#xA;&gt; other constraints which might prevent this; for example, we can&#39;t allow&#xA;&gt; more than 20 (?) of these in a row without being sufficiently buried&#xA;&gt; since I think that&#39;s where CPFP calculations top out.&#xA;&gt;&#xA;&#xA;We shouldn&#39;t allow more than one pending splice operation anyway, as&#xA;stated in your proposal initially. We are already critically reliant on our&#xA;transaction being confirmed on-chain, so I don&#39;t see this as much of an&#xA;added issue.&#xA;&#xA;&#xA;&gt; &gt; As mentioned maybe you had this workflow already in your mind but I don&#39;t&#xA;&gt; &gt; see why we need to send around all the messages twice with my workflow.&#xA;&gt; We&#xA;&gt; &gt; only need to maintain double state but only until it is fair / safe to do&#xA;&gt; &gt; so. I would also believe that with my approach it should be possible (but&#xA;&gt; &gt; not really necessary) to have multiple splicing operations in parallel.&#xA;&gt;&#xA;&gt; The extra sigs are only needed in transition, though; once splicing is&#xA;&gt; over the channel looks exactly like a newly created one, which is nice.&#xA;&gt;&#xA;&#xA;I&#39;m less worried about the bandwidth overhead, rather the&#xA;parallel state updates are error prone and there might be&#xA;corner-cases that we simply don&#39;t see right now. Having parallel&#xA;state-updates just for the sake of saving some on-chain&#xA;fees (fees that we&#39;d spend in purely on-chain cases anyway) has a&#xA;direct impact on the channel state machine.&#xA;&#xA;&#xA;&gt; &gt; One other question: What happens to the short_channel_id of a channel to&#xA;&gt; &gt; which founds have been spliced in?&#xA;&gt;&#xA;&gt; In the parallel splice world, they look like two channels.  In my&#xA;&gt; proposal it looks like a new channel, with a channel_update to make sure&#xA;&gt; modern nodes know that the transition is happening.&#xA;&gt;&#xA;&#xA;With the pre-allocation the final effect is the same, we&#39;ve just&#xA;pulled some of the waiting time above the re-anchoring and added&#xA;one more TX.&#xA;&#xA;&#xA;This is one of the cases where a simpler solution (relatively&#xA;speaking ^^) is to be preferred imho, allowing for future&#xA;iterations.&#xA;&#xA;Cheers,&#xA;Christian&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181011/f7fa9632/attachment.html&gt;</html></oembed>