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




  <entry>
    <id>https://nostr.ae/nevent1qqs830h5qhzswprskzfslavdd8tvr4qgr4d38ndr9ppxezgu4trzuaqzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzzrxgc8</id>
    
      <title type="html">📅 Original date posted:2023-09-16 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs830h5qhzswprskzfslavdd8tvr4qgr4d38ndr9ppxezgu4trzuaqzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzzrxgc8" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsxa8zqf5y52fmg9dadr08xlv0ffm6acqft5w5t495c4lt837lq9jg4dla4n&#39;&gt;nevent1q…la4n&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-09-16&lt;br/&gt;🗒️ Summary of this message: The main point of the conversation is that the key challenge in scaling Bitcoin and Lightning is providing them to casual users. The proposal focuses on onboarding scalability and providing multiple channels to as many users as possible. Other scalability dimensions are not clearly weighted in.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Antoine,&lt;br/&gt;&lt;br/&gt;Thanks for your note. Responses are in-line below:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi John,&lt;br/&gt;&lt;br/&gt;&amp;gt; Thanks for the proposal, few feedback after a first look.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; If Bitcoin and Lightning are to become widely-used, they will have to be adopted by casual users who want to send and receive bitcoin, but &amp;gt; who do not want to go to any effort in order to provide the infrastructure for making payments.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&amp;gt;&amp;lt;i&amp;gt; Instead, it&amp;#39;s reasonable to expect that the Lightning infrastructure will be provided by dedicated users who are far less numerous than&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t know if it is that simple to classify expected users in&lt;br/&gt;&amp;gt; &amp;#34;casual&amp;#34;-vs&amp;#34;dedicated&amp;#34; and then design protocols accordingly. In&lt;br/&gt;&amp;gt; practice, if you take today Lightning as an example the trust&lt;br/&gt;&amp;gt; assumptions is more a matrix than a dichotomie, e.g you have the&lt;br/&gt;&amp;gt; choice between full-node vs light client to get block-relay,&lt;br/&gt;&amp;gt; large-sized mempool vs small mempool or no mempool at all for fee&lt;br/&gt;&amp;gt; estimations, routing HTLCs or not, running local watchtower or not...&lt;br/&gt;&amp;gt; without all those choices being necessarily interdependent. Generally,&lt;br/&gt;&amp;gt; I would say &amp;#34;tell me your IO disk/bandwidth/CPU performance/fees&lt;br/&gt;&amp;gt; ressources and level of technical knowledge and I&amp;#39;ll tell you what&lt;br/&gt;&amp;gt; level of trust-minimization you can afford&amp;#34;.&lt;br/&gt;&lt;br/&gt;Fair enough.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m sure there are users with a wide range of expertise, resources, and interest in supporting Bitcoin.&lt;br/&gt;My main point is that there&amp;#39;s a huge pool of potential users that just want payments to work, and they don&amp;#39;t want to devote time or hardware resources to making them work (if they can get away with that).&lt;br/&gt;I also think we should do whatever we can to meet their needs.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; This difference in numbers implies that the key challenge in scaling Bitcoin and Lightning is providing bitcoin and Lightning to casual&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; users.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&amp;gt;&amp;lt;i&amp;gt; As a result, the rest of this post will focus on this challenge.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; I think few different scaling notions can be introduced to measure the&lt;br/&gt;&amp;gt; performance of an off-chain construction. Onboarding scaling defining&lt;br/&gt;&amp;gt; how many users can co-exist off-chain, considering throughput limits&lt;br/&gt;&amp;gt; (e.g blocksize, average block interval). Transactional scaling&lt;br/&gt;&amp;gt; defining how many transfers can be performed off-chain per on-chain&lt;br/&gt;&amp;gt; transaction, considering the properties of the off-chain system. Users&lt;br/&gt;&amp;gt; resource scaling defining how much resource a user should mobilize /&lt;br/&gt;&amp;gt; consume (e.g average weight cost for cooperative /  non-cooperative&lt;br/&gt;&amp;gt; close) to make a trust-minimized usage of the off-chain construction.&lt;br/&gt;&amp;gt; I think the proposal is mainly considering onboarding scalability, i.e&lt;br/&gt;&amp;gt; maxing out the number of channels that can be owned by a user though&lt;br/&gt;&amp;gt; it is unclear if other scalability dimensions are weighted in.&lt;br/&gt;&lt;br/&gt;Yes, exactly.&lt;br/&gt;I&amp;#39;ve focused on providing multiple channels to as many casual users as possible.&lt;br/&gt;&lt;br/&gt;In terms of other scalability dimensions, I think Lightning does a great job of providing a nearly unbounded number of payments per channel, without requiring on-chain transactions (once the channel is created).&lt;br/&gt;I also think resizing channels can be done fairly effectively off-chain with hierarchical channels [1] (and even better with hierarchical channels within timeout-trees).&lt;br/&gt;&lt;br/&gt;&amp;gt; In particular, no known protocol that uses the current Bitcoin&lt;br/&gt;&amp;gt; consensus rules allows a large number (e.g., tens-of-thousands to&lt;br/&gt;&amp;gt; millions) of Lightning channels, each co-owned by a casual user, to be&lt;br/&gt;&amp;gt; created from a single on-chain unspent transaction output (UTXO).&lt;br/&gt;&lt;br/&gt;&amp;gt; I’m not sure if this statement is 100% accurate. One could create a&lt;br/&gt;&amp;gt; radixpool with replacing CTV usage with Musig2 where the end&lt;br/&gt;&amp;gt; transactions outputs bear Lightning channel:&lt;br/&gt;&amp;gt; &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017968.html.&amp;#34;&amp;gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017968.html.&amp;lt;/a&amp;gt&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017968.html.&amp;#34;&amp;gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017968.html.&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&lt;br/&gt;&amp;gt; Of course there is no N-party update mechanism to rebalance the&lt;br/&gt;&amp;gt; channel internally and it’s a nightmare if a subranch of transactions&lt;br/&gt;&amp;gt; with some depth hit the chain, though I think it works with today&lt;br/&gt;&amp;gt; Bitcoin consensus rules.&lt;br/&gt;&lt;br/&gt;I agree that it&amp;#39;s theoretically possible to use signatures to create Lightning channels for a million casual users that are funded by a single UTXO.&lt;br/&gt;I just don&amp;#39;t believe that that is possible in practice, due to the need to get a million casual users to sign a transaction where the transaction specifies the casual users that need to sign it.&lt;br/&gt;&lt;br/&gt;&amp;gt; The requirement for casual users to sign transactions that specify the&lt;br/&gt;&amp;gt; exact set of casual users whose signatures are required creates a very&lt;br/&gt;&amp;gt; difficult group coordination problem that&amp;#39;s not well-suited to the&lt;br/&gt;&amp;gt; behavior of casual users [9, Section 2.2].&lt;br/&gt;&lt;br/&gt;&amp;gt; I think you have two more precise problems designated under this group&lt;br/&gt;&amp;gt; coordination problem. One is the dynamic novation of this group, i.e&lt;br/&gt;&amp;gt; how you add / remove user, if possible in a compact fashion. The&lt;br/&gt;&amp;gt; second the dynamic update of the “account” / channels owned by the&lt;br/&gt;&amp;gt; users of this group, if possible with minimal interactivity.&lt;br/&gt;&lt;br/&gt;Yes, changing who pairs with whom and resizing channels are both important problems.&lt;br/&gt;&lt;br/&gt;I propose that changing pairings be done only via the creation and expiry of timeout-trees (with users that want to keep pairing with the same dedicated user(s) doing so via passive rollovers).&lt;br/&gt;I propose that channel resizing is mainly done via hierarchical channels, with any resizing that&amp;#39;s not possible to do off-chain in that manner being done via creation and expiry of timeout-trees.&lt;br/&gt;&lt;br/&gt;With these proposals, it&amp;#39;s possible to dramatically limit the interactivity.&lt;br/&gt;&lt;br/&gt;For example, if every channel created by a timeout-tree is a hierarchical channel of the form:&lt;br/&gt;* (casual user, (dedicated user, dedicated user)), or&lt;br/&gt;* (dedicated user, (dedicated user, dedicated user)), or&lt;br/&gt;* ((dedicated user, dedicated user), (dedicated user, dedicated user)),&lt;br/&gt;then at most four users ever have to coordinate to update any channel, and at most one of those users is ever a casual user.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; On the other hand, sometime shortly before E, casual user A_i can use the Lightning Network to send all of their balance in the channel &amp;gt; &amp;gt; (A_i, B) to themselves in some other Lightning channel that is the leaf of some other timeout-tree.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; I think there is an uncertainty in this model as there is no guarantee&lt;br/&gt;&amp;gt; that you have a dedicated user ready to be the gateway to route the&lt;br/&gt;&amp;gt; balance, neither the dedicated user have adequate channel topology&lt;br/&gt;&amp;gt; allowing to send the funds in the part of the network you wish to do&lt;br/&gt;&amp;gt; so. And this is unclear what the casual user is left to do if an&lt;br/&gt;&amp;gt; intermediate hop withhold the HTLC in-flight until the timeout-tree&lt;br/&gt;&amp;gt; mature in favor of the dedicated user, iiuc.&lt;br/&gt;&lt;br/&gt;&amp;gt; So I think draining is uncertain in a world where jamming is possible,&lt;br/&gt;&amp;gt; even assuming economic mitigation as one might earn more to jam a&lt;br/&gt;&amp;gt; casual user draining than loosing in jamming upfront fees.&lt;br/&gt;&lt;br/&gt;I agree that active draining by the casual user is uncertain.&lt;br/&gt;I propose that if the active drain fails, the casual user should put their channel in the old timeout-tree on-chain (so that it won&amp;#39;t timeout on them).&lt;br/&gt;Sorry that wasn&amp;#39;t clear.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; Of course, sometime between E - to_self_delay_i and E, A_i should verify that B has created such a new timeout-tree.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; I think this requirement is altering the design goal introduced at&lt;br/&gt;&amp;gt; first on casual users “performing actions at specific times in the&lt;br/&gt;&amp;gt; future” as from my understanding there is no guarantee B broadcast an&lt;br/&gt;&amp;gt; on-chain transaction triggering the move of A funds to the new&lt;br/&gt;&amp;gt; timeout-tree. This becomes unclear when A should take correction&lt;br/&gt;&amp;gt; actions like broadcasting its own control transaction (?) when B fails&lt;br/&gt;&amp;gt; to dos, especially in a world where you have mempool congestion, and&lt;br/&gt;&amp;gt; earlier you’re better it might in term of fee risk.&lt;br/&gt;&lt;br/&gt;Ideally, I&amp;#39;d like casual users to only perform actions when they want to send or receive a payment.&lt;br/&gt;Unfortunately, I don&amp;#39;t know how to do that.&lt;br/&gt;As a result, I&amp;#39;ve been forced to add a requirement that each casual user turns on their wallet software for a few minutes (but at a time of their choosing!) every few months (with the exact number of months being selected by the user) [2].&lt;br/&gt;I agree this isn&amp;#39;t ideal, but I think it&amp;#39;s much better than having them have to perform some action at a specific time or within a very limited time window (such as a day or a week).&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; Fortunately, timeout-trees can be used to provide casual users with immediately-accessible off-chain bitcoin in addition to bitcoin in&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; I think this is unclear what is meant by “immediately-accessible”&lt;br/&gt;&amp;gt; here, if they’re confirmed or not. Pre-signed / pre-committed&lt;br/&gt;&amp;gt; transactions at a fixed feerate might still not propagate on the&lt;br/&gt;&amp;gt; network, due to mempool min fee, and the user might have to take&lt;br/&gt;&amp;gt; actions in consequence like access hot wallet and sign a CPFP.&lt;br/&gt;&lt;br/&gt;I agree that the bitcoin may not be obtained if the user hasn&amp;#39;t signed and submitted a transaction with sufficient fees.&lt;br/&gt;I tried to address this issue in the &amp;#34;Limitations&amp;#34; section of the post (specifically, Limitationss 2 and 3).&lt;br/&gt;&lt;br/&gt;I think that getting a reliable transport mechanism for packages is critical.&lt;br/&gt;&lt;br/&gt;Getting fees right could be particularly challenging due to the &amp;#34;thundering herd&amp;#34; problem, as _aj_ pointed out.&lt;br/&gt;As I noted in my response to him, I think an additional change to Bitcoin that allows timing based on fee levels could be very helpful.&lt;br/&gt;I&amp;#39;ll try to write up the details and get that out as soon as possible.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;lt;i&amp;gt; In reality, their on-chain footprint would be dominated by users who don&amp;#39;t follow the protocol due to errors, unavailability, or malicious &amp;gt; intent.&lt;br/&gt;&amp;gt; &amp;lt;/i&amp;gt;&lt;br/&gt;&amp;gt; The fault-tolerance of such off-chain construction is very unclear i.e&lt;br/&gt;&amp;gt; if for any unavailable or erring user the whole off-chain construction&lt;br/&gt;&amp;gt; ends up on-chain. This is one significant defect in my opinion of the&lt;br/&gt;&amp;gt; radixpool or old school apo channel factory (or even coinpool if no&lt;br/&gt;&amp;gt; time-locked kick-out transaction is used), if one user becomes&lt;br/&gt;&amp;gt; unresponsive after a while.&lt;br/&gt;&lt;br/&gt;With a timeout-tree, if the dedicated user(s) funding the tree is unavailable (or makes an error) and fails to rollover a given casual user, that casual user should put their channel in the old timeout-tree on-chain.&lt;br/&gt;If the failure applies to all channels in the timeout-tree, the entire timeout-tree will be forced to go on-chain (thus doubling the number of on-chain transactions as compared to just putting the channels on-chain directly, without a timeout-tree).&lt;br/&gt;Sorry this wasn&amp;#39;t made clear.&lt;br/&gt;&lt;br/&gt;These costs could be large, but hopefully they&amp;#39;re rare as they are failures by dedicated users that can afford to have highly-available hardware and who want to maintain a good reputation.&lt;br/&gt;&lt;br/&gt;Separately, HTLCs that are not resolved off-chain have to be put on-chain, but doing so does not force the timeout-tree itself to go on-chain.&lt;br/&gt;If the HTLC control transactions are funded via zero-valued covenant trees (as proposed in the post and paper), putting an HTLC transaction on-chain can also require putting its ancestors in the covenant tree on-chain (thus creating a blow-up that is logarithmic in the number of leaves in the covenant tree).&lt;br/&gt;However, the paper has a proposal for the use of &amp;#34;short-cut&amp;#34; transactions that may be able to eliminate this logarithmic blow-up.&lt;br/&gt;&lt;br/&gt;Thanks for your thoughtful comments and please let me know if there&amp;#39;s anything else that wasn&amp;#39;t clear.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&lt;br/&gt;[1] Law, &amp;#34;Resizing Lightning Channels Off-Chain With Hierarchical Channels&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-hierarchical-channels&#34;&gt;https://github.com/JohnLaw2/ln-hierarchical-channels&lt;/a&gt;&lt;br/&gt;[2] Law, &amp;#34;Watchtower-Free Lightning Channels For Casual Users&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&lt;br/&gt;&lt;br/&gt;&amp;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/20230917/556e2033/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20230917/556e2033/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-09-19T12:29:42&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsxa8zqf5y52fmg9dadr08xlv0ffm6acqft5w5t495c4lt837lq9jgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzl2yz94</id>
    
      <title type="html">📅 Original date posted:2023-09-16 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsxa8zqf5y52fmg9dadr08xlv0ffm6acqft5w5t495c4lt837lq9jgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzl2yz94" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0g9gvtat9m792684u7njzxkf8r5mmzr6hgsu90huzqruaynps9cg32ajrx&#39;&gt;nevent1q…ajrx&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-09-16&lt;br/&gt;🗒️ Summary of this message: The paper presents some interesting ideas, but there are concerns about the increased cost of enforcement. Short-cut transactions could help address this issue. In worst case scenarios, there may be a 2x penalty on the number of on-chain transactions. In cases where the user fails to rollover, relying on legal and custody policies may be preferable.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Rusty,&lt;br/&gt;&lt;br/&gt;&amp;gt;         I&amp;#39;ve read the start of the paper on my vacation, and am still&lt;br/&gt;&amp;gt; digesting it.  But even so far, it presents some delightful&lt;br/&gt;&amp;gt; possibilities.&lt;br/&gt;&lt;br/&gt;Great!&lt;br/&gt;&lt;br/&gt;&amp;gt; As with some other proposals, it&amp;#39;s worth noting that the cost of&lt;br/&gt;&amp;gt; enforcement is dramatically increased.  It&amp;#39;s no longer one or two txs,&lt;br/&gt;&amp;gt; it&amp;#39;s 10&#43;.  If the &amp;#34;dedicated user&amp;#34; contributes some part of the expected&lt;br/&gt;&amp;gt; fee, the capital efficiency is reduced (and we&amp;#39;re back to &amp;#34;how much is&lt;br/&gt;&amp;gt; enough?&amp;#34;).&lt;br/&gt;&lt;br/&gt;Yes, this is certainly an issue, and it affects both settling the channel on-chain and resolving HTLCS on-chain.&lt;br/&gt;The paper has a few ideas about how &amp;#34;short-cut&amp;#34; transactions could be used to address the cost of enforcing HTLCs on-chain.&lt;br/&gt;It may be possible to do something similar for the channel itself, but that&amp;#39;s more complex because of the value included in the channel and the potential for channels with different capacities in a single timeout-tree.&lt;br/&gt;&lt;br/&gt;&amp;gt; But worst case (dramatic dedicated user failure) it&amp;#39;s only a 2x penalty&lt;br/&gt;&amp;gt; on number of onchain txs, which seems acceptable if the network is&lt;br/&gt;&amp;gt; sufficiently mature that these failure events are rare.&lt;br/&gt;&lt;br/&gt;&amp;gt; Note also that the (surprisingly common!) &amp;#34;user goes away&amp;#34; case where&lt;br/&gt;&amp;gt; the casual user fails to rollover only returns funds to the dedicated&lt;br/&gt;&amp;gt; user; relying on legal and normal custody policies in this case may be&lt;br/&gt;&amp;gt; preferable to an eternal burden on the UTXO set with the current&lt;br/&gt;&amp;gt; approach!&lt;br/&gt;&lt;br/&gt;Agreed.&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;&amp;gt; Thankyou!&lt;br/&gt;&amp;gt; Rusty.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Sent with Proton Mail secure email.
    </content>
    <updated>2023-09-19T12:29:42&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsddykxvk4g7ne6ca9qhst8qp0ns5vzep3w7xwv9vh25k74ph5ny7qzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzraywcg</id>
    
      <title type="html">📅 Original date posted:2023-09-08 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsddykxvk4g7ne6ca9qhst8qp0ns5vzep3w7xwv9vh25k74ph5ny7qzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzraywcg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsfcnlzyzdeqy7nr9z40lyw5dnyks0jgv0r9ecaxapq6nt38dtznjqn2f0a0&#39;&gt;nevent1q…f0a0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-09-08&lt;br/&gt;🗒️ Summary of this message: Adding covenants to Bitcoin&amp;#39;s consensus rules, such as CheckTemplateVerify (CTV) and AnyPrevOut (APO), would greatly improve the scalability of Lightning for casual users. These changes would allow for the creation of millions of Lightning channels using a single UTXO, support resizing channels off-chain, provide liquidity to casual users, charge penalties for attempting to put an old state on-chain, and allow casual users to monitor the blockchain without a watchtower service. Implementing these changes would make Lightning a widely-used means of payment.&lt;br/&gt;📝 Original message:&lt;br/&gt;TL;DR&lt;br/&gt;=====&lt;br/&gt;* The key challenge in scaling Lightning in a trust-free manner is the creation of Lightning channels for casual users.&lt;br/&gt;  - It appears that signature-based factories are inherently limited to creating at most tens or hundreds of Lightning channels per UTXO.&lt;br/&gt;  - In contrast, simple covenants (including those enabled by CTV [1] or APO [2]) would allow a single UTXO to create Lightning channels for millions of casual users.&lt;br/&gt;* The resulting covenant-based protocols also:&lt;br/&gt;  - support resizing channels off-chain,&lt;br/&gt;  - use the same capital to simultaneously provide in-bound liquidity to casual users and route unrelated payments for other users,&lt;br/&gt;  - charge casual users tunable penalties for attempting to put an old state on-chain, and&lt;br/&gt;  - allow casual users to monitor the blockchain for just a few minutes every few months without employing a watchtower service.&lt;br/&gt;* As a result, adding CTV and/or APO to Bitcoin&amp;#39;s consensus rules would go a long way toward making Lightning a widely-used means of payment.&lt;br/&gt;&lt;br/&gt;Overview&lt;br/&gt;========&lt;br/&gt;&lt;br/&gt;Many proposed changes to the Bitcoin consensus rules, including CheckTemplateVerify (CTV) [1] and AnyPrevOut (APO) [2], would support covenants.&lt;br/&gt;While covenants have been shown to improve Bitcoin in a number of ways, scalability of Lightning is not typically listed as one of them.&lt;br/&gt;This post argues that any change (including CTV and/or APO) that enables even simple covenants greatly improves Lightning&amp;#39;s scalability, while meeting the usability requirements of casual users.&lt;br/&gt;A more complete description, including figures, is given in a paper [3].&lt;br/&gt;&lt;br/&gt;The Scalability Problem&lt;br/&gt;=======================&lt;br/&gt;&lt;br/&gt;If Bitcoin and Lightning are to become widely-used, they will have to be adopted by casual users who want to send and receive bitcoin, but who do not want to go to any effort in order to provide the infrastructure for making payments.&lt;br/&gt;Instead, it&amp;#39;s reasonable to expect that the Lightning infrastructure will be provided by dedicated users who are far less numerous than the casual users.&lt;br/&gt;In fact, there are likely to be tens-of-thousands to millions of casual users per dedicated user.&lt;br/&gt;This difference in numbers implies that the key challenge in scaling Bitcoin and Lightning is providing bitcoin and Lightning to casual users.&lt;br/&gt;As a result, the rest of this post will focus on this challenge.&lt;br/&gt;&lt;br/&gt;Known Lightning protocols allow casual users to perform Lightning payments without:&lt;br/&gt; * maintaining high-availability,&lt;br/&gt; * performing actions at specific times in the future, or&lt;br/&gt; * having to trust a third-party (such as a watchtower service) [5][6].&lt;br/&gt;&lt;br/&gt;In addition, they support tunable penalties for casual users who attempt to put an old channel state on-chain (for example, due to a crash that causes a loss of state).&lt;br/&gt;As a result, these protocols meet casual users&amp;#39; needs and could become widely-used for payments if they were sufficiently scalable.&lt;br/&gt;&lt;br/&gt;The Lightning Network lets users send and receive bitcoin off-chain in a trust-free manner [4].&lt;br/&gt;Furthermore, there are Lightning protocols that allow Lightning channels to be resized off-chain [7].&lt;br/&gt;Therefore, making Lightning payments and resizing Lightning channels are highly scalable operations.&lt;br/&gt;&lt;br/&gt;However, providing Lightning channels to casual users is not scalable.&lt;br/&gt;In particular, no known protocol that uses the current Bitcoin consensus rules allows a large number (e.g., tens-of-thousands to millions) of Lightning channels, each co-owned by a casual user, to be created from a single on-chain unspent transaction output (UTXO).&lt;br/&gt;As a result, being able to create (and close) casual users&amp;#39; Lightning channels remains the key bottleneck in scaling Lightning.&lt;br/&gt;&lt;br/&gt;Casual Users And Signatures&lt;br/&gt;===========================&lt;br/&gt;&lt;br/&gt;Unfortunately, there are good reasons to believe this bottleneck is unavoidable given the current Bitcoin consensus rules.&lt;br/&gt;The problem is that in order for a casual user to co-own a Lightning channel, they must co-own an on-chain UTXO [8].&lt;br/&gt;Therefore, if a large number of casual users are to each co-own a Lightning channel, all of which are funded by a single UTXO, that UTXO must require signatures from all of those casual users.&lt;br/&gt;&lt;br/&gt;In practice, the problem is much harder than just getting signatures from a large number of casual users, as the signatures themselves depend on the exact set of casual users whose signatures are required.&lt;br/&gt;For example, if a UTXO requires signatures from a set of 1,000 casual users and if 999 of them sign but one does not, the 999 signatures that were obtained can&amp;#39;t be used.&lt;br/&gt;Instead, one has to start all over again, say with a new UTXO that requires signatures from the 999 users that signed the previous time.&lt;br/&gt;However, if not all of those 999 sign, the signatures that were obtained in the second try are also unusable.&lt;br/&gt;&lt;br/&gt;The requirement for casual users to sign transactions that specify the exact set of casual users whose signatures are required creates a very difficult group coordination problem that&amp;#39;s not well-suited to the behavior of casual users [9, Section 2.2].&lt;br/&gt;As a result, while a channel factory could be used to fund channels for perhaps 10 or even 100 casual users, it&amp;#39;s very unlikely that any protocol using the current Bitcoin consensus rules can fund tens-of-thousands to millions of channels from a single UTXO.&lt;br/&gt;&lt;br/&gt;Simple Covenants And Timeout-Trees&lt;br/&gt;==================================&lt;br/&gt;&lt;br/&gt;On the other hand, if the consensus rules are changed to allow even simple covenants, this scaling bottleneck is eliminated.&lt;br/&gt;The key observation is that with covenants, a casual user can co-own an off-chain Lightning channel without having to sign all (or any) of the transactions on which it depends.&lt;br/&gt;Instead, a UTXO can have a covenant that guarantees the creation of the casual user&amp;#39;s channel.&lt;br/&gt;The simplest way to have a single UTXO create channels for a large number of casual users is to put a covenant on the UTXO that forces the creation of a tree of transactions, the leaves of which are the casual users&amp;#39; channels.&lt;br/&gt;&lt;br/&gt;While such a covenant tree can create channels for millions of casual users without requiring signatures or solving a difficult group coordination problem, it&amp;#39;s not sufficient for scaling.&lt;br/&gt;The problem is that each channel created by a covenant tree has a fixed set of owners, and changing the ownership of a channel created by a covenant tree requires putting the channel on-chain.&lt;br/&gt;Therefore, assuming that all casual users will eventually want to pair with different dedicated users (and vice-versa), the covenant tree doesn&amp;#39;t actually provide any long-term scaling benefit.&lt;br/&gt;&lt;br/&gt;Fortunately, real long-term scaling can be achieved by adding a deadline after which all non-leaf outputs in the covenant tree can be spent without having to meet the conditions of the covenant.&lt;br/&gt;The resulting covenant tree is called a &amp;#34;timeout-tree&amp;#34; [9, Section 5.3].&lt;br/&gt;&lt;br/&gt;Let A_1 ... A_n denote a large number of casual users, let B be a dedicated user, and let E denote some fixed time in the future.&lt;br/&gt;User B creates a timeout-tree with expiry E where:&lt;br/&gt; * leaf i has an output that funds a Lightning channel owned by A_i and B, and&lt;br/&gt; * after time E, each non-leaf output in the covenant tree can also be spent by user B without having to meet the conditions of the covenant.&lt;br/&gt;&lt;br/&gt;Thus, any time before E, casual user A_i can put the Lightning channel (A_i, B) on-chain by putting all of its ancestors in the timeout-tree on-chain.&lt;br/&gt;Once (A_i, B) is on-chain, the expiry E has no effect so A_i and B can continue to use the Lightning channel to send and receive payments from and to A_i.&lt;br/&gt;&lt;br/&gt;On the other hand, sometime shortly before E, casual user A_i can use the Lightning Network to send all of their balance in the channel (A_i, B) to themselves in some other Lightning channel that is the leaf of some other timeout-tree.&lt;br/&gt;More precisely, casual user A_i should rollover their balance by sending it from a given timeout-tree between time E - to_self_delay_i and time E, where E is the timeout-tree&amp;#39;s expiry and to_self_delay_i is A_i&amp;#39;s Lightning channel safety parameter.&lt;br/&gt;Note that to_self_delay_i can be in the range of 1 to 3 months if a watchtower-free channel protocol is used [5][6], so performing the drain within this time window does not put an unreasonable availability requirement on A_i.&lt;br/&gt;&lt;br/&gt;If all casual users drain their balances from the timeout-tree before E, then after E dedicated user B can create a new timeout-tree, with leaves that create Lightning channels for a new set of casual users, by putting a single transaction on-chain that spends the UTXO which created the expired timeout-tree.&lt;br/&gt;In this case, all n of the old Lightning channels are closed and n new channels are created with a single on-chain transaction.&lt;br/&gt;&lt;br/&gt;Of course, it&amp;#39;s possible that some casual users will put their Lightning channel in the old timeout-tree on-chain, while others will drain their balance from the timeout-tree before E.&lt;br/&gt;In this case, user B can create a new timeout-tree that&amp;#39;s funded by the non-leaf outputs of the old timeout-tree that have been put on-chain.&lt;br/&gt;While this results in a larger on-chain footprint than the case in which all casual users drain their balances from the old timeout-tree, it can still provide substantial scaling as long as the number of leaves put on-chain is small (in particular, well below n/(log n)).&lt;br/&gt;By creating incentives that reward users who drain their balances from the timeout-tree rather than putting their channels on-chain, almost all leaves will stay off-chain and good scalability will be achieved.&lt;br/&gt;&lt;br/&gt;Passive Rollovers For Casual Users&lt;br/&gt;==================================&lt;br/&gt;&lt;br/&gt;The timeout-trees defined above don&amp;#39;t place unreasonable availability requirements on casual users and they allow a very large number of casual users to obtain a Lightning channel with a single on-chain transaction.&lt;br/&gt;However, there are two problems with forcing casual users to drain their balances from an old timeout-tree to a new timeout-tree before the old timeout-tree&amp;#39;s expiry:&lt;br/&gt;  1) if a casual user fails to perform the required drain before the old timeout-tree&amp;#39;s expiry (due to unexpected unavailability), they lose all of their funds in the timeout-tree, and&lt;br/&gt;  2) if the dedicated user B is unavailable when a casual user attempts to drain their funds prior to the timeout-tree&amp;#39;s expiry, the casual user will put their timeout-tree leaf on-chain (thus increasing the on-chain footprint and limiting scalability).&lt;br/&gt;This second problem matters, as a casual user should only have to devote a short period (e.g., 10 minutes) every few months to performing the drain, so even a short period of unavailability by the dedicated user could force the casual user to go on-chain.&lt;br/&gt;&lt;br/&gt;Instead, it would be preferable if the dedicated user could facilitate the rollover of the casual user&amp;#39;s funds from a timeout-tree that&amp;#39;s about to expire to another one without requiring input from the casual user.&lt;br/&gt;This can be achieved by using a variation of the FFO-WF Lightning channel protocol [6].&lt;br/&gt;The FFO-WF protocol uses control transactions to determine the current state of the Lightning channel and the resolution of any outstanding HTLCs, and these control transactions determine how the channel&amp;#39;s value transactions disperse the channel&amp;#39;s funds.&lt;br/&gt;&lt;br/&gt;As a result, just prior to E - to_self_delay_i, B can create a new timeout-tree that funds a new Lightning channel with casual user A_i where the new channel is controlled by A_i&amp;#39;s *same* control transactions (thus allowing A_i to obtain their funds from either the old or new Lightning channel, but not from both).&lt;br/&gt;Therefore, once the old timeout-tree expires, A_i can still access their funds in the new timeout-tree&amp;#39;s Lightning channel without having to perform any actions.&lt;br/&gt;Of course, sometime between E - to_self_delay_i and E, A_i should verify that B has created such a new timeout-tree.&lt;br/&gt;&lt;br/&gt;In addition, HTLCs can be handled so that rolling over the casual user&amp;#39;s funds from one timeout-tree to another does not require any actions from the casual user.&lt;br/&gt;The details are given in the paper [3].&lt;br/&gt;&lt;br/&gt;Off-Chain bitcoin&lt;br/&gt;=================&lt;br/&gt;&lt;br/&gt;The Lightning Network lets casual users send and receive bitcoin entirely off-chain&lt;br/&gt;However, the casual user has to wait (for a period of time specified by their Lightning partner&amp;#39;s to_self_delay parameter) before they can access their Lightning funds on-chain.&lt;br/&gt;This is problematic, as accessing one&amp;#39;s Lightning funds on-chain requires paying fees to put transactions on-chain, and those fees cannot be paid using one&amp;#39;s Lightning funds (due to the delay mentioned above).&lt;br/&gt;Thus, while Lightning can be used for most of a user&amp;#39;s funds, the user must also be able to access some bitcoin (enough to pay transaction fees) without any delays.&lt;br/&gt;&lt;br/&gt;Fortunately, timeout-trees can be used to provide casual users with immediately-accessible off-chain bitcoin in addition to bitcoin in Lightning channels.&lt;br/&gt;Furthermore, it&amp;#39;s possible to use a control output owned by a casual user to rollover the casual user&amp;#39;s immediately-accessible bitcoin from one timeout-tree to the next along with their Lightning funds [3].&lt;br/&gt;In fact, this rollover can also be done without requiring any actions from the casual user and it can be used to rebalance the fraction of the user&amp;#39;s funds that are immediately-accessible versus within Lightning [3].&lt;br/&gt;&lt;br/&gt;Control UTXOs&lt;br/&gt;=============&lt;br/&gt;&lt;br/&gt;The FFO-WF protocol (as adapted for timeout-trees) requires that each casual user own an independent UTXO that is spent by that user&amp;#39;s control transactions.&lt;br/&gt;Creating an on-chain UTXO for every casual user could require a significant on-chain footprint, thus limiting scalability.&lt;br/&gt;Instead, each casual user can be given an off-chain UTXO that is created by a leaf of a tree of off-chain transactions defined by covenants [3].&lt;br/&gt;&lt;br/&gt;Improving Capital Efficiency&lt;br/&gt;============================&lt;br/&gt;&lt;br/&gt;In order to rollover funds from one timeout-tree to another, the dedicated user creating those timeout-trees must fund both the old and new timeout-trees simultaneously, even though they only create one timeout-tree&amp;#39;s worth of Lightning channel capacity.&lt;br/&gt;Fortunately, this overhead can be made very small by funding multiple timeout-trees in a staggered fashion, where only one has to be rolled-over at a time [3].&lt;br/&gt;&lt;br/&gt;Also, because casual users may send and receive payments infrequently, the dedicated user&amp;#39;s capital devoted to timeout-trees may generate few routing fees.&lt;br/&gt;As a result, casual users may have to pay significant fees for the creation of their Lightning channels (and/or for payments to or from those channels).&lt;br/&gt;&lt;br/&gt;However, the fees that casual users have to pay could be reduced if the capital in their channels could also be used for routing payments between other users.&lt;br/&gt;This can be accomplished by having the timeout-trees create hierarchical channels, each of which is owned by a single casual user and a pair of dedicated users [7].&lt;br/&gt;By using an idea created by Towns [10][11][3], a single unit of capital in each hierarchical channel can be used to route two independent payments of one unit each.&lt;br/&gt;&lt;br/&gt;Scalability&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;The above protocols can perform the following actions completely off-chain:&lt;br/&gt;  * Lightning sends and receives, and&lt;br/&gt;  * resizing of Lightning channels.&lt;br/&gt;&lt;br/&gt;Assuming:&lt;br/&gt;  * 1 million hierarchical Lightning channels per timeout-tree,&lt;br/&gt;  * a 1,000-block (about a week) to_self_delay parameter for dedicated users, and&lt;br/&gt;  * a 10,000-block (about 69 days) to_self_delay parameter for casual users, and&lt;br/&gt;  * 121,000 blocks (about 2.3 years) from the creation of each timeout-tree to its expiry,&lt;br/&gt;&lt;br/&gt;a single 1-input/2-output transaction per block provides:&lt;br/&gt;  * 11 Lightning channels per casual user to each of 10 billion casual users [3].&lt;br/&gt;&lt;br/&gt;Furthermore, given the above assumptions, a single 1-input/2-output transaction per block allows each casual user to:&lt;br/&gt;  * close an existing Lightning channel,&lt;br/&gt;  * open a new Lightning channel with a new partner, and&lt;br/&gt;  * rebalance funds between Lightning and immediately-accessible off-chain bitcoin&lt;br/&gt;once every 10,000 blocks (about 69 days) [3].&lt;br/&gt;&lt;br/&gt;Of course, the above calculations don&amp;#39;t mean that 10 billion casual Lightning users would create only 1 on-chain transaction per block.&lt;br/&gt;In reality, their on-chain footprint would be dominated by users who don&amp;#39;t follow the protocol due to errors, unavailability, or malicious intent.&lt;br/&gt;The rate of such protocol violations is hard to predict, but it&amp;#39;s likely that casual users&amp;#39; unavailability would be the most significant problem.&lt;br/&gt;&lt;br/&gt;Usability&lt;br/&gt;=========&lt;br/&gt;&lt;br/&gt;The above protocols have the following properties for casual users:&lt;br/&gt;  * watchtower-freedom (that is, they accommodate months-long unavailability without requiring a watchtower service to secure the user&amp;#39;s funds) ([5] Section 3.1),&lt;br/&gt;  * one-shot receives (that is, receiving a payment does not require performing actions at multiple blockheights) ([5] Section 3.4),&lt;br/&gt;  * asynchronous receives (that is, it&amp;#39;s possible to receive a payment when the sender is offline) ([5] Section 3.6), and&lt;br/&gt;  * tunable penalties for attempting to put an old state on-chain ([12]).&lt;br/&gt;&lt;br/&gt;Limitations&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;Finally, the above results depend on the following assumptions:&lt;br/&gt;  1) the cost of resolving an HTLC on-chain is less than the value of the HTLC,&lt;br/&gt;  2) transaction packages are relayed reliably from users to miners, and&lt;br/&gt;  3) there is a known upper bound on the delay from when a package is submitted to when it is included in the blockchain.&lt;br/&gt;&lt;br/&gt;These limitations, and ideas for how they can be addressed, are discussed further in the paper [3].&lt;br/&gt;&lt;br/&gt;Conclusions&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;With the current Bitcoin consensus rules, there are reasons to believe that the scalability of Lightning is inherently limited.&lt;br/&gt;However, simple covenants and timeout-trees can overcome these scalability limitations.&lt;br/&gt;In particular, CheckTemplateVerify (CTV) and/or AnyPrevOut (APO) could be used to dramatically increase the number of casual users who send and receive bitcoin in a trust-free manner.&lt;br/&gt;As a result, it&amp;#39;s hoped that CTV, APO or a similar mechanism that enables simple covenants will be added to Bitcoin&amp;#39;s consensus rules in order to allow Lightning to become a widely-used means of payment.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;[1] BIP 119 CHECKTEMPLATEVERIFY, &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0119.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0119.mediawiki&lt;/a&gt;&lt;br/&gt;[2] BIP 118 SIGHASH_ANYPREVOUT, &lt;a href=&#34;https://anyprevout.xyz/&#34;&gt;https://anyprevout.xyz/&lt;/a&gt;&lt;br/&gt;[3] Law, &amp;#34;Scaling Lightning With Simple Covenants&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-scaling-covenants&#34;&gt;https://github.com/JohnLaw2/ln-scaling-covenants&lt;/a&gt;&lt;br/&gt;[4] &amp;#34;BOLT (Basis Of Lightning Technology) specifications&amp;#34;, &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc&#34;&gt;https://github.com/lightningnetwork/lightning-rfc&lt;/a&gt;&lt;br/&gt;[5] Law, &amp;#34;Watchtower-Free Lightning Channels For Casual Users&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;&lt;br/&gt;[6] Law, &amp;#34;Factory-Optimized Channel Protocols For Lightning&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-factory-optimized&#34;&gt;https://github.com/JohnLaw2/ln-factory-optimized&lt;/a&gt;.&lt;br/&gt;[7] Law, &amp;#34;Resizing Lightning Channels Off-Chain With Hierarchical Channels&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-hierarchical-channels&#34;&gt;https://github.com/JohnLaw2/ln-hierarchical-channels&lt;/a&gt;&lt;br/&gt;[8] Burchert, Decker and Wattenhofer, &amp;#34;Scalable Funding of Bitcoin Micropayment Channel Networks&amp;#34;, &lt;a href=&#34;http://dx.doi.org/10.1098/rsos.180089&#34;&gt;http://dx.doi.org/10.1098/rsos.180089&lt;/a&gt;&lt;br/&gt;[9] Law, &amp;#34;Scaling Bitcoin With Inherited IDs&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/btc-iids&#34;&gt;https://github.com/JohnLaw2/btc-iids&lt;/a&gt;&lt;br/&gt;[10] Towns, &amp;#34;Re: Resizing Lightning Channels Off-Chain With Hierarchical Channels&amp;#34;, &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-April/003913.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-April/003913.html&lt;/a&gt;&lt;br/&gt;[11] Law, &amp;#34;Re: Resizing Lightning Channels Off-Chain With Hierarchical Channels&amp;#34;, &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-April/003917.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-April/003917.html&lt;/a&gt;&lt;br/&gt;[12] Law, &amp;#34;Lightning Channels With Tunable Penalties&amp;#34;, &lt;a href=&#34;https://github.com/JohnLaw2/ln-tunable-penalties&#34;&gt;https://github.com/JohnLaw2/ln-tunable-penalties&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&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/20230908/90196255/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20230908/90196255/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-09-12T10:59:58&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs8s96adretah7x7kzhkk2w4w0zqdv94fl8t7eavp39t6jgc84u8xqzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzx48dwn</id>
    
      <title type="html">📅 Original date posted:2023-04-03 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs8s96adretah7x7kzhkk2w4w0zqdv94fl8t7eavp39t6jgc84u8xqzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzx48dwn" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsgqzmu5nggpaatl5nng3a7yw8dxs0f77jp0cpp6y0yndmclvfsjfcyxezjj&#39;&gt;nevent1q…ezjj&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-04-03&lt;br/&gt;🗒️ Summary of this message: The proposed tunable penalties offer offchain channel resizes and liquidity multiplexing, but the former can already be achieved with existing techniques using channel factories.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;Thank you for your clear and insightful response.&lt;br/&gt;&lt;br/&gt;Comments inline below:&lt;br/&gt;&lt;br/&gt;&amp;gt;Hi John,&lt;br/&gt;&lt;br/&gt;&amp;gt;Thank you for another innovative application of your tunable penalties.&lt;br/&gt;&amp;gt;I see two key benefits being described by your paper[1]:&lt;br/&gt;&lt;br/&gt;&amp;gt;- **Offchain channel resizes:** in state 0, Alice and Bob share control&lt;br/&gt;&amp;gt;   over an offchain UTXO valued at x satoshis; in state 1, the value of&lt;br/&gt;&amp;gt;   the offchain UTXO is y satoshis.&lt;br/&gt;&lt;br/&gt;&amp;gt;- **Liquidity multiplexing:** Alice, Bob, Carol, and Dan each rightfully&lt;br/&gt;&amp;gt;   own some portion of a UTXO.  Alice and Bob expect to always be&lt;br/&gt;&amp;gt;   available; Carol and Dan may sometimes be unavailable.  The proposal&lt;br/&gt;&amp;gt;   allows Carol and Dan to spend/receive in combination with Alice and&lt;br/&gt;&amp;gt;   Bob, but also ensures Alice and Bob can spend back and forth the&lt;br/&gt;&amp;gt;   entirety their portions of the UTXO even if Carol, Dan, or both of&lt;br/&gt;&amp;gt;   them are unavailable.&lt;br/&gt;&lt;br/&gt;&amp;gt;For the Offchain Channel Resizes, I don&amp;#39;t see how your proposal&lt;br/&gt;&amp;gt;functionally differs from a classic channel factory.  In section 3, you&lt;br/&gt;&amp;gt;show the set {A, B, C, D} with the subset {A,B} where A reduces its&lt;br/&gt;&amp;gt;balance in {A,B} by transfering it to {C,D} via an HTLC to another of its&lt;br/&gt;&amp;gt;nodes (A&amp;#39;).&lt;br/&gt;&lt;br/&gt;&amp;gt;Your description uses hierarchical channels (which may have &amp;gt;2&lt;br/&gt;&amp;gt;participants per channel).  In a classic pair-producing channel factory,&lt;br/&gt;&amp;gt;each channel only has two participants, e.g. the factory {A, B, C, D}&lt;br/&gt;&amp;gt;produces the channels,&lt;br/&gt;&lt;br/&gt;&amp;gt;   {A,B}&lt;br/&gt;&amp;gt;   {A,C}&lt;br/&gt;&amp;gt;   {A,D}&lt;br/&gt;&amp;gt;   {B,C}&lt;br/&gt;&amp;gt;   {B,D}&lt;br/&gt;&amp;gt;   {C,D}&lt;br/&gt;&lt;br/&gt;&amp;gt;However, the same thing is possible, A as part of {A,B} can pay through&lt;br/&gt;&amp;gt;{B,C} out of the factory to A&amp;#39;.  After the HTLCs are settled, the&lt;br/&gt;&amp;gt;offchain channel setup transactions inside the factory can be&lt;br/&gt;&amp;gt;regenerated with the cooperation of all {A, B, C, D}.&lt;br/&gt;&lt;br/&gt;&amp;gt;Am I missing something, or is this first key benefit something that was&lt;br/&gt;&amp;gt;already possible (in theory) with pair-producing channel factories?&lt;br/&gt;&lt;br/&gt;When the first key benefit is defined as:&lt;br/&gt;&lt;br/&gt;	Benefit 1: Ability to resize a channel owned by Alice and Bob&lt;br/&gt;	offchain from x satoshis to y satoshis&lt;br/&gt;&lt;br/&gt;you are correct that this can be achieved with existing techniques&lt;br/&gt;using channel factories.&lt;br/&gt;&lt;br/&gt;However, when the key benefit is defined differently, it becomes clear&lt;br/&gt;that it can be achieved only with hierarchical channels. I&amp;#39;ll give two&lt;br/&gt;other definitions of the benefit that demonstrate what is new. In these&lt;br/&gt;definitions, note that the quantity &amp;#34;delta&amp;#34; could be positive or&lt;br/&gt;negative. Also, assume that all capacity owned by the users considered&lt;br/&gt;must be in a Lightning channel at all times (in order to avoid&lt;br/&gt;stranding liquidity). Finally, for simplicity, ignore routing fees&lt;br/&gt;in the following.&lt;br/&gt;&lt;br/&gt;	Benefit 2: Ability to resize a channel owned by Alice and Bob&lt;br/&gt;	offchain from x satoshis to y = x - delta satoshis, while&lt;br/&gt;	resizing a channel owned by Harriet and Isaac from u satoshis&lt;br/&gt;	to v = u &#43; delta satoshis, where:&lt;br/&gt;		a) Harriet and Isaac do not know Alice and Bob and&lt;br/&gt;		never co-sign transactions with Alice and Bob, and&lt;br/&gt;		b) all other 2-user channels&amp;#39; capacities are&lt;br/&gt;		unchanged.&lt;br/&gt;&lt;br/&gt;Note that Benefit 2 can&amp;#39;t be achieved with channel factories, as they&lt;br/&gt;would violate requirement a) above. In contrast, Benefit 2 can be&lt;br/&gt;achieved with hierarchical channels, as long as all channels are&lt;br/&gt;viewed as logical (rather than physical) channels. An example of&lt;br/&gt;how this can be achieved is with the payment given in Figure 4 of&lt;br/&gt;the paper (p. 8), but stopping the payment one hop earlier as it&lt;br/&gt;is received by H and I (Harriet and Isaac). Benefit 2 matters, as&lt;br/&gt;it&amp;#39;s a lot easier to find a channel that wants to make a capacity&lt;br/&gt;change that offsets the capacity change that Alice and Bob want&lt;br/&gt;to make if the offsetting channel can be anywhere in the world&lt;br/&gt;(but connected via the Lightning Network) as opposed to in a&lt;br/&gt;channel factory containing Alice and Bob (as there will only&lt;br/&gt;be, say, 10 or 100 users in each such factory). Having to offset&lt;br/&gt;a channel capacity change by finding a channel making the opposite&lt;br/&gt;change within a channel factory is like having to make LN payments&lt;br/&gt;without using HTLCs. It would be possible to make payments within&lt;br/&gt;a factory, but in most cases that wouldn&amp;#39;t help, as the payer and&lt;br/&gt;payee would not happen to be in the same factory.&lt;br/&gt;&lt;br/&gt;	Benefit 3: Ability to resize a channel owned by Alice and Bob&lt;br/&gt;	offchain from x satoshis to y = x - delta satoshis, where all&lt;br/&gt;	other 2-user channels&amp;#39; capacities are unchanged.&lt;br/&gt;&lt;br/&gt;Note that Benefit 3 cannot be achieved with channel factories, as any&lt;br/&gt;change in the capacity of a channel in a factory must be offset by&lt;br/&gt;the opposite change in one or more other channels within the factory&lt;br/&gt;(given our requirement that all capacity is always kept within channels&lt;br/&gt;in order to avoid stranding liquidity).&lt;br/&gt;&lt;br/&gt;In contrast, Benefit 3 is possible with hierarchical channels, as&lt;br/&gt;long as they are viewed as logical channels. Examples include the&lt;br/&gt;payment shown in Figure 1 of the paper (p. 4). This somewhat&lt;br/&gt;surprising result is due to the existence of a 3-user hierarchical&lt;br/&gt;channel (namely the one owned by C, D and E in Figure 1) that&lt;br/&gt;transitions from HTLCs that swap capacity between pairs of 2-user&lt;br/&gt;channels to HTLCs that swap balances between users within a 2-user&lt;br/&gt;channel. This benefit is even stronger than the previous one, as&lt;br/&gt;no channel that wants to make an offsetting capacity change has&lt;br/&gt;to be found at all.&lt;br/&gt;&lt;br/&gt;I hope these two explicitly-stated benefits demonstrate that&lt;br/&gt;hierarchical channels *do* provide new capabilities that did not&lt;br/&gt;exist previously, and that these new capabilities are very&lt;br/&gt;important in practice.&lt;br/&gt;&lt;br/&gt;Please let me know if any of this doesn&amp;#39;t make sense.&lt;br/&gt;&lt;br/&gt;Thanks again,&lt;br/&gt;John
    </content>
    <updated>2023-06-09T15:12:58&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsgl8efmzgaa77ttt7s2gnj5tfrtpgfxpdwtj5dj4zwqjux8qt82rgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzxzd5vy</id>
    
      <title type="html">📅 Original date posted:2023-01-15 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsgl8efmzgaa77ttt7s2gnj5tfrtpgfxpdwtj5dj4zwqjux8qt82rgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzxzd5vy" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsfkqmeshldn7z0v52telezptqcm0thy0jyc2hcecmg79q482hh0lqf5ge8y&#39;&gt;nevent1q…ge8y&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-01-15&lt;br/&gt;🗒️ Summary of this message: New protocols for Lightning factories that can be closed unilaterally in O(1) time using O(1) on-chain transactions have been presented, which are essential for scaling the Lightning Network. The Tunable-Penalty Factory (TPF) protocol requires P different transactions to instantiate the factory&amp;#39;s channels, while the Single-Commitment (SC) protocol uses only a single transaction.&lt;br/&gt;📝 Original message:&lt;br/&gt;TL;DR&lt;br/&gt;=====&lt;br/&gt;&lt;br/&gt;* Factories that create and update a large number of Lightning channels efficiently are essential for scaling the Lightning Network.&lt;br/&gt;* This post presents the first known protocol for Lightning factories that can be closed unilaterally in O(1) time using O(1) on-chain transactions.&lt;br/&gt;  - If P parties use the protocol, they create P conflicting Commitment transactions, any of which can be used to establish the factory&amp;#39;s state.&lt;br/&gt;  - As a result, each party must maintain P copies of the state of each channel created by the factory.&lt;br/&gt;  - Another factory protocol is presented that eliminates the need to maintain P copies of each channel state (at the expense of requiring more on-chain bytes).&lt;br/&gt;* Both factory protocols are modifications of the Tunable-Penalty Channel protocol and share many of its properties, including:&lt;br/&gt;  - tunable penalties for putting old transactions on-chain, and&lt;br/&gt;  - watchtowers with storage that&amp;#39;s logarithmic in the number of factory states supported (but linear in the number of parties in the factory).&lt;br/&gt;&lt;br/&gt;Overview&lt;br/&gt;========&lt;br/&gt;&lt;br/&gt;Factories that allow multiple two-party Lightning channels to be created, re-sized and closed with a small number of on-chain transactions are essential to the scalability of Bitcoin [2].&lt;br/&gt;Let P denote the number of parties, C denote tha number of channels created, and S denote the number of factory states supported.&lt;br/&gt;The most efficient previously-known factory, created by Burchert, Decker and Wattenhofer [2], can be closed unilaterally in O(log S) time using O(log S) on-chain transactions and O(C &#43; log S) on-chain bytes.&lt;br/&gt;A single fixed transaction is used to instantiate the factory&amp;#39;s channels when it&amp;#39;s closed unilaterally, so the parties using the factory can maintain just a one version of each off-chain channel state.&lt;br/&gt;Performing a unilateral close with O(log S) on-chain transactions requires that the party closing the factory interact with the blockchain at O(log S) different blockheights (so a unilateral close is an O(log S)-shot procedure [4]), which could be awkward for some users [8].&lt;br/&gt;&lt;br/&gt;This paper presents two protocols for factories that can be closed unilaterally in O(1) time using O(1) on-chain transactions.&lt;br/&gt;The first protocol, called the Tunable-Penalty Factory (TPF) protocol, requires only O(C) on-chain bytes for a unilateral close, but it can use P different transactions to instantiate the factory&amp;#39;s channels, thus forcing the parties using the factory to maintain P different versions of each off-chain channel state.&lt;br/&gt;The second protocol, called the Single-Commitment (SC) protocol, requires O(C &#43; log S) on-chain bytes for a unilateral close, but it uses only a single transaction to instantiate the factory&amp;#39;s channels, so multiple versions of off-chain channel states aren&amp;#39;t required.&lt;br/&gt;The TPF protocol is particularly simple and allows a 2-shot unilateral close (that is, the party closing the channel only has to perform actions at 2 different blockheights).&lt;br/&gt;&lt;br/&gt;Both protocols are based on the Tunable-Penalty Channel (TPC) protocol [5] and they share many of its properties, including:&lt;br/&gt;* tunable penalties for putting old transactions on-chain, and&lt;br/&gt;* watchtowers with storage that&amp;#39;s logarithmic in the number of factory states supported (but linear in the number of parties in the factory).&lt;br/&gt;&lt;br/&gt;No change to the underlying Bitcoin protocol is required.&lt;br/&gt;&lt;br/&gt;A more complete description, including a proof of correctness and better figures, is available in a paper [6].&lt;br/&gt;&lt;br/&gt;The Tunable-Penalty Factory (TPF) Protocol&lt;br/&gt;==========================================&lt;br/&gt;&lt;br/&gt;The TPF protocol is a slight modification of the TPC protocol [5].&lt;br/&gt;&lt;br/&gt;Each party using the TPC protocol has their own on-chain Individual transaction, the output of which they spend with their State transaction.&lt;br/&gt;This State transaction is a control transaction and its first output&amp;#39;s value is equal to the desired penalty for putting an old State transaction on-chain.&lt;br/&gt;This first output can be spent by the same party&amp;#39;s Commitment transaction for the same state, but only after a relative delay equal to the maximum of the parties&amp;#39; to_self_delay parameters.&lt;br/&gt;The relative delay gives the other party time to revoke an old State transaction by spending its first output and thus claiming the penalty.&lt;br/&gt;The State transaction also has an HTLC control output for each HTLC that is active in that state.&lt;br/&gt;The TPC protocol revokes old State transactions with per-commitment keys that can be known to all parties, rather than with revocation keys that cannot be known by the party putting the revocable transaction on-chain [5].&lt;br/&gt;&lt;br/&gt;The TPC protocol is modified to create the TPF protocol by:&lt;br/&gt;* eliminating the HTLC control outputs from the State transactions,&lt;br/&gt;* modifying the Commitment transactions to have channel outputs, each of which is owned by two parties in the factory, and&lt;br/&gt;* supporting P &amp;gt; 2 parties by allowing each party to have their own Individual, State and Commitment transactions.&lt;br/&gt;&lt;br/&gt;The TPF protocol is shown below:&lt;br/&gt;&lt;br/&gt;&#43;-&#43; A..Z                           &#43;----&#43; AD&lt;br/&gt;|F|------&#43;-------------------------| CC |-----&lt;br/&gt;&#43;-&#43;      |                         |    |&lt;br/&gt;         |                         |    | BC&lt;br/&gt;         |                         |    |-----&lt;br/&gt;         |                         |    |&lt;br/&gt;         .                         |    | MZ&lt;br/&gt;         .                         |    |-----&lt;br/&gt;         .                         &#43;----&#43;&lt;br/&gt;         |&lt;br/&gt;         |                         &#43;----&#43; AD&lt;br/&gt;         &#43;-------------------------|C_Ai|-----&lt;br/&gt;         |                         |    |&lt;br/&gt;         |                         |    | BC&lt;br/&gt;         |                         |    |-----&lt;br/&gt;         |                         |    |&lt;br/&gt;         |               tsdAZ &amp;amp; A |    | MZ&lt;br/&gt;         |             &#43;-----------|    |-----&lt;br/&gt;         |             |           &#43;----&#43;&lt;br/&gt;         |             |&lt;br/&gt;         |             |           &#43;----&#43; AD&lt;br/&gt;         &#43;-------------------------|C_Bi|-----&lt;br/&gt;         |             |           |    |&lt;br/&gt;         |             |           |    | BC&lt;br/&gt;         |             |           |    |-----&lt;br/&gt;         |             |           |    |&lt;br/&gt;         .             | tsdAZ &amp;amp; B |    | MZ&lt;br/&gt;         .           &#43;-------------|    |-----&lt;br/&gt;         .           | |           &#43;----&#43;&lt;br/&gt;         |           | |&lt;br/&gt;         |           | |           &#43;----&#43; AD&lt;br/&gt;         &#43;-------------------------|C_Zi|-----&lt;br/&gt;         |           | |           |    |&lt;br/&gt;         .           | |           |    | BC&lt;br/&gt;         .           | |           |    |-----&lt;br/&gt;         .           | |           |    |&lt;br/&gt;         |           | | tsdAZ &amp;amp; Z |    | MZ&lt;br/&gt;         V         &#43;---------------|    |-----&lt;br/&gt;                   | | |           &#43;----&#43;&lt;br/&gt;                   | | |&lt;br/&gt;&#43;----&#43; A  &#43;-----&#43;  | | | pckeyAi&lt;br/&gt;|In_A|----|St_Ai|------&#43;-----------&lt;br/&gt;&#43;----&#43;    |     |  | |&lt;br/&gt;          &#43;-----&#43;  | |&lt;br/&gt;                   | |&lt;br/&gt;&#43;----&#43; B  &#43;-----&#43;  | |   pckeyBi&lt;br/&gt;|In_B|----|St_Bi|----&#43;-------------&lt;br/&gt;&#43;----&#43;    |     |  |&lt;br/&gt;          &#43;-----&#43;  |&lt;br/&gt;  .          .     .&lt;br/&gt;  .          .     .&lt;br/&gt;  .          .     .&lt;br/&gt;                   |&lt;br/&gt;&#43;----&#43; Z  &#43;-----&#43;  |     pckeyZi&lt;br/&gt;|In_Z|----|St_Zi|--&#43;---------------&lt;br/&gt;&#43;----&#43;    |     |&lt;br/&gt;          &#43;-----&#43;&lt;br/&gt;&lt;br/&gt;where:&lt;br/&gt;F is the Funding transaction,&lt;br/&gt;CC is the Cooperative Close transaction,&lt;br/&gt;In_{A..Z} is {A..Z&amp;#39;s} Individual transaction,&lt;br/&gt;St_{A..Z}i is {A..Z&amp;#39;s} State transaction for state i, and&lt;br/&gt;C_{A..Z}i is {A..Z&amp;#39;s} Commitment transaction for state i.&lt;br/&gt;&lt;br/&gt;Requirements for output cases are as follows:&lt;br/&gt;{A..Z}: {A..Z}&amp;#39;s signature (a single party&amp;#39;s signature),&lt;br/&gt;A..Z: A..Z&amp;#39;s signature (every parties&amp;#39; signature),&lt;br/&gt;pairs of capital letters indicate signatures from those two parties,&lt;br/&gt;pckey{A..Z}i: a signature using a per-commitment key for revoking {A..Z}&amp;#39;s state i transaction, and&lt;br/&gt;tsdAZ: a relative delay equal to the maximum of {A..Z}&amp;#39;s to_self_delay parameters.&lt;br/&gt;&lt;br/&gt;In order to establish a new factory state, all parties:&lt;br/&gt;* calculate the State and Commitment transactions for the new state (this step includes exchanging per-commitment pubkeys for the new state with each of the other parties),&lt;br/&gt;* exchange partial signatures for the new state&amp;#39;s Commitment transactions, and&lt;br/&gt;* exchange per-commitment keys for the old state, thus revoking it.&lt;br/&gt;&lt;br/&gt;All parties constantly look for old (revoked) State transactions put on-chain by other parties, and if they find such a transaction they use the corresponding per-commitment key to spend its first output, thus obtaining the penalty funds and revoking the old state.&lt;br/&gt;Once a State transaction has been on-chain for tsdAZ without its first output being spent, the party that put the State transaction on-chain can attempt to put their corresponding Commitment transaction on-chain at any time.&lt;br/&gt;Any party can close the factory unilaterally by putting their current State transaction on-chain, waiting until it has been on-chain for tsdAZ, and then submitting their corresponding Commitment transaction to the blockchain.&lt;br/&gt;&lt;br/&gt;As was the case with the TPC protocol, per-commitment keys can use the Lightning protocol&amp;#39;s compact storage technique for revocation keys to consume only O(log S) storage to revoke a maximum of S old transactions that could be put on-chain by a single other party [7][5].&lt;br/&gt;Therefore, each party requires O(P*log S) storage to hold the per-commitment keys for all of the P parties.&lt;br/&gt;&lt;br/&gt;The Single-Commitment (SC) Factory Protocol&lt;br/&gt;===========================================&lt;br/&gt;&lt;br/&gt;Note that the TPF factory protocol uses P conflicting Commitment transactions to establish the factory state and to instantiate the factory&amp;#39;s channels.&lt;br/&gt;Therefore, a separate channel state must be maintained and updated for each of the P versions of the channel that could be instantiated, thus increasing the computation, storage, and communication for channels by a factor of P.&lt;br/&gt;The result could be quite expensive if there are a large number of parties in the factory.&lt;br/&gt;&lt;br/&gt;The SC protocol eliminates this factor of P blow-up by having all of the parties use a single shared Commitment transaction.&lt;br/&gt;Like the TPF protocol, the SC protocol uses revocable State transactions, each of which spends a single party&amp;#39;s Individual transaction output, to ensure that only the current Commitment transaction can be put on-chain.&lt;br/&gt;The challenge is how to use a single shared Commitment transaction that depends on the value of an unrevoked State transaction without actually spending any of the outputs of that State transaction (as spending a State transaction output would make the Commitment transaction&amp;#39;s input dependent on which party&amp;#39;s State transaction it spends, thus preventing the use of a single shared Commitment transaction).&lt;br/&gt;This challenge is solved by introducing a shared Trigger transaction and a per-user Mold transaction, where the Commitment and Mold transactions compete for the Trigger transaction&amp;#39;s outputs.&lt;br/&gt;The Mold transaction is put on-chain prior to the Commitment transaction, and it constrains the Commitment transactions that can be put on-chain somewhat like how a mold shapes a liquid that is poured into it.&lt;br/&gt;&lt;br/&gt;Specifically, the Trigger transaction has one value output and log_2(S) control outputs, numbered 0 .. log_2(S) - 1. Commitment transaction i, 0 &amp;lt;= i &amp;lt;= S - 1, spends those Trigger control outputs b, 0 &amp;lt;= b &amp;lt;= log_2(S) - 1, such that bit position b of the binary representation of i is a 0.&lt;br/&gt;Each Mold transaction i, 0 &amp;lt;= i &amp;lt;= S - 1, spends the output of the same party&amp;#39;s State i transaction, and Trigger control outputs b, 0 &amp;lt;= b &amp;lt;= log_2(S) - 1, such that bit position b of the binary representation of i is a 1.&lt;br/&gt;This construction guarantees that if a Mold transaction for state i is on-chain, only Commitment transactions for states j &amp;gt;= i can be put on-chain.&lt;br/&gt;&lt;br/&gt;States 0 through S - 1 are supported, with the exception of states of the form 2^b where 1 &amp;lt;= b &amp;lt;= log_2(S) - 1.&lt;br/&gt;These exceptions are made to guarantee that it is impossible to put Mold transactions on-chain for two consecutive states (other than states 0 and 1) where they would prevent any current Commitment transaction from being put on-chain.&lt;br/&gt;When state i is supported but state i&#43;1 is not, the next state after i is i&#43;2.&lt;br/&gt;&lt;br/&gt;The protocol operation is similar to that of the TPF protocol, except parties closing the channel unilaterally submit the Trigger transaction and their current State transaction to the blockchain, and once their State transaction has been on-chain for tsdAZ, submit their Mold transaction for the same state to the blockchain.&lt;br/&gt;Once the Trigger transaction has been on-chain for 3tsdAZ, they submit to the blockchain the Commitment transaction for the same state as the on-chain Mold transaction.&lt;br/&gt;&lt;br/&gt;Also, all parties monitor the blockchain for the Trigger transaction, and if they find it they use the above protocol for closing the factory as soon as possible.&lt;br/&gt;&lt;br/&gt;Because only Mold transactions for unrevoked State transactions can be put on-chain, and because only the latest State transactions can be unrevoked, only the latest (and thus current) Commitment transactions can be put on-chain.&lt;br/&gt;&lt;br/&gt;A figure for the SC protocol, and a detailed proof of correctness, are in the paper [6].&lt;br/&gt;&lt;br/&gt;Related Work&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The concept of creating a channel factory for Lightning, as well as the most efficient published protocol for such a factory, was presented by Burchert, Decker and Wattenhofer [2].&lt;br/&gt;The protocols presented here differ in only requiring O(1) time and O(1) on-chain transactions for a unilateral factory close.&lt;br/&gt;&lt;br/&gt;A number of researchers have proposed changes to Bitcoin in order to support simpler and more efficient factories.&lt;br/&gt;The eltoo factory protocol [3] has a particularly simple structure and it allows the parties to maintain only one version of each off-chain channel state.&lt;br/&gt;It requires O(1) time, O(1) on-chain transactions and O(1) on-chain bytes for a unilateral close.&lt;br/&gt;However, a malicious party could delay the closing of the factory until O(S) transactions are put on-chain, if the malicious party is willing to pay the required fees.&lt;br/&gt;The eltoo protocol differs from the protocols presented here by requiring a change to Bitcoin, namely the support for BIP 118 [1].&lt;br/&gt;&lt;br/&gt;The TPF and SC protocols are based on the TPC protocol presented by Law [5].&lt;br/&gt;&lt;br/&gt;Conclusions&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;This post presents new factory protocols that require O(1) time and O(1) on-chain transactions for a unilateral close.&lt;br/&gt;They are the first factory protocols known that achieve those bounds with the existing Bitcoin protocol.&lt;br/&gt;&lt;br/&gt;The ability to unilaterally close a factory with just two or three submissions to the blockchain, with a fixed delay between them, is quite a bit simpler than closing previously-published factories [2].&lt;br/&gt;As a result, it&amp;#39;s hoped that TPF and SC factories will lead to the increased use of factories in practice, thus improving the scalability of Bitcoin and Lightning.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;References&lt;br/&gt;==========&lt;br/&gt;[1] &amp;#34;BIP 118: SIGHASH_ANYPREVOUT&amp;#34;, available at &lt;a href=&#34;https://anyprevout.xyz/&#34;&gt;https://anyprevout.xyz/&lt;/a&gt; and &lt;a href=&#34;https://github.com/bitcoin/bips/pull/943&#34;&gt;https://github.com/bitcoin/bips/pull/943&lt;/a&gt;.&lt;br/&gt;[2] Burchert, Decker and Wattenhofer, &amp;#34;Scalable Funding of Bitcoin Micropayment Channel Networks&amp;#34;, available at &lt;a href=&#34;http://dx.doi.org/10.1098/rsos.180089&#34;&gt;http://dx.doi.org/10.1098/rsos.180089&lt;/a&gt;.&lt;br/&gt;[3] Decker, Russell and Osuntokun. eltoo: A Simple Layer2 Protocol for Bitcoin. Available at &lt;a href=&#34;https://blockstream.com/eltoo.pdf&#34;&gt;https://blockstream.com/eltoo.pdf&lt;/a&gt;.&lt;br/&gt;[4] Law, &amp;#34;Watchtower-Free Lightning Channels For Casual Users&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;.&lt;br/&gt;[5] Law, &amp;#34;Lightning Channels With Tunable Penalties&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-tunable-penalties&#34;&gt;https://github.com/JohnLaw2/ln-tunable-penalties&lt;/a&gt;.&lt;br/&gt;[6] Law, &amp;#34;Efficient Factories For Lightning Channels&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-efficient-factories&#34;&gt;https://github.com/JohnLaw2/ln-efficient-factories&lt;/a&gt;.&lt;br/&gt;[7] Russell, &amp;#34;Efficient Per-Commitment Secret Storage&amp;#34;, available at &lt;a href=&#34;https://github.com/lightning/bolts/blob/master/03-transactions.md#efficient-per-commitment-secret-storage&#34;&gt;https://github.com/lightning/bolts/blob/master/03-transactions.md#efficient-per-commitment-secret-storage&lt;/a&gt;.&lt;br/&gt;[8] ZmnSCPxj, &amp;#34;Channel Eviction From Channel Factories By New Covenant Operations&amp;#34;, available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-February/003479.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-February/003479.html&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&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/20230115/1c24b7f0/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20230115/1c24b7f0/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:12:32&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs2gs0nrf32s3cl306mlfwlwnk3pd02dspzvqkz8p47xah9lvw470gzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzjks3vg</id>
    
      <title type="html">📅 Original date posted:2022-12-02 📝 Original message: TL;DR ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs2gs0nrf32s3cl306mlfwlwnk3pd02dspzvqkz8p47xah9lvw470gzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzjks3vg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszzw9tkwc75ymat7pq9rjysjr7w4cwlaavflcnjkpgw85n2n9tl9sppw69e&#39;&gt;nevent1q…w69e&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-12-02&lt;br/&gt;📝 Original message:&lt;br/&gt;TL;DR&lt;br/&gt;=====&lt;br/&gt;* This post presents a channel protocol that&amp;#39;s optimized for use within channel factories.&lt;br/&gt;* The protocol allows HTLCs to be resolved on-chain:&lt;br/&gt;* without making the expiry of the HTLC depend on the time to close the factory, and&lt;br/&gt;* without closing the factory.&lt;br/&gt;* The key ides is the use of separate value and control transactions like those used in the Tunable Penalties protocol.&lt;br/&gt;* A version of the protocol that provides watchtower-freedom and one-shot receives for casual users is also given.&lt;br/&gt;&lt;br/&gt;Overview&lt;br/&gt;========&lt;br/&gt;&lt;br/&gt;While the Lightning Network greatly improves Bitcoin&amp;#39;s scalability, factories that allow multiple two-party channels to be created and closed with a small number of on-chain transactions are essential if Bitcoin is to be widely used in a trust-free manner [2].&lt;br/&gt;Unfortunately, the existing channel protocols aren&amp;#39;t optimized for use within factories, thus limiting the efficiency of both the channels and the factories.&lt;br/&gt;&lt;br/&gt;The Lightning Network uses Hash Time-Locked Contracts (HTLCs) to implement payments across multiple channels.&lt;br/&gt;If one of the parties to an HTLC is unresponsive, the other party must resolve the HTLC on-chain.&lt;br/&gt;This creates two problems.&lt;br/&gt;&lt;br/&gt;First, the HTLC&amp;#39;s expiry must be delayed by the time required to close the factory and put the channel containing the HTLC on-chain.&lt;br/&gt;The most efficient known factory [2] can be closed in O(log S) time using O(log S) on-chain transactions, assuming the factory supports S states.&lt;br/&gt;If all the hops in a multi-hop payment use channels that are implemented with factories, the sum of the delays for closing all of those factories must be included in the HTLC expiry of the first hop.&lt;br/&gt;As a result, this delay could become very large, thus leading to inefficient use of the channels&amp;#39; capital and long waits to obtain payment receipts.&lt;br/&gt;&lt;br/&gt;Second, the requirement to close a factory due to the need to resolve an HTLC on-chain means that a single unresponsive party can force the closure of an entire factory, thus limiting the factory&amp;#39;s ability to scale Bitcoin.&lt;br/&gt;&lt;br/&gt;This post presents factory-optimized channel protocols that solve both of these problems.&lt;br/&gt;The first protocol, called the Partially-Factory-Optimized (PFO) protocol, solves the first problem, while the second protocol, called the Fully-Factory-Optimized (FFO) protocol, solves both problems.&lt;br/&gt;Both protocols are slight modifications of the Tunable-Penalties (TP) protocol [5] and they share many of its properties, including:&lt;br/&gt;* tunable penalties for putting old transactions on-chain, and&lt;br/&gt;* efficient watchtowers with O(log S) storage for supporting O(S) channel states.&lt;br/&gt;&lt;br/&gt;In addition, a version of the FFO protocol, called the Fully-Factory-Optimized-Watchtower-Free (FFO-WF) protocol is presented that supports watchtower-freedom and one-shot receives for casual users [4].&lt;br/&gt;No change to the underlying Bitcoin protocol is required.&lt;br/&gt;&lt;br/&gt;A paper with a more complete description of the protocols, including figures, values for the timing parameters, and proofs of correctness, is available [6].&lt;br/&gt;&lt;br/&gt;The Partially-Factory-Optimized (PFO) Protocol&lt;br/&gt;==============================================&lt;br/&gt;&lt;br/&gt;The PFO protocol is a slight modification of the TP protocol [5].&lt;br/&gt;In the TP protocol, each party has their own on-chain Individual transaction, the output of which they spend with their State transaction.&lt;br/&gt;This State transaction is a control transaction that establishes the channel&amp;#39;s state and has an HTLC control output corresponding to each HTLC outstanding in the channel in that state.&lt;br/&gt;Each HTLC control output is used to resolve an HTLC by spending the output with either an HTLC-success or an HTLC-timeout transaction.&lt;br/&gt;Critically, the State, HTLC-success and HTLC-timeout transactions can be put on-chain without spending any of the channel&amp;#39;s funds.&lt;br/&gt;Therefore, the TP protocol almost solves the problem of resolving a channel&amp;#39;s HTLCs without waiting for the Funding transaction to be put on-chain.&lt;br/&gt;&lt;br/&gt;Unfortunately, there&amp;#39;s one problem in trying to use the TP protocol to resolve the HTLCs of a factory-created channel before the factory is closed and its Funding transaction is on-chain.&lt;br/&gt;The correctness of the TP protocol depends on the ability to put the current Commitment transaction (spending the output of the channel&amp;#39;s Funding transaction) on-chain as soon as possible once the relative delay between it and its corresponding State transaction has been met.&lt;br/&gt;This relative delay is set to tsdAB, which is the maximum of the two parties&amp;#39; to_self_delay parameters.&lt;br/&gt;The problem is that the latency to close the factory and put the channel&amp;#39;s Funding transaction on-chain could exceed tsdAB.&lt;br/&gt;As a result, the TP protocol can&amp;#39;t be used in such a factory.&lt;br/&gt;&lt;br/&gt;The PFO protocol fixes this by simply setting the relative delay between the State transaction and its associated Commitment transaction to the maximum of the factory-close latency and tsdAB.&lt;br/&gt;&lt;br/&gt;The Fully-Factory-Optimized (FFO) Protocol&lt;br/&gt;==========================================&lt;br/&gt;&lt;br/&gt;While the PFO protocol separates the latency to close the factory from the setting of the HTLCs&amp;#39; expiries, it still requires that the factory be closed in order to guarantee that the HTLCs have been resolved correctly.&lt;br/&gt;&lt;br/&gt;The FFO protocol makes several changes to the PFO protocol in order to resolve HTLCs without requiring the closure of the factory.&lt;br/&gt;Consider an HTLC offered by Alice to Bob.&lt;br/&gt;&lt;br/&gt;First, in the FFO protocol only Bob&amp;#39;s State transaction has an HTLC control output that determines the resolution of this HTLC, regardless of which party&amp;#39;s Commitment transaction is put on-chain.&lt;br/&gt;As a result, there&amp;#39;s no race to put one&amp;#39;s Commitment transaction on-chain, and thus no need to close the factory in order to resolve HTLCs.&lt;br/&gt;As another result, it eliminates the possibility of this HTLC being resolved with Alice&amp;#39;s State and associated HTLC-timeout transactions being put on-chain late relative to the HTLC&amp;#39;s expiry.&lt;br/&gt;&lt;br/&gt;Second, because the HTLC is always resolved based on an HTLC control output in Bob&amp;#39;s State transaction, Bob has to be incentivized to put his correct State transaction on-chain (or else he could prevent the HTLC from timing out by not putting his State transaction on-chain).&lt;br/&gt;This is solved by requiring Bob&amp;#39;s State and HTLC-success transactions in order to pay the HTLC, and to refund the HTLC to Alice (after a suitable relative delay) if Bob&amp;#39;s State and HTLC-success transactions are not on-chain.&lt;br/&gt;&lt;br/&gt;Third, Bob is prevented from putting his State transaction on-chain late relative to the HTLC&amp;#39;s expiry by adding a relative delay of tsdA (Alice&amp;#39;s to_self_delay parameter) before he can put his HTLC-success transaction on-chain.&lt;br/&gt;This guarantees that Alice will have time to respond with a conflicting transaction that prevents Bob&amp;#39;s HTLC-success transaction from being put on-chain late relative to the HTLC&amp;#39;s expiry.&lt;br/&gt;&lt;br/&gt;Finally, if the HTLC&amp;#39;s secret were not revealed until the HTLC-success transaction is put on-chain, the worst-case latency for obtaining a secret from a successful HTLC would depend on tsdA, which would greatly increase Bob&amp;#39;s cltv_expiry_delta parameter, in turn increasing the cost of capital reserved for the HTLC and the delay for obtaining a payment receipt.&lt;br/&gt;This problem is solved by introducing a new transaction, called an HTLC-kickoff transaction, that spends the HTLC control output in Bob&amp;#39;s State transaction and reveals the HTLC&amp;#39;s secret, with the HTLC-success transaction spending the HTLC-kickoff transaction&amp;#39;s output.&lt;br/&gt;Thus,the revelation of the HTLC&amp;#39;s secret is performed first, followed by the resolution of the HTLC approximately tsdA later.&lt;br/&gt;&lt;br/&gt;The FFO protocol is shown below:&lt;br/&gt;&lt;br/&gt;&#43;-&#43; AB &#43;----&#43; A&lt;br/&gt;|F|----&#43;-----------------------------| CC |----&lt;br/&gt;&#43;-&#43; | | |&lt;br/&gt;. | | B&lt;br/&gt;. | |----&lt;br/&gt;. &#43;----&#43;&lt;br/&gt;| &#43;----&#43; A&lt;br/&gt;&#43;-----------------------------|C_Ai|----&lt;br/&gt;| | |&lt;br/&gt;| | | B&lt;br/&gt;| | |----&lt;br/&gt;| tsdB &amp;amp; A | | tsdAB &amp;amp; A&lt;br/&gt;| &#43;---------------| |-----&#43;------------&lt;br/&gt;| | &#43;----&#43; |&lt;br/&gt;| | | AB &#43;-----&#43; B&lt;br/&gt;| | &#43;--------------|Hp_Bi|----&lt;br/&gt;| | | |&lt;br/&gt;| | &#43;--| |&lt;br/&gt;| | | &#43;-----&#43;&lt;br/&gt;| | &#43;----&#43; A |&lt;br/&gt;&#43;-----------------------------|C_Bi|---- |&lt;br/&gt;| | | | |&lt;br/&gt;. | | | B |&lt;br/&gt;. | | |---- |&lt;br/&gt;. | tsdA &amp;amp; B | | tsdAB &amp;amp; A |&lt;br/&gt;| &#43;-----------------| |-----&#43;--------------&lt;br/&gt;V | | &#43;----&#43; | |&lt;br/&gt;| | | AB | &#43;-----&#43; B&lt;br/&gt;&#43;----&#43; A &#43;-----&#43; | | pckeyAi &#43;--------------|Hp_Bi|----&lt;br/&gt;|In_A|----|St_Ai|----&#43;---------- | | |&lt;br/&gt;&#43;----&#43; | | | &#43;--| |&lt;br/&gt;| | | | &#43;-----&#43;&lt;br/&gt;| | | |&lt;br/&gt;&#43;-----&#43; | |&lt;br/&gt;| (eAB&#43;tsdA) &amp;amp; A |&lt;br/&gt;&#43;----&#43; B &#43;-----&#43; | pckeyBi &#43;----------------- |&lt;br/&gt;|In_B|----|St_Bi|--&#43;------------ | |&lt;br/&gt;&#43;----&#43; | | | |&lt;br/&gt;| | hp(X) &amp;amp; B &#43;-----&#43; | tsdA &amp;amp; B &#43;-----&#43; B |&lt;br/&gt;| |------------|Hk_Bi|-&#43;-----------|Hs_Bi|----&#43;&lt;br/&gt;&#43;-----&#43; &#43;-----&#43; &#43;-----&#43;&lt;br/&gt;&lt;br/&gt;where:&lt;br/&gt;F is the Funding transaction,&lt;br/&gt;CC is the Cooperative Close transaction,&lt;br/&gt;In_{A|B} is {Alice&amp;#39;s|Bob&amp;#39;s} Individual transaction,&lt;br/&gt;St_{A|B}i is {Alice&amp;#39;s|Bob&amp;#39;s} State transaction for state i,&lt;br/&gt;C_{A|B}i is {Alice&amp;#39;s|Bob&amp;#39;s} Commitment transaction for state i,&lt;br/&gt;Hk_Bi is Bob&amp;#39;s HTLC-kickoff transaction for state i,&lt;br/&gt;Hs_Bi is Bob&amp;#39;s HTLC-success transaction for state i, and&lt;br/&gt;Hp_Bi is Bob&amp;#39;s HTLC-payment transaction for state i.&lt;br/&gt;&lt;br/&gt;Requirements for output cases are as follows:&lt;br/&gt;A: Alice&amp;#39;s signature,&lt;br/&gt;B: Bob&amp;#39;s signature,&lt;br/&gt;AB: Alice&amp;#39;s and Bob&amp;#39;s signatures,&lt;br/&gt;pckey{A|B}i: a signature using a per-commitment key for revoking&lt;br/&gt;{Alice&amp;#39;s|Bob&amp;#39;s} state i transaction,&lt;br/&gt;hp(X): the hash preimage of X,&lt;br/&gt;tsd{A|B}: a relative delay equal to {Alice&amp;#39;s|Bob&amp;#39;s} to_self_delay&lt;br/&gt;parameter,&lt;br/&gt;tsdAB: a relative delay equal to max(tsdA, tsdB), and&lt;br/&gt;eAB: an absolute timelock equal to the expiry of the HTLC in this hop.&lt;br/&gt;&lt;br/&gt;Extensions&lt;br/&gt;==========&lt;br/&gt;&lt;br/&gt;If a party accidentally puts on old State transaction on-chain, they only lose the penalty amount that is the output of that transaction (and potentially some of the minimal values of that transaction&amp;#39;s HTLC control outputs).&lt;br/&gt;However, once their State transaction has been revoked, they&amp;#39;ve lost the ability to force a unilateral close of the channel after the Funding transaction is on-chain.&lt;br/&gt;To address this, it&amp;#39;s possible to add a Trigger [2] transaction that spends the output of the Funding transaction.&lt;br/&gt;After the Trigger transaction has been on-chain for 3tsdAB (in order to allow the other party to put their Commitment transaction on-chain), the Decker-Wattenhofer protocol [3] can be used to settle the channel.&lt;br/&gt;&lt;br/&gt;The FFO protocol shows how a channel&amp;#39;s HTLCs can be resolved on-chain without putting its Funding transaction on-chain, and thus without closing the channel factory.&lt;br/&gt;The party that went on-chain can settle the channel and its HTLCs correctly, even if their partner is malicious.&lt;br/&gt;However, the most likely reason a party goes on-chain is that their partner is unintentionally unavailable, rather than malicious.&lt;br/&gt;When the unavailable partner becomes available again, the two parties could choose to re-start operating the channel, and that&amp;#39;s possible because the channel&amp;#39;s funds haven&amp;#39;t been distributed.&lt;br/&gt;In particular, the party that went on-chain can use the unspent first output of their State transaction to play the role of their Individiual transaction&amp;#39;s output as they resume operating the channel.&lt;br/&gt;This output has slightly less value, as it&amp;#39;s sized for the penalty amount and doesn&amp;#39;t have additional funds for HTLC control outputs, but it seems reasonable to reduce the penalty amount that they will have to pay, given that it was the other party&amp;#39;s unavailability that forced them to go on-chain.&lt;br/&gt;&lt;br/&gt;Watchtower-Freedom And One-Shot Receives For Casual Users&lt;br/&gt;=========================================================&lt;br/&gt;&lt;br/&gt;The WF protocol modified the current Lightning protocol to allow casual users to operate without watchtowers and to perform one-shot receives.&lt;br/&gt;A similar approach can be used to modify the FFO protocol to achieve the same goals, resulting in the FFO-WF protocol.&lt;br/&gt;&lt;br/&gt;Consider a casual user Alice and her dedicated channel partner Bob.&lt;br/&gt;Like the WF protocol, the FFO-WF protocol adds a relative delay before Alice can time out an HTLC offered to Bob, allowing Bob to stay off-chain after the HTLC&amp;#39;s expiry, thus tolerating Alice&amp;#39;s intentional unavailability.&lt;br/&gt;As in the FFO protocol, in the FFO-WF protocol only one of the two parties&amp;#39; State transactions has an HTLC control output for each HTLC that is outstanding.&lt;br/&gt;However, unlike the FFO protocol, Alice&amp;#39;s State transaction has the HTLC control outputs for all HTLCs, even those offered to Bob.&lt;br/&gt;The control of the HTLCs offered to Bob is moved to Alice&amp;#39;s State transaction in order to allow Alice to force Bob to produce a receipt (or to not receive payment) by putting her State transaction on-chain.&lt;br/&gt;While this solves the problem of forcing receipts, it creates a risk that Alice will never put her State transaction on-chain, thus preventing Bob from receiving payment for HTLCs offered to him.&lt;br/&gt;This risk is solved by modifying Bob&amp;#39;s Commitment transaction to ignore the HTLC control results and to pay all HTLC amounts (both those offered by him and those offered to him) to Bob, but delaying Bob&amp;#39;s State and Commitment transactions enough that Alice can always get her State and Commitment transactions on-chain, thus resolving the HTLCs correctly (as she is incentivized to do, given Bob&amp;#39;s Commitment transaction).&lt;br/&gt;&lt;br/&gt;In order to support one-shot receives for Alice, she is able to submit her State and HTLC-success transactions as a single package, without any relative delay between them.&lt;br/&gt;This creates a risk that she will submit them well after the HTLC&amp;#39;s expiry, thus allowing her to receive payment without meeting the terms of the HTLC.&lt;br/&gt;This risk is solved by requiring Alice&amp;#39;s HTLC-success transaction to also spend a new control output in Bob&amp;#39;s Individual transaction, and allowing Bob to spend that new control output with an HTLC-timeout transaction after the HTLC&amp;#39;s expiry (thus blocking Alice&amp;#39;s HTLC-success transaction).&lt;br/&gt;This design creates another issue, namely the possibility of Bob using an old HTLC-timeout transaction (or any other transaction) to spend the new control output and block Alice&amp;#39;s HTLC-success transaction before the HTLC&amp;#39;s expiry.&lt;br/&gt;This final issue is solved by having each HTLC output in Alice&amp;#39;s Commitment transaction default (after a sufficient relative delay) to paying her for the HTLC offered to her unless Bob&amp;#39;s corresponding HTLC-timeout transaction is on-chain.&lt;br/&gt;&lt;br/&gt;The FFO-WF protocol, with a single HTLC outstanding from dedicated user Bob to casual user Alice, is shown below:&lt;br/&gt;&lt;br/&gt;&#43;-&#43; AB &#43;----&#43; A&lt;br/&gt;|F|----&#43;-----------------------------| CC |----&lt;br/&gt;&#43;-&#43; | | |&lt;br/&gt;. | | B&lt;br/&gt;. | |----&lt;br/&gt;. &#43;----&#43;&lt;br/&gt;| tsdB &amp;amp; AB &#43;----&#43; A&lt;br/&gt;&#43;-----------------------------|C_Ai|----&lt;br/&gt;| | |&lt;br/&gt;| | | B&lt;br/&gt;| | |----&lt;br/&gt;| tsdB &amp;amp; A | | tsdAB &amp;amp; A&lt;br/&gt;| &#43;-----------------| |-----&#43;------------&lt;br/&gt;| | &#43;----&#43; |&lt;br/&gt;| | | AB &#43;-----&#43; B&lt;br/&gt;| | &#43;-----------|Hr_Bi|----&lt;br/&gt;| | | |&lt;br/&gt;| | B | |&lt;br/&gt;| | &#43;--| |&lt;br/&gt;| | | &#43;-----&#43;&lt;br/&gt;| tA&#43;B &amp;amp; AB | &#43;----&#43; A |&lt;br/&gt;&#43;-----------------------------|C_Bi|---- |&lt;br/&gt;| | | | |&lt;br/&gt;. | | | B |&lt;br/&gt;. | | |---- |&lt;br/&gt;. | tA&#43;B &amp;amp; B | | |&lt;br/&gt;| | &#43;-------------| | |&lt;br/&gt;V | | &#43;----&#43; |&lt;br/&gt;| | |&lt;br/&gt;&#43;----&#43; A &#43;-----&#43; | | pckeyAi |&lt;br/&gt;|In_A|----|St_Ai|--&#43;-------------- |&lt;br/&gt;&#43;----&#43; | | | |&lt;br/&gt;| | | hp(X) &amp;amp; A &#43;-----&#43; A |&lt;br/&gt;| | ---------------------|Hs_Ai|---- |&lt;br/&gt;&#43;-----&#43; | | | |&lt;br/&gt;| B | | |&lt;br/&gt;| &#43;--| | |&lt;br/&gt;| | &#43;-----&#43; |&lt;br/&gt;&#43;----&#43; (Li)&amp;amp;B &#43;-----&#43; | pckeyBi | |&lt;br/&gt;|In_B|---------|St_Bi|-&#43;---------- | |&lt;br/&gt;| | &#43;-----&#43; | |&lt;br/&gt;| | | (eAB) &amp;amp; B &#43;-----&#43; |&lt;br/&gt;| |------------------------------&#43;------------|Ht_Bi|-&#43;&lt;br/&gt;&#43;----&#43; &#43;-----&#43;&lt;br/&gt;&lt;br/&gt;where notation matches the figure above, plus:&lt;br/&gt;Hs_Ai is Alice&amp;#39;s HTLC-success transaction for state i,&lt;br/&gt;Ht_Bi is Bob&amp;#39;s HTLC-timeout transaction for state i,&lt;br/&gt;Hr_Bi is Bob&amp;#39;s HTLC-refund transaction for state i,&lt;br/&gt;tA&#43;B equals tsdA &#43; tsdB, and&lt;br/&gt;Li is an absolute locktime that is tsdA in the future when state i is&lt;br/&gt;created.&lt;br/&gt;&lt;br/&gt;Related Work&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The protocols presented here are designed to make efficient use of channel factories for Lightning.&lt;br/&gt;The concept of channel factories and the most efficient published protocol for a channel factory were created by Burchert, Decker and Wattenhofer [2].&lt;br/&gt;&lt;br/&gt;Towns proposed adding a new opcode to Bitcoin, called TAPLEAF_UPDATE_VERIFY (TLUV), that would support (among other things) the ability to remove one party from a CoinPool without having to close the CoinPool [7], and ZmnSCPxj noted that this opcode could also be used to remove one channel from a factory without closing the factory [8].&lt;br/&gt;Those proposals differ from the protocols presented here in that they require a change to Bitcoin.&lt;br/&gt;&lt;br/&gt;The protocols presented here use HTLC-timeout and HTLC-success transactions to resolve HTLCs before the channel&amp;#39;s Funding transaction has been put on-chain, thus reducing the expiry of those HTLCs.&lt;br/&gt;This idea is analogous to, and inspired by, the Lightning protocol&amp;#39;s use of HTLC-timeout and HTLC-success transactions to resolve HTLCs before their associated Commitment transaction has been verified to be unrevoked [1].&lt;br/&gt;&lt;br/&gt;The PFO, FFO and FFO-WF protocols are based on the TP protocol presented by Law [5].&lt;br/&gt;The techniques for supporting watchtower-freedom and one-shot receives in the FFO-WF protocol are based on those presented by Law in [4] and [5].&lt;br/&gt;&lt;br/&gt;Conclusions&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;This post presents channel protocols that are optimized for use within channel factories.&lt;br/&gt;The protocols make the resolution of HTLCs in the channels independent of the latency to close the channel factory.&lt;br/&gt;The FFO and FFO-WF protocols also allows HTLCs to be resolved on-chain without closing the channel factory.&lt;br/&gt;&lt;br/&gt;If the FFO protocol is used in channels owned by pairs of dedicated users and the FFO-WF protocol is used in channels with a casual user:&lt;br/&gt;* casual users do not require watchtowers,&lt;br/&gt;* casual users can use one-shot receives,&lt;br/&gt;* dedicated users can use watchtowers with logarithmic storage,&lt;br/&gt;* all users can have tunable penalties,&lt;br/&gt;* all channels can have HTLCs with expiries that are independent of the latency of closing the factory that created them, and&lt;br/&gt;* all channels can resolve their HTLCs without closing the factories that created them.&lt;br/&gt;&lt;br/&gt;It&amp;#39;s hoped that these factory-optimized protocols will allow channel factories to become commonly-used, thus improving Bitcoin&amp;#39;s scalability.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;References&lt;br/&gt;==========&lt;br/&gt;&lt;br/&gt;[1] BOLT specifications, available at &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc&#34;&gt;https://github.com/lightningnetwork/lightning-rfc&lt;/a&gt;.&lt;br/&gt;[2] Burchert, Decker and Wattenhofer, &amp;#34;Scalable Funding of Bitcoin Micropayment Channel Networks&amp;#34;, available at &lt;a href=&#34;http://dx.doi.org/10.1098/rsos.180089&#34;&gt;http://dx.doi.org/10.1098/rsos.180089&lt;/a&gt;.&lt;br/&gt;[3] Decker and Wattenhofer, &amp;#34;A Fast and Scalable Payment Network with Bitcoin Duplex Micropayment Channels&amp;#34;, available at &lt;a href=&#34;https://tik-old.ee.ethz.ch/file/716b955c130e6c703fac336ea17b1670/duplex-micropayment-channels.pdf&#34;&gt;https://tik-old.ee.ethz.ch/file/716b955c130e6c703fac336ea17b1670/duplex-micropayment-channels.pdf&lt;/a&gt;.&lt;br/&gt;[4] Law, &amp;#34;Watchtower-Free Lightning Channels For Casual Users&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;.&lt;br/&gt;[5] Law, &amp;#34;Lightning Channels With Tunable Penalties&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-tunable-penalties&#34;&gt;https://github.com/JohnLaw2/ln-tunable-penalties&lt;/a&gt;.&lt;br/&gt;[6] Law, &amp;#34;Factory-Optimized Channel Protocols For Lightning&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-factory-optimized&#34;&gt;https://github.com/JohnLaw2/ln-factory-optimized&lt;/a&gt;.&lt;br/&gt;[7] Towns, &amp;#34;TAPLEAF_UPDATE_VERIFY covenant opcode&amp;#34;, available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019419.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019419.html&lt;/a&gt;.&lt;br/&gt;[8] ZmnSCPxj, &amp;#34;Channel Eviction From Channel Factories By New Covenant Operations&amp;#34;, available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/003479.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/003479.html&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&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/20221202/9a91c6d0/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221202/9a91c6d0/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:07:35&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsgng4qapnu62xltl6pez7taqxn8cvmk5kgudlhc8v3nw492sytq8gzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gz90cdyq</id>
    
      <title type="html">📅 Original date posted:2022-10-30 📝 Original message: TL:DR ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsgng4qapnu62xltl6pez7taqxn8cvmk5kgudlhc8v3nw492sytq8gzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gz90cdyq" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqspzcrjex6dl85y62ypmadt8lruzy9a9mc8ky7qkv8fdhgujl292uceks5ma&#39;&gt;nevent1q…s5ma&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-30&lt;br/&gt;📝 Original message:&lt;br/&gt;TL:DR&lt;br/&gt;&lt;br/&gt;=====&lt;br/&gt;* It&amp;#39;s possible to modify the Lightning channel protocol to impose tunable penalties for putting old transactions on-chain.&lt;br/&gt;* The key idea is the use of separate value transactions and control transactions.&lt;br/&gt;* The Tunable-Penalty (TP) protocol also allows a watchtower to use storage that is logarithmic (vs. linear) in the number of channel states.&lt;br/&gt;* The TP protocol is not suitable for casual users, as it can require that users perform actions at specific times weeks or months after the expiry of an HTLC.&lt;br/&gt;&lt;br/&gt;Overview&lt;br/&gt;========&lt;br/&gt;&lt;br/&gt;In the current Lightning channel protocol [1][2], if a party accidentally puts an old transaction on-chain (for example, due to loss of state caused by a crash or loss of a cell phone), they risk losing all their funds in the channel (this has been called the &amp;#34;toxic-waste&amp;#34; problem) [7]. This post presents a new channel protocol, the Tunable-Penalty (TP) protocol, that supports a tunable penalty for putting old transactions on-chain, thus discouraging the use of old transactions while avoiding the risk of losing all channel funds [9][11]. In addition, the TP protocol allows watchtowers to use storage that is logarithmic, rather than linear, in the number of channel states supported. No change to the underlying Bitcoin protocol is required.&lt;br/&gt;&lt;br/&gt;A paper with a more complete description of the protocol, including figures, is available [6].&lt;br/&gt;&lt;br/&gt;The Challenge&lt;br/&gt;=============&lt;br/&gt;&lt;br/&gt;In order to motivate the TP protocol, first consider a straightforward approach to tuning penalties in a Lightning channel by charging the errant party the desired penalty and then dividing the remaining funds according to the channel&amp;#39;s current state. Consider the case where Alice put an old state i Commitment transaction on-chain, where the current channel state is j &amp;gt; i. In order to assess the penalty and correctly divide the remaining funds, Bob must be able to spend that transaction&amp;#39;s to_self output (which pays to Alice) with a Penalty_Bij transaction that splits its input value into the correct state j values (after assessing the penalty). Alice must approve of this division of funds when she agrees to make state j the current state. Therefore, Alice must sign a separate Penalty_Bij transaction for each pair of states i and j, where i &amp;lt; j, so she must sign a total of O(S^2) penalty transactions and Bob must store O(S) signatures for the current state, where S is the number of channel states [3]. The current Lightning protocol only requires O(S) signatures and O(log S) storage for each party [10], so this approach would be quite expensive.&lt;br/&gt;&lt;br/&gt;The Solution&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The TP protocol avoids this problem by using separate value and control transactions. In addition to an on-chain Funding transaction that provides the channel&amp;#39;s funds, each party in the TP protocol has an on-chain Individual transaction that they use to control how the channel&amp;#39;s funds are distributed. Each Individual transaction has a single output with a value slightly larger than the desired penalty amount. Before either party can put their Commitment transaction on-chain, they must first put their State transaction on-chain that spends the output of their Individual transaction. The State transaction encodes the channel&amp;#39;s state number in its nLocktime and nSequence fields, just like the Commitment transaction encodes the state number in the Lightning protocol. The first output of the State transaction has a value equal to the desired penalty amount.  After a relative delay equal to the maximum of the parties&amp;#39; to_self_delay parameters, this output can be spent by the same party&amp;#39;s Commitment transaction for the same state. However, if the State transaction is for an old state, it can be revoked by the other party (thus taking the penalty amount) before it can be used as an input to the Commitment transaction. If one party&amp;#39;s State transaction is revoked, the other party can still put their correct State transaction on-chain, as the two parties&amp;#39; State transactions spend outputs from different Individual transactions, and thus don&amp;#39;t conflict. Because old State transactions are revoked before they can affect the distribution of the channel&amp;#39;s funds, the problem with O(S^2) penalty transactions and signatures described above is avoided.&lt;br/&gt;&lt;br/&gt;The Protocol&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The TP protocol is shown below:&lt;br/&gt;&lt;br/&gt;&#43;-&#43; AB                           &#43;----&#43; A&lt;br/&gt;|F|----&#43;-------------------------| CC |----&lt;br/&gt;&#43;-&#43;    |                         |    |&lt;br/&gt;       .                         |    | B&lt;br/&gt;       .                         |    |----&lt;br/&gt;       .                         &#43;----&#43;&lt;br/&gt;       |                         &#43;----&#43; A&lt;br/&gt;       &#43;-------------------------|C_Ai|----&lt;br/&gt;       |                         |    |&lt;br/&gt;       |                         |    | B&lt;br/&gt;       |                         |    |----&lt;br/&gt;       |                         |    |&lt;br/&gt;       |               tsdAB &amp;amp; A |    | AB               &#43;-----&#43; A&lt;br/&gt;       |             &#43;-----------|    |-----&#43;------------|Hr_Ai|----&lt;br/&gt;       |             |           &#43;----&#43;     |  &#43;---------|     |&lt;br/&gt;       |             |                      |  |         &#43;-----&#43;&lt;br/&gt;       |             |                      |  |         &#43;-----&#43; B&lt;br/&gt;       |             |                      &#43;------------|Hp_Bi|----&lt;br/&gt;       |             |                         | &#43;-------|     |&lt;br/&gt;       |             |                         | |       &#43;-----&#43;&lt;br/&gt;       |             |           &#43;----&#43; A      | |&lt;br/&gt;       &#43;-------------------------|C_Bi|----    | |&lt;br/&gt;       |             |           |    |        | |&lt;br/&gt;       .             |           |    | B      | |&lt;br/&gt;       .             |           |    |----    | |&lt;br/&gt;       .             |           |    |        | |&lt;br/&gt;       |             | tsdAB &amp;amp; B |    | AB     | |       &#43;-----&#43; A&lt;br/&gt;       V           &#43;-------------|    |-----&#43;------------|Hr_Ai|----&lt;br/&gt;                   | |           &#43;----&#43;     |  | |  &#43;----|     |&lt;br/&gt;                   | |                      |  | |  |    &#43;-----&#43;&lt;br/&gt;                   | |                      |  | |  |    &#43;-----&#43; B&lt;br/&gt;&#43;----&#43; A  &#43;-----&#43;  | | pckeyAi              &#43;------------|Hp_Bi|----&lt;br/&gt;|In_A|----|St_Ai|----&#43;-----------              | |  | &#43;--|     |&lt;br/&gt;&#43;----&#43;    |     |  |                           | |  | |  &#43;-----&#43;&lt;br/&gt;          |     |  |   eAB &amp;amp; A   &#43;-----&#43; A     | |  | |&lt;br/&gt;          |     |----&#43;-----------|Ht_Ai|-------&#43; |  | |&lt;br/&gt;          &#43;-----&#43;  | |           &#43;-----&#43;         |  | |&lt;br/&gt;                   | | hp(X) &amp;amp; A &#43;-----&#43; B       |  | |&lt;br/&gt;                   | &#43;-----------|Hs_Bi|---------&#43;  | |&lt;br/&gt;                   |             &#43;-----&#43;            | |&lt;br/&gt;&#43;----&#43; B  &#43;-----&#43;  |   pckeyBi                      | |&lt;br/&gt;|In_B|----|St_Bi|--&#43;-------------                   | |&lt;br/&gt;&#43;----&#43;    |     |                                   | |&lt;br/&gt;          |     |      eAB &amp;amp; A   &#43;-----&#43; A          | |&lt;br/&gt;          |     |--&#43;-------------|Ht_Ai|------------&#43; |&lt;br/&gt;          &#43;-----&#43;  |             &#43;-----&#43;              |&lt;br/&gt;                   |   hp(X) &amp;amp; A &#43;-----&#43; B            |&lt;br/&gt;                   &#43;-------------|Hs_Bi|--------------&#43;&lt;br/&gt;                                 &#43;-----&#43;&lt;br/&gt;&lt;br/&gt;where:&lt;br/&gt;F is the Funding transaction,&lt;br/&gt;CC is the Cooperative Close transaction,&lt;br/&gt;In_{A|B} is {Alice&amp;#39;s|Bob&amp;#39;s} Individual transaction,&lt;br/&gt;St_{A|B}i is {Alice&amp;#39;s|Bob&amp;#39;s} State transaction for state i,&lt;br/&gt;C_{A|B}i is {Alice&amp;#39;s|Bob&amp;#39;s} Commitment transaction for state i,&lt;br/&gt;Ht_Ai is Alice&amp;#39;s HTLC-timeout transaction for state i,&lt;br/&gt;Hs_Bi is Bob&amp;#39;s HTLC-success transaction for state i,&lt;br/&gt;Hr_Ai is Alice&amp;#39;s HTLC-refund transaction for state i, and&lt;br/&gt;Hp_Bi is Bob&amp;#39;s HTLC-payment transaction for state i.&lt;br/&gt;&lt;br/&gt;The F, In_A and In_B transactions are on-chain, while the remaining transactions are off-chain during normal protocol operation. The output of the Ht_Ai and Hs_Bi transactions, and the second output of the St_Ai and St_Bi transactions, have the minimal allowed value, as they are used for control.&lt;br/&gt;&lt;br/&gt;Requirements for output cases are as follows:&lt;br/&gt;A: Alice&amp;#39;s signature,&lt;br/&gt;B: Bob&amp;#39;s signature,&lt;br/&gt;AB: Alice&amp;#39;s and Bob&amp;#39;s signatures,&lt;br/&gt;pckey{A|B}i: a signature using a per-commitment key for revoking {Alice&amp;#39;s|Bob&amp;#39;s} state i transaction,&lt;br/&gt;hp(X): the hash preimage of X,&lt;br/&gt;tsdAB: a relative delay equal to the maximum of Alice&amp;#39;s and Bob&amp;#39;s to_self_delay parameters, and&lt;br/&gt;eAB: an absolute timelock equal to the expiry of the HTLC in this hop.&lt;br/&gt;&lt;br/&gt;In order to establish a new channel state, both parties:&lt;br/&gt;* calculate the State, Commitment, HTLC-timeout, HTLC-success, HTLC-refund and HTLC-payment transactions for the new state,&lt;br/&gt;* exchange partial signatures for the new state&amp;#39;s HTLC-refund, HTLC-payment and Commitment transactions (in that order), and&lt;br/&gt;* exchange per-commitment pubkeys for the old state, thus revoking it.&lt;br/&gt;&lt;br/&gt;Consider the case of an HTLC offered by Alice to Bob (as shown in the figure above). When Bob receives the secret for the HTLC, he shares it with Alice and attempts to update the channel state off-chain. If he&amp;#39;s unable to update the state off-chain before his fulfillment_deadline prior to the HTLC&amp;#39;s expiry, he puts his State and associated HTLC-success transactions on-chain. If Alice hasn&amp;#39;t received the HTLC&amp;#39;s secret by her timeout_deadline *prior* to the HTLC&amp;#39;s expiry, she puts her State and associated HTLC-timeout transactions on-chain.&lt;br/&gt;&lt;br/&gt;Both parties constantly look for an old (revoked) State transaction put on-chain by their partner, and if they find such a transaction they use the corresponding per-commitment key to spend its first output, thus obtaining the penalty funds and revoking the old state. Whenever a current State transaction is put on-chain, both parties attempt to resolve its HTLC control output(s) by putting their HTLC-timeout and HTLC-success transactions on-chain. If the first output of a State transaction has not been spent within tsdAB, the party that put the State transaction on-chain attempts to put their corresponding Commitment transaction on-chain. Once a Commitment transaction is on-chain, each party puts its HTLC-refund and HTLC-payment transactions that spend its HTLC outputs on-chain (as determined by whether the corresponding HTLC-timeout or HTLC-success transaction is on-chain).&lt;br/&gt;&lt;br/&gt;Two-Input Transactions&lt;br/&gt;======================&lt;br/&gt;&lt;br/&gt;All transactions in the current Lightning protocol have a single input, while the Commitment, HTLC-refund and HTLC-payment transactions in the TP protocol each have two inputs. The first input is a value input that carries channel funds and requires both parties&amp;#39; signatures (using the SIGHASH_ALL flag). The second input is a control input that only requires one party&amp;#39;s signature. These two-input transactions are quite different from the Lightning protocol&amp;#39;s one-input transactions, so it&amp;#39;s worth examining them in detail.&lt;br/&gt;&lt;br/&gt;First, because the first input requires both parties&amp;#39; signatures, only two-input transactions that have been signed by both parties can be used.  Second, because signatures for the first input use the SIGHASH_ALL flag, they force the source of the second input to have the specified transaction ID. Third, because each transaction&amp;#39;s ID is a function of the transaction IDs of all of its parents (and indirectly, of all of its ancestors), all of the ancestors of the two-input transactions must have the specified transaction IDs. For example, Alice&amp;#39;s partial signature on the first input of Bob&amp;#39;s Commitment transaction forces its second input to spend the first output of Bob&amp;#39;s State transaction for the same state, and indirectly requires Bob&amp;#39;s State transaction for the same state to spend the output of his Individual transaction. Therefore, while Bob could spend the output of his Individual transaction in any way he chooses, spending it with anything other than the correct State transaction will prevent him from ever putting his correct Commitment transaction on-chain.  Similarly, if the first output of Bob&amp;#39;s State transaction is spent by anything other than his corresponding Commitment transaction, that Commitment transaction can never be put on-chain.&lt;br/&gt;&lt;br/&gt;Per-Commitment Keys&lt;br/&gt;===================&lt;br/&gt;&lt;br/&gt;In this way, Bob&amp;#39;s Commitment transaction for state i, and the HTLC-refund and HTLC-payment transactions that spend the HTLC outputs from his Commitment transaction for state i, all require that the first output of Bob&amp;#39;s State transaction for state i be spent by his Commitment transaction for state i. Therefore, revoking an old State transaction by spending its first output also revokes all of the same party&amp;#39;s Commitment transactions (for all states) and their associated HTLC-refund and HTLC-payment transactions. This is why there&amp;#39;s no need to separately revoke any of the outputs from the Commitment, HTLC-refund, HTLC-payment, HTLC-timeout or HTLC-success transactions.&lt;br/&gt;&lt;br/&gt;These dependent revocations also allow the TP protocol to use a different type of key for revoking old states. In the Lightning protocol the party that puts an old transaction on-chain cannot know the key for revoking that transaction. This is necessary in Lightning because if that party did know the revocation key, they could intentionally put an old Commitment transaction on-chain and then &amp;#34;revoke&amp;#34; the outputs of that transaction, thus taking the value for themselves. In contrast, in the TP protocol, if a party puts an old State transaction on-chain and then revokes it by spending its first output with a transaction other than its associated Commitment transaction, that party is actually blocking its ability to ever put a Commitment transaction on-chain. Furthermore, the funds that party obtains by spending the State transaction&amp;#39;s first output are the same penalty funds that they provided from their Individual transaction. As a result, it&amp;#39;s safe in the TP protocol to allow a party to revoke its own State transaction. This allows the TP protocol to use per-commitment keys (which are exactly the private keys of the per-commitment points used by the Lightning protocol [10]) to revoke transactions.&lt;br/&gt;&lt;br/&gt;Watchtowers&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;Because these per-commitment keys are known to the party putting the revocable transactions on-chain, they can also be shared with an untrusted watchtower. The watchtower can use the Lightning protocol&amp;#39;s compact storage technique for revocation keys to consume only O(log S) storage to revoke a maximum of S old transactions [10]. Conveniently, the watchtower can also take the penalty amount as payment for the service it provided.  The watchtower must be given the UTXO of the partner&amp;#39;s Individual transaction&amp;#39;s output in order to detect a revoked transaction, but the watchtower will see no association between that UTXO and the Funding transaction or any other channel state.&lt;br/&gt;&lt;br/&gt;Correctness&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;Each party is prevented from putting an old Commitment transaction for state i on-chain by the other party spending the first output of the corresponding State transaction for state i. Therefore, only the correct Commitment transaction can appear on-chain.&lt;br/&gt;&lt;br/&gt;While having separate, non-conflicting State transactions enables tunable penalties, it makes HTLC resolution more complex. As can be seen in the figure above, the parties&amp;#39; Commitment transactions conflict and the party whose Commitment transaction appears on-chain (called the winning party) also put on-chain the State transaction with the HTLC control outputs that determine whether HTLCs succeed or time out.&lt;br/&gt;&lt;br/&gt;For example, consider an HTLC offered by Alice to Bob. Bob could fulfill the HTLC by putting his State and associated HTLC-success transactions on-chain before its expiry, but if Alice is the winning party and she puts her State and associated HTLC-timeout transactions on-chain far after its expiry, Bob will not be paid by the HTLC depite having met its terms.  Similary, Alice could time out the HTLC by putting her State and HTLC-timeout transactions on-chain after its expiry, but if Bob is the winning party and he puts his State and associated HTLC-success transactions on-chain far later, Bob will be paid by the HTLC despite having failed to meet its terms.&lt;br/&gt;&lt;br/&gt;Note that both problems require the second party to put their State transaction on-chain late relative to the HTLC&amp;#39;s expiry, and yet be the winning party. These problems can&amp;#39;t occur in the TP protocol because both parties race to put their Commitment transactions on-chain and the relative delays from State transactions to Commitment transactions match.  Therefore, the winning party&amp;#39;s State transaction can&amp;#39;t be put on-chain much later than the other party&amp;#39;s State transaction. In the TP protocol, each party guarantees that the winning party&amp;#39;s State transaction is on-chain early enough relative to the HTLC&amp;#39;s expiry by putting their own State transaction on-chain early. Then, even if the other party is the winning party, the other party&amp;#39;s transaction must still be on-chain early enough relative to the HTLC&amp;#39;s expiry, thus guaranteeing its correct resolution.&lt;br/&gt;&lt;br/&gt;This argument is formalized in the paper [6].&lt;br/&gt;&lt;br/&gt;Related Work&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The protocol presented here makes extensive use of previously-published work, namely the Poon-Dryja Lightning channel protocol [1] and the BOLT specifications [2]. The compact storage technique for per-commitment keys comes from the compact storage technique for revocation keys created by Russell [10].&lt;br/&gt;&lt;br/&gt;Riard, ZmnSCPxj and Decker examined the idea of adding penalties to the eltoo protocol [7], but the techniques used there were different, as they did not use separate value and control transactions.&lt;br/&gt;&lt;br/&gt;Rubin (who also credited nullc and sipa) [8] showed how a two-input transaction with separate value and control inputs can be used to delegate the control of a UTXO (the value input) to another UTXO (the control input). This two-input transaction is similar to the TP protocol&amp;#39;s Commitment, HTLC-refund and HTLC-payment transactions, but differs in that its value input does not require a multi-sig, so the delegation can be revoked by the delegator via a double-spend.&lt;br/&gt;&lt;br/&gt;The idea of using separate value and control transactions was presented by Law in the update-forest and challenge-and-response protocols [4], but those protocols were for channel factories as opposed to channels, and they assumed a change to the underlying Bitcoin protocol.&lt;br/&gt;&lt;br/&gt;Conclusions&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;This paper presents a new channel protocol that allows one to select the penalty for putting an old transaction on-chain. In addition, it reduces the storage costs for untrusted watchtowers from O(S) to O(log S), where S is the number of channel states supported. A recent paper presented a channel protocol that is watchtower-free for casual users [5] and similar techniques could be used to make the TP protocol watchtower-free for such users. However, the TP protocol is not suitable for them as it can require that users submit their Commitment transaction at a specific time weeks or months after the expiry of an HTLC.&lt;br/&gt;&lt;br/&gt;The TP protocol achieves tunable penalties and logarithmic storage for watchtowers by using separate value and control transactions. As will be shown in the next posts, protocols that use separate value and control transaction and have a structure similar to the TP protocol can also be used to create factory-optimized channels and efficient channel factories.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;References&lt;br/&gt;==========&lt;br/&gt;&lt;br/&gt;[1] Poon and Dryja, &amp;#34;The Bitcoin Lightning Network&amp;#34;, available at &lt;a href=&#34;https://lightning.network/lightning-network-paper.pdf&#34;&gt;https://lightning.network/lightning-network-paper.pdf&lt;/a&gt;.&lt;br/&gt;[2] BOLT specifications, available at &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc&#34;&gt;https://github.com/lightningnetwork/lightning-rfc&lt;/a&gt;.&lt;br/&gt;[3] Decker, &amp;#34;Re: Simulating Eltoo Factories using SCU Escrows (aka SCUE&amp;#39;d Eltoo), available at &lt;a href=&#34;https://www.mail-archive.com/lightning-dev@lists.linuxfoundation.org/msg02046.html&#34;&gt;https://www.mail-archive.com/lightning-dev@lists.linuxfoundation.org/msg02046.html&lt;/a&gt;.&lt;br/&gt;[4] Law, &amp;#34;Scaling Bitcoin With Inherited IDs&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/btc-iids&#34;&gt;https://github.com/JohnLaw2/btc-iids&lt;/a&gt;.&lt;br/&gt;[5] Law, &amp;#34;Watchtower-Free Lightning Channels For Casual Users&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;.&lt;br/&gt;[6] Law, &amp;#34;Lightning Channels With Tunable Penalties&amp;#34;, available at &lt;a href=&#34;https://github.com/JohnLaw2/ln-tunable-penalties&#34;&gt;https://github.com/JohnLaw2/ln-tunable-penalties&lt;/a&gt;.&lt;br/&gt;[7] Riard, &amp;#34;Using Per-Update Credential to enable Eltoo-Penalty&amp;#34; and subsequent posts in the thread starting at: &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-July/002064.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-July/002064.html&lt;/a&gt;&lt;br/&gt;[8] Rubin, &amp;#34;Delegated signatures in Bitcoin within existing rules, no fork required&amp;#34; available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018615.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018615.html&lt;/a&gt;.&lt;br/&gt;[9] Rubin, &amp;#34;Re: &amp;#39;OP_EVICT&amp;#39;: An Alternative to &amp;#39;OP_TAPLEAFUPDATEVERIFY&amp;#39;&amp;#34;, available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/019945.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/019945.html&lt;/a&gt;.&lt;br/&gt;[10]Russell, &amp;#34;Efficient Per-Commitment Secret Storage&amp;#34;, available at &lt;a href=&#34;https://github.com/lightning/bolts/blob/master/03-transactions.md#efficient-per-commitment-secret-storage&#34;&gt;https://github.com/lightning/bolts/blob/master/03-transactions.md#efficient-per-commitment-secret-storage&lt;/a&gt;&lt;br/&gt;[11]Sanders, &amp;#34;Re: &amp;#39;OP_EVICT&amp;#39;: An Alternative to &amp;#39;OP_TAPLEAFUPDATEVERIFY&amp;#39;&amp;#34;, available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/019947&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-February/019947&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&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/20221030/b97aa76e/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221030/b97aa76e/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:07:11&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsrjz7t9aqrwmqg2ypc8fs83q32d0w7e07zd0t9lexsu05j6n7ngcgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzs969qx</id>
    
      <title type="html">📅 Original date posted:2022-10-11 📝 Original message: Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsrjz7t9aqrwmqg2ypc8fs83q32d0w7e07zd0t9lexsu05j6n7ngcgzyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzs969qx" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqspazvcp0tdxuut2k9s8vs3hmtmckuy8sf03xyd4ert8g7z4nxwftsn5k85c&#39;&gt;nevent1q…k85c&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-11&lt;br/&gt;📝 Original message:&lt;br/&gt;Hey Bastien,&lt;br/&gt;&lt;br/&gt;Thanks for your reply.&lt;br/&gt;&lt;br/&gt;Responses are in-line below:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hey John,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for sharing, this is very interesting.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There is a good insight here that we can remove the intermediate&lt;br/&gt;&amp;gt; HTLC-timeout transaction for outgoing payments because we are the&lt;br/&gt;&amp;gt; origin of that payment (and thus don&amp;#39;t need to quickly claim the&lt;br/&gt;&amp;gt; HTLC on-chain to then relay that failure to a matching incoming HTLC).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; More generally, you have perfectly identified that most of the&lt;br/&gt;&amp;gt; complexity of today&amp;#39;s transactions come from the need to ensure that&lt;br/&gt;&amp;gt; a failing/malicious downstream channel doesn&amp;#39;t negatively impact&lt;br/&gt;&amp;gt; honest upstream channels when relaying payments, and that some of this&lt;br/&gt;&amp;gt; complexity can be lifted when nodes don&amp;#39;t relay payments.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&amp;gt; However, my main criticism of your proposal is that liquidity isn&amp;#39;t free.&lt;br/&gt;&amp;gt; While your improvements are great from the CLU&amp;#39;s point of view, I&amp;#39;m not&lt;br/&gt;&amp;gt; sure they&amp;#39;re acceptable for the DLU. The main (probably only) job of an&lt;br/&gt;&amp;gt; LSP (DLU in your terminology) is to efficiently allocate their liquidity.&lt;br/&gt;&amp;gt; In order to do so, they must be able to quickly move liquidity from where&lt;br/&gt;&amp;gt; it&amp;#39;s unused to where it may be better used. That means closely watching&lt;br/&gt;&amp;gt; the demand for block space and doing on-chain transactions when fees are&lt;br/&gt;&amp;gt; low (to open/close channels, splice funds in/out [1], make peer swaps [2],&lt;br/&gt;&amp;gt; etc). With your proposal, DLUs won&amp;#39;t be able to quickly move liquidity&lt;br/&gt;&amp;gt; around, so the only way to make up for this is to charge the CLU for the&lt;br/&gt;&amp;gt; loss of expected revenue. I&amp;#39;m afraid that the amount DLUs would need to&lt;br/&gt;&amp;gt; charge CLUs will be prohibitively expensive for most CLUs.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m curious to get your feedback on that point.&lt;br/&gt;&lt;br/&gt;I really appreciate your insight here. I&amp;#39;m just an interested observer who doesn&amp;#39;t have experience with creating and deploying Lightning nodes, so I&amp;#39;m sure you have a better understanding of the current costs and trade-offs than I do.&lt;br/&gt;&lt;br/&gt;My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner&amp;#39;s cost-of-capital. Is that correct?&lt;br/&gt;&lt;br/&gt;If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either:&lt;br/&gt;1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or&lt;br/&gt;2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity.&lt;br/&gt;&lt;br/&gt;In contrast, with the Watchtower-Free (WF) protocol, the DLU could only move liquidity to another Lightning channel by either:&lt;br/&gt;1) getting the CLU to sign a cooperative close transaction that enables (or directly implements), the desired movement of funds, or&lt;br/&gt;2) putting a non-cooperative close transaction on-chain and waiting approximately 1-3 months (based on the I_L parameter set by the CLU) before moving the liquidity.&lt;br/&gt;In case 1), it would make sense for the DLU to refund the remaining portion of CLU&amp;#39;s cost-of-capital pre-payment to the CLU, as that capital is now being made available to the DLU. This was not proposed in the paper, but it should probably be added.&lt;br/&gt;&lt;br/&gt;With this change (namely refunding the remainder of the cost-of-capital pre-payment), it seems like the only disadvantage of the WF protocol to the DLU is the larger delay (1-3 months vs. 2 weeks). Do you feel increasing the delay from 2 weeks to 1 month is prohibitive?&lt;br/&gt;&lt;br/&gt;My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low.&lt;br/&gt;&lt;br/&gt;What are your thoughts on this?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;&amp;gt; Thanks again for sharing, and for the inherited IDs [3] proposal as well!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Bastien&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://github.com/lightning/bolts/pull/863&amp;#34;&amp;gt;https://github.com/lightning/bolts/pull/863&amp;lt;/a&amp;gt&#34;&gt;https://github.com/lightning/bolts/pull/863&amp;#34;&amp;gt;https://github.com/lightning/bolts/pull/863&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; [2] &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://www.peerswap.dev/&amp;#34;&amp;gt;https://www.peerswap.dev/&amp;lt;/a&amp;gt&#34;&gt;https://www.peerswap.dev/&amp;#34;&amp;gt;https://www.peerswap.dev/&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; [3] &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://github.com/JohnLaw2/btc-iids&amp;#34;&amp;gt;https://github.com/JohnLaw2/btc-iids&amp;lt;/a&amp;gt&#34;&gt;https://github.com/JohnLaw2/btc-iids&amp;#34;&amp;gt;https://github.com/JohnLaw2/btc-iids&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&lt;br/&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/20221012/f0ea0daa/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221012/f0ea0daa/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:07:00&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsql64ctzkjnnz5cmmcxy3e9g9uwfxatzqjpkj025xhztju3j3t7rszyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gz32ln9n</id>
    
      <title type="html">📅 Original date posted:2022-10-11 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsql64ctzkjnnz5cmmcxy3e9g9uwfxatzqjpkj025xhztju3j3t7rszyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gz32ln9n" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsw6c8z8l0qke5wwv9szy3kzyt3z05x9t5pat8d6a8rm80079ac2nqttah68&#39;&gt;nevent1q…ah68&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-11&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;Thanks for reading and for doing a better job of explaining the ideas than I did!&lt;br/&gt;&lt;br/&gt;Responses are in-line below:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi John,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; I had difficulty understanding your proposal description here and in &lt;br/&gt;&amp;gt; your paper[1].  I wonder if others are having the same the same &lt;br/&gt;&amp;gt; difficulty, so I&amp;#39;ve tried to reduce it down to just the essential idea &lt;br/&gt;&amp;gt; so you can tell me if I&amp;#39;m understanding correctly and others can &lt;br/&gt;&amp;gt; evaluate it more quickly.  Here I go:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; In a traditional HTLC, the agreement is essentially:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; - Setup: Alice has x BTC, an unpublished value y, and the hash digest z &lt;br/&gt;&amp;gt; which is hash(y)&lt;br/&gt;&amp;gt; - HTLC success: Alice offers Bob the x BTC, which he can claim at any &lt;br/&gt;&amp;gt; time if he publishes y satisfying the equation hash(y) == z&lt;br/&gt;&amp;gt; - HTLC failure: Alice can spend the x BTC back to her wallet after some &lt;br/&gt;&amp;gt; time t has elapsed&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; If I understand your modified protocol correctly, the essential modified &lt;br/&gt;&amp;gt; agreement is:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; - [Setup the same]&lt;br/&gt;&amp;gt; - [HTLC success the same]&lt;br/&gt;&amp;gt; - HTLC failure: Alice can spend the x BTC back to her wallet by first &lt;br/&gt;&amp;gt; getting a trigger[2] transaction confirmed onchain, waiting b blocks, &lt;br/&gt;&amp;gt; then getting the actual spend-back-to-wallet transaction confirmed&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Because the trigger transaction needs to be confirmed for b blocks &lt;br/&gt;&amp;gt; before Alice can can spend the money back to her wallet, Bob doesn&amp;#39;t &lt;br/&gt;&amp;gt; need to take any action to lock-in an HTLC Success unless he sees the &lt;br/&gt;&amp;gt; trigger transaction appear onchain or he expects to be offline for more &lt;br/&gt;&amp;gt; than b blocks.  This allows Alice to stay offline for as long as Bob can &lt;br/&gt;&amp;gt; tolerate (which goes towards your point of Alice prepaying Bob for that &lt;br/&gt;&amp;gt; tolerance).&lt;br/&gt;&lt;br/&gt;Yes, that&amp;#39;s exactly right.&lt;br/&gt;&lt;br/&gt;I&amp;#39;d note that the transaction that plays the role of the &amp;#34;trigger&amp;#34; transaction is actually just Alice&amp;#39;s Commitment transaction, so no new transaction is required.&lt;br/&gt;&lt;br/&gt;I&amp;#39;d also note that the parameter &amp;#34;b&amp;#34; is exactly Bob&amp;#39;s to_self_delay parameter and he has already committed himself to being able to respond to Alice&amp;#39;s on-chain transactions within a window of b blocks, so the protocol doesn&amp;#39;t put any additional requirements on his monitoring of the blockchain.&lt;br/&gt;&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; [1] &lt;br/&gt;&amp;gt; &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf&amp;#34;&amp;gt;https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf&amp;lt;/a&amp;gt&#34;&gt;https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf&amp;#34;&amp;gt;https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; [2] &amp;#34;Trigger&amp;#34; transaction is the name given to that type of transaction &lt;br/&gt;&amp;gt; in section 4.2 of the Eltoo paper: &amp;lt;a href=&amp;#34;&lt;a href=&#34;https://blockstream.com/eltoo.pdf&amp;#34;&amp;gt;https://blockstream.com/eltoo.pdf&amp;lt;/a&amp;gt&#34;&gt;https://blockstream.com/eltoo.pdf&amp;#34;&amp;gt;https://blockstream.com/eltoo.pdf&amp;lt;/a&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; One-Shot Receives&lt;br/&gt;&amp;gt; &amp;gt; =================&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; I understand the essence of this idea to be simply encumbering dedicated &lt;br/&gt;&amp;gt; user Bob&amp;#39;s commitment transaction with a timelock so that he can&amp;#39;t &lt;br/&gt;&amp;gt; publish it until near the time when any HTLCs in it would expire.  &lt;br/&gt;&amp;gt; Alice&amp;#39;s version of commitment would be unencumbered, so she could &lt;br/&gt;&amp;gt; publish it any time.&lt;br/&gt;&lt;br/&gt;Yes, that&amp;#39;s correct.&lt;br/&gt;&lt;br/&gt;In particular, dedicated user Bob can&amp;#39;t publish his current Commitment transaction until Alice has put her conflicting current Commitment transaction on-chain (assuming she follows the protocol) or both parties have updated the state off-chain. As a result, Alice doesn&amp;#39;t have to worry about the case where she submits her current Commitment and HTLC-success transactions only to later discover that Bob&amp;#39;s current Commitment transaction has won the race, thus forcing Alice to then submit her transaction (which is like an HTLC-success transaction but isn&amp;#39;t actually called that in the protocol) which reveals the hash preimage and takes payment of the HTLC. Forcing Alice to wait around to see who&amp;#39;s current Commitment transaction has won the race seems like an inconvenient requirement for a casual user.&lt;br/&gt;&lt;br/&gt;Is my understanding of this issue correct, or can Alice submit her transaction spending the HTLC output of Bob&amp;#39;s current Commitment transaction even before he has submitted his current Commitment transaction? I realize this part of the protocol depends on node relay behavior, so it&amp;#39;s harder to nail down and reason about than the consensus portion of the protocol. I may not have the correct understanding here, and if my understanding isn&amp;#39;t correct, I&amp;#39;d really like to fix it.&lt;br/&gt;&lt;br/&gt;&amp;gt; Although your proposal may address this in the normal case, I think it &lt;br/&gt;&amp;gt; doesn&amp;#39;t address the pathological case where honest casual user Alice &lt;br/&gt;&amp;gt; broadcasts the latest commitment transaction but her channel partner, &lt;br/&gt;&amp;gt; malicious dedicated user Mallory, broadcasts an older revoked commitment &lt;br/&gt;&amp;gt; transaction.  Because Mallory&amp;#39;s revoked commitment transaction is older, &lt;br/&gt;&amp;gt; its timelock has expired, so it can win the race against Alice&amp;#39;s latest &lt;br/&gt;&amp;gt; commitment transaction.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; To become aware of this situation and to broadcast a penalty transaction &lt;br/&gt;&amp;gt; within the necessary time limit, Alice still needs to monitor the block &lt;br/&gt;&amp;gt; chain.  If Alice still needs to monitor the block chain in any case, &lt;br/&gt;&amp;gt; this proposed change doesn&amp;#39;t eliminate the underlying problem of onerous &lt;br/&gt;&amp;gt; monitoring as far as I can tell.&lt;br/&gt;&lt;br/&gt;You&amp;#39;re right that Bob (or Mallory) could still broadcast an older revoked transaction, and if that happens, Alice needs to broadcast a penalty transaction within her long interval (I_L) safety parameter which I was suggesting she could set to something like 1-3 months. I felt that being able to shut off her phone and not worry about the Lightning app for all but a short time (say 10 minutes) every few months wasn&amp;#39;t overly onerous. Do you feel that casual users wouldn&amp;#39;t see it that way?&lt;br/&gt;&lt;br/&gt;The issue of how often Alice needs to monitor the blockchain is based on her setting of her I_L parameter and is really independent of her ability to perform one-shot receives. My understanding is that in the current Lightning protocol, if Alice is receiving a payment and she gives the payment&amp;#39;s secret to her partner Bob, and if Bob fails to update the channel state to reflect the payment, Alice has to 1) submit her Commitment and HTLC-success transactions, 2) wait to see if her current Commitment transaction or Bob&amp;#39;s current Commitment transaction won the race, and if Bob&amp;#39;s current Commitment transaction won, 3) submit her transaction spending Bob&amp;#39;s current Commitment transaction&amp;#39;s HTLC output. The protocol that supports one-shot receives eliminates steps 2) and 3) above, which seems like a better user interface.&lt;br/&gt;&lt;br/&gt;Does that make sense?&lt;br/&gt;&lt;br/&gt;Many thanks,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Sent with Proton Mail secure email.
    </content>
    <updated>2023-06-09T15:06:59&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsfp8czrfgqy4sz33l9z765ws20ku99uc88hjmfhcsx0erwdrenrnszyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzhgs960</id>
    
      <title type="html">📅 Original date posted:2022-10-03 📝 Original message: This ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsfp8czrfgqy4sz33l9z765ws20ku99uc88hjmfhcsx0erwdrenrnszyq007ldps66y82es44qv4v8rrvljuklxgnztw3m4p7x99javxd7gzhgs960" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszya43ulzvqg3qtg5x4626qd3acarhcm96n8arpwrvzedwc2fdstc2h07fc&#39;&gt;nevent1q…07fc&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-03&lt;br/&gt;📝 Original message:&lt;br/&gt;This is the first in a series of posts on ideas to improve the usability&lt;br/&gt;and scalability of the Lightning Network. This post presents a new channel&lt;br/&gt;protocol that allows casual users to send and receive Lightning payments&lt;br/&gt;without having to meet onerous availability requirements or use a&lt;br/&gt;watchtower service. This new Watchtower-Free (WF) protocol can also be&lt;br/&gt;used to simplify the reception of Lightning payments for casual users. No&lt;br/&gt;change to the underlying Bitcoin protocol is required.&lt;br/&gt;&lt;br/&gt;A paper with a more complete description of the protocol, including&lt;br/&gt;figures, is available [5].&lt;br/&gt;&lt;br/&gt;Properties&lt;br/&gt;==========&lt;br/&gt;&lt;br/&gt;The user-visible properties of the WF protocol can be expressed using&lt;br/&gt;two parameters:&lt;br/&gt;* I_S: a short time interval (e.g., 10 minutes) for communicating with&lt;br/&gt;  peers, checking the blockchain, and submitting transactions to the&lt;br/&gt;  blockchain, and&lt;br/&gt;* I_L: a long time interval (e.g., 1-3 months).&lt;br/&gt;&lt;br/&gt;The casual user must be online for up to:&lt;br/&gt;* I_S every I_L (e.g., 10 minutes every 1-3 months) to safeguard the funds&lt;br/&gt;  in their Lightning channel.&lt;br/&gt;&lt;br/&gt;With the WF protocol, the latency for payments is unchanged from the&lt;br/&gt;current protocol, but the latency for getting a payment receipt from an&lt;br/&gt;uncooperative channel partner is increased. In addition, the casual user&lt;br/&gt;may have to pay their channel partner for the partner&amp;#39;s cost of capital&lt;br/&gt;(which depends on I_L). If the casual user and their channel partner&lt;br/&gt;follow the protocol, the channel can remain off-chain arbitrarily long.&lt;br/&gt;&lt;br/&gt;First Attempt: Use The Current Lightning Protocol&lt;br/&gt;=================================================&lt;br/&gt;&lt;br/&gt;In order to motivate the new protocol, first consider what would happen if&lt;br/&gt;a casual user attempted to achieve the above properties with the current&lt;br/&gt;Lightning channel protocol. The casual user would set their&lt;br/&gt;&amp;#34;to_self_delay&amp;#34; (which controls how quickly their channel partner can&lt;br/&gt;receive funds from a transaction they put on-chain) and&lt;br/&gt;&amp;#34;cltv_expiry_delta&amp;#34; (which controls the staggering of timeouts between&lt;br/&gt;successive hops) parameters to values approaching I_L (because the casual&lt;br/&gt;user could be unavailable for nearly that long). This would create three&lt;br/&gt;problems:&lt;br/&gt;&lt;br/&gt;* Problem 1: The casual user&amp;#39;s proposed channel partner would likely&lt;br/&gt;  reject the creation of the channel due to the excessive &amp;#34;to_self_delay&amp;#34;&lt;br/&gt;  value.&lt;br/&gt;&lt;br/&gt;* Problem 2: If a channel were created with these parameters, Lightning&lt;br/&gt;  payments would not be routed through it due to the excessive&lt;br/&gt;  &amp;#34;cltv_expiry_delta&amp;#34; value.&lt;br/&gt;&lt;br/&gt;* Problem 3: If a channel were created with these parameters and if the&lt;br/&gt;  casual user sent a payment on that channel, their partner could have to&lt;br/&gt;  go on-chain in order to pull the payment from the casual user. In&lt;br/&gt;  particular, the casual user could be offline for nearly I_L (e.g., 1-3&lt;br/&gt;  months) when their partner receives the receipt, thus forcing their&lt;br/&gt;  partner to go on-chain to receive payment before the expiry of the&lt;br/&gt;  associated HTLC.&lt;br/&gt;&lt;br/&gt;The WF Protocol&lt;br/&gt;===============&lt;br/&gt;&lt;br/&gt;The WF protocol solves these problems by modifying the Lightning protocol&lt;br/&gt;as follows:&lt;br/&gt;&lt;br/&gt;* Problem 1 is solved by having the casual user pre-pay their channel&lt;br/&gt;  partner for the cost of the partner&amp;#39;s capital that&amp;#39;s tied up in the&lt;br/&gt;  channel due to the very large &amp;#34;to_self_delay&amp;#34; value. This pre-payment is&lt;br/&gt;  included in the initial channel state and is updated at least once every&lt;br/&gt;  I_L to reflect the additional cost of capital due to the partner not yet&lt;br/&gt;  going on-chain.&lt;br/&gt;&lt;br/&gt;* Problem 2 is solved by allowing casual users to designate themselves as&lt;br/&gt;  Casual-Lightning-Users (CLUs), while the remaining users are&lt;br/&gt;  Dedicated-Lightning-Users (DLUs). CLUs can only partner with DLUs to&lt;br/&gt;  open channels, such channels must be unannounced, and CLUs must not&lt;br/&gt;  route (as opposed to send or receive) payments. These constraints fit&lt;br/&gt;  naturally with the desires of casual users who want to send and receive&lt;br/&gt;  their Lightning payments, but not route payments for others. Support for&lt;br/&gt;  CLUs is analogous to support for SPV (Simplified-Payment-Verification)&lt;br/&gt;  nodes in Bitcoin.&lt;br/&gt;&lt;br/&gt;* Problem 3 is solved by modifying both users&amp;#39; Commitment transactions in&lt;br/&gt;  the channel that sends the payment so the CLU can be offline for nearly&lt;br/&gt;  I_L without forcing their DLU partner to go on-chain. A simple approach&lt;br/&gt;  would be to delay the expiry of the HTLC for each payment in the sending&lt;br/&gt;  channel by I_L. This approach works, but it has the downside of delaying&lt;br/&gt;  (by I_L) the CLU&amp;#39;s ability to force production of a payment receipt. A&lt;br/&gt;  better approach is to add a relative delay before the CLU can time out&lt;br/&gt;  the HTLC output of a Commitment transaction, thus enabling the DLU to&lt;br/&gt;  safely stay off-chain even after the expiry of the HTLC. That&amp;#39;s the&lt;br/&gt;  approach taken here.&lt;br/&gt;&lt;br/&gt;Let Alice be a CLU who shares a channel with DLU Bob. Bob sets his channel&lt;br/&gt;parameters as he would in the current Lightning protocol, while Alice sets&lt;br/&gt;her &amp;#34;to_self_delay&amp;#34; parameter (controlling Bob&amp;#39;s payments to himself) to&lt;br/&gt;I_L greater than it would be in the current Lightning protocol. Consider&lt;br/&gt;the case where Alice sends a Lightning payment on the channel she shares&lt;br/&gt;with Bob.&lt;br/&gt;&lt;br/&gt;Let:&lt;br/&gt;  - eAB denote the expiry for this payment in the channel shared by Alice&lt;br/&gt;    and Bob,&lt;br/&gt;  - tsdA denote the &amp;#34;to_self_delay&amp;#34; parameter set by Alice, and&lt;br/&gt;  - tsdB denote the &amp;#34;to_self_delay&amp;#34; parameter set by Bob.&lt;br/&gt;&lt;br/&gt;Three changes are made relative to the current Lightning protocol:&lt;br/&gt;  - a relative delay of tsdB is enforced before Alice can spend the HTLC&lt;br/&gt;    output for this payment in either Commitment transaction,&lt;br/&gt;  - after eAB, only Alice&amp;#39;s (rather than both parties&amp;#39;) signature is&lt;br/&gt;    required to spend the HTLC output in Alice&amp;#39;s Commitment transaction,&lt;br/&gt;    and that output doesn&amp;#39;t need to be spent using an HTLC-timeout&lt;br/&gt;    transaction that can be revoked (because the relative delay added&lt;br/&gt;    above guarantees Bob can prevent Alice from spending the HTLC output&lt;br/&gt;    in a revoked Commitment transaction that she puts on-chain), and&lt;br/&gt;  - both parties update the channel state off-chain at least once every&lt;br/&gt;    I_L to reflect Bob&amp;#39;s cost of capital, as described above.&lt;br/&gt;&lt;br/&gt;The resulting protocol, with a single payment from Alice outstanding, is&lt;br/&gt;shown below:&lt;br/&gt;&lt;br/&gt;&#43;-&#43; AB      &#43;----&#43; A&lt;br/&gt;|F|----&#43;---&amp;gt;| CC |---&amp;gt;&lt;br/&gt;&#43;-&#43;    |    |    |&lt;br/&gt;       .    |    | B&lt;br/&gt;       .    |    |---&amp;gt;&lt;br/&gt;       .    &#43;----&#43;&lt;br/&gt;       |&lt;br/&gt;       |&lt;br/&gt;       |              revkeyBi&lt;br/&gt;       |            &#43;----------&amp;gt;&lt;br/&gt;       |            |&lt;br/&gt;       |    &#43;----&#43;  | tsdB &amp;amp; A&lt;br/&gt;       &#43;---&amp;gt;|C_Ai|--&#43;----------&amp;gt;&lt;br/&gt;       |    |    |&lt;br/&gt;       |    |    |    B&lt;br/&gt;       |    |    |-------------&amp;gt;&lt;br/&gt;       |    |    |&lt;br/&gt;       |    |    |    revkeyBi&lt;br/&gt;       |    |    |  &#43;----------&amp;gt;&lt;br/&gt;       |    |    |  |&lt;br/&gt;       |    |    |  | tsdB &amp;amp; (eAB) &amp;amp; A&lt;br/&gt;       |    |    |--&#43;-------------------&amp;gt;&lt;br/&gt;       |    &#43;----&#43;  |&lt;br/&gt;       |            | Preimage(X) &amp;amp; B&lt;br/&gt;       |            &#43;-------------------&amp;gt;&lt;br/&gt;       |&lt;br/&gt;       |&lt;br/&gt;       |&lt;br/&gt;       |              revkeyAi&lt;br/&gt;       |            &#43;----------&amp;gt;&lt;br/&gt;       |            |&lt;br/&gt;       |    &#43;----&#43;  | tsdA &amp;amp; B&lt;br/&gt;       &#43;---&amp;gt;|C_Bi|--&#43;----------&amp;gt;&lt;br/&gt;       |    |    |&lt;br/&gt;       |    |    |    A&lt;br/&gt;       |    |    |-------------&amp;gt;&lt;br/&gt;       |    |    |&lt;br/&gt;       |    |    |    revkeyAi&lt;br/&gt;       |    |    |  &#43;----------&amp;gt;&lt;br/&gt;       .    |    |  |&lt;br/&gt;       .    |    |  | tsdB &amp;amp; (eAB) &amp;amp; A              revkeyAi&lt;br/&gt;       .    |    |--&#43;-------------------&amp;gt;         &#43;----------&amp;gt;&lt;br/&gt;       |    &#43;----&#43;  |                             |&lt;br/&gt;       |            | Preimage(X) &amp;amp; AB   &#43;-----&#43;  | tsdA &amp;amp; B&lt;br/&gt;       V            &#43;-------------------&amp;gt;|Hs_Bi|--&#43;----------&amp;gt;&lt;br/&gt;                                         &#43;-----&#43;&lt;br/&gt;&lt;br/&gt;where:&lt;br/&gt;F is the Funding transaction,&lt;br/&gt;CC is the Cooperative Close transaction,&lt;br/&gt;C_Ai is Alice&amp;#39;s Commitment transaction for state i,&lt;br/&gt;C_Bi is Bob&amp;#39;s Commitment transaction for state i, and&lt;br/&gt;Hs_Bi is Bob&amp;#39;s HTLC-success transaction for state i.&lt;br/&gt;&lt;br/&gt;The F transaction is on-chain, while the remaining transactions are&lt;br/&gt;off-chain during normal protocol operation.&lt;br/&gt;&lt;br/&gt;Requirements for output cases are as follows:&lt;br/&gt;A: Alice&amp;#39;s signature,&lt;br/&gt;B: Bob&amp;#39;s signature,&lt;br/&gt;AB: Alice&amp;#39;s and Bob&amp;#39;s signatures,&lt;br/&gt;revkeyAi: a signature using a revocation key that Alice can use to revoke&lt;br/&gt;          Bob&amp;#39;s state i transaction,&lt;br/&gt;revkeyBi: a signature using a revocation key that Bob can use to revoke&lt;br/&gt;          Alice&amp;#39;s state i transaction,&lt;br/&gt;tsdA: a relative delay equal to Alice&amp;#39;s to_self_delay parameter,&lt;br/&gt;tsdB: a relative delay equal to Bob&amp;#39;s to_self_delay parameter,&lt;br/&gt;(eAB): an absolute timelock equal to the expiry of the outstanding HTLC&lt;br/&gt;       offered by Alice, and&lt;br/&gt;Preimage(X): the hash preimage of X.&lt;br/&gt;&lt;br/&gt;Once Bob knows Preimage(X), he sends Preimage(X) to Alice and attempts to&lt;br/&gt;update both parties&amp;#39; Commitment transactions to show payment of the HTLC.&lt;br/&gt;If he has spent I_L time unsuccessfully trying to update those Commitment&lt;br/&gt;transactions, he can submit his Commitment and HTLC-success transactions&lt;br/&gt;to the blockchain. If at any point he sees Alice&amp;#39;s Commitment transaction&lt;br/&gt;on-chain, he stops trying to update the Commitment transactions off-chain&lt;br/&gt;and he puts his transaction that reveals Preimage(X) and spends the HTLC&lt;br/&gt;output in her Commitment transaction on-chain as soon as possible.&lt;br/&gt;&lt;br/&gt;Alice implements the WF channel protocol as she would the current&lt;br/&gt;Lightning channel protocol, except:&lt;br/&gt; - she can choose to be intentionally unavailable, provided she is&lt;br/&gt;   available (or at least not intentionally unavailable) for at least I_S&lt;br/&gt;   every I_L (to update her pre-payment for Bob&amp;#39;s cost of capital and to&lt;br/&gt;   revoke any old transactions put on-chain by Bob), and&lt;br/&gt; - she does not put her Commitment transaction on-chain until she has&lt;br/&gt;   been available (or at least not intentionally unavailable) for at least&lt;br/&gt;   a grace period of G following the expiry of her offered HTLC (where G&lt;br/&gt;   is the same grace period as is used in the current Lightning protocol&lt;br/&gt;   and G &amp;lt;= I_S).&lt;br/&gt;&lt;br/&gt;Correctness&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;When Alice sends a payment on the channel she shares with Bob, the WF&lt;br/&gt;protocol matches the Lightning protocol except the parties stay off-chain&lt;br/&gt;longer with the WF protocol (to accommodate Alice&amp;#39;s intentional&lt;br/&gt;unavailability). Staying off-chain longer is safe for Alice, as she&lt;br/&gt;originated the payment and thus does not have to time out the HTLC at any&lt;br/&gt;specific time in order receive payment in an earlier hop. Staying&lt;br/&gt;off-chain longer is also safe for Bob, because whenever Alice&amp;#39;s (or Bob&amp;#39;s)&lt;br/&gt;Commitment transaction is put on-chain, the tsdB relative delay before&lt;br/&gt;Alice can time out the HTLC output is long enough to allow Bob to put his&lt;br/&gt;transaction on-chain that takes payment for the HTLC.&lt;br/&gt;&lt;br/&gt;Finally, the WF protocol requires that Alice and Bob stay off-chain long&lt;br/&gt;enough to guarantee that Alice will be available (or at least not&lt;br/&gt;intentionally unavailable) for at least G, which is sufficient for both&lt;br/&gt;parties to update the channel state off-chain. As a result, if both&lt;br/&gt;parties follow the protocol, the channel will remain off-chain despite&lt;br/&gt;Alice&amp;#39;s intentional unavailability.&lt;br/&gt;&lt;br/&gt;A more detailed proof of correctness is given in the paper [5].&lt;br/&gt;&lt;br/&gt;One-Shot Receives&lt;br/&gt;=================&lt;br/&gt;&lt;br/&gt;While eliminating watchtowers is helpful for casual users, the protocol&lt;br/&gt;for receiving Lightning payments could still be awkward for such users.&lt;br/&gt;With the current Lightning protocol, when a user receives a payment and&lt;br/&gt;their channel partner is unresponsive, the user must submit their&lt;br/&gt;Commitment and HTLC-success transactions to the blockchain. However, if&lt;br/&gt;their partner&amp;#39;s conflicting Commitment transaction wins the race and is&lt;br/&gt;included in the blockchain, the user then has to submit a different&lt;br/&gt;transaction that reveals the HTLC&amp;#39;s secret and spends the HTLC output in&lt;br/&gt;their partner&amp;#39;s Commitment transaction. The requirement to wait and check&lt;br/&gt;the blockchain for the winning Commitment transaction (which might not be&lt;br/&gt;determined until multiple blocks have been added to the blockchain) is&lt;br/&gt;awkward for a casual user. It would be far preferable if the casual user&lt;br/&gt;could always receive a payment by performing a sequence of off-chain&lt;br/&gt;message exchanges and at most one submission to the blockchain. A protocol&lt;br/&gt;that has this property will be said to support &amp;#34;one-shot receives&amp;#34;.&lt;br/&gt;&lt;br/&gt;The WF protocol can be made to support one-short receives (and to simplify&lt;br/&gt;the process of getting a receipt) for CLU Alice by making the following&lt;br/&gt;change whenever a new Commitment transaction for DLU Bob is signed by&lt;br/&gt;Alice:&lt;br/&gt; - if Bob has one or more outstanding HTLCs offered to Alice, the&lt;br/&gt;   nLocktime field of Bob&amp;#39;s Commitment transaction is set to the expiry of&lt;br/&gt;   the earliest such HTLC,&lt;br/&gt; - otherwise, the nLocktime field of Bob&amp;#39;s Commitment transaction is set&lt;br/&gt;   to I_L in the future (relative to when Bob&amp;#39;s Commitment transaction is&lt;br/&gt;   signed by Alice).&lt;br/&gt;&lt;br/&gt;Before examining how this change supports one-shot receives, it&amp;#39;s&lt;br/&gt;important to resolve a technical issue. In the current Lightning protocol,&lt;br/&gt;the nLocktime field in the Commitment transaction provides 24 bits of the&lt;br/&gt;channel&amp;#39;s state number in order to allow efficient revocation of old&lt;br/&gt;on-chain Commitments (with the remaining 24 bits being provided by the&lt;br/&gt;nSequence field of the Commitment transaction&amp;#39;s sole input). Because we&amp;#39;re&lt;br/&gt;now using the nLocktime field to enforce an absolute timelock, those 24&lt;br/&gt;bits of state number can no longer be encoded in the nLocktime field.&lt;br/&gt;There are two solutions to this problem:&lt;br/&gt; - add a second input to Bob&amp;#39;s Commitment transaction that spends a UTXO&lt;br/&gt;   owned by Bob (the value of which is arbitrary and is refunded to Bob in&lt;br/&gt;   the Commitment transaction) and use the nSequence field of that input&lt;br/&gt;   to encode 24 bits of state number, or&lt;br/&gt; - support only 24-bit state numbers, as 16 million channel states are&lt;br/&gt;   likely sufficient for most casual users.&lt;br/&gt;&lt;br/&gt;In addition, the following constraints are added in order to guarantee&lt;br/&gt;one-shot receives:&lt;br/&gt;1. Whenever a new HTLC is offered to Alice, its expiry is set to exactly&lt;br/&gt;   her min_final_cltv_expiry parameter in the future. This constraint&lt;br/&gt;   guarantees that new HTLCs have expiries that are monotonically&lt;br/&gt;   nondecreasing.&lt;br/&gt;2. Whenever Alice gives Bob a secret for an HTLC, that HTLC has the&lt;br/&gt;   earliest expiry of all the HTLCs in Alice&amp;#39;s current Commitment&lt;br/&gt;   transaction.&lt;br/&gt;3. Whenever a new channel state i&#43;1 is created, Alice&amp;#39;s partial signature&lt;br/&gt;   for Bob&amp;#39;s Commitment transaction for state i&#43;1 is given to Bob, and the&lt;br/&gt;   revocation key for Bob&amp;#39;s Commitment transaction for state i is given to&lt;br/&gt;   Alice, before Bob&amp;#39;s partial signature for Alice&amp;#39;s Commitment&lt;br/&gt;   transaction for state i&#43;1 is given to Alice.&lt;br/&gt;&lt;br/&gt;Given these constraints and the setting of the nLocktime field in Bob&amp;#39;s&lt;br/&gt;Commitment transaction, Alice can always put her Commitment transaction&lt;br/&gt;on-chain before Bob can put a conflicting current Commitment transaction&lt;br/&gt;on-chain, thus providing one-shot receives. The details are provided in&lt;br/&gt;the paper [5].&lt;br/&gt;&lt;br/&gt;Finally, it&amp;#39;s important to verify that the delay of Bob&amp;#39;s Commitment&lt;br/&gt;transaction (caused by the setting of its nLocktime field) does not create&lt;br/&gt;any problems for Bob. First, for HTLCs offered to Alice (that is, payments&lt;br/&gt;received by Alice), the current Lightning protocol requires that Bob wait&lt;br/&gt;until after the expiry of his offered HTLC before he goes on-chain with&lt;br/&gt;his Commitment and HTLC-timeout transactions. Therefore, the nLocktime&lt;br/&gt;field has no impact on Bob&amp;#39;s actions regarding HTLCs offered to Alice.&lt;br/&gt;Second, for HTLCs offered by Alice (that is, payments sent by Alice), the&lt;br/&gt;WF protocol does not force Bob to put his Commitment and associated&lt;br/&gt;HTLC-success transactions on-chain before any specific time in order&lt;br/&gt;guarantee the success of any HTLCs. As a result, Bob&amp;#39;s ability to force&lt;br/&gt;payment for HTLCs offered by Alice is unaffected by the nLocktime field in&lt;br/&gt;his Commitment transactions. Note that the Lightning protocol does&lt;br/&gt;require Bob to put his Commitment and associated HTLC-success transactions&lt;br/&gt;on-chain by a specific time, which is why the changes described here&lt;br/&gt;cannot be made to the Lightning protocol to support one-shot receives.&lt;br/&gt;&lt;br/&gt;Getting A Payment Receipt&lt;br/&gt;=========================&lt;br/&gt;&lt;br/&gt;Consider again the case where casual user Alice has offered an HTLC to&lt;br/&gt;Bob. At any time after the expiry of the HTLC, if Alice needs to get a&lt;br/&gt;payment receipt and Bob is uncooperative, Alice can put her Commitment&lt;br/&gt;transaction on-chain and then attempt to spend the HTLC output of her&lt;br/&gt;Commitment transaction tsdB later. As was shown above, she is guaranteed&lt;br/&gt;to win the race in putting her Commitment transaction on-chain due to the&lt;br/&gt;nLocktime field in Bob&amp;#39;s Commitment transaction. Therefore, she will&lt;br/&gt;either get her receipt before she is able to spend the HTLC output or she&lt;br/&gt;will not have to make her payment (because she succeeded in spending the&lt;br/&gt;HTLC output). This procedure for getting a payment receipt isn&amp;#39;t one-shot&lt;br/&gt;and may be awkward for casual users. Fortunately, it&amp;#39;s only required when&lt;br/&gt;there&amp;#39;s both a payment dispute (or other need to get a receipt quickly)&lt;br/&gt;and an uncooperative channel partner.&lt;br/&gt;&lt;br/&gt;Asynchronous Payments&lt;br/&gt;=====================&lt;br/&gt;&lt;br/&gt;The WF protocol gives significant flexibility to when CLUs have to be&lt;br/&gt;online, but it still requires that the sender and receiver are both online&lt;br/&gt;simultaneously. This requirement can be eliminated by keeping the relative&lt;br/&gt;delay but removing the absolute delay in Alice&amp;#39;s transaction that times&lt;br/&gt;out an HTLC for a payment that she initiates. The details are given in the&lt;br/&gt;paper [5].&lt;br/&gt;&lt;br/&gt;Related Work&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;The protocol presented here is based extensively on previously-published&lt;br/&gt;work, namely the Poon-Dryja Lightning channel protocol [1] and the BOLT&lt;br/&gt;specifications [2]. The asynchronous payments protocol is based on&lt;br/&gt;Corallo&amp;#39;s proposal for sending tips to an offline receiver [3], but&lt;br/&gt;differs by using only a relative delay in the sender&amp;#39;s HTLC.&lt;br/&gt;&lt;br/&gt;The idea of eliminating watchtowers for a casual user by delaying their&lt;br/&gt;partner&amp;#39;s ability to put transactions on-chain was described by Law [4],&lt;br/&gt;but the interaction of that delay with HTLCs was not analyzed and that&lt;br/&gt;paper assumed modifications to the underlying Bitcoin protocol.&lt;br/&gt;&lt;br/&gt;Conclusions&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;This post presents the idea of dividing users into Casual-Lightning-Users&lt;br/&gt;(CLUs) that only send and receive payments, and Dedicated-Lightning-Users&lt;br/&gt;(DLUs) that can also route payments. It gives a new protocol that allows&lt;br/&gt;casual users to send and receive Lightning payments in a trust-free manner&lt;br/&gt;without requiring a watchtower service. It also allows CLUs to receive&lt;br/&gt;payments in a one-shot manner (that is, without having to wait for blocks&lt;br/&gt;to be added to the blockchain). No changes to the Bitcoin protocol are&lt;br/&gt;required.&lt;br/&gt;&lt;br/&gt;The new protocol does have some disadvantages, such as increasing the cost&lt;br/&gt;of capital for DLUs that partner with CLUs and increasing the latency for&lt;br/&gt;CLUs to get payment receipts from uncooperative partners. Hopefully, the&lt;br/&gt;elimination of watchtowers for casual users, and their ability to do&lt;br/&gt;one-shot receives, will more than make up for these drawbacks.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m not an expert in the area, so I might have missed something.&lt;br/&gt;&lt;br/&gt;Corrections and comments are greatly appreciated.&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;John&lt;br/&gt;&lt;br/&gt;References&lt;br/&gt;==========&lt;br/&gt;&lt;br/&gt;[1] Poon and Dryja, The Bitcoin Lightning Network, available at&lt;br/&gt;    &lt;a href=&#34;https://lightning.network/lightning-network-paper.pdf&#34;&gt;https://lightning.network/lightning-network-paper.pdf&lt;/a&gt;.&lt;br/&gt;[2] BOLT specifications, available at&lt;br/&gt;    &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc&#34;&gt;https://github.com/lightningnetwork/lightning-rfc&lt;/a&gt;.&lt;br/&gt;[3] Corallo, A Mobile Lightning User Goes to Pay a Mobile Lightning&lt;br/&gt;    User..., available at &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-October/003307.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-October/003307.html&lt;/a&gt;.&lt;br/&gt;[4] Law, Section 3.6 of Scaling Bitcoin With Inherited IDs, available at&lt;br/&gt;    &lt;a href=&#34;https://github.com/JohnLaw2/btc-iids&#34;&gt;https://github.com/JohnLaw2/btc-iids&lt;/a&gt;.&lt;br/&gt;[5] Law, Watchtower-Free Lightning Channels For Casual Users, available at&lt;br/&gt;    &lt;a href=&#34;https://github.com/JohnLaw2/ln-watchtower-free&#34;&gt;https://github.com/JohnLaw2/ln-watchtower-free&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Sent with [Proton Mail](&lt;a href=&#34;https://proton.me/&#34;&gt;https://proton.me/&lt;/a&gt;) secure email.&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/20221003/ee49228d/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221003/ee49228d/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:06:58&#43;02:00</updated>
  </entry>

</feed>