<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated></updated>
  <generator>https://nostr.ae</generator>

  <title>Nostr notes by </title>
  <author>
    <name></name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://nostr.ae/npub1za0a9afyj7um5feva0d5xmhfsah3zxm252hna2duq0numa952frqvuua2a.rss" />
  <link href="https://nostr.ae/npub1za0a9afyj7um5feva0d5xmhfsah3zxm252hna2duq0numa952frqvuua2a" />
  <id>https://nostr.ae/npub1za0a9afyj7um5feva0d5xmhfsah3zxm252hna2duq0numa952frqvuua2a</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://nostr.ae/nevent1qqsrn0jgjq8g39p3x6cstzzwhczfr8etk9hphv4kv5zsrrdrwryltnszyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvzz8dje</id>
    
      <title type="html">📅 Original date posted:2020-10-20 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsrn0jgjq8g39p3x6cstzzwhczfr8etk9hphv4kv5zsrrdrwryltnszyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvzz8dje" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsr2f5lgsh3d9lmhnm4mlmefrlkhvtsfkkpacjes8qcsmu022nk2usdsx24x&#39;&gt;nevent1q…x24x&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-10-20&lt;br/&gt;📝 Original message:&lt;br/&gt;-----BEGIN PGP SIGNED MESSAGE-----&lt;br/&gt;Hash: SHA256&lt;br/&gt;&lt;br/&gt;Hi all,&lt;br/&gt;&lt;br/&gt;Today we are writing to disclose the details of CVE-2020-26896 as a follow up to&lt;br/&gt;the partial disclosure sent to lightning-dev [1].&lt;br/&gt;&lt;br/&gt;## Abstract&lt;br/&gt;&lt;br/&gt;Prior to v0.11.0-beta, an lnd node could be coerced into revealing an invoice&lt;br/&gt;preimage for a forwarded HTLC with a colliding payment hash. This can be&lt;br/&gt;exploited to a) weaken the victim&amp;#39;s receiver privacy by confirming the&lt;br/&gt;destination of an HTLC, and/or b) under certain circumstances, result in loss of&lt;br/&gt;funds to the victim by believing the invoice was paid when it only received&lt;br/&gt;routing fees. We have no evidence of either case being exploited in the wild.&lt;br/&gt;&lt;br/&gt;It affects routing nodes, i.e. any lnd node that permits HTLC forwarding and&lt;br/&gt;operates as any form of merchant node (accepts payment for goods &amp;amp; services);&lt;br/&gt;nodes that use rejecthtlc=1 are not affected.&lt;br/&gt;&lt;br/&gt;The vulnerability was reported privately to the lnd team by Antoine Riard.&lt;br/&gt;&lt;br/&gt;## Background&lt;br/&gt;&lt;br/&gt;When resolving incoming HTLCs on-chain, the forwarding node is expected to&lt;br/&gt;supply a valid preimage via the witness in order to claim the HTLC. Preimages&lt;br/&gt;can be learned in two primary ways: by generating an invoice or receiving a&lt;br/&gt;preimage as the result of a successfully forwarded HTLC. Internally, lnd tracks&lt;br/&gt;these differing preimage classes in two distinct places: an invoice database and&lt;br/&gt;a preimage database.&lt;br/&gt;&lt;br/&gt;For proper handling, a node should inspect the off-chain HTLC it received to&lt;br/&gt;determine whether the node was an intermediary or the final hop (indicated by an&lt;br/&gt;all zeros next_hop short channel id). Final hops are intended to consult the&lt;br/&gt;invoice database for preimages, while intermediaries should consult the preimage&lt;br/&gt;database.&lt;br/&gt;&lt;br/&gt;Earlier versions of lnd would incorrectly fallback to the invoice database if&lt;br/&gt;the preimage database did not contain the preimage. This resulted in situations&lt;br/&gt;where the node would reveal an invoice preimage, even though the victim was not&lt;br/&gt;the final hop in a route.&lt;br/&gt;&lt;br/&gt;In coordination with a triggered channel closure, an attacker can construct a&lt;br/&gt;malicious HTLC through the victim, divulging the target invoice preimage&lt;br/&gt;on-chain when the incoming HTLCis claimed. After disclosing the preimage, an&lt;br/&gt;attacker can claim a concurrent outgoing HTLC whose CLTV has not yet expired.&lt;br/&gt;his results in the HTLC&amp;#39;s value being stolen, minus routing fees, since the&lt;br/&gt;victim incorrectly believes they received the payment.&lt;br/&gt;&lt;br/&gt;## Attack Scenario&lt;br/&gt;&lt;br/&gt;An example of the attack goes as follows:&lt;br/&gt;&lt;br/&gt;Assume a _real HTLC_ is routed to a malicious node, Malice, that has a channel&lt;br/&gt;with sufficient outgoing bandwidth to forward to the victim, Bob, the intended&lt;br/&gt;receiver of the payment.&lt;br/&gt;&lt;br/&gt;Instead of forwarding the real HTLC, Malice creates a new _malicious HTLC_ which&lt;br/&gt;has the same payment hash. The first hop’s amount should be equal or slightly&lt;br/&gt;larger, the CLTV can be increased as desired up to default implementation&lt;br/&gt;limits.&lt;br/&gt;&lt;br/&gt;Malice forwards the malicious HTLC in a circular route through Bob and back to&lt;br/&gt;herself, where she holds the malicious HTLC.&lt;br/&gt;&lt;br/&gt;With the malicious HTLC locked in place, Malice triggers a unilateral close of&lt;br/&gt;the Malice-Bob channel. The commitment played (from Bob’s POV) has an incoming&lt;br/&gt;HTLC with the target invoice’s payment hash. The unilateral closure should be&lt;br/&gt;initiated well before any of the malicious HTLC’s CLTVs expire, otherwise the&lt;br/&gt;last channel in the route will also go to chain.&lt;br/&gt;&lt;br/&gt;When the unilateral close is confirmed, Bob will promptly broadcast the&lt;br/&gt;HTLC-success transaction for the malicious HTLC. Due to the bug, the preimage&lt;br/&gt;provided to sweep the malicious HTLC is obtained from the invoice database as a&lt;br/&gt;fallback to the (forwarded) preimage database, rather than being ignored.&lt;br/&gt;&lt;br/&gt;The victim, Bob, has already marked the invoice settled and published the&lt;br/&gt;preimage on-chain. However, the malicious HTLC is still active on Bob’s&lt;br/&gt;downstream channel (and the rest of the circular route), allowing Malice to&lt;br/&gt;settle the malicious HTLC she holds _after_ the invoice has already been marked&lt;br/&gt;paid. This results in Bob only receiving routing fees, and the Malice&lt;br/&gt;redirecting the payment to herself, while simultaneously convincing Bob of&lt;br/&gt;receiving the full payment.&lt;br/&gt;&lt;br/&gt;At this point, the malicious HTLC  has been successfully pulled from Malice to&lt;br/&gt;herself in a circular route, making herself whole minus routing fees (in&lt;br/&gt;addition to chain fees if she was the initiator of the Malice-Bob channel).&lt;br/&gt;Malice then settles the real, intercepted HTLC using the same preimage to obtain&lt;br/&gt;a profit.&lt;br/&gt;&lt;br/&gt;### Caveats&lt;br/&gt;&lt;br/&gt;For the attack to succeed, Malice must intercept a legacy HTLC or a&lt;br/&gt;single-sharded MPP HTLC. If any other concurrent MPP shard has already reached&lt;br/&gt;Bob before attempting to claim on-chain, the attack will fail due to additional&lt;br/&gt;safety checks added to lnd [2], preventing an invoice from being settled by a&lt;br/&gt;downgraded HTLC after it has already accepted an MPP shard with a valid payment&lt;br/&gt;secret.&lt;br/&gt;&lt;br/&gt;In order to directly profit from the attack, Malice must be intercepting a&lt;br/&gt;payment from an unsuspecting victim, limiting control of timing and the amount&lt;br/&gt;that can be siphoned. Malice must also somehow infer or guess that Bob has the&lt;br/&gt;corresponding invoice being paid.&lt;br/&gt;&lt;br/&gt;If Malice runs the same attack without intercepting a real HTLC, she pays&lt;br/&gt;routing fees, and possibly chain fees, in exchange for the invoice preimage and&lt;br/&gt;identity of the receiver. However, it is possible for her to indirectly profit&lt;br/&gt;from this if the service provider releases tangible goods or services to anyone&lt;br/&gt;with knowledge of the invoice preimage, which is not recommended in practice.&lt;br/&gt;&lt;br/&gt;The upstream attacker does not need to be adjacent, they only need to know which&lt;br/&gt;channel to target and watch for closure. Being adjacent increases the&lt;br/&gt;assuredness of pulling off an exploit, but is not strictly required.&lt;br/&gt;&lt;br/&gt;Similarly, the downstream attacker (possibly distinct from Malice) does not need&lt;br/&gt;to be adjacent, they can settle the malicious HTLC further downstream to the&lt;br/&gt;same effect at the cost of more routing fees.&lt;br/&gt;&lt;br/&gt;## Patch&lt;br/&gt;&lt;br/&gt;This vulnerability was patched in lnd v0.11.0-beta, by properly isolating the&lt;br/&gt;preimage database from the invoice database according to the HTLC&amp;#39;s next_hop&lt;br/&gt;field in commit cf739f3f [3] of PR 4157 [4]. The isolation ensures that we can&lt;br/&gt;only claim forwarded HTLCs as a result of learning the preimage from an outgoing&lt;br/&gt;HTLC. It also fixes the privacy leak by not revealing invoice preimages unless&lt;br/&gt;the node is the final destination.&lt;br/&gt;&lt;br/&gt;Due to the complexities involved in describing vulnerabilities over textual&lt;br/&gt;mediums, the full nature of the issue wasn’t fully understood until after&lt;br/&gt;v0.10.0-beta had been released. Additionally, the covert fix contained in the&lt;br/&gt;v0.11.0-beta release was pushed back due to a concurrent investigation into&lt;br/&gt;network instabilities resulting in unexpected channel closures.&lt;br/&gt;&lt;br/&gt;Note, although the above patch fixes the issue, this issue could have also been&lt;br/&gt;avoided by having receivers require payment secrets (BOLT 11 `s` field) since&lt;br/&gt;the attackers would be unable to guess the payment secret. However, left as&lt;br/&gt;optional, the attacker can always downgrade to using malicious HTLCs that omit&lt;br/&gt;the payment secret.&lt;br/&gt;&lt;br/&gt;For some time we have debated flipping the switch on requiring payment secrets&lt;br/&gt;across the three major implementations. This vulnerability is further evidence&lt;br/&gt;to the additional safety and privacy benefits. Now almost a year since the&lt;br/&gt;initial deployment of payment secrets in lnd, the upcoming v0.12.0-beta release&lt;br/&gt;of lnd is likely to make payment secrets required by default. We would welcome&lt;br/&gt;other implementations to do the same.&lt;br/&gt;&lt;br/&gt;## Timeline&lt;br/&gt;&lt;br/&gt;04/19/2020 - Initial report from Antoine Riard&lt;br/&gt;04/29/2020 - lnd v0.10.0-beta released&lt;br/&gt;07/07/2020 - PR 4157 merged into master&lt;br/&gt;08/20/2020 - lnd v0.11.0-beta released&lt;br/&gt;10/08/2020 - Partial Disclosure sent to lightning-dev and lnd mailing list [1]&lt;br/&gt;10/20/2020 - Full Disclosure sent to lightning-dev and lnd mailing list&lt;br/&gt;&lt;br/&gt;## References&lt;br/&gt;&lt;br/&gt;[1] &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002819.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002819.html&lt;/a&gt;&lt;br/&gt;[2] &lt;a href=&#34;https://github.com/lightningnetwork/lnd/blob/9f32942a90bcd91cc37a4a9c6c2fb454f534a65d/invoices/update.go#L229&#34;&gt;https://github.com/lightningnetwork/lnd/blob/9f32942a90bcd91cc37a4a9c6c2fb454f534a65d/invoices/update.go#L229&lt;/a&gt;&lt;br/&gt;[3] &lt;a href=&#34;https://github.com/lightningnetwork/lnd/pull/4157/commits/cf739f3f87fdcb28ab45dfd48e3d18adf26e45b3&#34;&gt;https://github.com/lightningnetwork/lnd/pull/4157/commits/cf739f3f87fdcb28ab45dfd48e3d18adf26e45b3&lt;/a&gt;&lt;br/&gt;[4] &lt;a href=&#34;https://github.com/lightningnetwork/lnd/pull/4157&#34;&gt;https://github.com/lightningnetwork/lnd/pull/4157&lt;/a&gt;&lt;br/&gt;[5] &lt;a href=&#34;https://gist.github.com/ariard/6bdeb995565d1cc292753e1ee4ae402d&#34;&gt;https://gist.github.com/ariard/6bdeb995565d1cc292753e1ee4ae402d&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;A big thank you to Antoine for the responsible disclosure and for helping to&lt;br/&gt;make lnd more safu. More information can be found in Antoine’s disclosure [5].&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;Conner Fromknecht&lt;br/&gt;&lt;br/&gt;-----BEGIN PGP SIGNATURE-----&lt;br/&gt;&lt;br/&gt;iQIzBAEBCAAdFiEEnI1hhop8SSADsnRO59c3tn&#43;lkscFAl&#43;PWzMACgkQ59c3tn&#43;l&lt;br/&gt;kseIJw//UwswUyh6BNgmi4D8NoC6olelW0dRmecqcZF7JBQa619kVFm/D7rixp33&lt;br/&gt;J1YsXvZC2OLTpqmaJcJ3OvBKLVcW7CxheDp3Pm0JjrfVnmOl1NGX4CSymL6Zpou7&lt;br/&gt;nFqh&#43;nqOZ2n6o4OIv&#43;mx0y2YANKjAVtAcr9LakubMn/3LgYzqvKKu39QGqrtz9vZ&lt;br/&gt;lYGAAPU3zlAjIjFNv56xWpF0Pj9VE2mQB27w2QmbSuNtR21feOSJhJimEvmXhk6d&lt;br/&gt;O0Ze78Fea&#43;eaS&#43;d1uyRkB7aaEKBRAA5WCtDKgSOwfEY&#43;mHC7u5&#43;LRasyegjlc8Ie&lt;br/&gt;hYBNOsjEZqVjwIgr&#43;lqMDbQ8B5RtW4LVro/LMYGCbVRnGuF16gHu/lkDnVgz/sY7&lt;br/&gt;sbsPVG11wfVFH0U/TyJoBC8qOmeHMJoVsvGbY9I2XQiFw7yAbWxEdU&#43;7mMhQZA2Z&lt;br/&gt;Zd9pl0ATByLFPyg58gA6G4JV&#43;F45DvYrG3jj6cdkUvL2nQST08IZtTjnDxAnkDTk&lt;br/&gt;HwnJo0fd7vsixEyssTMuSCjbGSaPDMPCkmNQg8PAhhoIK8MeKUlylCKJuM6gMWeW&lt;br/&gt;YypzGBmE6O7OtoMTOYFWysU67edVXgQTV2dD/PE6abTYOfS79gvkNekU4BvW9NDE&lt;br/&gt;af0JBywXovzNVshdqpijPBleOT8/QSyTdLvI78ev&#43;zpJMsKMugU=&lt;br/&gt;=PY6W&lt;br/&gt;-----END PGP SIGNATURE-----
    </content>
    <updated>2023-06-09T15:01:23&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqst6penj20uh9448ghjez89gnm83wzyg7vtpufw9h6etv4pzs00z9gzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvpqsljp</id>
    
      <title type="html">📅 Original date posted:2019-12-03 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqst6penj20uh9448ghjez89gnm83wzyg7vtpufw9h6etv4pzs00z9gzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvpqsljp" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0elnmtq2f3d7hlfp7drzggv9hj4glhrf3s9ahnefp6hsegsvus4ccwdu3w&#39;&gt;nevent1q…du3w&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-12-03&lt;br/&gt;📝 Original message:&lt;br/&gt;Good evening,&lt;br/&gt;&lt;br/&gt;&amp;gt; I didn&amp;#39;t think this was the design.  The update transaction can spend any&lt;br/&gt;prior, with a fixed script, due to NOINPUT.&lt;br/&gt;&lt;br/&gt;&amp;gt;From my reading of the final construction, each update transaction has a&lt;br/&gt;unique script to bind settlement transactions to exactly one update.&lt;br/&gt;&lt;br/&gt;&amp;gt; My understanding is that this is not logically possible?&lt;br/&gt;The update transaction has no fixed txid until it commits to a particular&lt;br/&gt;output-to-be-spent, which is either the funding/kickoff txout, or a&lt;br/&gt;lower-`nLockTime` update transaction output.&lt;br/&gt;&amp;gt; Thus a settlement transaction *must* use `NOINPUT` as well, as it has no&lt;br/&gt;txid it can spend, if it is constrained to spend a particular update&lt;br/&gt;transaction.&lt;br/&gt;&lt;br/&gt;This is also my understanding. Any presigned descendants of a NOINPUT txn&lt;br/&gt;must also use NOINPUT as well. This chain must continue until a signer is&lt;br/&gt;online to bind a txn to a confirmed input. The unique settlement keys thus&lt;br/&gt;prevent rebinding of settlement txns since NOINPUT with a shared script&lt;br/&gt;would be too liberal.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Conner&lt;br/&gt;&lt;br/&gt;On Mon, Dec 2, 2019 at 18:55 ZmnSCPxj &amp;lt;ZmnSCPxj at protonmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Rusty,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Hi all,&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; I recently revisited the eltoo paper and noticed some things related&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; watchtowers that might affect channel construction.&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Due to NOINPUT, any update transaction can spend from any other, so&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; in theory the tower only needs the most recent update txn to resolve&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; any dispute.&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; In order to spend, however, the tower must also produce a witness&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; script which when hashed matches the witness program of the input. To&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; ensure settlement txns can only spend from exactly one update txn,&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; each update txn uses unique keys for the settlement clause, meaning&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; that each state has a unique witness program.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I didn&amp;#39;t think this was the design. The update transaction can spend&lt;br/&gt;&amp;gt; &amp;gt; any prior, with a fixed script, due to NOINPUT.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The settlement transaction does not use NOINPUT, and thus can only&lt;br/&gt;&amp;gt; &amp;gt; spend the matching update.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My understanding is that this is not logically possible?&lt;br/&gt;&amp;gt; The update transaction has no fixed txid until it commits to a particular&lt;br/&gt;&amp;gt; output-to-be-spent, which is either the funding/kickoff txout, or a&lt;br/&gt;&amp;gt; lower-`nLockTime` update transaction output.&lt;br/&gt;&amp;gt; Thus a settlement transaction *must* use `NOINPUT` as well, as it has no&lt;br/&gt;&amp;gt; txid it can spend, if it is constrained to spend a particular update&lt;br/&gt;&amp;gt; transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Unless I misunderstand how update transactions work, or what settlement&lt;br/&gt;&amp;gt; transactions are.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;-- &lt;br/&gt;—Sent from my Spaceship&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191202/00acdf73/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191202/00acdf73/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:57:32&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs804pqvvj52qg2veesksu0pvwn5cvfhd63w70n833m9q2h0wv528czyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv73au2k</id>
    
      <title type="html">📅 Original date posted:2018-11-13 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs804pqvvj52qg2veesksu0pvwn5cvfhd63w70n833m9q2h0wv528czyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv73au2k" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs00qymms56z9uf6xec8yxslx833f8n80qa7cftkwma4xuc3tfjztqkd48q4&#39;&gt;nevent1q…48q4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-13&lt;br/&gt;📝 Original message:&lt;br/&gt;Good morning all,&lt;br/&gt;&lt;br/&gt;&amp;gt; MUST NOT forward (if an intermediate node) or claim (if the final node) unless&lt;br/&gt;&amp;gt; it has received a total greater or equal to `intended_total_payment` in all&lt;br/&gt;&amp;gt; incoming HTLCs for the same `payment_hash`.&lt;br/&gt;&lt;br/&gt;I was under the impression that this would not require changes on behalf of the&lt;br/&gt;intermediaries, and only need to be implemented by the sender and receiver?&lt;br/&gt;If not, then nodes would need to advertise that they support this so that the&lt;br/&gt;sender can be sure to route through the subset of nodes that support it.&lt;br/&gt;&lt;br/&gt;Either way, it would seem that this constraint can only be accurately enforced&lt;br/&gt;by the receiver. If any partial payments fail, then the `intended_total_payment`&lt;br/&gt;through an intermediary may never arise and the payment would be held. This&lt;br/&gt;would also seem to exclude the possibility of iterative path finding, since the&lt;br/&gt;entire payment flow must be known up front during onion packet construction.&lt;br/&gt;&lt;br/&gt;Seems the proposal still works without the intermediaries needing to know this?&lt;br/&gt;&lt;br/&gt;We may want to add that the receiver:&lt;br/&gt;* SHOULD fail the payment if `intended_total_payment` is less than the invoice&lt;br/&gt;   amount&lt;br/&gt;&lt;br/&gt;&amp;gt; I&amp;#39;m wondering, since these payments are no longer atomic, should we name it&lt;br/&gt;&amp;gt; accordingly?&lt;br/&gt;&lt;br/&gt;Indeed this true. Perhaps NAMP or CPHR (Concurrent Payment Hash Re-use) are more&lt;br/&gt;accurate and may avoid confusion?&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Conner&lt;br/&gt;On Tue, Nov 13, 2018 at 8:33 AM Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Good evening Z and list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m wondering, since these payments are no longer atomic, should we name it accordingly?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Johan&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Tue, Nov 13, 2018 at 1:28 PM ZmnSCPxj via Lightning-dev &amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I propose the below to support Base AMP.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The below would allow arbitrary merges of paths, but not arbitrary splits.  I am uncertain about the safety of arbitrary splits.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### The `multipath_merge_per_hop` type (`option_base_amp`)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This indicates that payment has been split by the sender using Base AMP, and that the receiver should wait for the total intended payment before forwarding or claiming the payment.&lt;br/&gt;&amp;gt;&amp;gt; In case the receiving node is not the last node in the path, then succeeding hops MUST be the same across all splits.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. type: 1 (`termination_per_hop`)&lt;br/&gt;&amp;gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;&amp;gt;   * [`8` : `short_channel_id`]&lt;br/&gt;&amp;gt;&amp;gt;   * [`8` : `amt_to_forward`]&lt;br/&gt;&amp;gt;&amp;gt;   * [`4` : `outgoing_cltv_value`]&lt;br/&gt;&amp;gt;&amp;gt;   * [`8` : `intended_total_payment`]&lt;br/&gt;&amp;gt;&amp;gt;   * [`4` : `zeros`]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The contents of this hop will be the same across all paths of the Base AMP.&lt;br/&gt;&amp;gt;&amp;gt; The `payment_hash` of the incoming HTLCs will also be the same across all paths of the Base AMP.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; `intended_total_payment` is the total amount of money that this node should expect to receive in all incoming paths to the same `payment_hash`.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This may be the last hop of a payment onion, in which case the `HMAC` for this hop will be `0` (the same rule as for `per_hop_type` 0).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The receiver:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * MUST impose a reasonable timeout for waiting to receive all component paths, and fail all incoming HTLC offers for the `payment_hash`  if they have not totalled equal to `intended_total_payment`.&lt;br/&gt;&amp;gt;&amp;gt; * MUST NOT forward (if an intermediate node) or claim (if the final node) unless it has received a total greater or equal to `intended_total_payment` in all incoming HTLCs for the same `payment_hash`.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The sender:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * MUST use the same `payment_hash` for all paths of a single multipath payment.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;
    </content>
    <updated>2023-06-09T14:52:41&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs2ncmskr0zg8sy927wdu9j0cndqcn34qrkqxht35tlqksycay0y4gzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv7vgtsg</id>
    
      <title type="html">📅 Original date posted:2018-10-19 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs2ncmskr0zg8sy927wdu9j0cndqcn34qrkqxht35tlqksycay0y4gzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv7vgtsg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsg8av9f44v7cyc5984xyz820za4myl87h7nalzsa35neraazudayg3d35q3&#39;&gt;nevent1q…35q3&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-10-19&lt;br/&gt;📝 Original message:&lt;br/&gt;Good evening all,&lt;br/&gt;&lt;br/&gt;Thank you Rusty for starting us down this path :) and to ZmnSCPxj and Lisa&lt;br/&gt;for&lt;br/&gt;your thoughts. I think this narrows down the design space considerably!&lt;br/&gt;&lt;br/&gt;In light of this, and if I&amp;#39;m following along, it seems our hand is forced in&lt;br/&gt;splicing via a single on-chain transaction. In my book, this is preferable&lt;br/&gt;anyway. I&amp;#39;d much rather push complexity off-chain than having to do a&lt;br/&gt;mutli-stage splicing pipeline.&lt;br/&gt;&lt;br/&gt;&amp;gt; To add some context to this, if you start accepting HTLC&amp;#39;s for the new&lt;br/&gt;balance&lt;br/&gt;&amp;gt; after the parallel commitment is made, but before the re-anchor is buried,&lt;br/&gt;&amp;gt; there&amp;#39;s the potential for a race condition between a unilateral close (or&lt;br/&gt;any&lt;br/&gt;&amp;gt; revoked commitment transaction) and the re-anchoring commitment&lt;br/&gt;transaction,&lt;br/&gt;&amp;gt; that spends the &amp;#39;pre-committed&amp;#39; UTXO of splicing in funds and the original&lt;br/&gt;&amp;gt; funding transaction&lt;br/&gt;&lt;br/&gt;Indeed, I&amp;#39;m not aware of any splicing mechanism that enables off-chain use&lt;br/&gt;of&lt;br/&gt;spliced-in funds before the new funding output confirms. Even in the async,&lt;br/&gt;single-txn case, the new funds cannot be spent until the new funding output&lt;br/&gt;confirms sufficiently.&lt;br/&gt;&lt;br/&gt;&amp;gt;From my POV, the desired properties of a splice are:&lt;br/&gt; 1. non-blocking (asynchronous) usage of the channel&lt;br/&gt; 2. single on-chain txn&lt;br/&gt; 3. ability to RBF (have multiple pending splices)&lt;br/&gt;&lt;br/&gt;Of these, it seems we&amp;#39;ve solidified 1 and 2. I understand the desire to not&lt;br/&gt;tackle RBF on the first attempt given the additional complexity.  However, I&lt;br/&gt;do believe there are ways we can proceed in which our first attempt largely&lt;br/&gt;coincides with supporting it in the future.&lt;br/&gt;&lt;br/&gt;With that in mind, here are some thoughts on the proposals above.&lt;br/&gt;&lt;br/&gt;## RBF and Multiple Splices&lt;br/&gt;&lt;br/&gt;&amp;gt; 1. type: 132 (`commitment_signed`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`64`:`signature`]&lt;br/&gt;&amp;gt;    * [`2`:`num_htlcs`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_splice_signature`] (`option_splice`)&lt;br/&gt;&lt;br/&gt;This will overflow the maximum message size of 65535 bytes for num_htlcs &amp;gt;&lt;br/&gt;511.&lt;br/&gt;&lt;br/&gt;I would propose sending a distinct message, which references the&lt;br/&gt;`active_channel_id` and a `splice_channel_id` for the pending splice:&lt;br/&gt;&lt;br/&gt;1. type: XXX (`commitment_splice_signed`) (`option_splice`)&lt;br/&gt;2. data:&lt;br/&gt;   * [`32`:`active_channel_id`]&lt;br/&gt;   * [`32`:`splice_channel_id`]&lt;br/&gt;   * [`64`:`signature`]&lt;br/&gt;   * [`2`:`num_htlcs`]&lt;br/&gt;   * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&lt;br/&gt;This more directly addresses handling multiple pending splices, as well as&lt;br/&gt;preventing us from running into any size constraints. The purpose of&lt;br/&gt;including the `active_channel_id` would be to remote node locate the&lt;br/&gt;spliced channel, since it may not be populated indexes containing&lt;br/&gt;active channels. If we don&amp;#39;t want to include this, the existing message&lt;br/&gt;can be used without modification.&lt;br/&gt;&lt;br/&gt;&amp;gt; We shouldn&amp;#39;t allow more than one pending splice operation anyway, as&lt;br/&gt;&amp;gt; stated in your proposal initially. We are already critically reliant on&lt;br/&gt;our&lt;br/&gt;&amp;gt; transaction being confirmed on-chain, so I don&amp;#39;t see this as much of an&lt;br/&gt;&amp;gt; added issue.&lt;br/&gt;&lt;br/&gt;IMO there&amp;#39;s no reason to limit ourselves to one pending splice at the&lt;br/&gt;message&lt;br/&gt;level. I think it&amp;#39;d be an oversight to not to plan ahead with RBF in mind,&lt;br/&gt;given that funding transactions have gone unconfirmed precisely because of&lt;br/&gt;improperly chosen fee rates. Arguably, funding flow should be extended to&lt;br/&gt;support this as well.&lt;br/&gt;&lt;br/&gt;CPFP works, though it&amp;#39;s more wasteful than resigning and I&amp;#39;d prefer only to&lt;br/&gt;do&lt;br/&gt;so out of necessity, rather than relying on it. CPFP is nice because it&lt;br/&gt;doesn&amp;#39;t&lt;br/&gt;require interaction, though we are already assuming the other party to be&lt;br/&gt;online during the splice (unlike unilateral closes).&lt;br/&gt;&lt;br/&gt;Adding a splice-reject message/error code should be sufficient to allow&lt;br/&gt;implementations to signal that their local tolerance for number of pending&lt;br/&gt;splices has been reached. It&amp;#39;s likely we&amp;#39;d all start with getting one splice&lt;br/&gt;working, but then the messages won&amp;#39;t need to modified if we want to&lt;br/&gt;implement&lt;br/&gt;additional pending splices via RBF.&lt;br/&gt;&lt;br/&gt;A node that wants to RBF but receives a reject can then proceed with CPFP&lt;br/&gt;as a&lt;br/&gt;last resort.&lt;br/&gt;&lt;br/&gt;Are there any downsides I&amp;#39;m overlooking with this approach?&lt;br/&gt;&lt;br/&gt;&amp;gt; | Bit Position  | Name                      | Field&lt;br/&gt;      |&lt;br/&gt;&amp;gt; | ------------- | ------------------------- |&lt;br/&gt;-------------------------------- |&lt;br/&gt;&amp;gt; | 0             | `option_channel_htlc_max` | `htlc_maximum_msat`&lt;br/&gt;      |&lt;br/&gt;&amp;gt; | 1             | `option_channel_moving`   | `moving_txid&lt;br/&gt;     |&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The `channel_update` gains the following field:&lt;br/&gt;&amp;gt;     * [`32`: moving_txid`] (option_channel_moving)&lt;br/&gt;&lt;br/&gt;Do we actually need to send the `moving_txid` via a channel update? I think&lt;br/&gt;it&amp;#39;s&lt;br/&gt;enough for both parties to send `channel_update`s with the&lt;br/&gt;`option_channel_moving` bit set, and continue to keep the channel in our&lt;br/&gt;routing&lt;br/&gt;table.&lt;br/&gt;&lt;br/&gt;If we receive later receive two `channel_update`s whose `short_channel_id`s&lt;br/&gt;reference the spending transaction (and the node pubkeys are the same), we&lt;br/&gt;assume the splice was successful and that this channel has been subsumed. I&lt;br/&gt;think this works so long as the spending transaction doesn&amp;#39;t contain&lt;br/&gt;multiple&lt;br/&gt;funding outputs, though I think the current proposal is fallible to this as&lt;br/&gt;well.&lt;br/&gt;&lt;br/&gt;To me, this proposal has the benefit of not bloating gossip bandwidth with&lt;br/&gt;an&lt;br/&gt;extra field that would need to parsed indefinitely, and gracefully&lt;br/&gt;supporting&lt;br/&gt;RBF down the road. Otherwise we&amp;#39;d need to gossip and store each potential&lt;br/&gt;txid.&lt;br/&gt;&lt;br/&gt;With regards to forwarding, both `short_channel_id`s would be accepted by&lt;br/&gt;the&lt;br/&gt;splicers for up to 100 blocks (after splice confirm?), at which point they&lt;br/&gt;can&lt;br/&gt;both forget the prior `short_channel_id`.&lt;br/&gt;&lt;br/&gt;## Shachain&lt;br/&gt;&lt;br/&gt;&amp;gt; I thought about restarting the revocation sequence, but it seems like&lt;br/&gt;&amp;gt; that only saves a tiny amount since we only store log(N) entries.  We&lt;br/&gt;&amp;gt; can drop old HTLC info post-splice though, and (after some delay for&lt;br/&gt;&amp;gt; obscurity) tell watchtowers to drop old entries I think.&lt;br/&gt;&lt;br/&gt;I agree the additional state isn&amp;#39;t too burdensome, and that we would still&lt;br/&gt;be&lt;br/&gt;able to drop watchtower state after some delay as you mentioned.&lt;br/&gt;&lt;br/&gt;On one hand, it does seem like the opportune time to remove such state if&lt;br/&gt;desired.&lt;br/&gt;&lt;br/&gt;OTOH, it is _really_ nice from an atomicity perspective that the current&lt;br/&gt;channel and (potentially) N pending channels can be revoked using a single&lt;br/&gt;commitment secret and message. Doing so would mean we don&amp;#39;t have to&lt;br/&gt;modify the `revoke_and_ack` or `channel_reestablish` messages. The receiver&lt;br/&gt;would just apply the commitment secrets/points to the current channel and&lt;br/&gt;any&lt;br/&gt;pending splices.&lt;br/&gt;&lt;br/&gt;## Misc&lt;br/&gt;&lt;br/&gt;&amp;gt; Any reason to now make the splicing_add_* messages allow one to add&lt;br/&gt;several&lt;br/&gt;&amp;gt; inputs in a single message? Given &amp;#34;acceptable&amp;#34; constraints for how large&lt;br/&gt;the&lt;br/&gt;&amp;gt; witness and pkScripts can be, we can easily enforce an upper limit on the&lt;br/&gt;&amp;gt; number of inputs/outputs to add.&lt;br/&gt;&lt;br/&gt;Yes, I prefer this simplification.&lt;br/&gt;&lt;br/&gt;&amp;gt; Additionally, as the size of the channel is either expanding or&lt;br/&gt;contracting,&lt;br/&gt;&amp;gt; both sides should be allowed to modify things like the CSV param, reserve,&lt;br/&gt;&amp;gt; max accepted htlc&amp;#39;s, max htlc size, etc. Many of these parameters like the&lt;br/&gt;&amp;gt; CSV value should scale with the size of the channel, not allowing these&lt;br/&gt;&amp;gt; parameters to be re-negotiated could result in odd scenarios like still&lt;br/&gt;&amp;gt; maintain a 1 week CSV when the channel size has dipped from 1 BTC to 100k&lt;br/&gt;&amp;gt; satoshis.&lt;br/&gt;&lt;br/&gt;Agreed!&lt;br/&gt;&lt;br/&gt;&amp;gt; These all seem marginal to me.  I think if we start hitting max values,&lt;br/&gt;&amp;gt; we should discuss increasing them.&lt;br/&gt;&lt;br/&gt;Doesn&amp;#39;t this defeat the goal of firewalling funds against individual channel&lt;br/&gt;failures?&lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; One thing that I think we should lift from the multiple funding output&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; approach is the &amp;#34;pre seating of inputs&amp;#34;. This is cool as it would allow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; clients to generate addresses, that others could deposit to, and then&lt;br/&gt;have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; be spliced directly into the channel. Public derivation can be used,&lt;br/&gt;along&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; with a script template to do it non-interactively, with the clients&lt;br/&gt;picking&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; up these deposits, and initiating a splice in as needed.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; How about this restatement?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1.  Each channel has two public-key-derivation paths (BIP32) to create&lt;br/&gt;onchain&lt;br/&gt;&amp;gt;&amp;gt; addresses.  One for each side of the channel.&lt;br/&gt;&amp;gt;&amp;gt; 2.  The base of the above is actually a combined private-public keypair&lt;br/&gt;of both&lt;br/&gt;&amp;gt;&amp;gt; sides (e.g. created via MuSig or some other protocol).  Thus the&lt;br/&gt;addresses&lt;br/&gt;&amp;gt;&amp;gt; require cooperation of both parties to spend.&lt;br/&gt;&amp;gt;&amp;gt; 3.  When somebody sends to one of the onchain addresses in the path,&lt;br/&gt;their&lt;br/&gt;&amp;gt;&amp;gt; client detects this.&lt;br/&gt;&amp;gt;&amp;gt; 4.  The client updates the current transaction state, such that the new&lt;br/&gt;commit&lt;br/&gt;&amp;gt;&amp;gt; transaction has two inputs ( the original channel transaction and the&lt;br/&gt;new UTXO).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The above seems unsafe without trust in the other peer, as, the other&lt;br/&gt;peer can&lt;br/&gt;&amp;gt;&amp;gt; simply refuse to create the new commit transaction.  Since the address&lt;br/&gt;requires&lt;br/&gt;&amp;gt;&amp;gt; both parties to spend, the money cannot be spent and there is no backoff&lt;br/&gt;&amp;gt;&amp;gt; transaction that can be used.  But maybe you can describe some mechanism&lt;br/&gt;to&lt;br/&gt;&amp;gt;&amp;gt; ensure this, if this is what is meant instead?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This could easily be solved by making the destination address a Taproot&lt;br/&gt;&amp;gt; address, which by default is just a 2-of-2, but in the uncooperative&lt;br/&gt;&amp;gt; case it can reveal the script it commits to, which is just a timelocked&lt;br/&gt;&amp;gt; refund that requires a single-sig. The only problem with this is that&lt;br/&gt;&amp;gt; the refund would be non-interactive, and so the entirety of the funds,&lt;br/&gt;&amp;gt; that may be from a third-party, need to be claimed by one endpoint,&lt;br/&gt;&amp;gt; i.e., there is no splitting the funds in case of an uncollaborative&lt;br/&gt;&amp;gt; refund. Not sure how important that is though, since I don&amp;#39;t think&lt;br/&gt;&amp;gt; third-party funds will come from unrelated parties, e.g., most of these&lt;br/&gt;&amp;gt; funds will come from an on-chain wallet that is under the control of&lt;br/&gt;&amp;gt; either parties so the refund should go back to that party anyway.&lt;br/&gt;&lt;br/&gt;This can be accomplished similarly by having either (or both) party&lt;br/&gt;publishing a&lt;br/&gt;static address or publicly derivable address specific to the channel,&lt;br/&gt;derived&lt;br/&gt;from their HD seed.&lt;br/&gt;&lt;br/&gt;Arguably, the address should perhaps be global, so that it can outlive the&lt;br/&gt;lifetime of the channel, i.e. as soon as the first person deposits and a&lt;br/&gt;splice&lt;br/&gt;is initiated, is the address still valid for the new channel if new keys are&lt;br/&gt;used? Similarly, the channel could be closed and the funds locked until&lt;br/&gt;the timeout if the peer disappears.&lt;br/&gt;&lt;br/&gt;Regardless, both approaches can be made to have equivalent amounts of&lt;br/&gt;[non-]interactivity. However, the recipient isn&amp;#39;t burdened in spending by&lt;br/&gt;1) interaction with the channel peer, or 2) an absolute timeout if 1 fails,&lt;br/&gt;giving the receiver more flexibility if they wish to not commit the received&lt;br/&gt;funds to a splice. It also benefits from smaller witness sizes, a larger&lt;br/&gt;anonymity set, etc.&lt;br/&gt;&lt;br/&gt;In general, using a 2-of-2&#43;timeout to stage funds for splicing doesn&amp;#39;t offer&lt;br/&gt;that much IMO. It seems the primary purpose is to prevent the funds from&lt;br/&gt;being&lt;br/&gt;double spent during the splice, but observe that this is still possible if&lt;br/&gt;the&lt;br/&gt;timeout matures, perhaps because the splice doesn&amp;#39;t confirm in a timely&lt;br/&gt;manner.&lt;br/&gt;&lt;br/&gt;Acknowledging this, detecting double-spent inputs is still required for full&lt;br/&gt;correctness. By implementing it, either party is free to propose arbitrary&lt;br/&gt;inputs for a splice, which I believe reduces complexity in the long run.&lt;br/&gt;&lt;br/&gt;Splice out,&lt;br/&gt;Conner&lt;br/&gt;&lt;br/&gt;On Tue, Oct 16, 2018 at 10:00 PM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning lisa,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is a good observation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Before, I&amp;#39;d already considered the rationale, for why channels have a&lt;br/&gt;&amp;gt; single 2-of-2 UTXO as funding output.  And it seems I should have&lt;br/&gt;&amp;gt; considered this, prior to accepting the &amp;#34;parallel&amp;#34; construction as feasible.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For sake of posterity, I leave the below writeup as a tangential to the&lt;br/&gt;&amp;gt; design of splice (and to the design of Lightning having a single 2-of-2&lt;br/&gt;&amp;gt; UTXOs):&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; # 0-conf is Unsafe, Yet Lightning is Safe; Why?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To accept a 0-conf transaction output, is known to be unsafe.&lt;br/&gt;&amp;gt; Replace-by-fee is always a possibility, regardless of whether the&lt;br/&gt;&amp;gt; transaction opts in to RBF or not: a rational miner will always accept the&lt;br/&gt;&amp;gt; higher feerate, disregarding any &amp;#34;opt-in&amp;#34; flag that is set or not set on&lt;br/&gt;&amp;gt; the transaction.  Thus we reject any advice that claims that 0-conf is&lt;br/&gt;&amp;gt; tenable, even for tiny amounts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yet when viewed solely in terms of transactions, Lightning protocol uses&lt;br/&gt;&amp;gt; transactions that are not on any block (are kept offchain).  Since they are&lt;br/&gt;&amp;gt; not in a block, they are indistinguishable from 0-conf transactions, which&lt;br/&gt;&amp;gt; are accepted by the receiver, yet are also not on any block.  One might&lt;br/&gt;&amp;gt; argue the distinction, that a &amp;#34;real&amp;#34; 0-conf transaction exists on some&lt;br/&gt;&amp;gt; mempool somewhere, and thus has a chance to be on a block in the future,&lt;br/&gt;&amp;gt; but mempools have no consensus, and the existence of a transaction on some&lt;br/&gt;&amp;gt; mempool is not a safe assurance of it existing in the mempool of the next&lt;br/&gt;&amp;gt; winning miner.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So why is Lightning safe, when 0-conf transactions are in general not safe?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Again, we should focus on why 0-conf transactions in general are not safe:&lt;br/&gt;&amp;gt; transaction replacement.  Thus, 0-conf transactions can be made safe, if&lt;br/&gt;&amp;gt; you are somehow able to ensure that replacement transactions cannot be made.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For example, if you are part of an n-of-n federation that signs the&lt;br/&gt;&amp;gt; transaction, you can always safely accept a 0-conf transaction from that&lt;br/&gt;&amp;gt; federation paying only to you, because you can always veto any replacement&lt;br/&gt;&amp;gt; (by simply refusing to sign) that is not in your interests.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is in fact how Lightning works: a 2-of-2 federation (the channel&lt;br/&gt;&amp;gt; counterparties) are the signatories of the 0-conf transactions that are the&lt;br/&gt;&amp;gt; commitment transactions of the Lightning protocol.  Replacement of the&lt;br/&gt;&amp;gt; commitment transactions is strictly guided by the protocol; both sides have&lt;br/&gt;&amp;gt; veto rights, since the source transaction output is 2-of-2.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thus, Lightning, though it uses 0-conf transactions, is safe, because it&lt;br/&gt;&amp;gt; prevents the replacement of a 0-conf transaction without the receiver&lt;br/&gt;&amp;gt; allowing it, by the simple expedient of including the receiver in the&lt;br/&gt;&amp;gt; 2-of-2 multisig guarding its single funding TXO.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ##  The Implications for Splice Proposals&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Some splice proposals involve creating the equivalent of multiple funding&lt;br/&gt;&amp;gt; TXOs for a single channel.  Such constructions are unsafe-by-default on&lt;br/&gt;&amp;gt; Poon-Dryja.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In reality, every commitment transaction (or update transaction in&lt;br/&gt;&amp;gt; Decker-Osuntokun-Russell) is replaceable by any other commitment (or&lt;br/&gt;&amp;gt; update) transaction for that channel.  Under Poon-Dryja older transactions&lt;br/&gt;&amp;gt; are revoked (and hence one side risks loss of their collateral) while under&lt;br/&gt;&amp;gt; Decker-Osuntokun-Russell older transactions may be &amp;#34;gainsaid&amp;#34; (i.e. newer&lt;br/&gt;&amp;gt; update transactions may be reanchored to consume the TXO of the older&lt;br/&gt;&amp;gt; update transaction, thus preventing that update from truly being committed&lt;br/&gt;&amp;gt; to).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is relevant since before a splice, the channel has a single funding&lt;br/&gt;&amp;gt; TXO, while after the splice, the channel has multiple.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In particular, a commitment (or update) transaction, that has multiple&lt;br/&gt;&amp;gt; inputs (to consume the multiple funding TXOs), can be replaced with a&lt;br/&gt;&amp;gt; commitment (or update) transaction that was created before the splice.&lt;br/&gt;&amp;gt; Under Poon-Dryja, such a commitment transaction may be revoked, but this&lt;br/&gt;&amp;gt; leaves the other funding TXOs unuseable.  Under Decker-Osuntokun-Russell,&lt;br/&gt;&amp;gt; as long as the sequence number is preserved across the splice, it is&lt;br/&gt;&amp;gt; possible for a later update transaction with multiple inputs to simply&lt;br/&gt;&amp;gt; gainsay the old single-input update with the new multiple-input update&lt;br/&gt;&amp;gt; transaction. (I suppose, that this is another advantage that&lt;br/&gt;&amp;gt; Decker-Osuntokun-Russell has).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sent with ProtonMail &amp;lt;&lt;a href=&#34;https://protonmail.com&amp;gt&#34;&gt;https://protonmail.com&amp;gt&lt;/a&gt;; Secure Email.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&lt;br/&gt;&amp;gt; On Wednesday, October 17, 2018 9:09 AM, lisa neigut &amp;lt;niftynei at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To add some context to this, if you start accepting HTLC&amp;#39;s for the new&lt;br/&gt;&amp;gt; balance after the parallel commitment is made, but before the re-anchor is&lt;br/&gt;&amp;gt; buried, there&amp;#39;s the potential for a race condition between a unilateral&lt;br/&gt;&amp;gt; close (or any revoked commitment transaction) and the re-anchoring&lt;br/&gt;&amp;gt; commitment transaction, that spends the &amp;#39;pre-committed&amp;#39; UTXO of splicing in&lt;br/&gt;&amp;gt; funds and the original funding transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; You can get around this by waiting until both the pre-commitment UTXO and&lt;br/&gt;&amp;gt; the re-anchor have cleared a minimum depth before accepting HTLC&amp;#39;s for the&lt;br/&gt;&amp;gt; new balance totals, but that&amp;#39;s twice as long of a wait as the first,&lt;br/&gt;&amp;gt; synchronized re-commitment scheme that Rusty originally proposed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It also makes leaving the original funding transaction &amp;#39;exposed&amp;#39; (ie&lt;br/&gt;&amp;gt; Rene&amp;#39;s version of parallel splice) untenable, as there&amp;#39;s always the risk of&lt;br/&gt;&amp;gt; an old state being published to consume that input. This foobars your&lt;br/&gt;&amp;gt; current HTLC commitments.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Tue, Oct 16, 2018 at 3:31 PM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; writes:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; If we&amp;#39;re going to do side splice-in like this, I would use a very&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; different protocol: the reason for this protocol was to treat splice-in&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; and splice-out the same, and inline splice-in requires wait time.  Since&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; splice-out doesn&amp;#39;t, we don&amp;#39;t need this at all.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; It would look much more like:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 1. Prepare any output with script of specific form. eg:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;         OP_DEPTH 3 OP_EQUAL OP_IF&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;funding_pubkey1&amp;gt; &amp;lt;funding_pubkey2&amp;gt; OP_CHECKMULTISIG&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;         OP_ELSE&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;blockheight&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;myrescue_pubkey&amp;gt; OP_CHECKSIG&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;         OP_ENDIF&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 40 (`splice_in`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 2. data:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`8`: `satoshis`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `txoutnum`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `blockheight`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`33`: `myrescue_pubkey`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 137 (`update_splice_in_accept`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    data:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `txoutnum`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 138 (`update_splice_in_reject`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    data:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`2`:`len`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;    * [`len`:`errorstr`]&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; The recipient of `splice_in` checks that it&amp;#39;s happy with the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; `blockheight` (far enough in future).  Once it sees the tx referred to&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; buried to its own `minimum_depth`, it checks output is what they&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; claimed, then sends `update_splice_in_accept`; it&amp;#39;s followed up&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; `commitment_signed` like normal, but from this point onwards, all&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; commitment txs signatures have one extra sig.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Lisa started asking pointed questions, and so I noticed that parallel&lt;br/&gt;&amp;gt;&amp;gt; splice doesn&amp;#39;t work with Poon-Dryja channels.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The counterparty can spend the old funding txout with a revoked spend.&lt;br/&gt;&amp;gt;&amp;gt; Sure, I can take all the money from that, but what about the spliced&lt;br/&gt;&amp;gt;&amp;gt; input?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I came up with increasingly elaborate workarounds, but nothing stuck.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Back to Plan A...&lt;br/&gt;&amp;gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181018/d57ce11c/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181018/d57ce11c/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:51:40&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsz5av72vl8q2duf5xxkt0e9m5gpgw47w5w74thkag922a7cqd7s4czyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvk4vhs5</id>
    
      <title type="html">📅 Original date posted:2018-10-23 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsz5av72vl8q2duf5xxkt0e9m5gpgw47w5w74thkag922a7cqd7s4czyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvk4vhs5" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs2ncmskr0zg8sy927wdu9j0cndqcn34qrkqxht35tlqksycay0y4g2elam0&#39;&gt;nevent1q…lam0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-10-23&lt;br/&gt;📝 Original message:&lt;br/&gt;Good evening lightning-dev,&lt;br/&gt;&lt;br/&gt;&amp;gt; If we receive later receive two `channel_update`s whose&lt;br/&gt;`short_channel_id`s&lt;br/&gt;&amp;gt; reference the spending transaction (and the node pubkeys are the same), we&lt;br/&gt;&amp;gt; assume the splice was successful and that this channel has been subsumed.&lt;br/&gt;I&lt;br/&gt;&amp;gt; think this works so long as the spending transaction doesn&amp;#39;t contain&lt;br/&gt;multiple&lt;br/&gt;&amp;gt; funding outputs, though I think the current proposal is fallible to this&lt;br/&gt;as&lt;br/&gt;&amp;gt; well.&lt;br/&gt;&lt;br/&gt;Thought about this some more. The main difference seems to be whether the&lt;br/&gt;gossiped data is forward or backward looking. By forward looking, I mean&lt;br/&gt;that we&lt;br/&gt;gossip where the splice will move to, and backward looking gossips where the&lt;br/&gt;splice moved from.&lt;br/&gt;&lt;br/&gt;If we want to make the original proposal work w/ multiple funding outputs on&lt;br/&gt;one splice, I think it can be accomplished by sending the funding outpoint&lt;br/&gt;as&lt;br/&gt;opposed to just the txid. For the backward looking proposal, the&lt;br/&gt;`channel_update`&lt;br/&gt;could be modified to include the `short_channel_id` of the prior funding&lt;br/&gt;output.&lt;br/&gt;IMO we probably want to include the extra specificity even if we don&amp;#39;t plan&lt;br/&gt;to&lt;br/&gt;have multiple funding outputs on a commitment implemented tomorrow, since&lt;br/&gt;outputs are what we truly care about.&lt;br/&gt;&lt;br/&gt;Of the two, it still seems like the backward looking approach results in&lt;br/&gt;less&lt;br/&gt;gossiped data since are able to reference a single confirmed output by&lt;br/&gt;location&lt;br/&gt;(8 bytes), instead of N unconfirmed outputs by outpoint (N*34 bytes).&lt;br/&gt;&lt;br/&gt;Another advantage I see with the backward looking splice announcments is&lt;br/&gt;that&lt;br/&gt;they can be properly verified before forwarding to the network by examining&lt;br/&gt;the&lt;br/&gt;channel lineage. In contrast, one can&amp;#39;t be sure if the outpoint in a&lt;br/&gt;forward looking&lt;br/&gt;announcement will ever confirm, or even if it spends from the original&lt;br/&gt;channel point&lt;br/&gt;unless one also has the transaction. Until a splice does confirm, a node has&lt;br/&gt;to store multiple potential splice outpoints. Seeing this, it seems to me&lt;br/&gt;that&lt;br/&gt;backward looking announcements are less susceptible to abuse and DOS in&lt;br/&gt;this regard.&lt;br/&gt;&lt;br/&gt;Thoughts?&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Conner&lt;br/&gt;&lt;br/&gt;On Thu, Oct 18, 2018 at 8:04 PM Conner Fromknecht&lt;br/&gt;&amp;lt;conner at lightning.engineering&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good evening all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thank you Rusty for starting us down this path :) and to ZmnSCPxj and Lisa&lt;br/&gt;&amp;gt; for&lt;br/&gt;&amp;gt; your thoughts. I think this narrows down the design space considerably!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In light of this, and if I&amp;#39;m following along, it seems our hand is forced&lt;br/&gt;&amp;gt; in&lt;br/&gt;&amp;gt; splicing via a single on-chain transaction. In my book, this is preferable&lt;br/&gt;&amp;gt; anyway. I&amp;#39;d much rather push complexity off-chain than having to do a&lt;br/&gt;&amp;gt; mutli-stage splicing pipeline.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; To add some context to this, if you start accepting HTLC&amp;#39;s for the new&lt;br/&gt;&amp;gt; balance&lt;br/&gt;&amp;gt; &amp;gt; after the parallel commitment is made, but before the re-anchor is&lt;br/&gt;&amp;gt; buried,&lt;br/&gt;&amp;gt; &amp;gt; there&amp;#39;s the potential for a race condition between a unilateral close&lt;br/&gt;&amp;gt; (or any&lt;br/&gt;&amp;gt; &amp;gt; revoked commitment transaction) and the re-anchoring commitment&lt;br/&gt;&amp;gt; transaction,&lt;br/&gt;&amp;gt; &amp;gt; that spends the &amp;#39;pre-committed&amp;#39; UTXO of splicing in funds and the&lt;br/&gt;&amp;gt; original&lt;br/&gt;&amp;gt; &amp;gt; funding transaction&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Indeed, I&amp;#39;m not aware of any splicing mechanism that enables off-chain use&lt;br/&gt;&amp;gt; of&lt;br/&gt;&amp;gt; spliced-in funds before the new funding output confirms. Even in the async,&lt;br/&gt;&amp;gt; single-txn case, the new funds cannot be spent until the new funding output&lt;br/&gt;&amp;gt; confirms sufficiently.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; From my POV, the desired properties of a splice are:&lt;br/&gt;&amp;gt;  1. non-blocking (asynchronous) usage of the channel&lt;br/&gt;&amp;gt;  2. single on-chain txn&lt;br/&gt;&amp;gt;  3. ability to RBF (have multiple pending splices)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Of these, it seems we&amp;#39;ve solidified 1 and 2. I understand the desire to not&lt;br/&gt;&amp;gt; tackle RBF on the first attempt given the additional complexity.  However,&lt;br/&gt;&amp;gt; I&lt;br/&gt;&amp;gt; do believe there are ways we can proceed in which our first attempt largely&lt;br/&gt;&amp;gt; coincides with supporting it in the future.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With that in mind, here are some thoughts on the proposals above.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## RBF and Multiple Splices&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 1. type: 132 (`commitment_signed`)&lt;br/&gt;&amp;gt; &amp;gt; 2. data:&lt;br/&gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt; &amp;gt;    * [`64`:`signature`]&lt;br/&gt;&amp;gt; &amp;gt;    * [`2`:`num_htlcs`]&lt;br/&gt;&amp;gt; &amp;gt;    * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&amp;gt; &amp;gt;    * [`num_htlcs*64`:`htlc_splice_signature`] (`option_splice`)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This will overflow the maximum message size of 65535 bytes for num_htlcs &amp;gt;&lt;br/&gt;&amp;gt; 511.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I would propose sending a distinct message, which references the&lt;br/&gt;&amp;gt; `active_channel_id` and a `splice_channel_id` for the pending splice:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: XXX (`commitment_splice_signed`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`active_channel_id`]&lt;br/&gt;&amp;gt;    * [`32`:`splice_channel_id`]&lt;br/&gt;&amp;gt;    * [`64`:`signature`]&lt;br/&gt;&amp;gt;    * [`2`:`num_htlcs`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This more directly addresses handling multiple pending splices, as well as&lt;br/&gt;&amp;gt; preventing us from running into any size constraints. The purpose of&lt;br/&gt;&amp;gt; including the `active_channel_id` would be to remote node locate the&lt;br/&gt;&amp;gt; spliced channel, since it may not be populated indexes containing&lt;br/&gt;&amp;gt; active channels. If we don&amp;#39;t want to include this, the existing message&lt;br/&gt;&amp;gt; can be used without modification.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; We shouldn&amp;#39;t allow more than one pending splice operation anyway, as&lt;br/&gt;&amp;gt; &amp;gt; stated in your proposal initially. We are already critically reliant on&lt;br/&gt;&amp;gt; our&lt;br/&gt;&amp;gt; &amp;gt; transaction being confirmed on-chain, so I don&amp;#39;t see this as much of an&lt;br/&gt;&amp;gt; &amp;gt; added issue.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IMO there&amp;#39;s no reason to limit ourselves to one pending splice at the&lt;br/&gt;&amp;gt; message&lt;br/&gt;&amp;gt; level. I think it&amp;#39;d be an oversight to not to plan ahead with RBF in mind,&lt;br/&gt;&amp;gt; given that funding transactions have gone unconfirmed precisely because of&lt;br/&gt;&amp;gt; improperly chosen fee rates. Arguably, funding flow should be extended to&lt;br/&gt;&amp;gt; support this as well.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; CPFP works, though it&amp;#39;s more wasteful than resigning and I&amp;#39;d prefer only&lt;br/&gt;&amp;gt; to do&lt;br/&gt;&amp;gt; so out of necessity, rather than relying on it. CPFP is nice because it&lt;br/&gt;&amp;gt; doesn&amp;#39;t&lt;br/&gt;&amp;gt; require interaction, though we are already assuming the other party to be&lt;br/&gt;&amp;gt; online during the splice (unlike unilateral closes).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Adding a splice-reject message/error code should be sufficient to allow&lt;br/&gt;&amp;gt; implementations to signal that their local tolerance for number of pending&lt;br/&gt;&amp;gt; splices has been reached. It&amp;#39;s likely we&amp;#39;d all start with getting one&lt;br/&gt;&amp;gt; splice&lt;br/&gt;&amp;gt; working, but then the messages won&amp;#39;t need to modified if we want to&lt;br/&gt;&amp;gt; implement&lt;br/&gt;&amp;gt; additional pending splices via RBF.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A node that wants to RBF but receives a reject can then proceed with CPFP&lt;br/&gt;&amp;gt; as a&lt;br/&gt;&amp;gt; last resort.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Are there any downsides I&amp;#39;m overlooking with this approach?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; | Bit Position  | Name                      | Field&lt;br/&gt;&amp;gt;       |&lt;br/&gt;&amp;gt; &amp;gt; | ------------- | ------------------------- |&lt;br/&gt;&amp;gt; -------------------------------- |&lt;br/&gt;&amp;gt; &amp;gt; | 0             | `option_channel_htlc_max` | `htlc_maximum_msat`&lt;br/&gt;&amp;gt;       |&lt;br/&gt;&amp;gt; &amp;gt; | 1             | `option_channel_moving`   | `moving_txid&lt;br/&gt;&amp;gt;        |&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The `channel_update` gains the following field:&lt;br/&gt;&amp;gt; &amp;gt;     * [`32`: moving_txid`] (option_channel_moving)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Do we actually need to send the `moving_txid` via a channel update? I&lt;br/&gt;&amp;gt; think it&amp;#39;s&lt;br/&gt;&amp;gt; enough for both parties to send `channel_update`s with the&lt;br/&gt;&amp;gt; `option_channel_moving` bit set, and continue to keep the channel in our&lt;br/&gt;&amp;gt; routing&lt;br/&gt;&amp;gt; table.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we receive later receive two `channel_update`s whose `short_channel_id`s&lt;br/&gt;&amp;gt; reference the spending transaction (and the node pubkeys are the same), we&lt;br/&gt;&amp;gt; assume the splice was successful and that this channel has been subsumed. I&lt;br/&gt;&amp;gt; think this works so long as the spending transaction doesn&amp;#39;t contain&lt;br/&gt;&amp;gt; multiple&lt;br/&gt;&amp;gt; funding outputs, though I think the current proposal is fallible to this as&lt;br/&gt;&amp;gt; well.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To me, this proposal has the benefit of not bloating gossip bandwidth with&lt;br/&gt;&amp;gt; an&lt;br/&gt;&amp;gt; extra field that would need to parsed indefinitely, and gracefully&lt;br/&gt;&amp;gt; supporting&lt;br/&gt;&amp;gt; RBF down the road. Otherwise we&amp;#39;d need to gossip and store each potential&lt;br/&gt;&amp;gt; txid.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With regards to forwarding, both `short_channel_id`s would be accepted by&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; splicers for up to 100 blocks (after splice confirm?), at which point they&lt;br/&gt;&amp;gt; can&lt;br/&gt;&amp;gt; both forget the prior `short_channel_id`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## Shachain&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I thought about restarting the revocation sequence, but it seems like&lt;br/&gt;&amp;gt; &amp;gt; that only saves a tiny amount since we only store log(N) entries.  We&lt;br/&gt;&amp;gt; &amp;gt; can drop old HTLC info post-splice though, and (after some delay for&lt;br/&gt;&amp;gt; &amp;gt; obscurity) tell watchtowers to drop old entries I think.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I agree the additional state isn&amp;#39;t too burdensome, and that we would still&lt;br/&gt;&amp;gt; be&lt;br/&gt;&amp;gt; able to drop watchtower state after some delay as you mentioned.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On one hand, it does seem like the opportune time to remove such state if&lt;br/&gt;&amp;gt; desired.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; OTOH, it is _really_ nice from an atomicity perspective that the current&lt;br/&gt;&amp;gt; channel and (potentially) N pending channels can be revoked using a single&lt;br/&gt;&amp;gt; commitment secret and message. Doing so would mean we don&amp;#39;t have to&lt;br/&gt;&amp;gt; modify the `revoke_and_ack` or `channel_reestablish` messages. The receiver&lt;br/&gt;&amp;gt; would just apply the commitment secrets/points to the current channel and&lt;br/&gt;&amp;gt; any&lt;br/&gt;&amp;gt; pending splices.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## Misc&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Any reason to now make the splicing_add_* messages allow one to add&lt;br/&gt;&amp;gt; several&lt;br/&gt;&amp;gt; &amp;gt; inputs in a single message? Given &amp;#34;acceptable&amp;#34; constraints for how large&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; witness and pkScripts can be, we can easily enforce an upper limit on the&lt;br/&gt;&amp;gt; &amp;gt; number of inputs/outputs to add.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, I prefer this simplification.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Additionally, as the size of the channel is either expanding or&lt;br/&gt;&amp;gt; contracting,&lt;br/&gt;&amp;gt; &amp;gt; both sides should be allowed to modify things like the CSV param,&lt;br/&gt;&amp;gt; reserve,&lt;br/&gt;&amp;gt; &amp;gt; max accepted htlc&amp;#39;s, max htlc size, etc. Many of these parameters like&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; CSV value should scale with the size of the channel, not allowing these&lt;br/&gt;&amp;gt; &amp;gt; parameters to be re-negotiated could result in odd scenarios like still&lt;br/&gt;&amp;gt; &amp;gt; maintain a 1 week CSV when the channel size has dipped from 1 BTC to 100k&lt;br/&gt;&amp;gt; &amp;gt; satoshis.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Agreed!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; These all seem marginal to me.  I think if we start hitting max values,&lt;br/&gt;&amp;gt; &amp;gt; we should discuss increasing them.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Doesn&amp;#39;t this defeat the goal of firewalling funds against individual&lt;br/&gt;&amp;gt; channel&lt;br/&gt;&amp;gt; failures?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; One thing that I think we should lift from the multiple funding output&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; approach is the &amp;#34;pre seating of inputs&amp;#34;. This is cool as it would allow&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; clients to generate addresses, that others could deposit to, and then&lt;br/&gt;&amp;gt; have&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; be spliced directly into the channel. Public derivation can be used,&lt;br/&gt;&amp;gt; along&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; with a script template to do it non-interactively, with the clients&lt;br/&gt;&amp;gt; picking&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; up these deposits, and initiating a splice in as needed.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; How about this restatement?&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; 1.  Each channel has two public-key-derivation paths (BIP32) to create&lt;br/&gt;&amp;gt; onchain&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; addresses.  One for each side of the channel.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; 2.  The base of the above is actually a combined private-public keypair&lt;br/&gt;&amp;gt; of both&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; sides (e.g. created via MuSig or some other protocol).  Thus the&lt;br/&gt;&amp;gt; addresses&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; require cooperation of both parties to spend.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; 3.  When somebody sends to one of the onchain addresses in the path,&lt;br/&gt;&amp;gt; their&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; client detects this.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; 4.  The client updates the current transaction state, such that the new&lt;br/&gt;&amp;gt; commit&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; transaction has two inputs ( the original channel transaction and the&lt;br/&gt;&amp;gt; new UTXO).&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; The above seems unsafe without trust in the other peer, as, the other&lt;br/&gt;&amp;gt; peer can&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; simply refuse to create the new commit transaction.  Since the address&lt;br/&gt;&amp;gt; requires&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; both parties to spend, the money cannot be spent and there is no backoff&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; transaction that can be used.  But maybe you can describe some&lt;br/&gt;&amp;gt; mechanism to&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; ensure this, if this is what is meant instead?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; This could easily be solved by making the destination address a Taproot&lt;br/&gt;&amp;gt; &amp;gt; address, which by default is just a 2-of-2, but in the uncooperative&lt;br/&gt;&amp;gt; &amp;gt; case it can reveal the script it commits to, which is just a timelocked&lt;br/&gt;&amp;gt; &amp;gt; refund that requires a single-sig. The only problem with this is that&lt;br/&gt;&amp;gt; &amp;gt; the refund would be non-interactive, and so the entirety of the funds,&lt;br/&gt;&amp;gt; &amp;gt; that may be from a third-party, need to be claimed by one endpoint,&lt;br/&gt;&amp;gt; &amp;gt; i.e., there is no splitting the funds in case of an uncollaborative&lt;br/&gt;&amp;gt; &amp;gt; refund. Not sure how important that is though, since I don&amp;#39;t think&lt;br/&gt;&amp;gt; &amp;gt; third-party funds will come from unrelated parties, e.g., most of these&lt;br/&gt;&amp;gt; &amp;gt; funds will come from an on-chain wallet that is under the control of&lt;br/&gt;&amp;gt; &amp;gt; either parties so the refund should go back to that party anyway.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This can be accomplished similarly by having either (or both) party&lt;br/&gt;&amp;gt; publishing a&lt;br/&gt;&amp;gt; static address or publicly derivable address specific to the channel,&lt;br/&gt;&amp;gt; derived&lt;br/&gt;&amp;gt; from their HD seed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Arguably, the address should perhaps be global, so that it can outlive the&lt;br/&gt;&amp;gt; lifetime of the channel, i.e. as soon as the first person deposits and a&lt;br/&gt;&amp;gt; splice&lt;br/&gt;&amp;gt; is initiated, is the address still valid for the new channel if new keys&lt;br/&gt;&amp;gt; are&lt;br/&gt;&amp;gt; used? Similarly, the channel could be closed and the funds locked until&lt;br/&gt;&amp;gt; the timeout if the peer disappears.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regardless, both approaches can be made to have equivalent amounts of&lt;br/&gt;&amp;gt; [non-]interactivity. However, the recipient isn&amp;#39;t burdened in spending by&lt;br/&gt;&amp;gt; 1) interaction with the channel peer, or 2) an absolute timeout if 1 fails,&lt;br/&gt;&amp;gt; giving the receiver more flexibility if they wish to not commit the&lt;br/&gt;&amp;gt; received&lt;br/&gt;&amp;gt; funds to a splice. It also benefits from smaller witness sizes, a larger&lt;br/&gt;&amp;gt; anonymity set, etc.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In general, using a 2-of-2&#43;timeout to stage funds for splicing doesn&amp;#39;t&lt;br/&gt;&amp;gt; offer&lt;br/&gt;&amp;gt; that much IMO. It seems the primary purpose is to prevent the funds from&lt;br/&gt;&amp;gt; being&lt;br/&gt;&amp;gt; double spent during the splice, but observe that this is still possible if&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; timeout matures, perhaps because the splice doesn&amp;#39;t confirm in a timely&lt;br/&gt;&amp;gt; manner.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Acknowledging this, detecting double-spent inputs is still required for&lt;br/&gt;&amp;gt; full&lt;br/&gt;&amp;gt; correctness. By implementing it, either party is free to propose arbitrary&lt;br/&gt;&amp;gt; inputs for a splice, which I believe reduces complexity in the long run.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Splice out,&lt;br/&gt;&amp;gt; Conner&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Tue, Oct 16, 2018 at 10:00 PM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;&amp;gt; lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Good morning lisa,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is a good observation.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Before, I&amp;#39;d already considered the rationale, for why channels have a&lt;br/&gt;&amp;gt;&amp;gt; single 2-of-2 UTXO as funding output.  And it seems I should have&lt;br/&gt;&amp;gt;&amp;gt; considered this, prior to accepting the &amp;#34;parallel&amp;#34; construction as feasible.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For sake of posterity, I leave the below writeup as a tangential to the&lt;br/&gt;&amp;gt;&amp;gt; design of splice (and to the design of Lightning having a single 2-of-2&lt;br/&gt;&amp;gt;&amp;gt; UTXOs):&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # 0-conf is Unsafe, Yet Lightning is Safe; Why?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; To accept a 0-conf transaction output, is known to be unsafe.&lt;br/&gt;&amp;gt;&amp;gt; Replace-by-fee is always a possibility, regardless of whether the&lt;br/&gt;&amp;gt;&amp;gt; transaction opts in to RBF or not: a rational miner will always accept the&lt;br/&gt;&amp;gt;&amp;gt; higher feerate, disregarding any &amp;#34;opt-in&amp;#34; flag that is set or not set on&lt;br/&gt;&amp;gt;&amp;gt; the transaction.  Thus we reject any advice that claims that 0-conf is&lt;br/&gt;&amp;gt;&amp;gt; tenable, even for tiny amounts.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Yet when viewed solely in terms of transactions, Lightning protocol uses&lt;br/&gt;&amp;gt;&amp;gt; transactions that are not on any block (are kept offchain).  Since they are&lt;br/&gt;&amp;gt;&amp;gt; not in a block, they are indistinguishable from 0-conf transactions, which&lt;br/&gt;&amp;gt;&amp;gt; are accepted by the receiver, yet are also not on any block.  One might&lt;br/&gt;&amp;gt;&amp;gt; argue the distinction, that a &amp;#34;real&amp;#34; 0-conf transaction exists on some&lt;br/&gt;&amp;gt;&amp;gt; mempool somewhere, and thus has a chance to be on a block in the future,&lt;br/&gt;&amp;gt;&amp;gt; but mempools have no consensus, and the existence of a transaction on some&lt;br/&gt;&amp;gt;&amp;gt; mempool is not a safe assurance of it existing in the mempool of the next&lt;br/&gt;&amp;gt;&amp;gt; winning miner.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So why is Lightning safe, when 0-conf transactions are in general not&lt;br/&gt;&amp;gt;&amp;gt; safe?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Again, we should focus on why 0-conf transactions in general are not&lt;br/&gt;&amp;gt;&amp;gt; safe: transaction replacement.  Thus, 0-conf transactions can be made safe,&lt;br/&gt;&amp;gt;&amp;gt; if you are somehow able to ensure that replacement transactions cannot be&lt;br/&gt;&amp;gt;&amp;gt; made.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For example, if you are part of an n-of-n federation that signs the&lt;br/&gt;&amp;gt;&amp;gt; transaction, you can always safely accept a 0-conf transaction from that&lt;br/&gt;&amp;gt;&amp;gt; federation paying only to you, because you can always veto any replacement&lt;br/&gt;&amp;gt;&amp;gt; (by simply refusing to sign) that is not in your interests.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is in fact how Lightning works: a 2-of-2 federation (the channel&lt;br/&gt;&amp;gt;&amp;gt; counterparties) are the signatories of the 0-conf transactions that are the&lt;br/&gt;&amp;gt;&amp;gt; commitment transactions of the Lightning protocol.  Replacement of the&lt;br/&gt;&amp;gt;&amp;gt; commitment transactions is strictly guided by the protocol; both sides have&lt;br/&gt;&amp;gt;&amp;gt; veto rights, since the source transaction output is 2-of-2.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thus, Lightning, though it uses 0-conf transactions, is safe, because it&lt;br/&gt;&amp;gt;&amp;gt; prevents the replacement of a 0-conf transaction without the receiver&lt;br/&gt;&amp;gt;&amp;gt; allowing it, by the simple expedient of including the receiver in the&lt;br/&gt;&amp;gt;&amp;gt; 2-of-2 multisig guarding its single funding TXO.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##  The Implications for Splice Proposals&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Some splice proposals involve creating the equivalent of multiple funding&lt;br/&gt;&amp;gt;&amp;gt; TXOs for a single channel.  Such constructions are unsafe-by-default on&lt;br/&gt;&amp;gt;&amp;gt; Poon-Dryja.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In reality, every commitment transaction (or update transaction in&lt;br/&gt;&amp;gt;&amp;gt; Decker-Osuntokun-Russell) is replaceable by any other commitment (or&lt;br/&gt;&amp;gt;&amp;gt; update) transaction for that channel.  Under Poon-Dryja older transactions&lt;br/&gt;&amp;gt;&amp;gt; are revoked (and hence one side risks loss of their collateral) while under&lt;br/&gt;&amp;gt;&amp;gt; Decker-Osuntokun-Russell older transactions may be &amp;#34;gainsaid&amp;#34; (i.e. newer&lt;br/&gt;&amp;gt;&amp;gt; update transactions may be reanchored to consume the TXO of the older&lt;br/&gt;&amp;gt;&amp;gt; update transaction, thus preventing that update from truly being committed&lt;br/&gt;&amp;gt;&amp;gt; to).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is relevant since before a splice, the channel has a single funding&lt;br/&gt;&amp;gt;&amp;gt; TXO, while after the splice, the channel has multiple.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In particular, a commitment (or update) transaction, that has multiple&lt;br/&gt;&amp;gt;&amp;gt; inputs (to consume the multiple funding TXOs), can be replaced with a&lt;br/&gt;&amp;gt;&amp;gt; commitment (or update) transaction that was created before the splice.&lt;br/&gt;&amp;gt;&amp;gt; Under Poon-Dryja, such a commitment transaction may be revoked, but this&lt;br/&gt;&amp;gt;&amp;gt; leaves the other funding TXOs unuseable.  Under Decker-Osuntokun-Russell,&lt;br/&gt;&amp;gt;&amp;gt; as long as the sequence number is preserved across the splice, it is&lt;br/&gt;&amp;gt;&amp;gt; possible for a later update transaction with multiple inputs to simply&lt;br/&gt;&amp;gt;&amp;gt; gainsay the old single-input update with the new multiple-input update&lt;br/&gt;&amp;gt;&amp;gt; transaction. (I suppose, that this is another advantage that&lt;br/&gt;&amp;gt;&amp;gt; Decker-Osuntokun-Russell has).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Sent with ProtonMail &amp;lt;&lt;a href=&#34;https://protonmail.com&amp;gt&#34;&gt;https://protonmail.com&amp;gt&lt;/a&gt;; Secure Email.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&lt;br/&gt;&amp;gt;&amp;gt; On Wednesday, October 17, 2018 9:09 AM, lisa neigut &amp;lt;niftynei at gmail.com&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; To add some context to this, if you start accepting HTLC&amp;#39;s for the new&lt;br/&gt;&amp;gt;&amp;gt; balance after the parallel commitment is made, but before the re-anchor is&lt;br/&gt;&amp;gt;&amp;gt; buried, there&amp;#39;s the potential for a race condition between a unilateral&lt;br/&gt;&amp;gt;&amp;gt; close (or any revoked commitment transaction) and the re-anchoring&lt;br/&gt;&amp;gt;&amp;gt; commitment transaction, that spends the &amp;#39;pre-committed&amp;#39; UTXO of splicing in&lt;br/&gt;&amp;gt;&amp;gt; funds and the original funding transaction.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; You can get around this by waiting until both the pre-commitment UTXO and&lt;br/&gt;&amp;gt;&amp;gt; the re-anchor have cleared a minimum depth before accepting HTLC&amp;#39;s for the&lt;br/&gt;&amp;gt;&amp;gt; new balance totals, but that&amp;#39;s twice as long of a wait as the first,&lt;br/&gt;&amp;gt;&amp;gt; synchronized re-commitment scheme that Rusty originally proposed.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; It also makes leaving the original funding transaction &amp;#39;exposed&amp;#39; (ie&lt;br/&gt;&amp;gt;&amp;gt; Rene&amp;#39;s version of parallel splice) untenable, as there&amp;#39;s always the risk of&lt;br/&gt;&amp;gt;&amp;gt; an old state being published to consume that input. This foobars your&lt;br/&gt;&amp;gt;&amp;gt; current HTLC commitments.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Tue, Oct 16, 2018 at 3:31 PM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; writes:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; If we&amp;#39;re going to do side splice-in like this, I would use a very&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; different protocol: the reason for this protocol was to treat splice-in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; and splice-out the same, and inline splice-in requires wait time.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Since&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; splice-out doesn&amp;#39;t, we don&amp;#39;t need this at all.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; It would look much more like:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 1. Prepare any output with script of specific form. eg:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;         OP_DEPTH 3 OP_EQUAL OP_IF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;funding_pubkey1&amp;gt; &amp;lt;funding_pubkey2&amp;gt; OP_CHECKMULTISIG&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;         OP_ELSE&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;blockheight&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;                 &amp;lt;myrescue_pubkey&amp;gt; OP_CHECKSIG&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;         OP_ENDIF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 40 (`splice_in`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 2. data:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`8`: `satoshis`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `txoutnum`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `blockheight`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`33`: `myrescue_pubkey`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 137 (`update_splice_in_accept`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    data:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`4`: `txoutnum`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 1. type: 138 (`update_splice_in_reject`) (`option_splice`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    data:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`32`: `txid`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`2`:`len`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;    * [`len`:`errorstr`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; The recipient of `splice_in` checks that it&amp;#39;s happy with the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; `blockheight` (far enough in future).  Once it sees the tx referred to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; buried to its own `minimum_depth`, it checks output is what they&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; claimed, then sends `update_splice_in_accept`; it&amp;#39;s followed up&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; `commitment_signed` like normal, but from this point onwards, all&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; commitment txs signatures have one extra sig.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lisa started asking pointed questions, and so I noticed that parallel&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; splice doesn&amp;#39;t work with Poon-Dryja channels.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The counterparty can spend the old funding txout with a revoked spend.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Sure, I can take all the money from that, but what about the spliced&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; input?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I came up with increasingly elaborate workarounds, but nothing stuck.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Back to Plan A...&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181022/337246c7/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181022/337246c7/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:51:40&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqszwfg8vacuvz3xlcrsp0el79nlaa3xtpw7mfwz7ak7alrw09a3fhczyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv200gp9</id>
    
      <title type="html">📅 Original date posted:2018-04-17 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqszwfg8vacuvz3xlcrsp0el79nlaa3xtpw7mfwz7ak7alrw09a3fhczyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyv200gp9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9d773hlu9u2z3ukem5c3cxh3h5hc8zwxd9eqn04v9m8fwlnwspsq47y4py&#39;&gt;nevent1q…y4py&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-04-17&lt;br/&gt;📝 Original message:&lt;br/&gt;Good evening ZmnSCPxj,&lt;br/&gt;&lt;br/&gt;&amp;gt; Also, thank you for the link.&lt;br/&gt;&lt;br/&gt;Definitely! I had to do some digging myself to recover these hidden gems.&lt;br/&gt;&lt;br/&gt;&amp;gt; I understand. It would be good to know what you have, and perhaps consider&lt;br/&gt;&amp;gt; planning a new BOLT document for such.&lt;br/&gt;&lt;br/&gt;Yes, that is the ultimate goal. I think it might be a little to soon to&lt;br/&gt;have a&lt;br/&gt;full-on BOLT spec. There are still some implementation details that we would&lt;br/&gt;like to address before formalizing everything. I am working to have&lt;br/&gt;something&lt;br/&gt;written up in the short-term documenting the approach[es] that ends up being&lt;br/&gt;solidified. Hopefully that can get some eyes during development, and perhaps&lt;br/&gt;serve as working document/rough draft.&lt;br/&gt;&lt;br/&gt;&amp;gt; Sorry, I seem confused this idea.  Can you give example for commitment&lt;br/&gt;with 2x&lt;br/&gt;&amp;gt; HTLC?&lt;br/&gt;&lt;br/&gt;Sure thing! The confirmation of second level HTLC txns can be separated by&lt;br/&gt;arbitrary delays. This is particularly true if the CLTVs have already&lt;br/&gt;expired,&lt;br/&gt;offering an attacker total control over when the txns appear on the&lt;br/&gt;network. One&lt;br/&gt;way this can happen is if the attacker iteratively broadcasts a single&lt;br/&gt;second-level txn, waits for confirmation and CSV to expire, then repeat with&lt;br/&gt;another second-level txn.&lt;br/&gt;&lt;br/&gt;Since the CSVs begin ticking as soon as they are included in the chain, the&lt;br/&gt;attacker could try to sweep each one immediately after its CSV expires. If&lt;br/&gt;the&lt;br/&gt;watchtower doesn&amp;#39;t have the ability to sweep outputs independently, it would&lt;br/&gt;have no way to intercept this behavior, and prevent the breacher from&lt;br/&gt;sweeping&lt;br/&gt;individual HTLCs sequentially.&lt;br/&gt;&lt;br/&gt;&amp;gt; When the commitment txid is found onchain, the WatchTower creates a single&lt;br/&gt;&amp;gt; main output claim transaction using the 1 or 2 signatures for the main&lt;br/&gt;&amp;gt; outputs.  And for each HTLC outpoint on the commitment transaction, if it&lt;br/&gt;gets&lt;br/&gt;&amp;gt; spent, the WatchTower creates one HTLC justice transaction from the&lt;br/&gt;&amp;gt; second-stage HTLC transaction.&lt;br/&gt;&lt;br/&gt;Yes, this is how it would work in context of what I was suggesting.&lt;br/&gt;Certainly,&lt;br/&gt;there are other ways to accomplish the same thing. I don&amp;#39;t wish to claim&lt;br/&gt;that&lt;br/&gt;this is the best solution available, there are a lot of tradeoffs that need&lt;br/&gt;to be evaluated. I&amp;#39;m hoping that you and others can bring any shortcomings&lt;br/&gt;to&lt;br/&gt;light and help us sift through them.&lt;br/&gt;&lt;br/&gt;&amp;gt; 5.  0 or 1 or 2 signatures for the main outputs. These sign a single&lt;br/&gt;&amp;gt; transaction that claims only the main outputs.&lt;br/&gt;&lt;br/&gt;Yes, it seems necessary to separate the commitment outpoints from the HTLC&lt;br/&gt;outpoints in case the commitment txn is broadcasted before the CLTVs expire.&lt;br/&gt;You could try to batch these with the HTLCs, but then we get back into&lt;br/&gt;exponential territory.&lt;br/&gt;&lt;br/&gt;&amp;gt; Is that approximately what is needed?  Have I missed anything?&lt;br/&gt;&lt;br/&gt;Nope, I think your understanding is on point. IMO this seems to be a&lt;br/&gt;reasonable&lt;br/&gt;compromise of the tradeoffs at hand, and definitely something that could&lt;br/&gt;serve&lt;br/&gt;as an initial iteration due to its simplicity. In the future, there&lt;br/&gt;are definitely&lt;br/&gt;ways&lt;br/&gt;to improve on this on make it even more efficient! Though having a&lt;br/&gt;solid/workable v0 is important if it is to be deployed. I enjoy hearing your&lt;br/&gt;thoughts on this, thank you for your responses!&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Conner&lt;br/&gt;&lt;br/&gt;On Tue, Apr 17, 2018 at 6:14 AM ZmnSCPxj &amp;lt;ZmnSCPxj at protonmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Conner,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi ZmnSCPxj,&lt;br/&gt;&amp;gt; &amp;gt; Can you describe the &amp;#34;encrypted blob&amp;#34; approach to me? Or point me to&lt;br/&gt;&amp;gt; &amp;gt; materials?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There&amp;#39;s an awesome watchtower thread on the mailing list from 2016 that&lt;br/&gt;&amp;gt; starts&lt;br/&gt;&amp;gt; here [1]. It covers a broader range of possibilities than just the&lt;br/&gt;&amp;gt; encrypted&lt;br/&gt;&amp;gt; blob approach, and also considers other revocation schemes, e.g. elkrem.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Similar to what you described, one encrypted blob approached discussed in&lt;br/&gt;&amp;gt; that thread is:&lt;br/&gt;&amp;gt; 1. hint = tixd[:16]&lt;br/&gt;&amp;gt; 2. blob = Enc(data, txid[16:])&lt;br/&gt;&amp;gt; 3. Send (hint, blob) to watchtower.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Whenever a new block is mined, the watchtower checks if it has an entry&lt;br/&gt;&amp;gt; for each&lt;br/&gt;&amp;gt; txid[:16]. If so, it decrypts using txid[16:], assembles the justice txn,&lt;br/&gt;&amp;gt; and&lt;br/&gt;&amp;gt; broadcasts (assuming the reward output matches what was negotiated).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thank you, that is indeed similar to what I was thinking given the name&lt;br/&gt;&amp;gt; &amp;#34;encrypted blob&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Also, thank you for the link. I have not had much time to back-read&lt;br/&gt;&amp;gt; anything older than 2017 in the archives. I observe that neither Poon nor&lt;br/&gt;&amp;gt; Dryja seem to strongly participate in this list from 2017 onwards.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Do you have a description of the WatchTower protocol used in lnd? It&lt;br/&gt;&amp;gt; may be&lt;br/&gt;&amp;gt; &amp;gt; useful to be intercompatible.&lt;br/&gt;&amp;gt; We don&amp;#39;t have anything written up formally, though what we have currently&lt;br/&gt;&amp;gt; operates on the design above.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I understand. It would be good to know what you have, and perhaps consider&lt;br/&gt;&amp;gt; planning a new BOLT document for such.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Nicolas Dorier mentioned plans for BTCPay to somehow host &amp;#34;merchant&lt;br/&gt;&amp;gt; support networks&amp;#34; where merchants may expose WatchTower endpoints, which&lt;br/&gt;&amp;gt; other merchants may post revocation information for their channels to.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;ll also take this time to brain dump some recent investigations I&amp;#39;ve&lt;br/&gt;&amp;gt; been doing on&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; watchtowers. TL;DR @ fin.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; FWIW, I&amp;#39;ve been thinking about this in the context of the simple encrypted&lt;br/&gt;&amp;gt; blob approach, though the observations can generalize to other schemes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As Laolu mentioned, the storage requirement for the watchtower is&lt;br/&gt;&amp;gt; dominated by&lt;br/&gt;&amp;gt; the number of HTLC signatures included in the encrypted blob. Due to&lt;br/&gt;&amp;gt; independence of the second stage transactions, there is a combinatoric&lt;br/&gt;&amp;gt; blowup in&lt;br/&gt;&amp;gt; the number of signatures that would need to be pre-signed under the&lt;br/&gt;&amp;gt; revocation&lt;br/&gt;&amp;gt; private key _if sweeping of HTLC outputs is batched_.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we want to batch sweep without more liberal sighash flags, I think we&amp;#39;d&lt;br/&gt;&amp;gt; need to&lt;br/&gt;&amp;gt; pre-sign n*2^n signatures. There are 2^n possible ways that n HTLCs can&lt;br/&gt;&amp;gt; straddle&lt;br/&gt;&amp;gt; the first and second stages, and each permutation would require n distinct&lt;br/&gt;&amp;gt; signatures&lt;br/&gt;&amp;gt; since the set of inputs is unique to each permutation. Needless to say,&lt;br/&gt;&amp;gt; this isn&amp;#39;t feasible&lt;br/&gt;&amp;gt; with the maximum number of HTLCs allowed in the protocol.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, I thought this too.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, I have some observations that might inform an efficient set of&lt;br/&gt;&amp;gt; signatures we can choose to include in the encrypted blobs.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The first is that the HTLC timeout or HTLC success transaction _must_ be&lt;br/&gt;&amp;gt; broadcast before the attacker can move funds back into their wallet. If&lt;br/&gt;&amp;gt; these transactions are never mined, it is actually fine to do nothing and&lt;br/&gt;&amp;gt; leave&lt;br/&gt;&amp;gt; those outputs in the breached state.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If/when the victim comes back online, they themselves can sign and&lt;br/&gt;&amp;gt; broadcast&lt;br/&gt;&amp;gt; a justice transaction that executes the revocation clause of either the&lt;br/&gt;&amp;gt; offered or&lt;br/&gt;&amp;gt; received HTLC scripts, based on the observed spentness of the various&lt;br/&gt;&amp;gt; commitment&lt;br/&gt;&amp;gt; HLTC outputs at that time. So, we can save on signature data by only&lt;br/&gt;&amp;gt; requiring the&lt;br/&gt;&amp;gt; watchtower to act if second stage transactions are confirmed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is a good observation!  I initially thought that we would have to&lt;br/&gt;&amp;gt; provide both the first-stage and second-stage revocation signatures.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One reallyyy nice thing about not having the watchtower sweep the HTLC&lt;br/&gt;&amp;gt;  outputs&lt;br/&gt;&amp;gt; on the commitment txn directly is that it doesn&amp;#39;t need to know how to&lt;br/&gt;&amp;gt; reconstruct the more complex HTLC redeem scripts. It only needs to&lt;br/&gt;&amp;gt; reconstruct&lt;br/&gt;&amp;gt; commitment to-local and second-stage to-local scripts and witnesses. This&lt;br/&gt;&amp;gt; means&lt;br/&gt;&amp;gt; the blob primarily contains:&lt;br/&gt;&amp;gt;  - 1 revocation pubkey&lt;br/&gt;&amp;gt;  - 1 local delay pubkey&lt;br/&gt;&amp;gt;  - 1 CSV delay&lt;br/&gt;&amp;gt;  - 2 commitment signatures&lt;br/&gt;&amp;gt;  - n HTLC signatures&lt;br/&gt;&amp;gt; and we don&amp;#39;t have to bother sending CLTVs, local/remote htlc pubkeys, or&lt;br/&gt;&amp;gt; payment hashes at all.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The storage for this ends up being something like ~100 &#43; 64*(2&#43;nhtlcs)&lt;br/&gt;&amp;gt; when you&lt;br/&gt;&amp;gt; include other things like the sweep address.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thank you, that seems like a start at something that can be implemented.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The second observation is that the second stage transactions could be&lt;br/&gt;&amp;gt; broadcast&lt;br/&gt;&amp;gt; sequentially such that the CSV delays don&amp;#39;t overlap at all. In this&lt;br/&gt;&amp;gt; event, the&lt;br/&gt;&amp;gt; watchtower needs to sweep the HTLCs iteratively to prevent the attacker&lt;br/&gt;&amp;gt; from&lt;br/&gt;&amp;gt; sweeping any of the outputs as the relative timelocks expire.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sorry, I seem confused this idea.  Can you give example for commitment&lt;br/&gt;&amp;gt; with 2x HTLC?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One minimal solution could be to send signatures for independent sweep&lt;br/&gt;&amp;gt; transactions, allowing the watchtower to sweep each HTLC output&lt;br/&gt;&amp;gt; individually.&lt;br/&gt;&amp;gt; This is nice because it permits the watchtower to sweep exactly the&lt;br/&gt;&amp;gt; subset of&lt;br/&gt;&amp;gt; HTLCs that ever transition into the second stage, and under any&lt;br/&gt;&amp;gt; permutation&lt;br/&gt;&amp;gt; wrt. ordering of confirmed second stage transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, this seems like a good general idea.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With the single transaction per HTLC approach, the total number of&lt;br/&gt;&amp;gt; signatures that&lt;br/&gt;&amp;gt; are sent to the watchtower remains linear in the number HTLCs on the&lt;br/&gt;&amp;gt; commitment&lt;br/&gt;&amp;gt; transaction. This approach does have the downside of consuming slightly&lt;br/&gt;&amp;gt; more&lt;br/&gt;&amp;gt; fees, since each output is swept with a distinct transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, this approach is fairly efficient in preventing the attacker&lt;br/&gt;&amp;gt; entirely from&lt;br/&gt;&amp;gt; moving funds from the channel into their wallet wrt. to the amount of data&lt;br/&gt;&amp;gt; stored.&lt;br/&gt;&amp;gt; Considering that the majority of the channel balance is expected to be in&lt;br/&gt;&amp;gt; the commitment outputs and that hypothetically on-chains fees are offset&lt;br/&gt;&amp;gt; by the&lt;br/&gt;&amp;gt; remote balance, this could be an acceptable tradeoff.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I suspect that in practice, most second stage transactions will be valid&lt;br/&gt;&amp;gt; by the&lt;br/&gt;&amp;gt; time an attacker would drop to chain. Because of this, it&amp;#39;s possible that&lt;br/&gt;&amp;gt; they&lt;br/&gt;&amp;gt; could be mined in the same block as the breach transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If everything is mined in the same block or in quick succession, it might&lt;br/&gt;&amp;gt; be&lt;br/&gt;&amp;gt; worthwhile to also pre-sign a justice txn that batch sweeps all HTLCs&lt;br/&gt;&amp;gt; directly&lt;br/&gt;&amp;gt; from the second layer, requiring one additional signature/HTLC.&lt;br/&gt;&amp;gt; This could be a plausible scenario if the offender breached&lt;br/&gt;&amp;gt; unintentionally, and&lt;br/&gt;&amp;gt; their implementation tries to proceed normally. However it does require&lt;br/&gt;&amp;gt; all of the&lt;br/&gt;&amp;gt; CSV delays to conincide. If that doesn&amp;#39;t happen, the watchtower can always&lt;br/&gt;&amp;gt; resort to sweeping the outputs individually.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; All in all, I think the ability to sweep each HTLC independently is&lt;br/&gt;&amp;gt; more-or-less&lt;br/&gt;&amp;gt; a requirement just given the complexity of how the on-chain state-space can&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; manifest, especially if CLTVs have already expired. Other scenarios may&lt;br/&gt;&amp;gt; be worth including on a case by case basis or if we feel they are&lt;br/&gt;&amp;gt; justified. This&lt;br/&gt;&amp;gt; could be handled dynamically by including some bitvector or some compact&lt;br/&gt;&amp;gt; representation of how to reconstruct the transactions for any additional,&lt;br/&gt;&amp;gt; included&lt;br/&gt;&amp;gt; signatures.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Okay.  So it seems, the blob contains:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.  Revocation pubkey (from our revocation basepoint and per-commitment&lt;br/&gt;&amp;gt; basepoint)&lt;br/&gt;&amp;gt; 2.  Their delayed payment pubkey (needed in scripts)&lt;br/&gt;&amp;gt; 3.  Our imposed to_self_delay (the setting we indicate, that we impose on&lt;br/&gt;&amp;gt; the remote side)&lt;br/&gt;&amp;gt; 4.  Our payment pubkey&lt;br/&gt;&amp;gt; 5.  0 or 1 or 2 signatures for the main outputs. These sign a single&lt;br/&gt;&amp;gt; transaction that claims only the main outputs.&lt;br/&gt;&amp;gt; 6.  0 or more second-stage HTLC revocation signatures.  These sign&lt;br/&gt;&amp;gt; individual transactions (one per HTLC) that claims only the second-stage&lt;br/&gt;&amp;gt; HTLC output.&lt;br/&gt;&amp;gt; 7.  scriptpubkey to put all the funds in.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; When the commitment txid is found onchain, the WatchTower creates a single&lt;br/&gt;&amp;gt; main output claim transaction using the 1 or 2 signatures for the main&lt;br/&gt;&amp;gt; outputs.  And for each HTLC outpoint on the commitment transaction, if it&lt;br/&gt;&amp;gt; gets spent, the WatchTower creates one HTLC justice transaction from the&lt;br/&gt;&amp;gt; second-stage HTLC transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Is that approximately what is needed?  Have I missed anything?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180417/873b48e1/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180417/873b48e1/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:50:10&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsrt38aws57jttgf563zh0lthppqdca3s3mc8k9uv4scf6cv5mnlzczyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvyjvecx</id>
    
      <title type="html">📅 Original date posted:2018-02-07 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsrt38aws57jttgf563zh0lthppqdca3s3mc8k9uv4scf6cv5mnlzczyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvyjvecx" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsxv8625qkp90jffppqaysyqj3lw793p32rzpg8rapga05urx8k4fckw7pfg&#39;&gt;nevent1q…7pfg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-02-07&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi ZmnSCPxj and Laolu,&lt;br/&gt;&lt;br/&gt;&amp;gt;  Indeed, the existence of per-hop fees (`fee_base_msat`) means, splitting&lt;br/&gt;the&lt;br/&gt;&amp;gt;  payment over multiple flows will be, very likely, more expensive,&lt;br/&gt;compared to&lt;br/&gt;&amp;gt;  using a single flow.&lt;br/&gt;&lt;br/&gt;As Laolu pointed out, we have yet to see how fees evolve on mainnet or what&lt;br/&gt;will&lt;br/&gt;emerge as a sane, default fee schedules. I agree that if the same&lt;br/&gt;proportional&lt;br/&gt;fee is used across all partial payments, then it could certainly be more&lt;br/&gt;expensive.&lt;br/&gt;&lt;br/&gt;However, it could also be the case that you were paying a needlessly high&lt;br/&gt;proportional fee to begin with, because paths of sufficient capacity to the&lt;br/&gt;destination were scarce. In an AMP world, there will be an abundance of&lt;br/&gt;channels&lt;br/&gt;that can route small, partial payments, which may itself drive down the&lt;br/&gt;competitive fee rate for smaller payments. Just a hypothesis, we shall see&lt;br/&gt;where&lt;br/&gt;supply meets demand!&lt;br/&gt;&lt;br/&gt;At the end of the day, the user can always fall back to regular payment if&lt;br/&gt;they&lt;br/&gt;expect to end up paying more fees using an AMP.&lt;br/&gt;&lt;br/&gt;&amp;gt; (If we want to support multiple routes converging to an intermediate node,&lt;br/&gt;&amp;gt; then continue routing to a different final node after routes have merged&lt;br/&gt;(i.e.&lt;br/&gt;&amp;gt; A-&amp;gt;B-&amp;gt;C-&amp;gt;D, and A-&amp;gt;E-&amp;gt;C-&amp;gt;D, with the payment being merged by C, who&lt;br/&gt;forwards&lt;br/&gt;&amp;gt; the combination to D), then we need to follow the current hop data&lt;br/&gt;format, but&lt;br/&gt;&amp;gt; I think supporting AMP at final payees is actually enough...&lt;br/&gt;&lt;br/&gt;I think this is an interesting idea, sounds maybe like a&lt;br/&gt;recursive/hierarchical&lt;br/&gt;AMP? The ability to merge the payments seems like it would result in a&lt;br/&gt;decent privacy&lt;br/&gt;leak, as I believe an intermediary would have enough evidence to prove that&lt;br/&gt;two&lt;br/&gt;payments were merged/correlated. Simple traffic analysis would also reveal a&lt;br/&gt;discrepancy in the number of incoming and outgoing packets, and possibly&lt;br/&gt;other&lt;br/&gt;observable differences in routing (some) AMPs vs regular payments.&lt;br/&gt;&lt;br/&gt;FWIW the current proposal allows the paths of partial payments to overlap,&lt;br/&gt;in such a scenario C would just forward the HTLCs independently. One could&lt;br/&gt;send&lt;br/&gt;them all along the same path if they desired! I&amp;#39;m assuming the intent here&lt;br/&gt;is to&lt;br/&gt;try and reduce total fees?&lt;br/&gt;&lt;br/&gt;Minor correction^2:&lt;br/&gt;&lt;br/&gt;&amp;gt; This should actually be (H(s_0 || s_1 || ...), s_i).&lt;br/&gt;&lt;br/&gt;This assumes the receiver knows the indexes of each share. Without this&lt;br/&gt;knowledge they would have to brute force all orderings to check the&lt;br/&gt;fingerprint.&lt;br/&gt;&lt;br/&gt;To maintain order invariance on the receiving end, I would propose sending&lt;br/&gt;(0, s_i) for the first n-1 partial payments, and then (n, s_i) on the final&lt;br/&gt;one.&lt;br/&gt;As in the description of the basic AMP scheme, the receiver maintains a&lt;br/&gt;persistent count of how many partial payments have been received for ID. If&lt;br/&gt;the&lt;br/&gt;receiver does not get the last payment last, the receiver just waits until&lt;br/&gt;all n&lt;br/&gt;have been received before deciding that its reconstructed value is BP.&lt;br/&gt;&lt;br/&gt;The receiver can verify they&amp;#39;ve received the correct BP and n by rederiving&lt;br/&gt;the&lt;br/&gt;partial preimages r_i = H(BP || i) and checking that there are n outstanding&lt;br/&gt;payments, one for each h_i = H(r_i). This also saves the receiving node n&lt;br/&gt;additional hash invocations.&lt;br/&gt;&lt;br/&gt;-Conner&lt;br/&gt;&lt;br/&gt;On Tue, Feb 6, 2018 at 4:04 PM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi ZmnSCPxj,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; This is excellent work!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&lt;br/&gt;&amp;gt; &amp;gt; end-ot-end, `localfeatures` is not appropriate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yep, it would need to be a global feature bit. In the case that we&amp;#39;re&lt;br/&gt;&amp;gt; sending to a destination which isn&amp;#39;t publicly advertised, then perhaps an&lt;br/&gt;&amp;gt; extension to BOLT-11 could be made to signal receiver support.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I believe, currently, fees have not this super-linear component&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yep they don&amp;#39;t. Arguably, we should also have a component that scales&lt;br/&gt;&amp;gt; according to the proposed CLTV value of the outgoing HTLC. At Scaling&lt;br/&gt;&amp;gt; Bitcoin Stanford, Aviv Zohar gave a talked titled &amp;#34;How to Charge Lightning&amp;#34;&lt;br/&gt;&amp;gt; where the authors analyzed the possible evolution of fees on the network&lt;br/&gt;&amp;gt; (and also suggested adding this super-linear component to extend the&lt;br/&gt;&amp;gt; lifetime of channels).  However, the talk itself focused on a very simple&lt;br/&gt;&amp;gt; &amp;#34;mega super duper hub&amp;#34; topology. Towards the end he alluded to a&lt;br/&gt;&amp;gt; forthcoming&lt;br/&gt;&amp;gt; paper that had more comprehensive analysis of more complex topologies. I&lt;br/&gt;&amp;gt; look forward to the publication of their finalized work.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Indeed, the existence of per-hop fees (`fee_base_msat`) means, splitting&lt;br/&gt;&amp;gt; &amp;gt; the payment over multiple flows will be, very likely, more expensive,&lt;br/&gt;&amp;gt; &amp;gt; compared to using a single flow.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Well it&amp;#39;s still to be seen how the fee structure on mainnet emerges once&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; network is still fully bootstrapped. AFAIK, most running on mainnet atm are&lt;br/&gt;&amp;gt; using the default fee schedules for their respective implementations. For&lt;br/&gt;&amp;gt; example, the default fee_base_msat for lnd is 1000 msat (1 satoshi).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I believe the `realm` byte is intended for this.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The realm byte is meant to signal &amp;#34;forward this to the dogecoin channel&amp;#34;.&lt;br/&gt;&amp;gt; ATM, we just default to 0 as &amp;#34;Bitcoin&amp;#34;. However, the byte itself only&lt;br/&gt;&amp;gt; really&lt;br/&gt;&amp;gt; need significance between the sender and the intermediate node. So there&lt;br/&gt;&amp;gt; isn&amp;#39;t necessarily pressure to have a globally synchronized set of realm&lt;br/&gt;&amp;gt; bytes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Thus, you can route over nodes that are unaware of AMP, and only provide&lt;br/&gt;&amp;gt; &amp;gt; an AMP realm byte to the destination node, who, is able to reconstruct&lt;br/&gt;&amp;gt; this&lt;br/&gt;&amp;gt; &amp;gt; your AMP data as per your algorithm.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, the intermediate nodes don&amp;#39;t need to be aware of the end-to-end&lt;br/&gt;&amp;gt; protocol. For the final hop, there are actually 53 free bytes (before one&lt;br/&gt;&amp;gt; needs to signal the existence of EOBs):&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   * 1 byte realm&lt;br/&gt;&amp;gt;   * 8 bytes next addr (all zeroes to signal final dest)&lt;br/&gt;&amp;gt;   * 32 bytes hmac (also all zeroes for the final dest)&lt;br/&gt;&amp;gt;   * 12 bytes padding&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So any combo of these bytes can be used to signal more advanced protocols&lt;br/&gt;&amp;gt; to&lt;br/&gt;&amp;gt; the final destination.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A correction from the prior email description:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; We can further modify our usage of the per-hop payloads to send&lt;br/&gt;&amp;gt; &amp;gt; (H(BP), s_i) to consume most of the EOB sent from sender to receiver.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This should actually be (H(s_0 || s_1 || ...), s_i). So we still allow them&lt;br/&gt;&amp;gt; to check this finger print to see if they have all the final shares, but&lt;br/&gt;&amp;gt; don&amp;#39;t allow them to preemptively pull all the payments.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mon, Feb 5, 2018 at 11:12 PM ZmnSCPxj &amp;lt;ZmnSCPxj at protonmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Good morning Laolu,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is excellent work!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Some minor comments...&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (Atomic Multi-path Payments). It can be experimented with on Lightning&lt;br/&gt;&amp;gt;&amp;gt; *today* with the addition of a new feature bit to gate this new&lt;br/&gt;&amp;gt;&amp;gt; feature. The beauty of the scheme is that it requires no fundamental&lt;br/&gt;&amp;gt;&amp;gt; changes&lt;br/&gt;&amp;gt;&amp;gt; to the protocol as is now, as the negotiation is strictly *end-to-end*&lt;br/&gt;&amp;gt;&amp;gt; between sender and receiver.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&lt;br/&gt;&amp;gt;&amp;gt; end-ot-end, `localfeatures` is not appropriate.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   - Potential fee savings for larger payments, contingent on there being a&lt;br/&gt;&amp;gt;&amp;gt;     super-linear component to routed fees. It&amp;#39;s possible that with&lt;br/&gt;&amp;gt;&amp;gt;     modifications to the fee schedule, it&amp;#39;s actually *cheaper* to send&lt;br/&gt;&amp;gt;&amp;gt;     payments over multiple flows rather than one giant flow.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I believe, currently, fees have not this super-linear component.  Indeed,&lt;br/&gt;&amp;gt;&amp;gt; the existence of per-hop fees (`fee_base_msat`) means, splitting the&lt;br/&gt;&amp;gt;&amp;gt; payment over multiple flows will be, very likely, more expensive, compared&lt;br/&gt;&amp;gt;&amp;gt; to using a single flow.  Tiny roundoffs in computing the proportional fees&lt;br/&gt;&amp;gt;&amp;gt; (`fee_proportional_millionths`) may make smaller flows give a slight fee&lt;br/&gt;&amp;gt;&amp;gt; advantage, but I think the multiplication of per-hop fees will dominate.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   - Using smaller payments increases the set of possible paths a partial&lt;br/&gt;&amp;gt;&amp;gt;     payment could have taken, which reduces the effectiveness of static&lt;br/&gt;&amp;gt;&amp;gt;     analysis techniques involving channel capacities and the plaintext&lt;br/&gt;&amp;gt;&amp;gt;     values being forwarded.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Strongly agree!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In order to include the three tuple within the per-hop payload for the&lt;br/&gt;&amp;gt;&amp;gt; final&lt;br/&gt;&amp;gt;&amp;gt; destination, we repurpose the _first_ byte of the un-used padding bytes in&lt;br/&gt;&amp;gt;&amp;gt; the payload to signal version 0x01 of the AMP protocol (note this is a PoC&lt;br/&gt;&amp;gt;&amp;gt; outline, we would need to standardize signalling of these 12 bytes to&lt;br/&gt;&amp;gt;&amp;gt; support other protocols).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I believe the `realm` byte is intended for this.  Intermediate nodes do&lt;br/&gt;&amp;gt;&amp;gt; not need to understand realm bytes that are understood by other nodes in&lt;br/&gt;&amp;gt;&amp;gt; the route, including the realm bytes understood by the final destination,&lt;br/&gt;&amp;gt;&amp;gt; as intermediate nodes cannot, indeed, read the hop data of other nodes.&lt;br/&gt;&amp;gt;&amp;gt; Thus, you can route over nodes that are unaware of AMP, and only provide an&lt;br/&gt;&amp;gt;&amp;gt; AMP realm byte to the destination node, who, is able to reconstruct this&lt;br/&gt;&amp;gt;&amp;gt; your AMP data as per your algorithm.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Indeed, the `realm` byte controls the interpretation of the rest of the&lt;br/&gt;&amp;gt;&amp;gt; 65-byte packet.  If you define, instead, a separate `realm` that is&lt;br/&gt;&amp;gt;&amp;gt; understood by the destination node, you can redefine the entire 64 bytes of&lt;br/&gt;&amp;gt;&amp;gt; the final hop data as you wish.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If we support AMP only at final payees, we can completely redefine the 64&lt;br/&gt;&amp;gt;&amp;gt; bytes in the final hop data for the new AMP `realm`, and not consume the&lt;br/&gt;&amp;gt;&amp;gt; next hop (which would reduce route length by 1).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (If we want to support multiple routes converging to an intermediate&lt;br/&gt;&amp;gt;&amp;gt; node, then continue routing to a different final node after routes have&lt;br/&gt;&amp;gt;&amp;gt; merged (i.e. A-&amp;gt;B-&amp;gt;C-&amp;gt;D, and A-&amp;gt;E-&amp;gt;C-&amp;gt;D, with the payment being merged by&lt;br/&gt;&amp;gt;&amp;gt; C, who forwards the combination to D), then we need to follow the current&lt;br/&gt;&amp;gt;&amp;gt; hop data format, but I think supporting AMP at final payees is actually&lt;br/&gt;&amp;gt;&amp;gt; enough... AMP at intermediate nodes might not be used often enough by&lt;br/&gt;&amp;gt;&amp;gt; senders for it to matter, as taking advantage of that seems more complex&lt;br/&gt;&amp;gt;&amp;gt; than just asking your routing algo to provide you multiple routes to a&lt;br/&gt;&amp;gt;&amp;gt; destination, which you are probably already doing)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ----&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Overall, good work I think.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180207/686a561b/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180207/686a561b/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:48:58&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsg36hjl3dpkld62pcauzxm3qmjlqjm4q7g9u4x49nyf3vv5qd72egzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvr2vuj6</id>
    
      <title type="html">📅 Original date posted:2018-05-23 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsg36hjl3dpkld62pcauzxm3qmjlqjm4q7g9u4x49nyf3vv5qd72egzyqt4l5h4yjtmnw389n4aksmwaxrk7ygmd232704fhsp70n05k3fyvr2vuj6" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsy5c3xzdpxx3hwn7r0jtsuv4fx3yg92fajxflt4heqj9cfautt09sprz8l9&#39;&gt;nevent1q…z8l9&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-05-23&lt;br/&gt;📝 Original message:Hi all,&lt;br/&gt;&lt;br/&gt;Jimpo, thanks for looking into those stats! I had always imagined that there&lt;br/&gt;would be a more significant savings in having all filters in one bundle, as&lt;br/&gt;opposed to separate. These results are interesting, to say the least, and&lt;br/&gt;definitely offer us some flexibility in options for filter sharding.&lt;br/&gt;&lt;br/&gt;So far, the bulk of this discussion has centered around bandwidth. I am&lt;br/&gt;concerned, however, that splitting up the filters is at odds with the other&lt;br/&gt;goal of the proposal in offering improved privacy.&lt;br/&gt;&lt;br/&gt;Allowing clients to choose individual filter sets trivially exposes the&lt;br/&gt;type of&lt;br/&gt;data that client is interested in. This alone might be enough to&lt;br/&gt;fingerprint the&lt;br/&gt;function of a peer and reduce anonymity set justifying their potential&lt;br/&gt;behavior.&lt;br/&gt;&lt;br/&gt;Furthermore, if a match is encountered, and block requested, full nodes have&lt;br/&gt;more targeted insight into what caused a particular match. They could infer&lt;br/&gt;that&lt;br/&gt;the client received funds in a particular block, e.g., if they are only&lt;br/&gt;requesting&lt;br/&gt;output scripts.&lt;br/&gt;&lt;br/&gt;This is above and beyond the additional complexity of now syncing,&lt;br/&gt;validating,&lt;br/&gt;and managing five or six distinct header/filter-header/filter/block chains.&lt;br/&gt;&lt;br/&gt;I agree that saving on bandwidth is an important goal, but bandwidth and&lt;br/&gt;privacy&lt;br/&gt;are always seemingly at odds. Strictly comparing the bandwidth requirements&lt;br/&gt;of&lt;br/&gt;a system that heavily weighs privacy to existing ones, e.g. BIP39, that&lt;br/&gt;don&amp;#39;t is a&lt;br/&gt;losing battle IMO.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m not fundamentally opposed to splitting the filters, I certainly see the&lt;br/&gt;arguments for flexibility. However, I also want to ensure we are&lt;br/&gt;considering the&lt;br/&gt;second order effects that fall out of optimizing for one metric when others&lt;br/&gt;exist.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Conner&lt;br/&gt;On Wed, May 23, 2018 at 10:29 Gregory Maxwell via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Any chance you could add a graph of input-scripts  (instead of input&lt;br/&gt;&amp;gt; outpoints)?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Wed, May 23, 2018 at 7:38 AM, Jim Posen via bitcoin-dev&lt;br/&gt;&amp;gt; &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt; So I checked filter sizes (as a proportion of block size) for each of the&lt;br/&gt;&amp;gt; &amp;gt; sub-filters. The graph is attached.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; As interpretation, the first ~120,000 blocks are so small that the&lt;br/&gt;&amp;gt; &amp;gt; Golomb-Rice coding can&amp;#39;t compress the filters that well, which is why the&lt;br/&gt;&amp;gt; &amp;gt; filter sizes are so high proportional to the block size. Except for the&lt;br/&gt;&amp;gt; &amp;gt; input filter, because the coinbase input is skipped, so many of them&lt;br/&gt;&amp;gt; have 0&lt;br/&gt;&amp;gt; &amp;gt; elements. But after block 120,000 or so, the filter compression converges&lt;br/&gt;&amp;gt; &amp;gt; pretty quickly to near the optimal value. The encouraging thing here is&lt;br/&gt;&amp;gt; that&lt;br/&gt;&amp;gt; &amp;gt; if you look at the ratio of the combined size of the separated filters vs&lt;br/&gt;&amp;gt; &amp;gt; the size of a filter containing all of them (currently known as the basic&lt;br/&gt;&amp;gt; &amp;gt; filter), they are pretty much the same size. The mean of the ratio&lt;br/&gt;&amp;gt; between&lt;br/&gt;&amp;gt; &amp;gt; them after block 150,000 is 99.4%. So basically, not much compression&lt;br/&gt;&amp;gt; &amp;gt; efficiently is lost by separating the basic filter into sub-filters.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; On Tue, May 22, 2018 at 5:42 PM, Jim Posen &amp;lt;jim.posen at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; My suggestion was to advertise a bitfield for each filter type the node&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; serves,&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; where the bitfield indicates what elements are part of the filters.&lt;br/&gt;&amp;gt; This&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; essentially&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; removes the notion of decided filter types and instead leaves the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; decision to&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; full-nodes.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; I think it makes more sense to construct entirely separate filters for&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; different types of elements and allow clients to download only the ones&lt;br/&gt;&amp;gt; they&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; care about. If there are enough elements per filter, the compression&lt;br/&gt;&amp;gt; ratio&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; shouldn&amp;#39;t be much worse by splitting them up. This prevents the&lt;br/&gt;&amp;gt; exponential&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; blowup in the number of filters that you mention, Johan, and it works&lt;br/&gt;&amp;gt; nicely&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; with service bits for advertising different filter types independently.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; So if we created three separate filter types, one for output scripts,&lt;br/&gt;&amp;gt; one&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; for input outpoints, and one for TXIDs, each signaled with a separate&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; service bit, are people good with that? Or do you think there shouldn&amp;#39;t&lt;br/&gt;&amp;gt; be a&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; TXID filter at all, Matt? I didn&amp;#39;t include the option of a prev output&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; script filter or rolling that into the block output script filter&lt;br/&gt;&amp;gt; because it&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; changes the security model (cannot be proven to be correct/incorrect&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; succinctly).&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Then there&amp;#39;s the question of whether to separate or combine the headers.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; I&amp;#39;d lean towards keeping them separate because it&amp;#39;s simpler that way.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; &amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; &amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/b7412db9/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/b7412db9/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T20:12:15&#43;02:00</updated>
  </entry>

</feed>