<?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/npub1zgyy2j829vn4zuvhkgza7qe37knzdls4kuwt2k8cehwpjxn9duwqv5j4mf.rss" />
  <link href="https://nostr.ae/npub1zgyy2j829vn4zuvhkgza7qe37knzdls4kuwt2k8cehwpjxn9duwqv5j4mf" />
  <id>https://nostr.ae/npub1zgyy2j829vn4zuvhkgza7qe37knzdls4kuwt2k8cehwpjxn9duwqv5j4mf</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://nostr.ae/nevent1qqsxfkgnc4zlt5l8zmzalg368v066cepfjn9769smdfnj6pr5mvjeqqzyqfqs32gag4jw5t3j7eqthcrx866vfh7zkm3ed2clrxacxg6v4h3ca2kxep</id>
    
      <title type="html">📅 Original date posted:2023-07-28 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsxfkgnc4zlt5l8zmzalg368v066cepfjn9769smdfnj6pr5mvjeqqzyqfqs32gag4jw5t3j7eqthcrx866vfh7zkm3ed2clrxacxg6v4h3ca2kxep" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstwklmfs7zt4zlzfpln8zj5g2zjhz5v658snpr4xea5llwyhvhy0cgqypyu&#39;&gt;nevent1q…ypyu&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-07-28&lt;br/&gt;🗒️ Summary of this message: ZmnSCPxj proposes a scheme for a multipath payment protocol called &amp;#34;keysend&amp;#34; that allows for splitting payments into multiple parts.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi ZmnSCPxj,&lt;br/&gt;&lt;br/&gt;This sounds very similar to AMP&lt;br/&gt;(&lt;a href=&#34;https://docs.lightning.engineering/lightning-network-tools/lnd/amp&#34;&gt;https://docs.lightning.engineering/lightning-network-tools/lnd/amp&lt;/a&gt;).&lt;br/&gt;Does this scheme offer any improvements over AMP?&lt;br/&gt;&lt;br/&gt;- Matt&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Fri, Jul 28, 2023 at 7:24 AM ZmnSCPxj via Lightning-dev&lt;br/&gt;&amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I would like to share a simple scheme for creating a `keysend` protocol that allows for multipath payments.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In `keysend`, the preimage is embedded as TLV 5482373484 with length 32.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In the multipath case, we want the receiver to only be able to claim the payment once all parts have arrived at the receiver.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For example, suppose we want to split the `keysend` into 2 parts.&lt;br/&gt;&amp;gt; Let us select a true preimage `p` at random.&lt;br/&gt;&amp;gt; Then, we generate the payment hash `h = SHA256(p)`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then, we generate a new 256-bit scalar, `a`.&lt;br/&gt;&amp;gt; For one part, we send `a` for TLV 5482373484, and for the second part, we send `a ^ p`, where `^` is XOR.&lt;br/&gt;&amp;gt; All parts use the same payment hash `h`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The receiver, on receiving either part, will find that the supposed preimage does not match the actual HTLC payment hashes.&lt;br/&gt;&amp;gt; Instead of failing, it holds the payment, using the usual basic multipath payment rules.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; When the receiver receives another part, it will XOR together the supposed preimages.&lt;br/&gt;&amp;gt; In the above case, it would get `a` and `a ^ p`, which when XORed together result in `a ^ a ^ p` or `p`, which is now the correct preimage, and the receiver can now claim the entire complete funds.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The same technique would work with any number of parts --- if we split into `n` parts, we generate `n - 1` additional random scalars and use it for the first `n - 1` parts, then XOR all of them with the scalar-to-be-split for the `n`th part.&lt;br/&gt;&amp;gt; This scheme also works for dynamic splitting, i.e. if you are splitting a part that was already split off from a part that was already split off from a part etc.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A sender can detect if the receiver does not support multipath `keysend` if a part reaches the receiver and it errors with `incorrect_or_unknown_payment_details`.&lt;br/&gt;&amp;gt; If the receiver is aware of multipath `keysend`, it would hold onto the incoming HTLCs until MPP timeout, and instead error with `mpp_timeout`.&lt;br/&gt;&amp;gt; Thus, support for this on the receiver side does not need to be specially announced via a new feature bit --- an MPP-capable sender can simply try to split, and if it gets an `incorrect_or_unknown_payment_details`, knows that the receiver does not support multipath `keysend`.&lt;br/&gt;&amp;gt; The same feature bit 55 can be reused.&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; 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-07-31T00:54:54&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsdyt0zkeh84wsqnr2v4jgudx5gtdjyg4et0u7xgq3496zqhjg8mxqzyqfqs32gag4jw5t3j7eqthcrx866vfh7zkm3ed2clrxacxg6v4h3c8kjqh4</id>
    
      <title type="html">📅 Original date posted:2023-05-09 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsdyt0zkeh84wsqnr2v4jgudx5gtdjyg4et0u7xgq3496zqhjg8mxqzyqfqs32gag4jw5t3j7eqthcrx866vfh7zkm3ed2clrxacxg6v4h3c8kjqh4" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsxykl2jh48mg4wyftq54emv7n485lztm080zwj65cgy7akj5hdq9s55pm64&#39;&gt;nevent1q…pm64&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-05-09&lt;br/&gt;🗒️ Summary of this message: A proposed solution to protect against liquidity griefing attacks in Lightning Network&amp;#39;s dual funded transactions is to never lock UTXOs used in the transactions. Instead, if a remote node goes silent, the UTXOs will be automatically re-used in another instance of the protocol. However, this solution is not safe when multiple contributors are involved. The proposed solution is to lock UTXOs after tx_complete exchange if the channel has only one contributor and to differentiate 0-conf channels prior to UTXO selection to avoid reusing soft-locked UTXOs.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Bastien,&lt;br/&gt;&lt;br/&gt;In general, 0-conf is only safe when WE are the only contributor to&lt;br/&gt;the channel, otherwise the peer could double spend us.&lt;br/&gt;&lt;br/&gt;The problem you seem to be describing is that we might double-spend&lt;br/&gt;ourselves if we don&amp;#39;t lock our 0-conf UTXOs at some point.  I propose&lt;br/&gt;that we DO lock our UTXOs after tx_completes have been exchanged IF we&lt;br/&gt;are the only contributor.  We don&amp;#39;t have to worry about liquidity&lt;br/&gt;griefing in this case, since the peer has no tx_signatures to withhold&lt;br/&gt;from us.  Of course, the opportunistic upgrade of a regular channel to&lt;br/&gt;0-conf won&amp;#39;t work -- we need a way to differentiate 0-conf channels&lt;br/&gt;prior to UTXO selection, so that we don&amp;#39;t reuse soft-locked UTXOs.&lt;br/&gt;&lt;br/&gt;All together, what I propose is:&lt;br/&gt;&lt;br/&gt;1) If the channel type has option_zeroconf, select UTXOs that are not&lt;br/&gt;soft locked.&lt;br/&gt;2) If the peer adds any inputs to the funding transaction, abort&lt;br/&gt;(0-conf is unsafe for us in this case).&lt;br/&gt;3) After tx_complete exchange, TryLock() our UTXO inputs and abort if&lt;br/&gt;already locked.&lt;br/&gt;4) Broadcast funding transaction and begin using the 0-conf channel.&lt;br/&gt;&lt;br/&gt;I think this at least enables the common use case for 0-conf: LSPs can&lt;br/&gt;use their own funds to open 0-conf channels for clients.&lt;br/&gt;&lt;br/&gt;- Matt&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sat, May 6, 2023 at 3:16 AM Bastien TEINTURIER &amp;lt;bastien at acinq.fr&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One of the challenges created by the introduction of dual funded&lt;br/&gt;&amp;gt; transactions [1] in lightning is how to protect against liquidity&lt;br/&gt;&amp;gt; griefing attacks from malicious peers [2].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s start by reviewing this liquidity griefing issue. The dual funding&lt;br/&gt;&amp;gt; protocol starts by exchanging data about the utxos each peer adds to the&lt;br/&gt;&amp;gt; shared transaction, then exchange signatures and broadcast the resulting&lt;br/&gt;&amp;gt; transaction. If peers lock their utxos as soon as they&amp;#39;ve decided to add&lt;br/&gt;&amp;gt; them to the shared transaction, the remote node may go silent. If that&lt;br/&gt;&amp;gt; happens, the honest node has some liquidity that is locked and unusable.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This cannot easily be fixed by simply unlocking utxos *after* detecting&lt;br/&gt;&amp;gt; that the remote node is fishy, because the remote node would still have&lt;br/&gt;&amp;gt; succeeded at locking your liquidity for a (small) duration, and could&lt;br/&gt;&amp;gt; start other instances of that attack with different node_ids.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; An elegant solution to this issue is to never lock utxos used in dual&lt;br/&gt;&amp;gt; funded transactions. If a remote node goes silent in the middle of an&lt;br/&gt;&amp;gt; instance of the protocol, your utxos will automatically be re-used in&lt;br/&gt;&amp;gt; another instance of the protocol. The only drawback with that approach&lt;br/&gt;&amp;gt; is that when you have multiple concurrent instances of dual funding with&lt;br/&gt;&amp;gt; honest peers, some of them may fail because they are double-spent by one&lt;br/&gt;&amp;gt; of the concurrent instances. This is acceptable, since the protocol&lt;br/&gt;&amp;gt; should complete fairly quickly when peers are honest, and at worst, it&lt;br/&gt;&amp;gt; can simply be restarted when failure is detected.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; But that solution falls short when using 0-conf, because accidentally&lt;br/&gt;&amp;gt; double-spending a 0-conf channel (because of concurrent instances) can&lt;br/&gt;&amp;gt; result in loss of funds for one of the peers (if payments were made on&lt;br/&gt;&amp;gt; that channel before detecting the double-spend). It seems like using&lt;br/&gt;&amp;gt; 0-conf forces us to lock utxos to avoid this issue, which means that&lt;br/&gt;&amp;gt; nodes offering 0-conf services expose themselves to liquidity griefing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Another related issue is that nodes that want to offer 0-conf channels&lt;br/&gt;&amp;gt; must ensure that the utxos they use for 0-conf are isolated from the&lt;br/&gt;&amp;gt; utxos they use for non 0-conf, otherwise it is not possible to properly&lt;br/&gt;&amp;gt; lock utxos, because of the following race scenario:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - utxoA is selected for a non 0-conf funding attempt and not locked&lt;br/&gt;&amp;gt;   (to protect against liquidity griefing)&lt;br/&gt;&amp;gt; - utxoA is also selected for a 0-conf funding attempt (because it is&lt;br/&gt;&amp;gt;   found unlocked in the wallet) and then locked&lt;br/&gt;&amp;gt; - the funding transaction for the 0-conf channel is successfully&lt;br/&gt;&amp;gt;   published first and that channel is instantly used for payments&lt;br/&gt;&amp;gt; - the funding transaction for the non 0-conf channel is then published&lt;br/&gt;&amp;gt;   and confirms, accidentally double-spending the 0-conf channel&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This can be fixed by using a &amp;#34;soft lock&amp;#34; when selecting utxos for a non&lt;br/&gt;&amp;gt; 0-conf funding attempt. 0-conf funding attempts must ignore soft locked&lt;br/&gt;&amp;gt; utxos while non 0-conf funding attempts can (should) reuse soft locked&lt;br/&gt;&amp;gt; utxos.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In eclair, we are currently doing &amp;#34;opportunistic&amp;#34; 0-conf:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - if we receive `channel_ready` immediately (which means that our peer&lt;br/&gt;&amp;gt;   trusts us to use 0-conf)&lt;br/&gt;&amp;gt; - and we&amp;#39;re the only contributor to the funding transaction (our peer&lt;br/&gt;&amp;gt;   doesn&amp;#39;t have any input that they could use to double-spend)&lt;br/&gt;&amp;gt; - and the transaction hasn&amp;#39;t been RBF-ed yet&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then we immediately send `channel_ready` as well and start using that&lt;br/&gt;&amp;gt; channel (because we know we won&amp;#39;t double spend ourselves). This is nice&lt;br/&gt;&amp;gt; because it lets us use 0-conf in a way where only one side of the&lt;br/&gt;&amp;gt; channel needs to trust the other side (instead of both sides trusting&lt;br/&gt;&amp;gt; each other).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Unfortunately, we cannot do that anymore when mixing 0-conf and non&lt;br/&gt;&amp;gt; 0-conf funding attempts, because the utxos may be soft locked,&lt;br/&gt;&amp;gt; preventing us from &amp;#34;upgrading&amp;#34; to 0-conf.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; You have successfully reached the end of this quite technical post,&lt;br/&gt;&amp;gt; congrats! My goal with this post is to gather ideas on how we could&lt;br/&gt;&amp;gt; improve that situation and offer good enough protections against&lt;br/&gt;&amp;gt; liquidity griefing for nodes offering 0-conf services. Please share&lt;br/&gt;&amp;gt; your ideas! And yes, I know, 0-conf is a massive implementation pain&lt;br/&gt;&amp;gt; point that we would all like to remove from our codebases, but hey,&lt;br/&gt;&amp;gt; users like it ¯\_(ツ)_/¯&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Bastien&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] &lt;a href=&#34;https://github.com/lightning/bolts/pull/851&#34;&gt;https://github.com/lightning/bolts/pull/851&lt;/a&gt;&lt;br/&gt;&amp;gt; [2] &lt;a href=&#34;https://github.com/lightning/bolts/pull/851#discussion_r997537630&#34;&gt;https://github.com/lightning/bolts/pull/851#discussion_r997537630&lt;/a&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-09T15:13:15&#43;02:00</updated>
  </entry>

</feed>