<oembed><type>rich</type><version>1.0</version><author_name>npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_name><author_url>https://nostr.ae/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-10-24&#xA;📝 Original message:&#xA;Conner Fromknecht &lt;conner at lightning.engineering&gt; writes:&#xA;&gt; In light of this, and if I&#39;m following along, it seems our hand is forced in&#xA;&gt; splicing via a single on-chain transaction. In my book, this is preferable&#xA;&gt; anyway. I&#39;d much rather push complexity off-chain than having to do a&#xA;&gt; mutli-stage splicing pipeline.&#xA;&#xA;Agreed.  As Christian pointed out, at least our design space is reduced now?&#xA;&#xA;&gt; I would propose sending a distinct message, which references the&#xA;&gt; `active_channel_id` and a `splice_channel_id` for the pending splice:&#xA;&gt;&#xA;&gt; 1. type: XXX (`commitment_splice_signed`) (`option_splice`)&#xA;&gt; 2. data:&#xA;&gt;    * [`32`:`active_channel_id`]&#xA;&gt;    * [`32`:`splice_channel_id`]&#xA;&gt;    * [`64`:`signature`]&#xA;&gt;    * [`2`:`num_htlcs`]&#xA;&gt;    * [`num_htlcs*64`:`htlc_signature`]&#xA;&gt;&#xA;&gt; This more directly addresses handling multiple pending splices, as well as&#xA;&gt; preventing us from running into any size constraints. The purpose of&#xA;&gt; including the `active_channel_id` would be to remote node locate the&#xA;&gt; spliced channel, since it may not be populated indexes containing&#xA;&gt; active channels. If we don&#39;t want to include this, the existing message&#xA;&gt; can be used without modification.&#xA;&#xA;Yes, I like this!  I don&#39;t think the `splice_channel_id` helps us much,&#xA;since we need to wait we receive all pending commitement_splice_signed&#xA;before sending revoke_and_ack, and I think we should simply insist they&#xA;be in splice order which makes implementation easier (simple counter).&#xA;&#xA;&gt;&gt; We shouldn&#39;t allow more than one pending splice operation anyway, as&#xA;&gt;&gt; stated in your proposal initially. We are already critically reliant on&#xA;&gt; our&#xA;&gt;&gt; transaction being confirmed on-chain, so I don&#39;t see this as much of an&#xA;&gt;&gt; added issue.&#xA;&gt;&#xA;&gt; IMO there&#39;s no reason to limit ourselves to one pending splice at the&#xA;&gt; message&#xA;&gt; level. I think it&#39;d be an oversight to not to plan ahead with RBF in mind,&#xA;&gt; given that funding transactions have gone unconfirmed precisely because of&#xA;&gt; improperly chosen fee rates. Arguably, funding flow should be extended to&#xA;&gt; support this as well.&#xA;&#xA;Good reminder re: RBF and funding.  I&#39;ve put this on the brainstorming&#xA;list with your name next to it ;)&#xA;&#xA;&gt; Adding a splice-reject message/error code should be sufficient to allow&#xA;&gt; implementations to signal that their local tolerance for number of pending&#xA;&gt; splices has been reached. It&#39;s likely we&#39;d all start with getting one splice&#xA;&gt; working, but then the messages won&#39;t need to modified if we want to&#xA;&gt; implement&#xA;&gt; additional pending splices via RBF.&#xA;&gt;&#xA;&gt; A node that wants to RBF but receives a reject can then proceed with CPFP&#xA;&gt; as a&#xA;&gt; last resort.&#xA;&gt;&#xA;&gt; Are there any downsides I&#39;m overlooking with this approach?&#xA;&#xA;No, I think you&#39;ve covered it.&#xA;&#xA;&gt;&gt; | Bit Position  | Name                      | Field&#xA;&gt;       |&#xA;&gt;&gt; | ------------- | ------------------------- |&#xA;&gt; -------------------------------- |&#xA;&gt;&gt; | 0             | `option_channel_htlc_max` | `htlc_maximum_msat`&#xA;&gt;       |&#xA;&gt;&gt; | 1             | `option_channel_moving`   | `moving_txid&#xA;&gt;      |&#xA;&gt;&gt;&#xA;&gt;&gt; The `channel_update` gains the following field:&#xA;&gt;&gt;     * [`32`: moving_txid`] (option_channel_moving)&#xA;&gt;&#xA;&gt; Do we actually need to send the `moving_txid` via a channel update? I think&#xA;&gt; it&#39;s&#xA;&gt; enough for both parties to send `channel_update`s with the&#xA;&gt; `option_channel_moving` bit set, and continue to keep the channel in our&#xA;&gt; routing&#xA;&gt; table.&#xA;&#xA;It helps because they can&#39;t broadcast the new channel for 6 confirms.&#xA;OTOH, that&#39;s probably not too long to wait.&#xA;&#xA;&gt; If we receive later receive two `channel_update`s whose `short_channel_id`s&#xA;&gt; reference the spending transaction (and the node pubkeys are the same), we&#xA;&gt; assume the splice was successful and that this channel has been&#xA;&gt; subsumed.&#xA;&#xA;So rule would be: if we&#39;ve seen both channel_updates with&#xA;option_channel_moving set, we remember the txid which closed it, and&#xA;start a 100-block countdown the &#34;real close&#34;.  If we&#xA;a (valid) channel_announce for that closing tx with same node pubkeys,&#xA;we simply delete the 100-block countdown.&#xA;&#xA;&gt; I&#xA;&gt; think this works so long as the spending transaction doesn&#39;t contain&#xA;&gt; multiple&#xA;&gt; funding outputs, though I think the current proposal is fallible to this as&#xA;&gt; well.&#xA;&#xA;I think variant above works even in that case?&#xA;&#xA;&gt; To me, this proposal has the benefit of not bloating gossip bandwidth with&#xA;&gt; an&#xA;&gt; extra field that would need to parsed indefinitely, and gracefully&#xA;&gt; supporting&#xA;&gt; RBF down the road. Otherwise we&#39;d need to gossip and store each potential&#xA;&gt; txid.&#xA;&gt;&#xA;&gt; With regards to forwarding, both `short_channel_id`s would be accepted by&#xA;&gt; the&#xA;&gt; splicers for up to 100 blocks (after splice confirm?), at which point they&#xA;&gt; can&#xA;&gt; both forget the prior `short_channel_id`.&#xA;&#xA;Technically, the need to remember for some grace period after they&#xA;announce the block.  We have a similar recommendation for old fee&#xA;values, though it&#39;s soft.  100 seems overkill.&#xA;&#xA;I think we can assume gossip will propagate widely within 6 blocks and&#xA;say they should accept it at least up to 6 blocks after announcing?  Or&#xA;1 hour, though I prefer using the blockchain as a clock in general.&#xA;&#xA;&gt; ## Shachain&#xA;&gt;&#xA;&gt;&gt; I thought about restarting the revocation sequence, but it seems like&#xA;&gt;&gt; that only saves a tiny amount since we only store log(N) entries.  We&#xA;&gt;&gt; can drop old HTLC info post-splice though, and (after some delay for&#xA;&gt;&gt; obscurity) tell watchtowers to drop old entries I think.&#xA;&gt;&#xA;&gt; I agree the additional state isn&#39;t too burdensome, and that we would still&#xA;&gt; be&#xA;&gt; able to drop watchtower state after some delay as you mentioned.&#xA;&gt;&#xA;&gt; On one hand, it does seem like the opportune time to remove such state if&#xA;&gt; desired.&#xA;&gt;&#xA;&gt; OTOH, it is _really_ nice from an atomicity perspective that the current&#xA;&gt; channel and (potentially) N pending channels can be revoked using a single&#xA;&gt; commitment secret and message. Doing so would mean we don&#39;t have to&#xA;&gt; modify the `revoke_and_ack` or `channel_reestablish` messages. The receiver&#xA;&gt; would just apply the commitment secrets/points to the current channel and&#xA;&gt; any&#xA;&gt; pending splices.&#xA;&#xA;Agreed; on balance, it&#39;s fine to avoid reset.&#xA;&#xA;&gt; ## Misc&#xA;&gt;&#xA;&gt;&gt; Any reason to now make the splicing_add_* messages allow one to add&#xA;&gt; several&#xA;&gt;&gt; inputs in a single message? Given &#34;acceptable&#34; constraints for how large&#xA;&gt; the&#xA;&gt;&gt; witness and pkScripts can be, we can easily enforce an upper limit on the&#xA;&gt;&gt; number of inputs/outputs to add.&#xA;&gt;&#xA;&gt; Yes, I prefer this simplification.&#xA;&#xA;Just harder to write the spec that way :) I&#39;ll come up with something.&#xA;&#xA;&gt;&gt; Additionally, as the size of the channel is either expanding or&#xA;&gt; contracting,&#xA;&gt;&gt; both sides should be allowed to modify things like the CSV param, reserve,&#xA;&gt;&gt; max accepted htlc&#39;s, max htlc size, etc. Many of these parameters like the&#xA;&gt;&gt; CSV value should scale with the size of the channel, not allowing these&#xA;&gt;&gt; parameters to be re-negotiated could result in odd scenarios like still&#xA;&gt;&gt; maintain a 1 week CSV when the channel size has dipped from 1 BTC to 100k&#xA;&gt;&gt; satoshis.&#xA;&gt;&#xA;&gt; Agreed!&#xA;&#xA;&#34;CSV should scale with value&#34; seems like voodoo, though.  It make us&#xA;feel better that we&#39;re being conservative with large amounts of money,&#xA;but it makes no sense from a time-value-of-money perspective.  Sure,&#xA;bigger amounts are more important, but it&#39;s also more painful to have&#xA;them locked up.&#xA;&#xA;I&#39;d really like most of these parameters to go away, rather than&#xA;introducing YA negotiation pain point.  See other post.&#xA;&#xA;&gt;&gt; These all seem marginal to me.  I think if we start hitting max values,&#xA;&gt;&gt; we should discuss increasing them.&#xA;&gt;&#xA;&gt; Doesn&#39;t this defeat the goal of firewalling funds against individual channel&#xA;&gt; failures?&#xA;&#xA;That&#39;s kind of true, but you should be more concerned about node&#xA;failure, and thus diversify your channels between different nodes.&#xA;That&#39;s better for everyone.&#xA;&#xA;&gt; Splice out,&#xA;&gt; Conner&#xA;&#xA;Nice touch :)&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>