<oembed><type>rich</type><version>1.0</version><author_name>npub1za0a9afyj7um5feva0d5xmhfsah3zxm252hna2duq0numa952frqvuua2a</author_name><author_url>https://nostr.ae/npub1za0a9afyj7um5feva0d5xmhfsah3zxm252hna2duq0numa952frqvuua2a</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-10-23&#xA;📝 Original message:&#xA;Good evening lightning-dev,&#xA;&#xA;&gt; If we receive later receive two `channel_update`s whose&#xA;`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 subsumed.&#xA;I&#xA;&gt; think this works so long as the spending transaction doesn&#39;t contain&#xA;multiple&#xA;&gt; funding outputs, though I think the current proposal is fallible to this&#xA;as&#xA;&gt; well.&#xA;&#xA;Thought about this some more. The main difference seems to be whether the&#xA;gossiped data is forward or backward looking. By forward looking, I mean&#xA;that we&#xA;gossip where the splice will move to, and backward looking gossips where the&#xA;splice moved from.&#xA;&#xA;If we want to make the original proposal work w/ multiple funding outputs on&#xA;one splice, I think it can be accomplished by sending the funding outpoint&#xA;as&#xA;opposed to just the txid. For the backward looking proposal, the&#xA;`channel_update`&#xA;could be modified to include the `short_channel_id` of the prior funding&#xA;output.&#xA;IMO we probably want to include the extra specificity even if we don&#39;t plan&#xA;to&#xA;have multiple funding outputs on a commitment implemented tomorrow, since&#xA;outputs are what we truly care about.&#xA;&#xA;Of the two, it still seems like the backward looking approach results in&#xA;less&#xA;gossiped data since are able to reference a single confirmed output by&#xA;location&#xA;(8 bytes), instead of N unconfirmed outputs by outpoint (N*34 bytes).&#xA;&#xA;Another advantage I see with the backward looking splice announcments is&#xA;that&#xA;they can be properly verified before forwarding to the network by examining&#xA;the&#xA;channel lineage. In contrast, one can&#39;t be sure if the outpoint in a&#xA;forward looking&#xA;announcement will ever confirm, or even if it spends from the original&#xA;channel point&#xA;unless one also has the transaction. Until a splice does confirm, a node has&#xA;to store multiple potential splice outpoints. Seeing this, it seems to me&#xA;that&#xA;backward looking announcements are less susceptible to abuse and DOS in&#xA;this regard.&#xA;&#xA;Thoughts?&#xA;&#xA;Cheers,&#xA;Conner&#xA;&#xA;On Thu, Oct 18, 2018 at 8:04 PM Conner Fromknecht&#xA;&lt;conner at lightning.engineering&gt; wrote:&#xA;&#xA;&gt; Good evening all,&#xA;&gt;&#xA;&gt; Thank you Rusty for starting us down this path :) and to ZmnSCPxj and Lisa&#xA;&gt; for&#xA;&gt; your thoughts. I think this narrows down the design space considerably!&#xA;&gt;&#xA;&gt; In light of this, and if I&#39;m following along, it seems our hand is forced&#xA;&gt; 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;&gt;&#xA;&gt; &gt; To add some context to this, if you start accepting HTLC&#39;s for the new&#xA;&gt; balance&#xA;&gt; &gt; after the parallel commitment is made, but before the re-anchor is&#xA;&gt; buried,&#xA;&gt; &gt; there&#39;s the potential for a race condition between a unilateral close&#xA;&gt; (or any&#xA;&gt; &gt; revoked commitment transaction) and the re-anchoring commitment&#xA;&gt; transaction,&#xA;&gt; &gt; that spends the &#39;pre-committed&#39; UTXO of splicing in funds and the&#xA;&gt; original&#xA;&gt; &gt; funding transaction&#xA;&gt;&#xA;&gt; Indeed, I&#39;m not aware of any splicing mechanism that enables off-chain use&#xA;&gt; of&#xA;&gt; spliced-in funds before the new funding output confirms. Even in the async,&#xA;&gt; single-txn case, the new funds cannot be spent until the new funding output&#xA;&gt; confirms sufficiently.&#xA;&gt;&#xA;&gt; From my POV, the desired properties of a splice are:&#xA;&gt;  1. non-blocking (asynchronous) usage of the channel&#xA;&gt;  2. single on-chain txn&#xA;&gt;  3. ability to RBF (have multiple pending splices)&#xA;&gt;&#xA;&gt; Of these, it seems we&#39;ve solidified 1 and 2. I understand the desire to not&#xA;&gt; tackle RBF on the first attempt given the additional complexity.  However,&#xA;&gt; I&#xA;&gt; do believe there are ways we can proceed in which our first attempt largely&#xA;&gt; coincides with supporting it in the future.&#xA;&gt;&#xA;&gt; With that in mind, here are some thoughts on the proposals above.&#xA;&gt;&#xA;&gt; ## RBF and Multiple Splices&#xA;&gt;&#xA;&gt; &gt; 1. type: 132 (`commitment_signed`)&#xA;&gt; &gt; 2. data:&#xA;&gt; &gt;    * [`32`:`channel_id`]&#xA;&gt; &gt;    * [`64`:`signature`]&#xA;&gt; &gt;    * [`2`:`num_htlcs`]&#xA;&gt; &gt;    * [`num_htlcs*64`:`htlc_signature`]&#xA;&gt; &gt;    * [`num_htlcs*64`:`htlc_splice_signature`] (`option_splice`)&#xA;&gt;&#xA;&gt; This will overflow the maximum message size of 65535 bytes for num_htlcs &gt;&#xA;&gt; 511.&#xA;&gt;&#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;&gt;&#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;&gt;&#xA;&gt; CPFP works, though it&#39;s more wasteful than resigning and I&#39;d prefer only&#xA;&gt; to do&#xA;&gt; so out of necessity, rather than relying on it. CPFP is nice because it&#xA;&gt; doesn&#39;t&#xA;&gt; require interaction, though we are already assuming the other party to be&#xA;&gt; online during the splice (unlike unilateral closes).&#xA;&gt;&#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&#xA;&gt; 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;&gt;&#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&#xA;&gt; think 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;&gt;&#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 subsumed. 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;&gt;&#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;&gt;&#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;&gt;&#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;&gt;&#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,&#xA;&gt; reserve,&#xA;&gt; &gt; max accepted htlc&#39;s, max htlc size, etc. Many of these parameters like&#xA;&gt; 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;&gt;&#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&#xA;&gt; channel&#xA;&gt; failures?&#xA;&gt;&#xA;&gt; &gt;&gt;&gt; One thing that I think we should lift from the multiple funding output&#xA;&gt; &gt;&gt;&gt; approach is the &#34;pre seating of inputs&#34;. This is cool as it would allow&#xA;&gt; &gt;&gt;&gt; clients to generate addresses, that others could deposit to, and then&#xA;&gt; have&#xA;&gt; &gt;&gt;&gt; be spliced directly into the channel. Public derivation can be used,&#xA;&gt; along&#xA;&gt; &gt;&gt;&gt; with a script template to do it non-interactively, with the clients&#xA;&gt; picking&#xA;&gt; &gt;&gt;&gt; up these deposits, and initiating a splice in as needed.&#xA;&gt; &gt;&gt;&#xA;&gt; &gt;&gt; How about this restatement?&#xA;&gt; &gt;&gt;&#xA;&gt; &gt;&gt; 1.  Each channel has two public-key-derivation paths (BIP32) to create&#xA;&gt; onchain&#xA;&gt; &gt;&gt; addresses.  One for each side of the channel.&#xA;&gt; &gt;&gt; 2.  The base of the above is actually a combined private-public keypair&#xA;&gt; of both&#xA;&gt; &gt;&gt; sides (e.g. created via MuSig or some other protocol).  Thus the&#xA;&gt; addresses&#xA;&gt; &gt;&gt; require cooperation of both parties to spend.&#xA;&gt; &gt;&gt; 3.  When somebody sends to one of the onchain addresses in the path,&#xA;&gt; their&#xA;&gt; &gt;&gt; client detects this.&#xA;&gt; &gt;&gt; 4.  The client updates the current transaction state, such that the new&#xA;&gt; commit&#xA;&gt; &gt;&gt; transaction has two inputs ( the original channel transaction and the&#xA;&gt; new UTXO).&#xA;&gt; &gt;&gt;&#xA;&gt; &gt;&gt; The above seems unsafe without trust in the other peer, as, the other&#xA;&gt; peer can&#xA;&gt; &gt;&gt; simply refuse to create the new commit transaction.  Since the address&#xA;&gt; requires&#xA;&gt; &gt;&gt; both parties to spend, the money cannot be spent and there is no backoff&#xA;&gt; &gt;&gt; transaction that can be used.  But maybe you can describe some&#xA;&gt; mechanism to&#xA;&gt; &gt;&gt; ensure this, if this is what is meant instead?&#xA;&gt; &gt;&#xA;&gt; &gt; This could easily be solved by making the destination address a Taproot&#xA;&gt; &gt; address, which by default is just a 2-of-2, but in the uncooperative&#xA;&gt; &gt; case it can reveal the script it commits to, which is just a timelocked&#xA;&gt; &gt; refund that requires a single-sig. The only problem with this is that&#xA;&gt; &gt; the refund would be non-interactive, and so the entirety of the funds,&#xA;&gt; &gt; that may be from a third-party, need to be claimed by one endpoint,&#xA;&gt; &gt; i.e., there is no splitting the funds in case of an uncollaborative&#xA;&gt; &gt; refund. Not sure how important that is though, since I don&#39;t think&#xA;&gt; &gt; third-party funds will come from unrelated parties, e.g., most of these&#xA;&gt; &gt; funds will come from an on-chain wallet that is under the control of&#xA;&gt; &gt; either parties so the refund should go back to that party anyway.&#xA;&gt;&#xA;&gt; This can be accomplished similarly by having either (or both) party&#xA;&gt; publishing a&#xA;&gt; static address or publicly derivable address specific to the channel,&#xA;&gt; derived&#xA;&gt; from their HD seed.&#xA;&gt;&#xA;&gt; Arguably, the address should perhaps be global, so that it can outlive the&#xA;&gt; lifetime of the channel, i.e. as soon as the first person deposits and a&#xA;&gt; splice&#xA;&gt; is initiated, is the address still valid for the new channel if new keys&#xA;&gt; are&#xA;&gt; used? Similarly, the channel could be closed and the funds locked until&#xA;&gt; the timeout if the peer disappears.&#xA;&gt;&#xA;&gt; Regardless, both approaches can be made to have equivalent amounts of&#xA;&gt; [non-]interactivity. However, the recipient isn&#39;t burdened in spending by&#xA;&gt; 1) interaction with the channel peer, or 2) an absolute timeout if 1 fails,&#xA;&gt; giving the receiver more flexibility if they wish to not commit the&#xA;&gt; received&#xA;&gt; funds to a splice. It also benefits from smaller witness sizes, a larger&#xA;&gt; anonymity set, etc.&#xA;&gt;&#xA;&gt; In general, using a 2-of-2+timeout to stage funds for splicing doesn&#39;t&#xA;&gt; offer&#xA;&gt; that much IMO. It seems the primary purpose is to prevent the funds from&#xA;&gt; being&#xA;&gt; double spent during the splice, but observe that this is still possible if&#xA;&gt; the&#xA;&gt; timeout matures, perhaps because the splice doesn&#39;t confirm in a timely&#xA;&gt; manner.&#xA;&gt;&#xA;&gt; Acknowledging this, detecting double-spent inputs is still required for&#xA;&gt; full&#xA;&gt; correctness. By implementing it, either party is free to propose arbitrary&#xA;&gt; inputs for a splice, which I believe reduces complexity in the long run.&#xA;&gt;&#xA;&gt; Splice out,&#xA;&gt; Conner&#xA;&gt;&#xA;&gt; On Tue, Oct 16, 2018 at 10:00 PM ZmnSCPxj via Lightning-dev &lt;&#xA;&gt; lightning-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; Good morning lisa,&#xA;&gt;&gt;&#xA;&gt;&gt; This is a good observation.&#xA;&gt;&gt;&#xA;&gt;&gt; Before, I&#39;d already considered the rationale, for why channels have a&#xA;&gt;&gt; single 2-of-2 UTXO as funding output.  And it seems I should have&#xA;&gt;&gt; considered this, prior to accepting the &#34;parallel&#34; construction as feasible.&#xA;&gt;&gt;&#xA;&gt;&gt; For sake of posterity, I leave the below writeup as a tangential to the&#xA;&gt;&gt; design of splice (and to the design of Lightning having a single 2-of-2&#xA;&gt;&gt; UTXOs):&#xA;&gt;&gt;&#xA;&gt;&gt; # 0-conf is Unsafe, Yet Lightning is Safe; Why?&#xA;&gt;&gt;&#xA;&gt;&gt; To accept a 0-conf transaction output, is known to be unsafe.&#xA;&gt;&gt; Replace-by-fee is always a possibility, regardless of whether the&#xA;&gt;&gt; transaction opts in to RBF or not: a rational miner will always accept the&#xA;&gt;&gt; higher feerate, disregarding any &#34;opt-in&#34; flag that is set or not set on&#xA;&gt;&gt; the transaction.  Thus we reject any advice that claims that 0-conf is&#xA;&gt;&gt; tenable, even for tiny amounts.&#xA;&gt;&gt;&#xA;&gt;&gt; Yet when viewed solely in terms of transactions, Lightning protocol uses&#xA;&gt;&gt; transactions that are not on any block (are kept offchain).  Since they are&#xA;&gt;&gt; not in a block, they are indistinguishable from 0-conf transactions, which&#xA;&gt;&gt; are accepted by the receiver, yet are also not on any block.  One might&#xA;&gt;&gt; argue the distinction, that a &#34;real&#34; 0-conf transaction exists on some&#xA;&gt;&gt; mempool somewhere, and thus has a chance to be on a block in the future,&#xA;&gt;&gt; but mempools have no consensus, and the existence of a transaction on some&#xA;&gt;&gt; mempool is not a safe assurance of it existing in the mempool of the next&#xA;&gt;&gt; winning miner.&#xA;&gt;&gt;&#xA;&gt;&gt; So why is Lightning safe, when 0-conf transactions are in general not&#xA;&gt;&gt; safe?&#xA;&gt;&gt;&#xA;&gt;&gt; Again, we should focus on why 0-conf transactions in general are not&#xA;&gt;&gt; safe: transaction replacement.  Thus, 0-conf transactions can be made safe,&#xA;&gt;&gt; if you are somehow able to ensure that replacement transactions cannot be&#xA;&gt;&gt; made.&#xA;&gt;&gt;&#xA;&gt;&gt; For example, if you are part of an n-of-n federation that signs the&#xA;&gt;&gt; transaction, you can always safely accept a 0-conf transaction from that&#xA;&gt;&gt; federation paying only to you, because you can always veto any replacement&#xA;&gt;&gt; (by simply refusing to sign) that is not in your interests.&#xA;&gt;&gt;&#xA;&gt;&gt; This is in fact how Lightning works: a 2-of-2 federation (the channel&#xA;&gt;&gt; counterparties) are the signatories of the 0-conf transactions that are the&#xA;&gt;&gt; commitment transactions of the Lightning protocol.  Replacement of the&#xA;&gt;&gt; commitment transactions is strictly guided by the protocol; both sides have&#xA;&gt;&gt; veto rights, since the source transaction output is 2-of-2.&#xA;&gt;&gt;&#xA;&gt;&gt; Thus, Lightning, though it uses 0-conf transactions, is safe, because it&#xA;&gt;&gt; prevents the replacement of a 0-conf transaction without the receiver&#xA;&gt;&gt; allowing it, by the simple expedient of including the receiver in the&#xA;&gt;&gt; 2-of-2 multisig guarding its single funding TXO.&#xA;&gt;&gt;&#xA;&gt;&gt; ##  The Implications for Splice Proposals&#xA;&gt;&gt;&#xA;&gt;&gt; Some splice proposals involve creating the equivalent of multiple funding&#xA;&gt;&gt; TXOs for a single channel.  Such constructions are unsafe-by-default on&#xA;&gt;&gt; Poon-Dryja.&#xA;&gt;&gt;&#xA;&gt;&gt; In reality, every commitment transaction (or update transaction in&#xA;&gt;&gt; Decker-Osuntokun-Russell) is replaceable by any other commitment (or&#xA;&gt;&gt; update) transaction for that channel.  Under Poon-Dryja older transactions&#xA;&gt;&gt; are revoked (and hence one side risks loss of their collateral) while under&#xA;&gt;&gt; Decker-Osuntokun-Russell older transactions may be &#34;gainsaid&#34; (i.e. newer&#xA;&gt;&gt; update transactions may be reanchored to consume the TXO of the older&#xA;&gt;&gt; update transaction, thus preventing that update from truly being committed&#xA;&gt;&gt; to).&#xA;&gt;&gt;&#xA;&gt;&gt; This is relevant since before a splice, the channel has a single funding&#xA;&gt;&gt; TXO, while after the splice, the channel has multiple.&#xA;&gt;&gt;&#xA;&gt;&gt; In particular, a commitment (or update) transaction, that has multiple&#xA;&gt;&gt; inputs (to consume the multiple funding TXOs), can be replaced with a&#xA;&gt;&gt; commitment (or update) transaction that was created before the splice.&#xA;&gt;&gt; Under Poon-Dryja, such a commitment transaction may be revoked, but this&#xA;&gt;&gt; leaves the other funding TXOs unuseable.  Under Decker-Osuntokun-Russell,&#xA;&gt;&gt; as long as the sequence number is preserved across the splice, it is&#xA;&gt;&gt; possible for a later update transaction with multiple inputs to simply&#xA;&gt;&gt; gainsay the old single-input update with the new multiple-input update&#xA;&gt;&gt; transaction. (I suppose, that this is another advantage that&#xA;&gt;&gt; Decker-Osuntokun-Russell has).&#xA;&gt;&gt;&#xA;&gt;&gt; Regards,&#xA;&gt;&gt; ZmnSCPxj&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Sent with ProtonMail &lt;https://protonmail.com&gt; Secure Email.&#xA;&gt;&gt;&#xA;&gt;&gt; ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&#xA;&gt;&gt; On Wednesday, October 17, 2018 9:09 AM, lisa neigut &lt;niftynei at gmail.com&gt;&#xA;&gt;&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt; To add some context to this, if you start accepting HTLC&#39;s for the new&#xA;&gt;&gt; balance after the parallel commitment is made, but before the re-anchor is&#xA;&gt;&gt; buried, there&#39;s the potential for a race condition between a unilateral&#xA;&gt;&gt; close (or any revoked commitment transaction) and the re-anchoring&#xA;&gt;&gt; commitment transaction, that spends the &#39;pre-committed&#39; UTXO of splicing in&#xA;&gt;&gt; funds and the original funding transaction.&#xA;&gt;&gt;&#xA;&gt;&gt; You can get around this by waiting until both the pre-commitment UTXO and&#xA;&gt;&gt; the re-anchor have cleared a minimum depth before accepting HTLC&#39;s for the&#xA;&gt;&gt; new balance totals, but that&#39;s twice as long of a wait as the first,&#xA;&gt;&gt; synchronized re-commitment scheme that Rusty originally proposed.&#xA;&gt;&gt;&#xA;&gt;&gt; It also makes leaving the original funding transaction &#39;exposed&#39; (ie&#xA;&gt;&gt; Rene&#39;s version of parallel splice) untenable, as there&#39;s always the risk of&#xA;&gt;&gt; an old state being published to consume that input. This foobars your&#xA;&gt;&gt; current HTLC commitments.&#xA;&gt;&gt;&#xA;&gt;&gt; On Tue, Oct 16, 2018 at 3:31 PM Rusty Russell &lt;rusty at rustcorp.com.au&gt;&#xA;&gt;&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Rusty Russell &lt;rusty at rustcorp.com.au&gt; writes:&#xA;&gt;&gt;&gt; &gt; If we&#39;re going to do side splice-in like this, I would use a very&#xA;&gt;&gt;&gt; &gt; different protocol: the reason for this protocol was to treat splice-in&#xA;&gt;&gt;&gt; &gt; and splice-out the same, and inline splice-in requires wait time.&#xA;&gt;&gt;&gt; Since&#xA;&gt;&gt;&gt; &gt; splice-out doesn&#39;t, we don&#39;t need this at all.&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; It would look much more like:&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; 1. Prepare any output with script of specific form. eg:&#xA;&gt;&gt;&gt; &gt;         OP_DEPTH 3 OP_EQUAL OP_IF&#xA;&gt;&gt;&gt; &gt;                 &lt;funding_pubkey1&gt; &lt;funding_pubkey2&gt; OP_CHECKMULTISIG&#xA;&gt;&gt;&gt; &gt;         OP_ELSE&#xA;&gt;&gt;&gt; &gt;                 &lt;blockheight&gt; OP_CHECKLOCKTIMEVERIFY OP_DROP&#xA;&gt;&gt;&gt; &gt;                 &lt;myrescue_pubkey&gt; OP_CHECKSIG&#xA;&gt;&gt;&gt; &gt;         OP_ENDIF&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; 1. type: 40 (`splice_in`) (`option_splice`)&#xA;&gt;&gt;&gt; &gt; 2. data:&#xA;&gt;&gt;&gt; &gt;    * [`32`:`channel_id`]&#xA;&gt;&gt;&gt; &gt;    * [`8`: `satoshis`]&#xA;&gt;&gt;&gt; &gt;    * [`32`: `txid`]&#xA;&gt;&gt;&gt; &gt;    * [`4`: `txoutnum`]&#xA;&gt;&gt;&gt; &gt;    * [`4`: `blockheight`]&#xA;&gt;&gt;&gt; &gt;    * [`33`: `myrescue_pubkey`]&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; 1. type: 137 (`update_splice_in_accept`) (`option_splice`)&#xA;&gt;&gt;&gt; &gt;    data:&#xA;&gt;&gt;&gt; &gt;    * [`32`:`channel_id`]&#xA;&gt;&gt;&gt; &gt;    * [`32`: `txid`]&#xA;&gt;&gt;&gt; &gt;    * [`4`: `txoutnum`]&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; 1. type: 138 (`update_splice_in_reject`) (`option_splice`)&#xA;&gt;&gt;&gt; &gt;    data:&#xA;&gt;&gt;&gt; &gt;    * [`32`:`channel_id`]&#xA;&gt;&gt;&gt; &gt;    * [`32`: `txid`]&#xA;&gt;&gt;&gt; &gt;    * [`2`:`len`]&#xA;&gt;&gt;&gt; &gt;    * [`len`:`errorstr`]&#xA;&gt;&gt;&gt; &gt;&#xA;&gt;&gt;&gt; &gt; The recipient of `splice_in` checks that it&#39;s happy with the&#xA;&gt;&gt;&gt; &gt; `blockheight` (far enough in future).  Once it sees the tx referred to&#xA;&gt;&gt;&gt; &gt; buried to its own `minimum_depth`, it checks output is what they&#xA;&gt;&gt;&gt; &gt; claimed, then sends `update_splice_in_accept`; it&#39;s followed up&#xA;&gt;&gt;&gt; &gt; `commitment_signed` like normal, but from this point onwards, all&#xA;&gt;&gt;&gt; &gt; commitment txs signatures have one extra sig.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Lisa started asking pointed questions, and so I noticed that parallel&#xA;&gt;&gt;&gt; splice doesn&#39;t work with Poon-Dryja channels.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The counterparty can spend the old funding txout with a revoked spend.&#xA;&gt;&gt;&gt; Sure, I can take all the money from that, but what about the spliced&#xA;&gt;&gt;&gt; input?&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I came up with increasingly elaborate workarounds, but nothing stuck.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Back to Plan A...&#xA;&gt;&gt;&gt; Rusty.&#xA;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt; Lightning-dev mailing list&#xA;&gt;&gt;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; Lightning-dev mailing list&#xA;&gt;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181022/337246c7/attachment-0001.html&gt;</html></oembed>