<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>2023-06-09T12:15:33Z</updated>
  <generator>https://njump.me</generator>

  <title>Nostr notes by Johan Torås Halseth [ARCHIVE]</title>
  <author>
    <name>Johan Torås Halseth [ARCHIVE]</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://njump.me/npub1ppn2nhlfdzkw9gw0ytljpef5dpyzsxzw8ffcyykamt32hw6pge0smhs2fw.rss" />
  <link href="https://njump.me/npub1ppn2nhlfdzkw9gw0ytljpef5dpyzsxzw8ffcyykamt32hw6pge0smhs2fw" />
  <id>https://njump.me/npub1ppn2nhlfdzkw9gw0ytljpef5dpyzsxzw8ffcyykamt32hw6pge0smhs2fw</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://njump.me/nevent1qqs8hjwq37smcwa8ytdce0jfespprfwl9utta0gf77ntg77tp6qfxaqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9755q4vm</id>
    
      <title type="html">📅 Original date posted:2023-09-29 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs8hjwq37smcwa8ytdce0jfespprfwl9utta0gf77ntg77tp6qfxaqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9755q4vm" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqspqzyuyf20tngfpjsgt2pwflnz5t8qv54cuk3d4e6y6hm9et9ucjszdk6vn&#39;&gt;nevent1q…k6vn&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-09-29&lt;br/&gt;🗒️ Summary of this message: The author has implemented the MATT challenge protocol in Bitcoin Script and provides a detailed description and instructions on how to run the code. They propose using OP_CHECKCONTRACTVERIFY and OP_CAT opcodes to trace program execution and challenge computations. The next steps involve creating a generic framework for compiling high-level programs into MATT-compatible Bitcoin Scripts.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, all!&lt;br/&gt;&lt;br/&gt;I&amp;#39;ve been working on an implementation of the original MATT challenge&lt;br/&gt;protocol[0], with a detailed description of how we go from a&lt;br/&gt;&amp;#34;high-level arbitrary program&amp;#34; to something that can be verified&lt;br/&gt;on-chain in Bitcoin Script.&lt;br/&gt;&lt;br/&gt;You can find the write-up here, which also includes instructions of&lt;br/&gt;how to run the code and inspect the transactions using a local block&lt;br/&gt;explorer: &lt;a href=&#34;https://github.com/halseth/mattlab/blob/main/docs/challenge.md&#34;&gt;https://github.com/halseth/mattlab/blob/main/docs/challenge.md&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;TLDR; Using the proposed opcode OP_CHECKCONTRACTVERIFY and OP_CAT, we&lt;br/&gt;show to trace execution of the program `multiply` [1] and challenge&lt;br/&gt;this computation in O(n logn) on-chain transactions:&lt;br/&gt;&lt;br/&gt;func multiply(x int) int {&lt;br/&gt;    i := 0&lt;br/&gt;    while {&lt;br/&gt;        if i &amp;lt; 8 {&lt;br/&gt;            x = x &#43; x&lt;br/&gt;            i = i &#43; 1&lt;br/&gt;        } else {&lt;br/&gt;            break&lt;br/&gt;        }&lt;br/&gt;    }&lt;br/&gt;    return x&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Next steps would be to make this a generic framework with tools to&lt;br/&gt;automatically compile arbitrary high-level programs down to&lt;br/&gt;MATT-compatible Bitcoin Scripts.&lt;br/&gt;&lt;br/&gt;All feedback appreciated!&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;[0] &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html&lt;/a&gt;&lt;br/&gt;[1] &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021205.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021205.html&lt;/a&gt;
    </content>
    <updated>2023-10-03T21:44:19Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsd5n8hf87hmrjugc6hm8prx3a3kultch2yuert9cjewr5ec45cvmgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97675lzf</id>
    
      <title type="html">📅 Original date posted:2023-08-07 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsd5n8hf87hmrjugc6hm8prx3a3kultch2yuert9cjewr5ec45cvmgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97675lzf" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9ax7ghe58nmq92l7fy3pmc8qpqfwgx7aj58a4745v7gwwpc0jx7c50t60e&#39;&gt;nevent1q…t60e&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-08-07&lt;br/&gt;🗒️ Summary of this message: The sender thanks Salvatore for the update on taptree verification and offers suggestions on the proposal, including opcode parameter ordering and the deferred amount check.&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Salvatore.&lt;br/&gt;&lt;br/&gt;Thanks for the update! I like the fact that taptree verification now&lt;br/&gt;can be done on both input and outputs, and having them be symmetrical&lt;br/&gt;also makes the learning curve a bit easier.&lt;br/&gt;&lt;br/&gt;I have implemented the updated opcodes in btcd (very rough&lt;br/&gt;implementation)]1] as well as updated the example scripts for&lt;br/&gt;simulating CTV[2] and Coinpools[3].&lt;br/&gt;&lt;br/&gt;&amp;gt;From doing this I would again like to offer some suggestions on the proposal.&lt;br/&gt;&lt;br/&gt;- For the opcode parameter ordering, it feels unnatural for the two&lt;br/&gt;tweaks (data, taptree) to be separated by the internal key. A more&lt;br/&gt;natural ordering of parameters IMO would be (of course this is all&lt;br/&gt;subjective):&lt;br/&gt;&amp;lt;data&amp;gt; &amp;lt;taptree&amp;gt; &amp;lt;internalkey&amp;gt; &amp;lt;index&amp;gt; &amp;lt;flags&amp;gt; OP_CCV.&lt;br/&gt;&lt;br/&gt;If you disagree, I would love some rationale for the ordering you&lt;br/&gt;chose! (looks like you also changed it again after your last post?).&lt;br/&gt;&lt;br/&gt;- The deferred amount check seems a bit out of place, and insufficient&lt;br/&gt;at least for the use cases I had in mind. They work well in a vault&lt;br/&gt;setting, where you want to consolidate many outputs into a single new&lt;br/&gt;one, and in 1-input-1-output settings where you want to preserve the&lt;br/&gt;amount exactly. However, for coinpools, CTV with more than one output&lt;br/&gt;and other interesting contracts where you want to split or combine&lt;br/&gt;amounts it won&amp;#39;t be powerful enough.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m wondering what other use cases you had in mind for the deferred&lt;br/&gt;output amount check? Maybe I have missed something, but if not it&lt;br/&gt;would perhaps be better to leave out the amount preservation check, or&lt;br/&gt;go the extra mile and propose a more powerful amount introspection&lt;br/&gt;machinery.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;[1] - &lt;a href=&#34;https://github.com/halseth/btcd/pull/1&#34;&gt;https://github.com/halseth/btcd/pull/1&lt;/a&gt;&lt;br/&gt;[2] - &lt;a href=&#34;https://github.com/halseth/tapsim/blob/8f4ac4d914fde0847c72cd22bdd45a1b7247cadf/examples/matt/ctv2/README.md&#34;&gt;https://github.com/halseth/tapsim/blob/8f4ac4d914fde0847c72cd22bdd45a1b7247cadf/examples/matt/ctv2/README.md&lt;/a&gt;&lt;br/&gt;[3] - &lt;a href=&#34;https://github.com/halseth/tapsim/blob/8f4ac4d914fde0847c72cd22bdd45a1b7247cadf/examples/matt/coinpool/README.md&#34;&gt;https://github.com/halseth/tapsim/blob/8f4ac4d914fde0847c72cd22bdd45a1b7247cadf/examples/matt/coinpool/README.md&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sun, Jul 30, 2023 at 11:51 PM Salvatore Ingala via bitcoin-dev&lt;br/&gt;&amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I have put together a first complete proposal for the core opcodes of&lt;br/&gt;&amp;gt; MATT [1][2].&lt;br/&gt;&amp;gt; The changes make the opcode functionally complete, and the&lt;br/&gt;&amp;gt; implementation is revised and improved.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The code is implemented in the following fork of the&lt;br/&gt;&amp;gt; bitcoin-inquisition repo:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/Merkleize/bitcoin/tree/checkcontractverify&#34;&gt;https://github.com/Merkleize/bitcoin/tree/checkcontractverify&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Therefore, it also includes OP_CHECKTEMPLATEVERIFY, as in a&lt;br/&gt;&amp;gt; previous early demo for vaults [3].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Please check out the diff [4] if you are interested in the&lt;br/&gt;&amp;gt; implementation details. It includes some basic functional tests for&lt;br/&gt;&amp;gt; the main cases of the opcode.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## Changes vs the previous draft&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; These are the changes compared to the initial incomplete proposal:&lt;br/&gt;&amp;gt; - OP_CHECK{IN,OUT}CONTRACTVERIFY are replaced by a single opcode&lt;br/&gt;&amp;gt;   OP_CHECKCONTRACTVERIFY (CCV). An additional `flags` parameter allows&lt;br/&gt;&amp;gt;   to specify if the opcode operates on an input or an output.&lt;br/&gt;&amp;gt;   This also allows inspection of other inputs, that was not possible&lt;br/&gt;&amp;gt;   with the original opcodes.&lt;br/&gt;&amp;gt; - For outputs, the default behavior is to have the following deferred&lt;br/&gt;&amp;gt;   checks mechanism for amounts: all the inputs that have a CCV towards&lt;br/&gt;&amp;gt;   the same output, have their input amounts summed, and that act as a&lt;br/&gt;&amp;gt;   lower bound for that output&amp;#39;s amount.&lt;br/&gt;&amp;gt;   A flag can disable this behavior. [*]&lt;br/&gt;&amp;gt; - A number of special values of the parameters were defined in order&lt;br/&gt;&amp;gt;   to optimize for common cases, and add some implicit introspection.&lt;br/&gt;&amp;gt; - The order of parameters is modified (particularly, &amp;lt;data&amp;gt; is at the&lt;br/&gt;&amp;gt;   bottom of the arguments, as so is more natural when writing Scripts).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## Semantics&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The new OP_CHECKCONTRACTVERIFY takes 5 parameters from the stack:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   &amp;lt;data&amp;gt;, &amp;lt;index&amp;gt;, &amp;lt;pk&amp;gt;, &amp;lt;taptree&amp;gt;, &amp;lt;flags&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The core logic of the opcode is as follows:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;#34;Check if the &amp;lt;index&amp;gt;-th input/output&amp;#39;s scriptPubKey is a P2TR&lt;br/&gt;&amp;gt; whose public key is obtained from &amp;lt;pk&amp;gt;, (optionally) tweaked with&lt;br/&gt;&amp;gt; &amp;lt;data&amp;gt;, (optionally) tap-tweaked with &amp;lt;taptree&amp;gt;&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The following are special values of the parameters:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - if &amp;lt;pk&amp;gt; is empty, it is replaced with a fixed NUMS point. [**]&lt;br/&gt;&amp;gt; - if &amp;lt;pk&amp;gt; is -1, it is replaced with the current input&amp;#39;s taproot&lt;br/&gt;&amp;gt;   internal key.&lt;br/&gt;&amp;gt; - if &amp;lt;index&amp;gt; is -1, it is replaced with the current input&amp;#39;s index.&lt;br/&gt;&amp;gt; - if &amp;lt;data&amp;gt; is empty, the data tweak is skipped.&lt;br/&gt;&amp;gt; - if &amp;lt;taptree&amp;gt; is empty, the taptweak is skipped.&lt;br/&gt;&amp;gt; - if &amp;lt;taptree&amp;gt; is -1, it is replaced with the current input&amp;#39;s root&lt;br/&gt;&amp;gt;   of the taproot merkle tree.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are two defined flags:&lt;br/&gt;&amp;gt; - CCV_FLAG_CHECK_INPUT = 1: if present, &amp;lt;index&amp;gt; refers to an input;&lt;br/&gt;&amp;gt;   otherwise, it refers to an output.&lt;br/&gt;&amp;gt; - CCV_FLAG_IGNORE_OUTPUT_AMOUNT = 2: only defined when _CHECK_INPUT&lt;br/&gt;&amp;gt;   is absent, it disables the deferred checks logic for amounts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Finally, if both the flags CCV_FLAG_CHECK_INPUT and&lt;br/&gt;&amp;gt; CCV_FLAG_IGNORE_OUTPUT_AMOUNT are absent:&lt;br/&gt;&amp;gt;   - Add the current input&amp;#39;s amount to the &amp;lt;index&amp;gt;-th output&amp;#39;s bucket.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; After the evaluation of all inputs, it is verified that each output&amp;#39;s&lt;br/&gt;&amp;gt; amount is greater than or equal to the total amount in the bucket&lt;br/&gt;&amp;gt; if that output (validation of the deferred checks).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ## Comment&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It is unclear if all the special values above will be useful in&lt;br/&gt;&amp;gt; applications; however, as each special case requires very little added&lt;br/&gt;&amp;gt; code, I tried to make the specs as flexible as possible at this time.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With this new opcode, the full generality of MATT (including the fraud&lt;br/&gt;&amp;gt; proofs) can be obtained with just two opcodes: OP_CHECKCONTRACTVERIFY&lt;br/&gt;&amp;gt; and OP_CAT.&lt;br/&gt;&amp;gt; However, additional opcodes (and additional introspection) would&lt;br/&gt;&amp;gt; surely benefit some applications.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I look forward to your comments, and to start drafting a BIP proposal.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&amp;gt; Salvatore Ingala&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [*] - Credits go to James O&amp;#39;Beirne for this approach, taken from his&lt;br/&gt;&amp;gt;       OP_VAULT proposal. I cherry-picked the commit containing the&lt;br/&gt;&amp;gt;       Deferred Checks framework.&lt;br/&gt;&amp;gt; [**] - The same NUMS point suggested in BIP-0341 was used.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; References:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] - &lt;a href=&#34;https://merkle.fun/&#34;&gt;https://merkle.fun/&lt;/a&gt;&lt;br/&gt;&amp;gt; [2] - &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021182.html&lt;/a&gt;&lt;br/&gt;&amp;gt; [3] - &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021588.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021588.html&lt;/a&gt;&lt;br/&gt;&amp;gt; [4] - &lt;a href=&#34;https://github.com/bitcoin-inquisition/bitcoin/compare/24.0...Merkleize:bitcoin:checkcontractverify&#34;&gt;https://github.com/bitcoin-inquisition/bitcoin/compare/24.0...Merkleize:bitcoin:checkcontractverify&lt;/a&gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;
    </content>
    <updated>2023-08-08T14:20:52Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsvpn7rsxf9ww2s09dlnkr0fxpnf53tsva3v9j4xj2txpeuh0kq9rgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97uwpnmp</id>
    
      <title type="html">📅 Original date posted:2022-11-07 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsvpn7rsxf9ww2s09dlnkr0fxpnf53tsva3v9j4xj2txpeuh0kq9rgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97uwpnmp" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsfcs5c6ydkq0ewkhdzzptqsee8f2pat879zhzfc5nyew3w8xc2kkga9jq6c&#39;&gt;nevent1q…jq6c&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-11-07&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Laolu,&lt;br/&gt;&lt;br/&gt;Yeah, that is definitely the main downside, as Ruben also mentioned:&lt;br/&gt;tokens are &amp;#34;burned&amp;#34; if they get sent to an already spent UTXO, and&lt;br/&gt;there is no way to block those transfers.&lt;br/&gt;&lt;br/&gt;And I do agree with your concern about losing the blockchain as the&lt;br/&gt;main synchronization point, that seems indeed to be a prerequisite for&lt;br/&gt;making the scheme safe in terms of re-orgs and asynchronicity.&lt;br/&gt;&lt;br/&gt;I do think the scheme itself is sound though (maybe not off-chain, see&lt;br/&gt;below): it prevents double spending and as long as the clients adhere&lt;br/&gt;to the &amp;#34;rule&amp;#34; of not sending to a spent UTXO you&amp;#39;ll be fine (if not&lt;br/&gt;your tokens will be burned, the same way as if you don&amp;#39;t satisfy the&lt;br/&gt;Taro script when spending).&lt;br/&gt;&lt;br/&gt;Thinking more about the examples you gave, I think you are right it&lt;br/&gt;won&amp;#39;t easily be compatible with LN channels though:&lt;br/&gt;If you want to refill an existing channel with tokens, you need the&lt;br/&gt;channel counterparties to start signing new commitments that include&lt;br/&gt;spending the newly sent tokens. A problem arises however, if the&lt;br/&gt;channel is force-closed with a pre-existing commitment from before the&lt;br/&gt;token transfer took place. Since this commitment will be spending the&lt;br/&gt;funding UTXO, but not the new tokens, the tokens will be burned. And&lt;br/&gt;that seems to be harder to deal with (Eltoo style channels could be an&lt;br/&gt;avenue to explore, if one could override the broadcasted commitment).&lt;br/&gt;&lt;br/&gt;Tl;dr: I think you&amp;#39;re right, the scheme is not compatible with LN.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sat, Nov 5, 2022 at 1:36 AM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I haven&amp;#39;t really been able to find a precise technical explanation of the&lt;br/&gt;&amp;gt; &amp;#34;utxo teleport&amp;#34; scheme, but after thinking about your example use cases a&lt;br/&gt;&amp;gt; bit, I don&amp;#39;t think the scheme is actually sound. Consider that the scheme&lt;br/&gt;&amp;gt; attempts to target transmitting &amp;#34;ownership&amp;#34; to a UTXO. However, by the time&lt;br/&gt;&amp;gt; that transaction hits the chain, the UTXO may no longer exist. At that&lt;br/&gt;&amp;gt; point, what happens to the asset? Is it burned? Can you retry it again? Does&lt;br/&gt;&amp;gt; it go back to the sender?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As a concrete example, imagine I have a channel open, and give you an&lt;br/&gt;&amp;gt; address to &amp;#34;teleport&amp;#34; some additional assets to it. You take that addr, then&lt;br/&gt;&amp;gt; make a transaction to commit to the transfer. However, the block before you&lt;br/&gt;&amp;gt; commit to the transfer, my channel closes for w/e reason. As a result, when&lt;br/&gt;&amp;gt; the transaction committing to the UTXO (blinded or not), hits the chain, the&lt;br/&gt;&amp;gt; UTXO no longer exists. Alternatively, imagine the things happen in the&lt;br/&gt;&amp;gt; expected order, but then a re-org occurs, and my channel close is mined in a&lt;br/&gt;&amp;gt; block before the transfer. Ultimately, as a normal Bitcoin transaction isn&amp;#39;t&lt;br/&gt;&amp;gt; used as a serialization point, the scheme seems to lack a necessary total&lt;br/&gt;&amp;gt; ordering to ensure safety.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we look at Taro&amp;#39;s state transition model in contrast, everything is fully&lt;br/&gt;&amp;gt; bound to a single synchronization point: a normal Bitcoin transaction with&lt;br/&gt;&amp;gt; inputs consumed and outputs created. All transfers, just like Bitcoin&lt;br/&gt;&amp;gt; transactions, end up consuming assets from the set of inputs, and&lt;br/&gt;&amp;gt; re-creating them with a different distribution with the set of outputs. As a&lt;br/&gt;&amp;gt; result, Taro transfers inherit the same re-org safety traits as regular&lt;br/&gt;&amp;gt; Bitcoin transactions. It also isn&amp;#39;t possible to send to something that won&amp;#39;t&lt;br/&gt;&amp;gt; ultimately exist, as sends create new outputs just like Bitcoin&lt;br/&gt;&amp;gt; transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Taro&amp;#39;s state transition model also means anything you can do today with&lt;br/&gt;&amp;gt; Bitcoin/LN also apply. As an example, it would be possible for you to&lt;br/&gt;&amp;gt; withdrawn from your exchange into a Loop In address (on chain to off chain&lt;br/&gt;&amp;gt; swap), and have everything work as expected, with you topping off your&lt;br/&gt;&amp;gt; channel. Stuff like splicing, and other interactive transaction construction&lt;br/&gt;&amp;gt; schemes (atomic swaps, MIMO swaps, on chain auctions, etc) also just work.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Ignoring the ordering issue I mentioned above, I don&amp;#39;t think this is a great&lt;br/&gt;&amp;gt; model for anchoring assets in channels either. With Taro, when you make the&lt;br/&gt;&amp;gt; channel, you know how many assets are committed since they&amp;#39;re all committed&lt;br/&gt;&amp;gt; to in the funding output when the channel is created. However, let&amp;#39;s say we&lt;br/&gt;&amp;gt; do teleporting instead: at which point would we recognize the new asset&lt;br/&gt;&amp;gt; &amp;#34;deposits&amp;#34;? What if we close before a pending deposits confirms, how can one&lt;br/&gt;&amp;gt; regain those funds? Once again you lose the serialization of events/actions&lt;br/&gt;&amp;gt; the blockchain provides. I think you&amp;#39;d also run into similar issues when you&lt;br/&gt;&amp;gt; start to think about how these would even be advertised on a hypothetical&lt;br/&gt;&amp;gt; gossip network.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think one other drawback of the teleport model iiuc is that: it either&lt;br/&gt;&amp;gt; requires an OP_RETURN, or additional out of band synchronization to complete&lt;br/&gt;&amp;gt; the transfer. Since it needs to commit to w/e hash description of the&lt;br/&gt;&amp;gt; teleport, it either needs to use an OP_RETURN (so the receiver can see the&lt;br/&gt;&amp;gt; on chain action), or the sender needs to contact the receiver to initiate&lt;br/&gt;&amp;gt; the resolution of the transfer (details committed to in a change addr or&lt;br/&gt;&amp;gt; w/e).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With Taro, sending to an address creates an on-chain taproot output just&lt;br/&gt;&amp;gt; like sending to a P2TR address. The creation of the output directly creates&lt;br/&gt;&amp;gt; the new asset anchor/output as well, which allows the receiver to look for&lt;br/&gt;&amp;gt; that address on chain just like a normal on chain transaction. To 3rd party&lt;br/&gt;&amp;gt; observers, it just looks like a normal P2TR transfer. In order to finalize&lt;br/&gt;&amp;gt; the receipt of the asset, the receiver needs to obtain the relevant&lt;br/&gt;&amp;gt; provenance proofs, which can be obtained from a multi-verse gRPC/HTTP&lt;br/&gt;&amp;gt; service keyed by the input outpoint and output index. In short, the send&lt;br/&gt;&amp;gt; process is fully async, with the sender and receiver using the blockchain&lt;br/&gt;&amp;gt; itself as a synchronization point like a normal Bitcoin wallet.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; -- Laolu
    </content>
    <updated>2023-06-09T13:07:16Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsduf2v58ynhrp3rcgj43sgk6pg0gt6cr74528hzlmsznymlhp9nmszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97s8630g</id>
    
      <title type="html">📅 Original date posted:2022-11-03 📝 Original message: Hi, I ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsduf2v58ynhrp3rcgj43sgk6pg0gt6cr74528hzlmsznymlhp9nmszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97s8630g" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsppvaypgcjxzdhklyplnf6spvpp6tpf863cpy55mz8knmg6dchkfcktn2yu&#39;&gt;nevent1q…n2yu&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-11-03&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi,&lt;br/&gt;&lt;br/&gt;I wanted to chime in on the &amp;#34;teleport&amp;#34; feature explained by Ruben, as I&lt;br/&gt;think exploring something similar for Taro could be super useful in an LN&lt;br/&gt;setting.&lt;br/&gt;&lt;br/&gt;In today&amp;#39;s Taro, to transfer tokens you have to spend a UTXO, and present a&lt;br/&gt;proof showing that there are tokens committed to in the output you are&lt;br/&gt;spending. Let&amp;#39;s say this UTXO is &amp;#39;utxo:0&amp;#39;.&lt;br/&gt;&lt;br/&gt;In contrast, to spend teleported tokens, you would still spend utxo:0, but&lt;br/&gt;you would only have to present a proof that _some txout_ on-chain have&lt;br/&gt;committed tokens to utxo:0.&lt;br/&gt;&lt;br/&gt;As Ruben points out, this makes it possible to send tokens to an already&lt;br/&gt;spent TXO, essentially burning the tokens.&lt;br/&gt;&lt;br/&gt;However, it opens up some exciting possibilities IMO. You can in essence&lt;br/&gt;use this to &amp;#34;re-fill&amp;#34; UTXOs with tokens, which is very interesting for LN&lt;br/&gt;channels:&lt;br/&gt;&lt;br/&gt;- You could &amp;#34;add&amp;#34; tokens to your already open channels. The only thing&lt;br/&gt;needed is for the channel participants to be presented the proof that&lt;br/&gt;tokens were sent to the funding output, and they can update their&lt;br/&gt;commitment transaction to start spending these tokens.&lt;br/&gt;- You can &amp;#34;top-up&amp;#34; all your channels in a single on-chain tx. Since a&lt;br/&gt;single output can commit tokens to several UTXOs, you could with a single&lt;br/&gt;on-chain transaction add tokens to many channels without opening and&lt;br/&gt;closing them.&lt;br/&gt;&lt;br/&gt;RGB also has the ability to &amp;#34;blind&amp;#34; the UTXO that tokens get teleported to,&lt;br/&gt;hiding the recipient UTXO. This is cool, since I could withdraw tokens from&lt;br/&gt;an exchange directly into my LN channel, without revealing my channel UTXO.&lt;br/&gt;&lt;br/&gt;I found the explanation of the teleport feature in this blog post pretty&lt;br/&gt;good:&lt;br/&gt;&lt;a href=&#34;https://medium.com/@FedericoTenga/understanding-rgb-protocol-7dc7819d3059&#34;&gt;https://medium.com/@FedericoTenga/understanding-rgb-protocol-7dc7819d3059&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sun, Apr 10, 2022 at 6:52 PM Ruben Somsen &amp;lt;rsomsen at gmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Laolu,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;happy to hear that someone was actually able to extract enough details&lt;br/&gt;&amp;gt; from the RGB devs/docs to be able to analyze it properly&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Actually, even though I eventually puzzled everything together, this did&lt;br/&gt;&amp;gt; not go well for me either. There is a ton of documentation, but it&amp;#39;s a maze&lt;br/&gt;&amp;gt; of unhelpful details, and none of it clearly maps out the fundamental&lt;br/&gt;&amp;gt; design. I was also disappointed by the poor response I received when asking&lt;br/&gt;&amp;gt; questions, and I ended up getting chastised for helping others understand&lt;br/&gt;&amp;gt; it and pointing out potential flaws[1][2][3].Given my experience, I think&lt;br/&gt;&amp;gt; the project is not in great shape, so the decision to rebuild from scratch&lt;br/&gt;&amp;gt; seems right to me.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That said, in my opinion the above should not factor into the decision of&lt;br/&gt;&amp;gt; whether RGB should be credited in the Taro documentation. The design&lt;br/&gt;&amp;gt; clearly precedes (and seems to have inspired) Taro, so in my opinion this&lt;br/&gt;&amp;gt; should be acknowledged. Also, the people that are responsible for the&lt;br/&gt;&amp;gt; current shape of RGB aren&amp;#39;t the people who originated the idea, so it would&lt;br/&gt;&amp;gt; not be fair to the originators either (Peter Todd, Alekos Filini, Giacomo&lt;br/&gt;&amp;gt; Zucco).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;assets can be burnt if a user doesn&amp;#39;t supply a valid witness&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I am in agreement with what you said, but it is not clear to me whether we&lt;br/&gt;&amp;gt; are on the same page. What I tried to say was that it does not make sense&lt;br/&gt;&amp;gt; to build scripting support into Taro, because you can&amp;#39;t actually do&lt;br/&gt;&amp;gt; anything interesting with it due to this limitation. The only type of smart&lt;br/&gt;&amp;gt; contract you can build is one where you limit what the owner (as defined by&lt;br/&gt;&amp;gt; Bitcoin&amp;#39;s script) can do with their own Taro tokens, or else he will burn&lt;br/&gt;&amp;gt; them – not very useful. Anything involving a conditional transfer of&lt;br/&gt;&amp;gt; ownership to either A or B (i.e. any meaningful type of script) won&amp;#39;t work.&lt;br/&gt;&amp;gt; Do you see what I mean, or should I elaborate further?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;TAPLEAF_UPDATE_VERIFY can actually be used to further _bind_ Taro transitions&lt;br/&gt;&amp;gt; at the Bitcoin level, without Bitcoin explicitly needing to be aware&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That is conceptually quite interesting. So theoretically you could get&lt;br/&gt;&amp;gt; Bitcoin covenants to enforce certain spending conditions on Taro assets.&lt;br/&gt;&amp;gt; Not sure how practical that ends up being, but intriguing to consider.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;asset issuer to do a &amp;#34;re-genesis&amp;#34;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, RGB suggested the same thing, and this can work under some&lt;br/&gt;&amp;gt; circumstances, but note that this won&amp;#39;t help for tokens that aim to have a&lt;br/&gt;&amp;gt; publicly audited supply, as the proof that a token was legitimately&lt;br/&gt;&amp;gt; re-issued is the history of the previous token (so you&amp;#39;d actually be making&lt;br/&gt;&amp;gt; things worse, as now everyone has to verify it). And of course the idea&lt;br/&gt;&amp;gt; also requires the issuer to be active, which may not always be the case.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;I&amp;#39;m not familiar with how the RGB &amp;#34;teleport&amp;#34; technique works [...] Can&lt;br/&gt;&amp;gt; you point me to a coherent explanation of the technique&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To my knowledge no good explanation exists. &amp;#34;Teleporting&amp;#34; is just what I&lt;br/&gt;&amp;gt; thought was a good way of describing it. Basically, in your design when&lt;br/&gt;&amp;gt; Alice wants to send a Taro token to Bob, Alice has to spend her own output,&lt;br/&gt;&amp;gt; make a new output for Bob, and make a change output for herself. Inside the&lt;br/&gt;&amp;gt; Taro tree you&amp;#39;ll then point to the index of Bob&amp;#39;s output in order to assign&lt;br/&gt;&amp;gt; the tokens to his new output. Instead of pointing to the index, you could&lt;br/&gt;&amp;gt; point to the outpoint (txid, index) of an existing UTXO owned by Bob, thus&lt;br/&gt;&amp;gt; &amp;#34;teleporting&amp;#34; the Taro tokens to this UTXO. This saves on-chain space, as&lt;br/&gt;&amp;gt; now you don&amp;#39;t have to create a new output for Bob (but now you have to&lt;br/&gt;&amp;gt; ensure Bob doesn&amp;#39;t spend from this output while you&amp;#39;re simultaneously&lt;br/&gt;&amp;gt; sending tokens to it, as I mentioned in my previous post, as this would&lt;br/&gt;&amp;gt; destroy the tokens).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The above also reminds me of another potential issue which you need to be&lt;br/&gt;&amp;gt; aware of, if you&amp;#39;re not already. Similar to my comment about how the&lt;br/&gt;&amp;gt; location of the Taro tree inside the taproot tree needs to be deterministic&lt;br/&gt;&amp;gt; for the verifier, the output in which you place the Taro tree also needs to&lt;br/&gt;&amp;gt; be. If it&amp;#39;s not, then you can commit to a different Taro tree in each&lt;br/&gt;&amp;gt; output of the transaction, allowing you to secretly fork the history.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hope this helps.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Ruben&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] &lt;a href=&#34;https://twitter.com/SomsenRuben/status/1397267261619064836&#34;&gt;https://twitter.com/SomsenRuben/status/1397267261619064836&lt;/a&gt;&lt;br/&gt;&amp;gt; [2] &lt;a href=&#34;https://twitter.com/SomsenRuben/status/1397559406565462017&#34;&gt;https://twitter.com/SomsenRuben/status/1397559406565462017&lt;/a&gt;&lt;br/&gt;&amp;gt; [3] &lt;a href=&#34;https://twitter.com/afilini/status/1397484341236797441&#34;&gt;https://twitter.com/afilini/status/1397484341236797441&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Fri, Apr 8, 2022 at 7:48 PM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (this might be a double post as it ran into the size limit)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Ruben,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks! I don&amp;#39;t really consider things final until we have a good set of&lt;br/&gt;&amp;gt;&amp;gt; test&lt;br/&gt;&amp;gt;&amp;gt; vectors in the final set, after which we&amp;#39;d start to transition the set of&lt;br/&gt;&amp;gt;&amp;gt; documents beyond the draft state.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Seeing as there&amp;#39;s a large amount of overlap with RGB, a protocol which&lt;br/&gt;&amp;gt;&amp;gt; I have&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; examined quite extensively, I believe some of the issues I uncovered in&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; project also apply here.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m happy to hear that someone was actually able to extract enough&lt;br/&gt;&amp;gt;&amp;gt; details from&lt;br/&gt;&amp;gt;&amp;gt; the RGB devs/docs to be able to analyze it properly! In the past I tried&lt;br/&gt;&amp;gt;&amp;gt; to ask&lt;br/&gt;&amp;gt;&amp;gt; their developers questions about how things like transfers worked[1][2],&lt;br/&gt;&amp;gt;&amp;gt; but it&lt;br/&gt;&amp;gt;&amp;gt; seemed either people didn&amp;#39;t know, or they hadn&amp;#39;t finished the core design&lt;br/&gt;&amp;gt;&amp;gt; (large TBD sections) as they were working on adding other components to&lt;br/&gt;&amp;gt;&amp;gt; create&lt;br/&gt;&amp;gt;&amp;gt; a &amp;#34;new new Internet&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Furthermore, the Taro script is not enforced by Bitcoin, meaning those&lt;br/&gt;&amp;gt;&amp;gt; who&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; control the Bitcoin script can always choose to ignore the Taro script&lt;br/&gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; destroy the Taro assets as a result.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is correct, as a result in most contexts, an incentive exists for the&lt;br/&gt;&amp;gt;&amp;gt; holder of an asset to observe the Taro validation rules as otherwise,&lt;br/&gt;&amp;gt;&amp;gt; their&lt;br/&gt;&amp;gt;&amp;gt; assets are burnt in the process from the PoV of asset verifiers. In the&lt;br/&gt;&amp;gt;&amp;gt; single&lt;br/&gt;&amp;gt;&amp;gt; party case things are pretty straight forward, but more care needs to be&lt;br/&gt;&amp;gt;&amp;gt; taken&lt;br/&gt;&amp;gt;&amp;gt; in cases where one attempts to express partial application and permits&lt;br/&gt;&amp;gt;&amp;gt; anyone&lt;br/&gt;&amp;gt;&amp;gt; to spend a UTXO in question.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; By strongly binding all assets to Bitcoin UTXOs, we resolve issues&lt;br/&gt;&amp;gt;&amp;gt; related to&lt;br/&gt;&amp;gt;&amp;gt; double spending or duplicate assets, but needs to mind the fact that&lt;br/&gt;&amp;gt;&amp;gt; assets can&lt;br/&gt;&amp;gt;&amp;gt; be burnt if a user doesn&amp;#39;t supply a valid witness. There&amp;#39;re likely ways&lt;br/&gt;&amp;gt;&amp;gt; to get&lt;br/&gt;&amp;gt;&amp;gt; around this by lessening the binding to Bitcoin UTXO&amp;#39;s, but then the&lt;br/&gt;&amp;gt;&amp;gt; system&lt;br/&gt;&amp;gt;&amp;gt; would need to be able to collect, retain and order all the set of possible&lt;br/&gt;&amp;gt;&amp;gt; spends, essentially requiring a parallel network. The core of the system&lt;br/&gt;&amp;gt;&amp;gt; as it&lt;br/&gt;&amp;gt;&amp;gt; stands today is pretty simple (which was an explicit design goal to avoid&lt;br/&gt;&amp;gt;&amp;gt; getting forever distracted by the large design space), with a minimal&lt;br/&gt;&amp;gt;&amp;gt; implementation being relatively compact given all the Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; context/design&lt;br/&gt;&amp;gt;&amp;gt; re-use.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Also one cool trait of the way commitments are designed is that the Taro&lt;br/&gt;&amp;gt;&amp;gt; commitment impact the final derived taproot output key. As a result,&lt;br/&gt;&amp;gt;&amp;gt; potential&lt;br/&gt;&amp;gt;&amp;gt; Script extensions like TAPLEAF_UPDATE_VERIFY can actually be used to&lt;br/&gt;&amp;gt;&amp;gt; further&lt;br/&gt;&amp;gt;&amp;gt; _bind_ Taro transitions at the Bitcoin level, without Bitcoin explicitly&lt;br/&gt;&amp;gt;&amp;gt; needing to be aware of the Taro rules. In short, covenants can allow&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; Script to bind Taro state transitions, without any of the logic bleeding&lt;br/&gt;&amp;gt;&amp;gt; over,&lt;br/&gt;&amp;gt;&amp;gt; as the covenant just checks for a certain output key, which is a function&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt; the Taro commitment being present.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; There are two possible designs here: a.) The token history remains&lt;br/&gt;&amp;gt;&amp;gt; separate –&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Dave receives Alice&amp;#39;s 2 tokens, Bob&amp;#39;s tokens are split and he receives&lt;br/&gt;&amp;gt;&amp;gt; 2 (or&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 3 from Bob 1 from Alice).  b.) The token history gets merged – Dave&lt;br/&gt;&amp;gt;&amp;gt; receives&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 4 tokens (linking the new output with both Alice and Bob&amp;#39;s history).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Mechanically, with respect to the way the change/UTXOs work in the&lt;br/&gt;&amp;gt;&amp;gt; system, both&lt;br/&gt;&amp;gt;&amp;gt; are expressible: Dave can chose to merge them into a single UTXO (with the&lt;br/&gt;&amp;gt;&amp;gt; appropriate witnesses included for each of them), or Dave can keep them&lt;br/&gt;&amp;gt;&amp;gt; distinct in the asset tree. You&amp;#39;re correct in that asset issuers may opt&lt;br/&gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt; issue assets in denominations vs allowing them to be fully divisible.&lt;br/&gt;&amp;gt;&amp;gt; Ultimately, the compatibility with the LN layer will be the primary way&lt;br/&gt;&amp;gt;&amp;gt; to keep&lt;br/&gt;&amp;gt;&amp;gt; asset histories compressed, without relying on another trust model, or&lt;br/&gt;&amp;gt;&amp;gt; relying&lt;br/&gt;&amp;gt;&amp;gt; on the incentive of an asset issuer to do a &amp;#34;re-genesis&amp;#34; which would&lt;br/&gt;&amp;gt;&amp;gt; effectively re-create assets in a supply-preserving manner (burn N units,&lt;br/&gt;&amp;gt;&amp;gt; then&lt;br/&gt;&amp;gt;&amp;gt; produce a new genesis outpoint for N units). Alternatively,&lt;br/&gt;&amp;gt;&amp;gt; implementations can&lt;br/&gt;&amp;gt;&amp;gt; also chose to utilize a checkpointing system similar to what some Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; full&lt;br/&gt;&amp;gt;&amp;gt; node clients do today.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;  is that you end up with a linked transaction graph, just like in&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is correct, the protocol doesn&amp;#39;t claim to achieve better privacy&lt;br/&gt;&amp;gt;&amp;gt; guarantees than the base chain. However inheriting this transaction graph&lt;br/&gt;&amp;gt;&amp;gt; model&lt;br/&gt;&amp;gt;&amp;gt; imo makes it easier for existing Bitcoin developers to interact with the&lt;br/&gt;&amp;gt;&amp;gt; system, and all the data structures are very familiar tooling wise.&lt;br/&gt;&amp;gt;&amp;gt; However any&lt;br/&gt;&amp;gt;&amp;gt; privacy enhancing protocol used for on-chain top-level Bitcoin UTXOs can&lt;br/&gt;&amp;gt;&amp;gt; also&lt;br/&gt;&amp;gt;&amp;gt; be applied to Taro, so people can use things like coinswap and coinjoin,&lt;br/&gt;&amp;gt;&amp;gt; along&lt;br/&gt;&amp;gt;&amp;gt; with LN to shed prior coin lineages.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; This implies the location of the Taro tree inside the taproot tree is&lt;br/&gt;&amp;gt;&amp;gt; not&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; fixed. What needs to be prevented here is that a taproot tree contains&lt;br/&gt;&amp;gt;&amp;gt; more&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; than one Taro tree, as that would enable the owner of the commitment to&lt;br/&gt;&amp;gt;&amp;gt; show&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; different histories to different people.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Great observation, I patched a similar issue much earlier in the design&lt;br/&gt;&amp;gt;&amp;gt; process&lt;br/&gt;&amp;gt;&amp;gt; by strongly binding all signatures to a prevOut super-set (so the outpoint&lt;br/&gt;&amp;gt;&amp;gt; along with the unique key apth down into the tree), which prevents&lt;br/&gt;&amp;gt;&amp;gt; duplicating&lt;br/&gt;&amp;gt;&amp;gt; the asset across outputs, as signature verification would fail.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In terms of achieving this level of binding within the Taro tree itself,&lt;br/&gt;&amp;gt;&amp;gt; I can&lt;br/&gt;&amp;gt;&amp;gt; think of three options:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   1. Require the Taro commitment to be in the first/last position within&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;   (fully sorted?) Tapscript tree, and also require its sibling to be the&lt;br/&gt;&amp;gt;&amp;gt; hash&lt;br/&gt;&amp;gt;&amp;gt;   of some set string (all zeroes or w/e). We&amp;#39;d require the sibling to the&lt;br/&gt;&amp;gt;&amp;gt; empty&lt;br/&gt;&amp;gt;&amp;gt;   as the tapscript hashes are sorted before hashing so you sort of lose&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;   final ordering information.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   2. Include the position of the Taro commitment within the tapscript tree&lt;br/&gt;&amp;gt;&amp;gt;   within the sighash digest (basically the way the single input in the&lt;br/&gt;&amp;gt;&amp;gt; virtual&lt;br/&gt;&amp;gt;&amp;gt;   transaction is created from the TLV structure).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   3. Include the position of the Taro commitment within the tapscript&lt;br/&gt;&amp;gt;&amp;gt; tree as&lt;br/&gt;&amp;gt;&amp;gt;   part of the message that&amp;#39;s hashed to derive asset IDs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; AFAICT, #1 resolves the issue entirely, #2 renders transfers outside of&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; canonical history invalid, and #2 minds hte asset ID to the initial&lt;br/&gt;&amp;gt;&amp;gt; position&lt;br/&gt;&amp;gt;&amp;gt; meaning you can track a canonical lineage from the very start.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Finally, let me conclude with two questions. Could you clarify the&lt;br/&gt;&amp;gt;&amp;gt; purpose of&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; the sparse merkle tree in your design?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Sure, it does a few things:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * Non-inclusion proofs so I can do things like prove to your I&amp;#39;m no&lt;br/&gt;&amp;gt;&amp;gt; longer&lt;br/&gt;&amp;gt;&amp;gt;     committing to my 1-of-1 holographic beefzard card when we swap.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * The key/tree structure means that the tree is history independent,&lt;br/&gt;&amp;gt;&amp;gt; meaning&lt;br/&gt;&amp;gt;&amp;gt;     that if you and I insert the same things into the tree in a different&lt;br/&gt;&amp;gt;&amp;gt;     order, we&amp;#39;ll get the same root hash. This is useful for things like&lt;br/&gt;&amp;gt;&amp;gt;     tracking all the issuance events for a given asset, or allowing two&lt;br/&gt;&amp;gt;&amp;gt;     entities to sync their knowledge/history of a single asset, or a set&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt;     assets.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * Each asset/script mapping to a unique location within the tree means&lt;br/&gt;&amp;gt;&amp;gt; it&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;     easy to ensure uniqueness of certain items/commitments (not possible&lt;br/&gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt;     commit to the same asset ID twice in the tree as an example).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * The merkle-sum trait means I that validation is made simpler, as you&lt;br/&gt;&amp;gt;&amp;gt; just&lt;br/&gt;&amp;gt;&amp;gt;     check that the input&#43;output commitment sum to the same value, and I&lt;br/&gt;&amp;gt;&amp;gt; can&lt;br/&gt;&amp;gt;&amp;gt;     also verify that if we&amp;#39;re swapping, then you aren&amp;#39;t committing to more&lt;br/&gt;&amp;gt;&amp;gt;     units that exist (so I make sure I don&amp;#39;t get an invalid split).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; And the second question – when transferring Taro token ownership from&lt;br/&gt;&amp;gt;&amp;gt; one&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Bitcoin UTXO to another, do you generate a new UTXO for the recipient&lt;br/&gt;&amp;gt;&amp;gt; or do&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; you support the ability to &amp;#34;teleport&amp;#34; the tokens to an existing UTXO&lt;br/&gt;&amp;gt;&amp;gt; like how&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; RGB does it? If the latter, have you given consideration to timing&lt;br/&gt;&amp;gt;&amp;gt; issues&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; that might occur when someone sends tokens to an existing UTXO that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; simultaneously happens to get spent by the owner?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So for interactive transfers, the UTXOs generated as just the ones part&lt;br/&gt;&amp;gt;&amp;gt; of the&lt;br/&gt;&amp;gt;&amp;gt; MIMO transaction. When sending via the address format, a new non-dust&lt;br/&gt;&amp;gt;&amp;gt; output is&lt;br/&gt;&amp;gt;&amp;gt; created which holds the new commitment, and uses an internal key provided&lt;br/&gt;&amp;gt;&amp;gt; by&lt;br/&gt;&amp;gt;&amp;gt; the receiver, so only they can move the UTXO. Admittedly, I&amp;#39;m not&lt;br/&gt;&amp;gt;&amp;gt; familiar with&lt;br/&gt;&amp;gt;&amp;gt; how the RGB &amp;#34;teleport&amp;#34; technique works, I checked out some slide decks a&lt;br/&gt;&amp;gt;&amp;gt; while&lt;br/&gt;&amp;gt;&amp;gt; back, but they were mostly about all the new components they were&lt;br/&gt;&amp;gt;&amp;gt; creating and&lt;br/&gt;&amp;gt;&amp;gt; their milestone of 1 million lines of code. Can you point me to a coherent&lt;br/&gt;&amp;gt;&amp;gt; explanation of the technique? I&amp;#39;d love to compare/contrast so we can&lt;br/&gt;&amp;gt;&amp;gt; analyze&lt;br/&gt;&amp;gt;&amp;gt; the diff tradeoffs being made here.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks for an initial round of feedback/analysis, I&amp;#39;ll be updating the&lt;br/&gt;&amp;gt;&amp;gt; draft&lt;br/&gt;&amp;gt;&amp;gt; over the next few days to better spell things out and particularly that&lt;br/&gt;&amp;gt;&amp;gt; commitment/sighash uniqueness trait.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://twitter.com/roasbeef/status/1330654936074371073?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&#34;&gt;https://twitter.com/roasbeef/status/1330654936074371073?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://twitter.com/roasbeef/status/1330692571736117249?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&#34;&gt;https://twitter.com/roasbeef/status/1330692571736117249?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221103/a53b523d/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221103/a53b523d/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T13:07:15Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxln2w0muyvq48vd7t3wvlzsmg2pyv00x2n7keyuvu4myzut42yeqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97rc4t8f</id>
    
      <title type="html">📅 Original date posted:2022-10-28 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxln2w0muyvq48vd7t3wvlzsmg2pyv00x2n7keyuvu4myzut42yeqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97rc4t8f" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsy4flq8qyyya5hw9vm52fd9duerwum4g9jk4ladye989uj743z8qcft9n89&#39;&gt;nevent1q…9n89&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-28&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Matt.&lt;br/&gt;&lt;br/&gt;You&amp;#39;re correct, I made the suggestion mainly because it would open up for&lt;br/&gt;PTLCs (or other future features) in today&amp;#39;s channels.&lt;br/&gt;&lt;br/&gt;Having the existing network close and reopen new channels would really slow&lt;br/&gt;the adoption of new channel features I reckon.&lt;br/&gt;&lt;br/&gt;And I don&amp;#39;t think it adds much complexity compared to the adapter approach.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Thu, Oct 27, 2022 at 4:54 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; I’m not sure I understand this - is there much reason to want taproot&lt;br/&gt;&amp;gt; commitment outputs? I mean they’re cool, and witnesses are a bit smaller,&lt;br/&gt;&amp;gt; which is nice I guess, but they’re not providing materially new features,&lt;br/&gt;&amp;gt; AFAIU. Taproot funding, on the other hand, provides a Bitcoin-wide privacy&lt;br/&gt;&amp;gt; improvement as well the potential future ability of channel participants to&lt;br/&gt;&amp;gt; use multisig for their own channel funds transparently.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sure, if we’re doing taproot funding outputs we should probably just do it&lt;br/&gt;&amp;gt; for the commitment outputs as well, because why not (and it’s a prereq for&lt;br/&gt;&amp;gt; PTLCs). But trying to split them up seems like added complexity “just&lt;br/&gt;&amp;gt; because”? I suppose it tees us up for eventual PTLC support in todays&lt;br/&gt;&amp;gt; channels, but we can also consider that separately when we get to that&lt;br/&gt;&amp;gt; point, IMO.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Am I missing some important utility of taproot commitment transaction&lt;br/&gt;&amp;gt; outputs?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Oct 27, 2022, at 02:17, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ﻿&lt;br/&gt;&amp;gt; Hi, Laolu.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think it could be worth considering dividing the taprootyness of a&lt;br/&gt;&amp;gt; channel into two:&lt;br/&gt;&amp;gt; 1) taproot funding output&lt;br/&gt;&amp;gt; 2) taproot commitment outputs&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That way we could upgrade existing channels only on the commitment level,&lt;br/&gt;&amp;gt; not needing to close or re-anchor the channels using an adapter in order to&lt;br/&gt;&amp;gt; get many of the taproot benefits.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; New channels would use taproot multisig (musig2) for the funding output.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This seems to be less disruptive to the existing network, and we could get&lt;br/&gt;&amp;gt; features enabled by taproot to larger parts of the network quicker. And to&lt;br/&gt;&amp;gt; me this seems to carry less complexity (and closing fees) than an adapter.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One caveat is that this wouldn&amp;#39;t work (I think) for Eltoo channels, as the&lt;br/&gt;&amp;gt; funding output would not be plain multisig anymore.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - Johan&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Sat, Mar 26, 2022 at 1:27 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Laolu,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks for the proposal, quick feedback.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; It *is* still the case that _ultimately_ the two transactions to close&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit&lt;br/&gt;&amp;gt;&amp;gt; v1&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; funding output are unavoidable. However this adapter commitment lets&lt;br/&gt;&amp;gt;&amp;gt; peers&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; _defer_ these two transactions until closing time.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think there is one downside coming with adapter commitment, which is&lt;br/&gt;&amp;gt;&amp;gt; the uncertainty of the fee overhead at the closing time. Instead of closing&lt;br/&gt;&amp;gt;&amp;gt; your segwit v0 channel _now_ with known fees, when your commitment is empty&lt;br/&gt;&amp;gt;&amp;gt; of time-sensitive HTLCs, you&amp;#39;re taking the risk of closing during fees&lt;br/&gt;&amp;gt;&amp;gt; spikes, due a move triggered by your counterparty, when you might have&lt;br/&gt;&amp;gt;&amp;gt; HTLCs at stake.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; It might be more economically rational for a LN node operator to pay the&lt;br/&gt;&amp;gt;&amp;gt; upgrade cost now if they wish  to benefit from the taproot upgrade early,&lt;br/&gt;&amp;gt;&amp;gt; especially if long-term we expect block fees to increase, or wait when&lt;br/&gt;&amp;gt;&amp;gt; there is a &amp;#34;normal&amp;#34; cooperative closing.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So it&amp;#39;s unclear to me what the economic gain of adapter commitments ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In the remainder of this mail, I&amp;#39;ll describe an alternative&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; approach that would allow upgrading nearly all channel/commitment&lt;br/&gt;&amp;gt;&amp;gt; related&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; values (dust limit, max in flight, etc), which is inspired by the way&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Long-term, I think we&amp;#39;ll likely need a consensus protocol anyway for&lt;br/&gt;&amp;gt;&amp;gt; multi-party constructions (channel factories/payment pools). AFAIU this&lt;br/&gt;&amp;gt;&amp;gt; proposal doesn&amp;#39;t aim to roll out a full-fledged consensus protocol *now*&lt;br/&gt;&amp;gt;&amp;gt; though it could be wise to ensure what we&amp;#39;re building slowly moves in this&lt;br/&gt;&amp;gt;&amp;gt; direction. Less critical code to maintain across bitcoin&lt;br/&gt;&amp;gt;&amp;gt; codebases/toolchains.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; retransmission phase.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; What&amp;#39;s the purpose of data origin authentication if we assume only&lt;br/&gt;&amp;gt;&amp;gt; two-parties running over Noise_XK ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think it&amp;#39;s already a security property we have. Though if we think&lt;br/&gt;&amp;gt;&amp;gt; we&amp;#39;re going to reuse these dynamic upgrades for N counterparties&lt;br/&gt;&amp;gt;&amp;gt; communicating through a coordinator, yes I think it&amp;#39;s useful.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; HTLCs were in flight (hence some of the ideas to clear out the&lt;br/&gt;&amp;gt;&amp;gt; commitment&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; beforehand).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The dynamic upgrade might serve in an emergency context where we don&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; have the leisury to wait for the settlement of the pending HTLCs. The&lt;br/&gt;&amp;gt;&amp;gt; timing of those ones might be beyond the coordination of link&lt;br/&gt;&amp;gt;&amp;gt; counterparties. Thus, we have to allow upgrade of non-empty commitments&lt;br/&gt;&amp;gt;&amp;gt; (and if there are undesirable interferences between new commitment types&lt;br/&gt;&amp;gt;&amp;gt; and HTLCs/PTLCs present, deal case-by-case).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Le jeu. 24 mars 2022 à 18:53, Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt; écrit :&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Hi y&amp;#39;all,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Dynamic Commitments Retrospective&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Two years-ish ago I made a mailing list post on some ideas re dynamic&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitments [1], and how the concept can be used to allow us to upgrade&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; channel types on the fly, and also remove pesky hard coded limits like&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 483 HTLC in-flight limit that&amp;#39;s present today. Back then my main target&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; was&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; upgrading all the existing channels over to the anchor output commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; variant, so the core internal routing network would be more resilient in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; persistent high fee environment (which hasn&amp;#39;t really happened over the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; past&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 2 years for various reasons tbh). Fast forward to today, and with taproot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; now active on mainnet, and some initial design work/sketches for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; taproot-native channels underway, I figure it would be good to bump this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; concept as it gives us a way to upgrade all 80k&#43; public channels to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; taproot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; without any on chain transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Updating Across Witness Versions w/ Adapter Commitments&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; In my original mail, I incorrectly concluded that the dynamic commitments&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; concept would only really work within the confines of a &amp;#34;static&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; multi-sig&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; output, meaning that it couldn&amp;#39;t be used to help channels upgrade to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; future&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; segwit witness versions.  Thankfully this reply [2] by ZmnSCPxj,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; outlined a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; way to achieve this in practice. At a high level he proposes an &amp;#34;adaptor&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment&amp;#34; (similar to the kickoff transaction in eltoo/duplex), which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; basically an upgrade transaction that spends one witness version type,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; produces an output with the next (upgraded) type. In the context of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; converting from segwit v0 to v1 (taproot), two peers would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; collaboratively&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; create a new adapter commitment that spends the old v0 multi-sig output,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; produces a _new_ v1 multi-sig output. The new commitment transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; then be anchored using this new output.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Here&amp;#39;s a rough sequence diagram of the before and after state to better&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; convey the concept:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;   * Before: fundingOutputV0 -&amp;gt; commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;   * After fundingOutputV0 -&amp;gt; fundingOutputV1 (the adapter) -&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;     commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; It *is* still the case that _ultimately_ the two transactions to close&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; v1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; funding output are unavoidable. However this adapter commitment lets&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; peers&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _defer_ these two transactions until closing time. When force closing two&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; transactions need to be confirmed before the commitment outputs can be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; resolved. However, for co-op close, you can just spend the v0 output, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; deliver to the relevant P2TR outputs. The adapter commitment can leverage&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; sighash anyonecanpay to let both parties (assuming it&amp;#39;s symmetric) attach&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; additional inputs for fees (to avoid introducing the old update_fee&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; related&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; static fee issues), or alternatively inherit the anchor output pattern at&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; this level.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Existing Dynamic Commitments Proposals&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Assuming this concept holds up, then we need an actual concrete protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; allow for dynamic commitment updates. Last year, Rusty made a spec PR&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; outlining a way to upgrade the commitment type (leveraging the new&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment type feature bits) upon channel re-establish [3]. The proposal&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; relies on another message that both sides send (`stfu`) to clear the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment (similar to the shutdown semantics) before the switch over&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; happens. However as this is tied to the channel re-establish flow, it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; doesn&amp;#39;t allow both sides to do things like only allow your peer to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; attach N&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs to start with, slowing increasing their allotted slots and possibly&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reducing them (TCP AIMD style).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## A Two-Phase Dynamic Commitment Update Protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; IMO if we&amp;#39;re adding in a way to do commitment/channel upgrades, then it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; may&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; be worthwhile to go with a more generalized, but slightly more involved&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; route instead. In the remainder of this mail, I&amp;#39;ll describe an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; alternative&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; approach that would allow upgrading nearly all channel/commitment related&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; values (dust limit, max in flight, etc), which is inspired by the way the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; For those that aren&amp;#39;t aware, Raft is a consensus protocol analogous to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Paxos&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (but isn&amp;#39;t byzantine fault tolerant out of the box) that was designed as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; more understandable alternative to Paxos for a pedagogical environment.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Typically the algorithm is run in the context of a fixed cluster with N&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; machines, but supports adding/removing machines from the cluster with a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; configuration update protocol. At a high level the way this works is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new config is sent to the leader, with the leader synchronizing the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; config&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; change with the other members of the cluster. Once a majority threshold&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reached, the leader then commits the config change with the acknowledged&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; parties using the new config (basically a two phase commit). I&amp;#39;m skipping&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; over some edge cases here that can arise if the new nodes participate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; consensus too early, which can cause a split majority leading to two&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; leaders&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; being elected.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Applying this to the LN context is a bit simpler than a generalized&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; protocol, as we typically just have two parties involved. The initiator&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; already naturally a &amp;#34;leader&amp;#34; in our context, as they&amp;#39;re the only ones&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; can do things like trigger fee updates.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Message Structure&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; At a high level I propose we introduce two new messages, with the fields&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; looking something like this for `commitment_update_propose`:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 1 (`propose_sig`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`64*byte`:`sig`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 2 (`update_payload`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`tlv_payload`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and this `commitment_update_apply`:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 1 (`local_propose`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 2 (`remote_propose`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Protocol Flow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The core idea here is that either party can propose a commitment/channel&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; param update, but only the initiator can actually apply it. The&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` encodes the new set of updates, with a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; signature&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; covering the TLV blob for the new params (more on why that&amp;#39;s needed&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; later).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The `commitment_update_apply` includes up to _two_&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` messages (one for the initiator and one for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; responder, as nested TLV messages). The `commitment_update_propose`&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; message&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would be treated like any other `update_*` message, in that it takes a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment signature to properly commit/apply it.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The normal flow takes the form of both sides sending a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` message, with the initiator finally&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; committing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; both by sending a `commitment_update_apply` message. In the event that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; only&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the responder wants to apply a param change/update, then the initiator&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; can&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reply immediately with a `commitment_update_apply` message that doesn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; include a param change for their commitment (or they just echo the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; parameters if they&amp;#39;re acceptable).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Handling Retransmissions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; retransmission phase. As the `commitment_update_propose` message would be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; retransmitted like any other message, if the initiator attempts to commit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the update but the connection dies, they&amp;#39;ll retransmit it as normal along&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; with their latest signature.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Nested TLV Param Generality&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The messages as sketched out here just have an opaque nested TLV field&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; makes it extensible to add in other things like tweaking the total&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; number of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; max HTLCs, the current dust values, min/max HTLCs, etc (all things that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; currently hard coded for the lifetime of the channel). An initial target&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would likely just be a `chan_type` field, with future feature bits&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; governing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _what_ type of commitment updates both parties understand in the future.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs were in flight (hence some of the ideas to clear out the commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; beforehand). I don&amp;#39;t see a reason why this fundamentally _shouldn&amp;#39;t_ be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; allowed, as from the point of view of the channel update state machine,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; all&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; updates (adds/removes) get applied as normal, but with this _new_&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; type/params. The main edge case we&amp;#39;ll need to consider is cases where the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new params make older HTLCs invalid for some reason.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Conclusion&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Using the adapter commitment idea combined with a protocol for updating&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitments on the fly, would potentially allow us to update all 80k&#43;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; segwit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; v0 channels to the base level of taprooty channels without any on chain&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; transactions. The two transactions (open&#43;close) must happen eventually,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; by holding another layer of spends off-chain we can defer them&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (potentially&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; indefinitely, as we have channels today that have been opened for over a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; year).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Deploying a generalised on-the-fly dynamic commitment update protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; gives&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; us a tool to future proof the _existing_ anchored multi-sig outputs in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; chain, and also a way to remove many of the hard coded parameters we have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; today in the protocol. One overly inflexible parameter we have today in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; network is the 483 HTLC limit. Allowing this value to float would allow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; peers to apply similar congestion avoidance algorithm that are used in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; TCP&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; today, and also give us a way to protect the network against future&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; unforeseen widespread policy changes (like a raising of the dust limit).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [3]: &lt;a href=&#34;https://github.com/lightning/bolts/pull/868&#34;&gt;https://github.com/lightning/bolts/pull/868&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;On Thu, Oct 27, 2022 at 4:54 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; I’m not sure I understand this - is there much reason to want taproot&lt;br/&gt;&amp;gt; commitment outputs? I mean they’re cool, and witnesses are a bit smaller,&lt;br/&gt;&amp;gt; which is nice I guess, but they’re not providing materially new features,&lt;br/&gt;&amp;gt; AFAIU. Taproot funding, on the other hand, provides a Bitcoin-wide privacy&lt;br/&gt;&amp;gt; improvement as well the potential future ability of channel participants to&lt;br/&gt;&amp;gt; use multisig for their own channel funds transparently.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sure, if we’re doing taproot funding outputs we should probably just do it&lt;br/&gt;&amp;gt; for the commitment outputs as well, because why not (and it’s a prereq for&lt;br/&gt;&amp;gt; PTLCs). But trying to split them up seems like added complexity “just&lt;br/&gt;&amp;gt; because”? I suppose it tees us up for eventual PTLC support in todays&lt;br/&gt;&amp;gt; channels, but we can also consider that separately when we get to that&lt;br/&gt;&amp;gt; point, IMO.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Am I missing some important utility of taproot commitment transaction&lt;br/&gt;&amp;gt; outputs?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Oct 27, 2022, at 02:17, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ﻿&lt;br/&gt;&amp;gt; Hi, Laolu.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think it could be worth considering dividing the taprootyness of a&lt;br/&gt;&amp;gt; channel into two:&lt;br/&gt;&amp;gt; 1) taproot funding output&lt;br/&gt;&amp;gt; 2) taproot commitment outputs&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That way we could upgrade existing channels only on the commitment level,&lt;br/&gt;&amp;gt; not needing to close or re-anchor the channels using an adapter in order to&lt;br/&gt;&amp;gt; get many of the taproot benefits.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; New channels would use taproot multisig (musig2) for the funding output.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This seems to be less disruptive to the existing network, and we could get&lt;br/&gt;&amp;gt; features enabled by taproot to larger parts of the network quicker. And to&lt;br/&gt;&amp;gt; me this seems to carry less complexity (and closing fees) than an adapter.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One caveat is that this wouldn&amp;#39;t work (I think) for Eltoo channels, as the&lt;br/&gt;&amp;gt; funding output would not be plain multisig anymore.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - Johan&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Sat, Mar 26, 2022 at 1:27 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Laolu,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks for the proposal, quick feedback.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; It *is* still the case that _ultimately_ the two transactions to close&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit&lt;br/&gt;&amp;gt;&amp;gt; v1&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; funding output are unavoidable. However this adapter commitment lets&lt;br/&gt;&amp;gt;&amp;gt; peers&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; _defer_ these two transactions until closing time.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think there is one downside coming with adapter commitment, which is&lt;br/&gt;&amp;gt;&amp;gt; the uncertainty of the fee overhead at the closing time. Instead of closing&lt;br/&gt;&amp;gt;&amp;gt; your segwit v0 channel _now_ with known fees, when your commitment is empty&lt;br/&gt;&amp;gt;&amp;gt; of time-sensitive HTLCs, you&amp;#39;re taking the risk of closing during fees&lt;br/&gt;&amp;gt;&amp;gt; spikes, due a move triggered by your counterparty, when you might have&lt;br/&gt;&amp;gt;&amp;gt; HTLCs at stake.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; It might be more economically rational for a LN node operator to pay the&lt;br/&gt;&amp;gt;&amp;gt; upgrade cost now if they wish  to benefit from the taproot upgrade early,&lt;br/&gt;&amp;gt;&amp;gt; especially if long-term we expect block fees to increase, or wait when&lt;br/&gt;&amp;gt;&amp;gt; there is a &amp;#34;normal&amp;#34; cooperative closing.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So it&amp;#39;s unclear to me what the economic gain of adapter commitments ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In the remainder of this mail, I&amp;#39;ll describe an alternative&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; approach that would allow upgrading nearly all channel/commitment&lt;br/&gt;&amp;gt;&amp;gt; related&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; values (dust limit, max in flight, etc), which is inspired by the way&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Long-term, I think we&amp;#39;ll likely need a consensus protocol anyway for&lt;br/&gt;&amp;gt;&amp;gt; multi-party constructions (channel factories/payment pools). AFAIU this&lt;br/&gt;&amp;gt;&amp;gt; proposal doesn&amp;#39;t aim to roll out a full-fledged consensus protocol *now*&lt;br/&gt;&amp;gt;&amp;gt; though it could be wise to ensure what we&amp;#39;re building slowly moves in this&lt;br/&gt;&amp;gt;&amp;gt; direction. Less critical code to maintain across bitcoin&lt;br/&gt;&amp;gt;&amp;gt; codebases/toolchains.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; retransmission phase.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; What&amp;#39;s the purpose of data origin authentication if we assume only&lt;br/&gt;&amp;gt;&amp;gt; two-parties running over Noise_XK ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think it&amp;#39;s already a security property we have. Though if we think&lt;br/&gt;&amp;gt;&amp;gt; we&amp;#39;re going to reuse these dynamic upgrades for N counterparties&lt;br/&gt;&amp;gt;&amp;gt; communicating through a coordinator, yes I think it&amp;#39;s useful.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; HTLCs were in flight (hence some of the ideas to clear out the&lt;br/&gt;&amp;gt;&amp;gt; commitment&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; beforehand).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The dynamic upgrade might serve in an emergency context where we don&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; have the leisury to wait for the settlement of the pending HTLCs. The&lt;br/&gt;&amp;gt;&amp;gt; timing of those ones might be beyond the coordination of link&lt;br/&gt;&amp;gt;&amp;gt; counterparties. Thus, we have to allow upgrade of non-empty commitments&lt;br/&gt;&amp;gt;&amp;gt; (and if there are undesirable interferences between new commitment types&lt;br/&gt;&amp;gt;&amp;gt; and HTLCs/PTLCs present, deal case-by-case).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Le jeu. 24 mars 2022 à 18:53, Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt; écrit :&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Hi y&amp;#39;all,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Dynamic Commitments Retrospective&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Two years-ish ago I made a mailing list post on some ideas re dynamic&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitments [1], and how the concept can be used to allow us to upgrade&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; channel types on the fly, and also remove pesky hard coded limits like&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 483 HTLC in-flight limit that&amp;#39;s present today. Back then my main target&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; was&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; upgrading all the existing channels over to the anchor output commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; variant, so the core internal routing network would be more resilient in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; persistent high fee environment (which hasn&amp;#39;t really happened over the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; past&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 2 years for various reasons tbh). Fast forward to today, and with taproot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; now active on mainnet, and some initial design work/sketches for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; taproot-native channels underway, I figure it would be good to bump this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; concept as it gives us a way to upgrade all 80k&#43; public channels to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; taproot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; without any on chain transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Updating Across Witness Versions w/ Adapter Commitments&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; In my original mail, I incorrectly concluded that the dynamic commitments&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; concept would only really work within the confines of a &amp;#34;static&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; multi-sig&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; output, meaning that it couldn&amp;#39;t be used to help channels upgrade to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; future&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; segwit witness versions.  Thankfully this reply [2] by ZmnSCPxj,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; outlined a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; way to achieve this in practice. At a high level he proposes an &amp;#34;adaptor&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment&amp;#34; (similar to the kickoff transaction in eltoo/duplex), which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; basically an upgrade transaction that spends one witness version type,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; produces an output with the next (upgraded) type. In the context of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; converting from segwit v0 to v1 (taproot), two peers would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; collaboratively&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; create a new adapter commitment that spends the old v0 multi-sig output,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; produces a _new_ v1 multi-sig output. The new commitment transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; then be anchored using this new output.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Here&amp;#39;s a rough sequence diagram of the before and after state to better&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; convey the concept:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;   * Before: fundingOutputV0 -&amp;gt; commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;   * After fundingOutputV0 -&amp;gt; fundingOutputV1 (the adapter) -&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;     commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; It *is* still the case that _ultimately_ the two transactions to close&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; v1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; funding output are unavoidable. However this adapter commitment lets&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; peers&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _defer_ these two transactions until closing time. When force closing two&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; transactions need to be confirmed before the commitment outputs can be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; resolved. However, for co-op close, you can just spend the v0 output, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; deliver to the relevant P2TR outputs. The adapter commitment can leverage&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; sighash anyonecanpay to let both parties (assuming it&amp;#39;s symmetric) attach&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; additional inputs for fees (to avoid introducing the old update_fee&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; related&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; static fee issues), or alternatively inherit the anchor output pattern at&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; this level.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Existing Dynamic Commitments Proposals&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Assuming this concept holds up, then we need an actual concrete protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; allow for dynamic commitment updates. Last year, Rusty made a spec PR&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; outlining a way to upgrade the commitment type (leveraging the new&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment type feature bits) upon channel re-establish [3]. The proposal&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; relies on another message that both sides send (`stfu`) to clear the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment (similar to the shutdown semantics) before the switch over&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; happens. However as this is tied to the channel re-establish flow, it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; doesn&amp;#39;t allow both sides to do things like only allow your peer to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; attach N&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs to start with, slowing increasing their allotted slots and possibly&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reducing them (TCP AIMD style).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## A Two-Phase Dynamic Commitment Update Protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; IMO if we&amp;#39;re adding in a way to do commitment/channel upgrades, then it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; may&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; be worthwhile to go with a more generalized, but slightly more involved&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; route instead. In the remainder of this mail, I&amp;#39;ll describe an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; alternative&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; approach that would allow upgrading nearly all channel/commitment related&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; values (dust limit, max in flight, etc), which is inspired by the way the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; For those that aren&amp;#39;t aware, Raft is a consensus protocol analogous to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Paxos&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (but isn&amp;#39;t byzantine fault tolerant out of the box) that was designed as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; more understandable alternative to Paxos for a pedagogical environment.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Typically the algorithm is run in the context of a fixed cluster with N&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; machines, but supports adding/removing machines from the cluster with a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; configuration update protocol. At a high level the way this works is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new config is sent to the leader, with the leader synchronizing the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; config&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; change with the other members of the cluster. Once a majority threshold&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reached, the leader then commits the config change with the acknowledged&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; parties using the new config (basically a two phase commit). I&amp;#39;m skipping&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; over some edge cases here that can arise if the new nodes participate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; consensus too early, which can cause a split majority leading to two&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; leaders&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; being elected.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Applying this to the LN context is a bit simpler than a generalized&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; protocol, as we typically just have two parties involved. The initiator&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; already naturally a &amp;#34;leader&amp;#34; in our context, as they&amp;#39;re the only ones&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; can do things like trigger fee updates.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Message Structure&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; At a high level I propose we introduce two new messages, with the fields&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; looking something like this for `commitment_update_propose`:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 1 (`propose_sig`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`64*byte`:`sig`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 2 (`update_payload`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`tlv_payload`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and this `commitment_update_apply`:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 1 (`local_propose`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;  * type: 2 (`remote_propose`)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Protocol Flow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The core idea here is that either party can propose a commitment/channel&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; param update, but only the initiator can actually apply it. The&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` encodes the new set of updates, with a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; signature&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; covering the TLV blob for the new params (more on why that&amp;#39;s needed&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; later).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The `commitment_update_apply` includes up to _two_&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` messages (one for the initiator and one for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; responder, as nested TLV messages). The `commitment_update_propose`&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; message&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would be treated like any other `update_*` message, in that it takes a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment signature to properly commit/apply it.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The normal flow takes the form of both sides sending a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; `commitment_update_propose` message, with the initiator finally&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; committing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; both by sending a `commitment_update_apply` message. In the event that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; only&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the responder wants to apply a param change/update, then the initiator&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; can&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; reply immediately with a `commitment_update_apply` message that doesn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; include a param change for their commitment (or they just echo the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; parameters if they&amp;#39;re acceptable).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Handling Retransmissions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; retransmission phase. As the `commitment_update_propose` message would be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; retransmitted like any other message, if the initiator attempts to commit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the update but the connection dies, they&amp;#39;ll retransmit it as normal along&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; with their latest signature.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ### Nested TLV Param Generality&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The messages as sketched out here just have an opaque nested TLV field&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; makes it extensible to add in other things like tweaking the total&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; number of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; max HTLCs, the current dust values, min/max HTLCs, etc (all things that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; currently hard coded for the lifetime of the channel). An initial target&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; would likely just be a `chan_type` field, with future feature bits&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; governing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _what_ type of commitment updates both parties understand in the future.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs were in flight (hence some of the ideas to clear out the commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; beforehand). I don&amp;#39;t see a reason why this fundamentally _shouldn&amp;#39;t_ be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; allowed, as from the point of view of the channel update state machine,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; all&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; updates (adds/removes) get applied as normal, but with this _new_&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; type/params. The main edge case we&amp;#39;ll need to consider is cases where the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; new params make older HTLCs invalid for some reason.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ## Conclusion&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Using the adapter commitment idea combined with a protocol for updating&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commitments on the fly, would potentially allow us to update all 80k&#43;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; segwit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; v0 channels to the base level of taprooty channels without any on chain&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; transactions. The two transactions (open&#43;close) must happen eventually,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; by holding another layer of spends off-chain we can defer them&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (potentially&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; indefinitely, as we have channels today that have been opened for over a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; year).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Deploying a generalised on-the-fly dynamic commitment update protocol&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; gives&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; us a tool to future proof the _existing_ anchored multi-sig outputs in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; chain, and also a way to remove many of the hard coded parameters we have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; today in the protocol. One overly inflexible parameter we have today in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; network is the 483 HTLC limit. Allowing this value to float would allow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; peers to apply similar congestion avoidance algorithm that are used in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; TCP&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; today, and also give us a way to protect the network against future&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; unforeseen widespread policy changes (like a raising of the dust limit).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [3]: &lt;a href=&#34;https://github.com/lightning/bolts/pull/868&#34;&gt;https://github.com/lightning/bolts/pull/868&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&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/20221028/c91f1825/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221028/c91f1825/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T13:07:09Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqspnyeldumtr5l8h5yvl4dnr4hqkjkz63j8fru0c0kmq32llcyrjmgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9799ef2g</id>
    
      <title type="html">📅 Original date posted:2022-10-27 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqspnyeldumtr5l8h5yvl4dnr4hqkjkz63j8fru0c0kmq32llcyrjmgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9799ef2g" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs88j56nnqhdv5g6n5mq32w0gsl6wt9vfyydylugqkn4uva08qltwgucxqn3&#39;&gt;nevent1q…xqn3&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-27&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Laolu.&lt;br/&gt;&lt;br/&gt;I think it could be worth considering dividing the taprootyness of a&lt;br/&gt;channel into two:&lt;br/&gt;1) taproot funding output&lt;br/&gt;2) taproot commitment outputs&lt;br/&gt;&lt;br/&gt;That way we could upgrade existing channels only on the commitment level,&lt;br/&gt;not needing to close or re-anchor the channels using an adapter in order to&lt;br/&gt;get many of the taproot benefits.&lt;br/&gt;&lt;br/&gt;New channels would use taproot multisig (musig2) for the funding output.&lt;br/&gt;&lt;br/&gt;This seems to be less disruptive to the existing network, and we could get&lt;br/&gt;features enabled by taproot to larger parts of the network quicker. And to&lt;br/&gt;me this seems to carry less complexity (and closing fees) than an adapter.&lt;br/&gt;&lt;br/&gt;One caveat is that this wouldn&amp;#39;t work (I think) for Eltoo channels, as the&lt;br/&gt;funding output would not be plain multisig anymore.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sat, Mar 26, 2022 at 1:27 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Laolu,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for the proposal, quick feedback.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; It *is* still the case that _ultimately_ the two transactions to close&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit&lt;br/&gt;&amp;gt; v1&lt;br/&gt;&amp;gt; &amp;gt; funding output are unavoidable. However this adapter commitment lets&lt;br/&gt;&amp;gt; peers&lt;br/&gt;&amp;gt; &amp;gt; _defer_ these two transactions until closing time.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think there is one downside coming with adapter commitment, which is the&lt;br/&gt;&amp;gt; uncertainty of the fee overhead at the closing time. Instead of closing&lt;br/&gt;&amp;gt; your segwit v0 channel _now_ with known fees, when your commitment is empty&lt;br/&gt;&amp;gt; of time-sensitive HTLCs, you&amp;#39;re taking the risk of closing during fees&lt;br/&gt;&amp;gt; spikes, due a move triggered by your counterparty, when you might have&lt;br/&gt;&amp;gt; HTLCs at stake.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It might be more economically rational for a LN node operator to pay the&lt;br/&gt;&amp;gt; upgrade cost now if they wish  to benefit from the taproot upgrade early,&lt;br/&gt;&amp;gt; especially if long-term we expect block fees to increase, or wait when&lt;br/&gt;&amp;gt; there is a &amp;#34;normal&amp;#34; cooperative closing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So it&amp;#39;s unclear to me what the economic gain of adapter commitments ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; In the remainder of this mail, I&amp;#39;ll describe an alternative&lt;br/&gt;&amp;gt; &amp;gt; approach that would allow upgrading nearly all channel/commitment related&lt;br/&gt;&amp;gt; &amp;gt; values (dust limit, max in flight, etc), which is inspired by the way the&lt;br/&gt;&amp;gt; &amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Long-term, I think we&amp;#39;ll likely need a consensus protocol anyway for&lt;br/&gt;&amp;gt; multi-party constructions (channel factories/payment pools). AFAIU this&lt;br/&gt;&amp;gt; proposal doesn&amp;#39;t aim to roll out a full-fledged consensus protocol *now*&lt;br/&gt;&amp;gt; though it could be wise to ensure what we&amp;#39;re building slowly moves in this&lt;br/&gt;&amp;gt; direction. Less critical code to maintain across bitcoin&lt;br/&gt;&amp;gt; codebases/toolchains.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt; &amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt; that&lt;br/&gt;&amp;gt; &amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt; &amp;gt; retransmission phase.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; What&amp;#39;s the purpose of data origin authentication if we assume only&lt;br/&gt;&amp;gt; two-parties running over Noise_XK ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think it&amp;#39;s already a security property we have. Though if we think we&amp;#39;re&lt;br/&gt;&amp;gt; going to reuse these dynamic upgrades for N counterparties communicating&lt;br/&gt;&amp;gt; through a coordinator, yes I think it&amp;#39;s useful.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt; that&lt;br/&gt;&amp;gt; &amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt; &amp;gt; HTLCs were in flight (hence some of the ideas to clear out the commitment&lt;br/&gt;&amp;gt; &amp;gt; beforehand).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The dynamic upgrade might serve in an emergency context where we don&amp;#39;t&lt;br/&gt;&amp;gt; have the leisury to wait for the settlement of the pending HTLCs. The&lt;br/&gt;&amp;gt; timing of those ones might be beyond the coordination of link&lt;br/&gt;&amp;gt; counterparties. Thus, we have to allow upgrade of non-empty commitments&lt;br/&gt;&amp;gt; (and if there are undesirable interferences between new commitment types&lt;br/&gt;&amp;gt; and HTLCs/PTLCs present, deal case-by-case).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le jeu. 24 mars 2022 à 18:53, Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; a&lt;br/&gt;&amp;gt; écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi y&amp;#39;all,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Dynamic Commitments Retrospective&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Two years-ish ago I made a mailing list post on some ideas re dynamic&lt;br/&gt;&amp;gt;&amp;gt; commitments [1], and how the concept can be used to allow us to upgrade&lt;br/&gt;&amp;gt;&amp;gt; channel types on the fly, and also remove pesky hard coded limits like the&lt;br/&gt;&amp;gt;&amp;gt; 483 HTLC in-flight limit that&amp;#39;s present today. Back then my main target&lt;br/&gt;&amp;gt;&amp;gt; was&lt;br/&gt;&amp;gt;&amp;gt; upgrading all the existing channels over to the anchor output commitment&lt;br/&gt;&amp;gt;&amp;gt; variant, so the core internal routing network would be more resilient in a&lt;br/&gt;&amp;gt;&amp;gt; persistent high fee environment (which hasn&amp;#39;t really happened over the&lt;br/&gt;&amp;gt;&amp;gt; past&lt;br/&gt;&amp;gt;&amp;gt; 2 years for various reasons tbh). Fast forward to today, and with taproot&lt;br/&gt;&amp;gt;&amp;gt; now active on mainnet, and some initial design work/sketches for&lt;br/&gt;&amp;gt;&amp;gt; taproot-native channels underway, I figure it would be good to bump this&lt;br/&gt;&amp;gt;&amp;gt; concept as it gives us a way to upgrade all 80k&#43; public channels to&lt;br/&gt;&amp;gt;&amp;gt; taproot&lt;br/&gt;&amp;gt;&amp;gt; without any on chain transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Updating Across Witness Versions w/ Adapter Commitments&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In my original mail, I incorrectly concluded that the dynamic commitments&lt;br/&gt;&amp;gt;&amp;gt; concept would only really work within the confines of a &amp;#34;static&amp;#34; multi-sig&lt;br/&gt;&amp;gt;&amp;gt; output, meaning that it couldn&amp;#39;t be used to help channels upgrade to&lt;br/&gt;&amp;gt;&amp;gt; future&lt;br/&gt;&amp;gt;&amp;gt; segwit witness versions.  Thankfully this reply [2] by ZmnSCPxj, outlined&lt;br/&gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt; way to achieve this in practice. At a high level he proposes an &amp;#34;adaptor&lt;br/&gt;&amp;gt;&amp;gt; commitment&amp;#34; (similar to the kickoff transaction in eltoo/duplex), which is&lt;br/&gt;&amp;gt;&amp;gt; basically an upgrade transaction that spends one witness version type, and&lt;br/&gt;&amp;gt;&amp;gt; produces an output with the next (upgraded) type. In the context of&lt;br/&gt;&amp;gt;&amp;gt; converting from segwit v0 to v1 (taproot), two peers would collaboratively&lt;br/&gt;&amp;gt;&amp;gt; create a new adapter commitment that spends the old v0 multi-sig output,&lt;br/&gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt; produces a _new_ v1 multi-sig output. The new commitment transaction would&lt;br/&gt;&amp;gt;&amp;gt; then be anchored using this new output.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Here&amp;#39;s a rough sequence diagram of the before and after state to better&lt;br/&gt;&amp;gt;&amp;gt; convey the concept:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * Before: fundingOutputV0 -&amp;gt; commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * After fundingOutputV0 -&amp;gt; fundingOutputV1 (the adapter) -&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;     commitmentTransaction&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; It *is* still the case that _ultimately_ the two transactions to close the&lt;br/&gt;&amp;gt;&amp;gt; old segwit v0 funding output, and re-open the channel with a new segwit v1&lt;br/&gt;&amp;gt;&amp;gt; funding output are unavoidable. However this adapter commitment lets peers&lt;br/&gt;&amp;gt;&amp;gt; _defer_ these two transactions until closing time. When force closing two&lt;br/&gt;&amp;gt;&amp;gt; transactions need to be confirmed before the commitment outputs can be&lt;br/&gt;&amp;gt;&amp;gt; resolved. However, for co-op close, you can just spend the v0 output, and&lt;br/&gt;&amp;gt;&amp;gt; deliver to the relevant P2TR outputs. The adapter commitment can leverage&lt;br/&gt;&amp;gt;&amp;gt; sighash anyonecanpay to let both parties (assuming it&amp;#39;s symmetric) attach&lt;br/&gt;&amp;gt;&amp;gt; additional inputs for fees (to avoid introducing the old update_fee&lt;br/&gt;&amp;gt;&amp;gt; related&lt;br/&gt;&amp;gt;&amp;gt; static fee issues), or alternatively inherit the anchor output pattern at&lt;br/&gt;&amp;gt;&amp;gt; this level.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Existing Dynamic Commitments Proposals&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Assuming this concept holds up, then we need an actual concrete protocol&lt;br/&gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt; allow for dynamic commitment updates. Last year, Rusty made a spec PR&lt;br/&gt;&amp;gt;&amp;gt; outlining a way to upgrade the commitment type (leveraging the new&lt;br/&gt;&amp;gt;&amp;gt; commitment type feature bits) upon channel re-establish [3]. The proposal&lt;br/&gt;&amp;gt;&amp;gt; relies on another message that both sides send (`stfu`) to clear the&lt;br/&gt;&amp;gt;&amp;gt; commitment (similar to the shutdown semantics) before the switch over&lt;br/&gt;&amp;gt;&amp;gt; happens. However as this is tied to the channel re-establish flow, it&lt;br/&gt;&amp;gt;&amp;gt; doesn&amp;#39;t allow both sides to do things like only allow your peer to attach&lt;br/&gt;&amp;gt;&amp;gt; N&lt;br/&gt;&amp;gt;&amp;gt; HTLCs to start with, slowing increasing their allotted slots and possibly&lt;br/&gt;&amp;gt;&amp;gt; reducing them (TCP AIMD style).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## A Two-Phase Dynamic Commitment Update Protocol&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; IMO if we&amp;#39;re adding in a way to do commitment/channel upgrades, then it&lt;br/&gt;&amp;gt;&amp;gt; may&lt;br/&gt;&amp;gt;&amp;gt; be worthwhile to go with a more generalized, but slightly more involved&lt;br/&gt;&amp;gt;&amp;gt; route instead. In the remainder of this mail, I&amp;#39;ll describe an alternative&lt;br/&gt;&amp;gt;&amp;gt; approach that would allow upgrading nearly all channel/commitment related&lt;br/&gt;&amp;gt;&amp;gt; values (dust limit, max in flight, etc), which is inspired by the way the&lt;br/&gt;&amp;gt;&amp;gt; Raft consensus protocol handles configuration/member changes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For those that aren&amp;#39;t aware, Raft is a consensus protocol analogous to&lt;br/&gt;&amp;gt;&amp;gt; Paxos&lt;br/&gt;&amp;gt;&amp;gt; (but isn&amp;#39;t byzantine fault tolerant out of the box) that was designed as a&lt;br/&gt;&amp;gt;&amp;gt; more understandable alternative to Paxos for a pedagogical environment.&lt;br/&gt;&amp;gt;&amp;gt; Typically the algorithm is run in the context of a fixed cluster with N&lt;br/&gt;&amp;gt;&amp;gt; machines, but supports adding/removing machines from the cluster with a&lt;br/&gt;&amp;gt;&amp;gt; configuration update protocol. At a high level the way this works is that&lt;br/&gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt; new config is sent to the leader, with the leader synchronizing the config&lt;br/&gt;&amp;gt;&amp;gt; change with the other members of the cluster. Once a majority threshold is&lt;br/&gt;&amp;gt;&amp;gt; reached, the leader then commits the config change with the acknowledged&lt;br/&gt;&amp;gt;&amp;gt; parties using the new config (basically a two phase commit). I&amp;#39;m skipping&lt;br/&gt;&amp;gt;&amp;gt; over some edge cases here that can arise if the new nodes participate&lt;br/&gt;&amp;gt;&amp;gt; consensus too early, which can cause a split majority leading to two&lt;br/&gt;&amp;gt;&amp;gt; leaders&lt;br/&gt;&amp;gt;&amp;gt; being elected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Applying this to the LN context is a bit simpler than a generalized&lt;br/&gt;&amp;gt;&amp;gt; protocol, as we typically just have two parties involved. The initiator is&lt;br/&gt;&amp;gt;&amp;gt; already naturally a &amp;#34;leader&amp;#34; in our context, as they&amp;#39;re the only ones that&lt;br/&gt;&amp;gt;&amp;gt; can do things like trigger fee updates.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Message Structure&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; At a high level I propose we introduce two new messages, with the fields&lt;br/&gt;&amp;gt;&amp;gt; looking something like this for `commitment_update_propose`:&lt;br/&gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;  * type: 1 (`propose_sig`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`64*byte`:`sig`]&lt;br/&gt;&amp;gt;&amp;gt;  * type: 2 (`update_payload`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`*byte`:`tlv_payload`]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; and this `commitment_update_apply`:&lt;br/&gt;&amp;gt;&amp;gt;  * type: 0 (`channel_id`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`32*byte`:`chan_id`]&lt;br/&gt;&amp;gt;&amp;gt;  * type: 1 (`local_propose`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;  * type: 2 (`remote_propose`)&lt;br/&gt;&amp;gt;&amp;gt;    * value: [`*byte`:`commitment_update_propose`]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Protocol Flow&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The core idea here is that either party can propose a commitment/channel&lt;br/&gt;&amp;gt;&amp;gt; param update, but only the initiator can actually apply it. The&lt;br/&gt;&amp;gt;&amp;gt; `commitment_update_propose` encodes the new set of updates, with a&lt;br/&gt;&amp;gt;&amp;gt; signature&lt;br/&gt;&amp;gt;&amp;gt; covering the TLV blob for the new params (more on why that&amp;#39;s needed&lt;br/&gt;&amp;gt;&amp;gt; later).&lt;br/&gt;&amp;gt;&amp;gt; The `commitment_update_apply` includes up to _two_&lt;br/&gt;&amp;gt;&amp;gt; `commitment_update_propose` messages (one for the initiator and one for&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; responder, as nested TLV messages). The `commitment_update_propose`&lt;br/&gt;&amp;gt;&amp;gt; message&lt;br/&gt;&amp;gt;&amp;gt; would be treated like any other `update_*` message, in that it takes a new&lt;br/&gt;&amp;gt;&amp;gt; commitment signature to properly commit/apply it.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The normal flow takes the form of both sides sending a&lt;br/&gt;&amp;gt;&amp;gt; `commitment_update_propose` message, with the initiator finally committing&lt;br/&gt;&amp;gt;&amp;gt; both by sending a `commitment_update_apply` message. In the event that&lt;br/&gt;&amp;gt;&amp;gt; only&lt;br/&gt;&amp;gt;&amp;gt; the responder wants to apply a param change/update, then the initiator can&lt;br/&gt;&amp;gt;&amp;gt; reply immediately with a `commitment_update_apply` message that doesn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; include a param change for their commitment (or they just echo the&lt;br/&gt;&amp;gt;&amp;gt; parameters if they&amp;#39;re acceptable).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Handling Retransmissions&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The role of the signature it to prevent &amp;#34;spoofing&amp;#34; by one of the parties&lt;br/&gt;&amp;gt;&amp;gt; (authenticate the param change), and also it serves to convince a party&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; they actually sent a prior commitment propose update during the&lt;br/&gt;&amp;gt;&amp;gt; retransmission phase. As the `commitment_update_propose` message would be&lt;br/&gt;&amp;gt;&amp;gt; retransmitted like any other message, if the initiator attempts to commit&lt;br/&gt;&amp;gt;&amp;gt; the update but the connection dies, they&amp;#39;ll retransmit it as normal along&lt;br/&gt;&amp;gt;&amp;gt; with their latest signature.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Nested TLV Param Generality&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The messages as sketched out here just have an opaque nested TLV field&lt;br/&gt;&amp;gt;&amp;gt; which&lt;br/&gt;&amp;gt;&amp;gt; makes it extensible to add in other things like tweaking the total number&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt; max HTLCs, the current dust values, min/max HTLCs, etc (all things that&lt;br/&gt;&amp;gt;&amp;gt; are&lt;br/&gt;&amp;gt;&amp;gt; currently hard coded for the lifetime of the channel). An initial target&lt;br/&gt;&amp;gt;&amp;gt; would likely just be a `chan_type` field, with future feature bits&lt;br/&gt;&amp;gt;&amp;gt; governing&lt;br/&gt;&amp;gt;&amp;gt; _what_ type of commitment updates both parties understand in the future.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the past, when ideas like this were brought up, some were concerned&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; it wouldn&amp;#39;t really be possible to do this type of updates while existing&lt;br/&gt;&amp;gt;&amp;gt; HTLCs were in flight (hence some of the ideas to clear out the commitment&lt;br/&gt;&amp;gt;&amp;gt; beforehand). I don&amp;#39;t see a reason why this fundamentally _shouldn&amp;#39;t_ be&lt;br/&gt;&amp;gt;&amp;gt; allowed, as from the point of view of the channel update state machine,&lt;br/&gt;&amp;gt;&amp;gt; all&lt;br/&gt;&amp;gt;&amp;gt; updates (adds/removes) get applied as normal, but with this _new_&lt;br/&gt;&amp;gt;&amp;gt; commitment&lt;br/&gt;&amp;gt;&amp;gt; type/params. The main edge case we&amp;#39;ll need to consider is cases where the&lt;br/&gt;&amp;gt;&amp;gt; new params make older HTLCs invalid for some reason.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Conclusion&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Using the adapter commitment idea combined with a protocol for updating&lt;br/&gt;&amp;gt;&amp;gt; commitments on the fly, would potentially allow us to update all 80k&#43;&lt;br/&gt;&amp;gt;&amp;gt; segwit&lt;br/&gt;&amp;gt;&amp;gt; v0 channels to the base level of taprooty channels without any on chain&lt;br/&gt;&amp;gt;&amp;gt; transactions. The two transactions (open&#43;close) must happen eventually,&lt;br/&gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt; by holding another layer of spends off-chain we can defer them&lt;br/&gt;&amp;gt;&amp;gt; (potentially&lt;br/&gt;&amp;gt;&amp;gt; indefinitely, as we have channels today that have been opened for over a&lt;br/&gt;&amp;gt;&amp;gt; year).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Deploying a generalised on-the-fly dynamic commitment update protocol&lt;br/&gt;&amp;gt;&amp;gt; gives&lt;br/&gt;&amp;gt;&amp;gt; us a tool to future proof the _existing_ anchored multi-sig outputs in the&lt;br/&gt;&amp;gt;&amp;gt; chain, and also a way to remove many of the hard coded parameters we have&lt;br/&gt;&amp;gt;&amp;gt; today in the protocol. One overly inflexible parameter we have today in&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; network is the 483 HTLC limit. Allowing this value to float would allow&lt;br/&gt;&amp;gt;&amp;gt; peers to apply similar congestion avoidance algorithm that are used in TCP&lt;br/&gt;&amp;gt;&amp;gt; today, and also give us a way to protect the network against future&lt;br/&gt;&amp;gt;&amp;gt; unforeseen widespread policy changes (like a raising of the dust limit).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002763.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-July/002770.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [3]: &lt;a href=&#34;https://github.com/lightning/bolts/pull/868&#34;&gt;https://github.com/lightning/bolts/pull/868&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221027/70db062c/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20221027/70db062c/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T13:07:09Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsfsg0d7exhm0vdsdkedwgyl84ml3qsak8ejy2ukwklflyv68qs9wqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9785grx0</id>
    
      <title type="html">📅 Original date posted:2020-11-23 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsfsg0d7exhm0vdsdkedwgyl84ml3qsak8ejy2ukwklflyv68qs9wqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9785grx0" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs2jupnterd6c69tja744nj0ly0a0hqt27dp32jnmrfrr8ucacwfrq9x6wv2&#39;&gt;nevent1q…6wv2&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-11-23&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi,&lt;br/&gt;&lt;br/&gt;Posting an update to this thread, as we are inching closer to an&lt;br/&gt;implementation in lnd that handles this scenario.&lt;br/&gt;&lt;br/&gt;I put up a proposed PR today that attempts to solve this in a&lt;br/&gt;backwards compatible manner:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/pull/4795&#34;&gt;https://github.com/lightningnetwork/lnd/pull/4795&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;The gist is that in every state we check that the &amp;#34;worst case fee&lt;br/&gt;leak&amp;#34; is at most the channel reserve. The idea is that there should be&lt;br/&gt;no incentive to perform the attack as described, as the cheating party&lt;br/&gt;will gain at most the channel reserve, but at the same time lose its&lt;br/&gt;channel reserve.&lt;br/&gt;&lt;br/&gt;Since this makes small channels unusable at high fee rates (the leaked&lt;br/&gt;fee would exceed the channel reserve for just a few, even a single&lt;br/&gt;HTLC) we also clamp the maximum update_fee we&amp;#39;ll send at 10 sat/b (a&lt;br/&gt;configurable value). As an example a 1,000,000 sat channel with a 1%&lt;br/&gt;channel reserve would have space for 6 HTLCs at this fee rate.&lt;br/&gt;&lt;br/&gt;&amp;gt; Completely adhering to the bring-your-own-fee model for HTLC-txn sounds better as it splits more fairly fees burden between channel participants.&lt;br/&gt;&lt;br/&gt;I totally agree that this sounds like the best solution! AFAICT this&lt;br/&gt;would require a (simple) spec change, but would definitely be a big&lt;br/&gt;win and a simple implementation change when we are doing BYOF on the&lt;br/&gt;HTLC transactions anyway :)&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Mon, Sep 14, 2020 at 1:30 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I would be open to patching the spec to disallow update_fee for anchor&lt;br/&gt;&amp;gt; &amp;gt; channels, but maybe we can just add a warning and discourage it.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My initial thinking was just to restrain it for the commitment-level only.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Completely adhering to the bring-your-own-fee model for HTLC-txn sounds better as it splits more fairly fees burden between channel participants. The initiator won&amp;#39;t have to pay for the remote&amp;#39;s HTLC-txn, especially in periods of high-congestion. A participant shouldn&amp;#39;t have to bear the cost of the counterparty choosing to go onchain, as it&amp;#39;s mostly a client security parameter (&amp;#34;how many blocks it will take me to confirm ?&amp;#34;)  or an economic decision (&amp;#34;is this HTLC worthy to claim/expire ?&amp;#34;).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One could argue it&amp;#39;s increasing the blockspace footprint as you will use one more pair of input-output but if you&amp;#39;re paying the feerate that&amp;#39;s lawful usage.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le ven. 11 sept. 2020 à 04:15, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Very good observation, most definitely not a type of attack I forseen!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Luckily, it was the plan to phase out update_fee all along, in favor&lt;br/&gt;&amp;gt;&amp;gt; of only accepting the minimum relay fee (zero fee if/when package&lt;br/&gt;&amp;gt;&amp;gt; relay is a reality). If I understand the scenario correctly, that&lt;br/&gt;&amp;gt;&amp;gt; should mitigate this attack completely, as the attacker cannot impact&lt;br/&gt;&amp;gt;&amp;gt; the intended miner fees on the HTLCs, and could only siphon off the&lt;br/&gt;&amp;gt;&amp;gt; minimal miner fee if anything at all.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I would be open to patching the spec to disallow update_fee for anchor&lt;br/&gt;&amp;gt;&amp;gt; channels, but maybe we can just add a warning and discourage it.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Johan&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Thu, Sep 10, 2020 at 8:13 PM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Hi Antoine,&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Great findings!&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I think an even simpler mitigation is just for the non-initiator to _reject_&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; update_fee proposals that are &amp;#34;unreasonable&amp;#34;. The non-initiator can run a&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; &amp;#34;fee leak calculation&amp;#34; to compute the worst-case leakage of fees in the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; revocation case. This can be done to day without any significant updates to&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; implementations, and some implementations may already be doing this.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; One issue is that we don&amp;#39;t have a way to do a &amp;#34;soft reject&amp;#34; of an update_fee&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; as is. However, depending on the implementations, it may be possible to just&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; reconnect and issue a co-op close if there&amp;#39;re no HTLCs on the commitment&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; transaction.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; As you mentioned by setting proper values for max allowed htlcs, max in&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; flight, reserve, etc, nodes are able to quantify this fee leak risk ahead of&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; time, and set reasonable parameters based on their security model. One issue&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; is that these values are set in stone rn when the channel is opened, but&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; future iterations of dynamic commitments may allow us to update them on the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; fly.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In the mid-term, implementations can start to phase out usage of update_fee&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; by setting a minimal commitment fee when the channel is first opened, then&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; relying on CPFP to bump up the commitment and any HTLCs if needed. This&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; discovery might very well hasten the demise of update_fee in the protocol&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; all together as well.  I don&amp;#39;t think we need to depend entirely on a&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; theoretical package relay Bitcoin p2p upgrade assuming implementations are&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; willing to make an assumption that say 20 sat/byte or w/e has a good chance&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; of widespread propagation into mempools.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; From the perspective of channel safety, and variations of attacks like&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; &amp;#34;flood &amp;amp; loot&amp;#34;, imo it&amp;#39;s absolutely critical that nodes are able to update&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; the fees on their second-level HTLC transactions. As this is where the real&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; danger lies: if nodes aren&amp;#39;t able to get 2nd level HTLCs in the chain in&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; time, then the incoming HTLC expiry will expire, creating a race condition&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; across both commitments which can potentially cascade.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; In lnd today, anchors is still behind a build flag, but we plan to enable&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; it by default for our upcoming 0.12 release. The blockers on our end were to&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; add support for towers, and add basic deadline aware bumping, both of which&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; are currently on track. We&amp;#39;ll now also look into setting clamps on the&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; receiver end to just not accept unreasonable values for the fee rate of a&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; commitment, as this ends up eating into the true HTLC values for both sides.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; On Thu, Sep 10, 2020 at 9:28 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Hi,&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; In this post, I would like to expose a potential vulnerability introduced by the recent anchor output spec update related to the new usage of SIGHASH_SINGLE for HTLC transactions. This new malleability combined with the currently deployed mechanism of `update_fee` is likely harmful for funds safety.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; This has been previously shared with deployed implementations devs, as anchor channels are flagged as experimental it&amp;#39;s better to discuss and solve this publicly. That said, if you&amp;#39;re currently running experimental anchor channels with non-trusted parties on mainnet, you might prefer to close them.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; # SIGHASH_SINGLE and `update_fee` (skip it if you&amp;#39;re familiar)&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; First, let&amp;#39;s get started by a quick reminder of the data set committed by signature digest algorithm of Segwit transactions (BIP 143):&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * nVersion&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * hashPrevouts&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * hashSequence&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * outpoint&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * scriptCode of the input&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * value of the output spent by this input&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * nSequence of the input&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * hashOutputs&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * nLocktime&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; * sighash type of the signature&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Anchor output switched the sighash type from SIGHASH_ALL to SIGHASH_SINGLE | SIGHASH_ANYONECANPAY for HTLC signatures sent to your counterparty. Thus it can spend non-cooperatively its HTLC outputs on its commitment transactions. I.e when Alice broadcasts her commitment transaction, every Bob&amp;#39;s signatures on Alice&amp;#39;s HTLC-Success/Timeout transactions are now flagging the new sighash type.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Thus `hashPrevouts`, `hashSequence` (ANYONECANPAY) and `hashOutputs` (SINGLE) aren&amp;#39;t committed anymore. SINGLE only enforces commitment to the output scriptpubkey/amount at the same index that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; the spending input. Alice is free to attach additional inputs/outputs to her HTLC transaction. This change is aiming to let a single-party bump the feerate of 2nd-stage HTLC transactions in case of mempool-congestion, without counterparty cooperation and thus make HTLC funds safer.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; The attached outputs are _not_ encumbered by a revokeable redeemscript for a potential punishment.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; That said, anchor ouput spec didn&amp;#39;t change disable the current fee mechanism already covering HTLC transactions. Pre/post-anchor channels are negotiating a feerate through `update_fee` exchange, initiated by the channel funder. This `update_fee` can be rejected by the receiver if it&amp;#39;s deemed unreasonable compared to your local fee estimator view, but as of today implementations are pretty liberal in their acceptance, admitting a divergence from a scale of 1 to no-bound at all.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; This negotiated feerate (`feerate_per_kw`) is used by channel participants to compute effective fees which have to be deduced either from the funder balance output for commitment transactions or from HTLC output value for HTLC transactions.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; # The Vulnerability : a Penalty Escape Vector&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; By increasing the feerate thanks to `update_fee`, a malicious party can inflate fees committed on HTLC input/output pairs and redirect this inflated fee to a single-controlled output attached to these malleable pairs. This won&amp;#39;t be punishable by an honest party in case of revoked state broadcast and thus enable to partially escape the penalty.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; As an example, Alice and Bob have a 100_000 sats channel. `feerate_per_kw` is 10000 sats.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; At state N, Alice balance is all on her side. She announces 10 outgoing HTLCs of value 7000 sats.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; As Commitment tx weight with 10 outputs is 2844 (post-anchor), the absolute fee committed is 28440 sats.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; As HTLC-timeout weight is 666 (post-anchor), the absolute fee committed is of 6660 sat, the HTLC tx output as counter-signed by Bob is of 340 sat. This absolute fee aims to pay the miner fee in case Alice needs to timeout HTLC onchain.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Her remaining balance is 1560 sat, above both dust_limit_satoshi and the channel reserve as constrained by Bob (likely 1%).&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Alice waits for HTLCs to expire and advances state to N&#43;1. Then she empties her balance minus reserve by sending a HTLC relayed by Bob either to a colluding channel on the rest of network or back to an onchain address thanks to a swap service.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; At state N&#43;2, Alice finalizes HTLC-timeout of state N by capturing almost all of the absolute fee to a new P2WPKH output only controlled by her. She broadcasts the revoked commitment tx N and burns 28440 sats in commitment fee.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Her balance of 1560 sats is punished by Bob&amp;#39;s justice transaction.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; After confirmation and thus maturing of the CSV of 1 on her HTLC output Alice broadcasts her 10 HTLC-timeout sending back to her 6660 sat - 660 to pay a low-fee. Bob punishes the 10 HTLC-timeout outputs of 340 sats.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Alice gain =  99_000 (swap spend) &#43; 66_660 (HTLCs escape) - 1560 (commitment balance punishment) - 28440 (commitment fee) - 660*10 (HTLCs fees) - 340*10 (HTLCs output) = 125600 sats.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Alice&amp;#39;s gain is superior at channel value as it has been partially double-spend by bypassing the revocation punishment.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; # Limitations of Attacker Success&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; A first limitation of attack success which can be point of is the fact that post-anchor HTLC outputs are CSV&amp;#39;ed by 1, which means in theory a honest party can punish this output before the malicious spend them with the revoked HTLC txn. In practice a malicious party can attach a branch of descendants to its anchor output and that way only allowing one more mempool victim&amp;#39;s transaction on the revoked commitment. The victim must spend all outputs at once or otherwise they&amp;#39;re going to obstrucate each other at mempool acceptance.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Secondly, other limitations  are the per-implementation channel policy `max_accepted_htlcs`, `max_htlc_value_in_flight`, `channel_reserve` and acceptance bound of `update_fee`. A quick look at default policies, even if they vary between deploy implementations, let it think there is room to escape a substantial part of channel value.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Lastly, after the revoked commitment transaction is confirmed, both attacker and victim are in a feerate race to confirm either a justice transaction or a malicious HTLC-timeout. As fee estimator logic of the victim&amp;#39;s implementation is a public piece of knowledge, it shouldn&amp;#39;t be hard for the attacker to know the range of the first fee bid and override it by a bit to confirm it before the victim RBF at next block. Currently, not all implementations have RBF of justice transactions.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; As of today, if anchor output is deployed and given how LN implementations are managing fees/rebroadcast of onchain transactions, the chance of attack success sounds high in my opinion.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; # Countermeasures&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Channel policies could be tighter, like bounded further down `max_accepted_htlcs` or restraining acceptance of `update_fee`. For the latter, it&amp;#39;s pretty hard as a) fee estimators diverge on mempool views b) an attacker can craft escape HTLC-txn in a period of high-fee and patiently waits a low-fee period to launch the exploitation.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Justice transactions can adopt a scorched earth approach binding their feerate to the max to increase odds of winning the feerate race and thus deter attackers. But this sounds like introducing a griefing attack vector. Your counterparty can burn more of your lawful balance in fees than you&amp;#39;ll punish its revoked balance.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; A workable option would be to patch current anchor spec to remove `feerate_per_kw` appliance on 2nd-stage transactions, maybe just committing a minimal relay fee.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Thoughts of further countermeasures ?&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; I think the vulnerability described is mostly right but please point any missing details.&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;
    </content>
    <updated>2023-06-09T13:01:30Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs9trkq926dlvsdejgsxj22z4wk3wzlk8eplla3sty2uy9m9mrhgyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97kvaqwk</id>
    
      <title type="html">📅 Original date posted:2020-10-16 📝 Original message: Many ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs9trkq926dlvsdejgsxj22z4wk3wzlk8eplla3sty2uy9m9mrhgyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97kvaqwk" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsx5qf6kupseyen6sumzfhmt5shz4ptpdgecwsazx2waahpucunndgr8cwqw&#39;&gt;nevent1q…cwqw&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-10-16&lt;br/&gt;📝 Original message:&lt;br/&gt;Many good thoughts here.&lt;br/&gt;&lt;br/&gt;Personally I think we should design any changes for a package-relay&lt;br/&gt;future, where the commitment can be 0-fee, update_fee doesn&amp;#39;t longer&lt;br/&gt;exist and fees are only decided upon on channel close.&lt;br/&gt;&lt;br/&gt;- johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Wed, Oct 14, 2020 at 10:25 AM Bastien TEINTURIER via Lightning-dev&lt;br/&gt;&amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I totally agree with the simplicity argument, I wanted to raise this because it&amp;#39;s (IMO) an issue&lt;br/&gt;&amp;gt; today because of the way we deal with on-chain fees, but it&amp;#39;s less impactful once update_fee is&lt;br/&gt;&amp;gt; scoped to some min_relay_fee.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s put this aside for now then and we can revisit later if needed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for the feedback everyone!&lt;br/&gt;&amp;gt; Bastien&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le lun. 12 oct. 2020 à 20:49, Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; It seems to me that the &amp;#34;funder pays all the commit tx fees&amp;#34; rule exists&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; solely for simplicity (which was totally reasonable).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; At this stage, I&amp;#39;ve learned that simplicity (when doing anything that&lt;br/&gt;&amp;gt;&amp;gt; involves multi-party on-chain fee negotiating/verification/enforcement can&lt;br/&gt;&amp;gt;&amp;gt; really go a long way). Just think about all the edge cases w.r.t _allocating&lt;br/&gt;&amp;gt;&amp;gt; enough funds to pay for fees_ we&amp;#39;ve discovered over the past few years in&lt;br/&gt;&amp;gt;&amp;gt; the state machine. I fear adding a more elaborate fee splitting mechanism&lt;br/&gt;&amp;gt;&amp;gt; would only blow up the number of obscure edge cases that may lead to a&lt;br/&gt;&amp;gt;&amp;gt; channel temporarily or permanently being &amp;#34;borked&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If we&amp;#39;re going to add a &amp;#34;fairer&amp;#34; way of splitting fees, we&amp;#39;ll really need to&lt;br/&gt;&amp;gt;&amp;gt; dig down pre-deployment to ensure that we&amp;#39;ve explored any resulting edge&lt;br/&gt;&amp;gt;&amp;gt; cases within our solution space, as we&amp;#39;ll only be _adding_ complexity to fee&lt;br/&gt;&amp;gt;&amp;gt; splitting.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; IMO, anchor commitments in their &amp;#34;final form&amp;#34; (fixed fee rate on commitment&lt;br/&gt;&amp;gt;&amp;gt; transaction, only &amp;#34;emergency&amp;#34; use of update_fee) significantly simplifies&lt;br/&gt;&amp;gt;&amp;gt; things as it shifts from &amp;#34;funding pay fees&amp;#34;, to &amp;#34;broadcaster/confirmer pays&lt;br/&gt;&amp;gt;&amp;gt; fees&amp;#34;. However, as you note this doesn&amp;#39;t fully distribute the worst-case&lt;br/&gt;&amp;gt;&amp;gt; cost of needing to go to chain with a &amp;#34;fully loaded&amp;#34; commitment transaction.&lt;br/&gt;&amp;gt;&amp;gt; Even with HTLCs, they could only be signed at 1 sat/byte from the funder&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; perspective, once again putting the burden on the broadcaster/confirmer to&lt;br/&gt;&amp;gt;&amp;gt; make up the difference.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Mon, Oct 5, 2020 at 6:13 AM Bastien TEINTURIER via Lightning-dev &amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; It seems to me that the &amp;#34;funder pays all the commit tx fees&amp;#34; rule exists solely for simplicity&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (which was totally reasonable). I haven&amp;#39;t been able to find much discussion about this decision&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; on the mailing list nor in the spec commits.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; At first glance, it&amp;#39;s true that at the beginning of the channel lifetime, the funder should be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; responsible for the fee (it&amp;#39;s his decision to open a channel after all). But as time goes by and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; both peers earn value from this channel, this rule becomes questionable. We&amp;#39;ve discovered since&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; then that there is some risk associated with having pending HTLCs (flood-and-loot type of attacks,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; pinning, channel jamming, etc).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think that *in some cases*, fundees should be paying a portion of the commit-tx on-chain fees,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; otherwise we may end up with a web-of-trust network where channels would only exist between peers&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that trust each other, which is quite limiting (I&amp;#39;m hoping we can do better).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Routing nodes may be at risk when they *receive* HTLCs. All the attacks that steal funds come from&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the fact that a routing node has paid downstream but cannot claim the upstream HTLCs (correct me&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; if that&amp;#39;s incorrect). Thus I&amp;#39;d like nodes to pay for the on-chain fees of the HTLCs they offer&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; while they&amp;#39;re pending in the commit-tx, regardless of whether they&amp;#39;re funder or fundee.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The simplest way to do this would be to deduce the HTLC cost (172 * feerate) from the offerer&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; main output (instead of the funder&amp;#39;s main output, while keeping the base commit tx weight paid&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; by the funder).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; A more extreme proposal would be to tie the *total* commit-tx fee to the channel usage:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * if there are no pending HTLCs, the funder pays all the fee&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * if there are pending HTLCs, each node pays a proportion of the fee proportional to the number of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs they offered. If Alice offered 1 HTLC and Bob offered 3 HTLCs, Bob pays 75% of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; commit-tx fee and Alice pays 25%. When the HTLCs settle, the fee is redistributed.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; This model uses the on-chain fee as collateral for usage of the channel. If Alice wants to forward&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; HTLCs through this channel (because she has something to gain - routing fees), she should be taking&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; on some of the associated risk, not Bob. Bob will be taking the same risk downstream if he chooses&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; to forward.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I believe it also forces the fundee to care about on-chain feerates, which is a healthy incentive.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; It may create a feedback loop between on-chain feerates and routing fees, which I believe is also&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a good long-term thing (but it&amp;#39;s hard to predict as there may be negative side-effects as well).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; What do you all think? Is this a terrible idea? Is it okay-ish, but not worth the additional&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; complexity? Is it an amazing idea worth a lightning nobel? Please don&amp;#39;t take any of my claims&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; for granted and challenge them, there may be negative side-effects I&amp;#39;m completely missing, this is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a fragile game of incentives...&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Side-note: don&amp;#39;t forget to take into account that the fees for HTLC transactions (second-level txs)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; are always paid by the party that broadcasts them (which makes sense). I still think this is not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; enough and can even be abused by fundees in some setups.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Thanks,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Bastien&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;
    </content>
    <updated>2023-06-09T13:01:03Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsywe94m0c4w8wuhxym7j0ghclvjxxsxempvxha98jwfdvsw0ldr0szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970v9d5h</id>
    
      <title type="html">📅 Original date posted:2020-09-11 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsywe94m0c4w8wuhxym7j0ghclvjxxsxempvxha98jwfdvsw0ldr0szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970v9d5h" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsraa2m52pszfqazwex2h5z5khwyvalqw6v3qafkf4tfmnn9ycxcksmxdrph&#39;&gt;nevent1q…drph&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-09-11&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi,&lt;br/&gt;&lt;br/&gt;Very good observation, most definitely not a type of attack I forseen!&lt;br/&gt;&lt;br/&gt;Luckily, it was the plan to phase out update_fee all along, in favor&lt;br/&gt;of only accepting the minimum relay fee (zero fee if/when package&lt;br/&gt;relay is a reality). If I understand the scenario correctly, that&lt;br/&gt;should mitigate this attack completely, as the attacker cannot impact&lt;br/&gt;the intended miner fees on the HTLCs, and could only siphon off the&lt;br/&gt;minimal miner fee if anything at all.&lt;br/&gt;&lt;br/&gt;I would be open to patching the spec to disallow update_fee for anchor&lt;br/&gt;channels, but maybe we can just add a warning and discourage it.&lt;br/&gt;&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Thu, Sep 10, 2020 at 8:13 PM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Antoine,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Great findings!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think an even simpler mitigation is just for the non-initiator to _reject_&lt;br/&gt;&amp;gt; update_fee proposals that are &amp;#34;unreasonable&amp;#34;. The non-initiator can run a&lt;br/&gt;&amp;gt; &amp;#34;fee leak calculation&amp;#34; to compute the worst-case leakage of fees in the&lt;br/&gt;&amp;gt; revocation case. This can be done to day without any significant updates to&lt;br/&gt;&amp;gt; implementations, and some implementations may already be doing this.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One issue is that we don&amp;#39;t have a way to do a &amp;#34;soft reject&amp;#34; of an update_fee&lt;br/&gt;&amp;gt; as is. However, depending on the implementations, it may be possible to just&lt;br/&gt;&amp;gt; reconnect and issue a co-op close if there&amp;#39;re no HTLCs on the commitment&lt;br/&gt;&amp;gt; transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As you mentioned by setting proper values for max allowed htlcs, max in&lt;br/&gt;&amp;gt; flight, reserve, etc, nodes are able to quantify this fee leak risk ahead of&lt;br/&gt;&amp;gt; time, and set reasonable parameters based on their security model. One issue&lt;br/&gt;&amp;gt; is that these values are set in stone rn when the channel is opened, but&lt;br/&gt;&amp;gt; future iterations of dynamic commitments may allow us to update them on the&lt;br/&gt;&amp;gt; fly.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In the mid-term, implementations can start to phase out usage of update_fee&lt;br/&gt;&amp;gt; by setting a minimal commitment fee when the channel is first opened, then&lt;br/&gt;&amp;gt; relying on CPFP to bump up the commitment and any HTLCs if needed. This&lt;br/&gt;&amp;gt; discovery might very well hasten the demise of update_fee in the protocol&lt;br/&gt;&amp;gt; all together as well.  I don&amp;#39;t think we need to depend entirely on a&lt;br/&gt;&amp;gt; theoretical package relay Bitcoin p2p upgrade assuming implementations are&lt;br/&gt;&amp;gt; willing to make an assumption that say 20 sat/byte or w/e has a good chance&lt;br/&gt;&amp;gt; of widespread propagation into mempools.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; From the perspective of channel safety, and variations of attacks like&lt;br/&gt;&amp;gt; &amp;#34;flood &amp;amp; loot&amp;#34;, imo it&amp;#39;s absolutely critical that nodes are able to update&lt;br/&gt;&amp;gt; the fees on their second-level HTLC transactions. As this is where the real&lt;br/&gt;&amp;gt; danger lies: if nodes aren&amp;#39;t able to get 2nd level HTLCs in the chain in&lt;br/&gt;&amp;gt; time, then the incoming HTLC expiry will expire, creating a race condition&lt;br/&gt;&amp;gt; across both commitments which can potentially cascade.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In lnd today, anchors is still behind a build flag, but we plan to enable&lt;br/&gt;&amp;gt; it by default for our upcoming 0.12 release. The blockers on our end were to&lt;br/&gt;&amp;gt; add support for towers, and add basic deadline aware bumping, both of which&lt;br/&gt;&amp;gt; are currently on track. We&amp;#39;ll now also look into setting clamps on the&lt;br/&gt;&amp;gt; receiver end to just not accept unreasonable values for the fee rate of a&lt;br/&gt;&amp;gt; commitment, as this ends up eating into the true HTLC values for both sides.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Thu, Sep 10, 2020 at 9:28 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In this post, I would like to expose a potential vulnerability introduced by the recent anchor output spec update related to the new usage of SIGHASH_SINGLE for HTLC transactions. This new malleability combined with the currently deployed mechanism of `update_fee` is likely harmful for funds safety.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This has been previously shared with deployed implementations devs, as anchor channels are flagged as experimental it&amp;#39;s better to discuss and solve this publicly. That said, if you&amp;#39;re currently running experimental anchor channels with non-trusted parties on mainnet, you might prefer to close them.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # SIGHASH_SINGLE and `update_fee` (skip it if you&amp;#39;re familiar)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; First, let&amp;#39;s get started by a quick reminder of the data set committed by signature digest algorithm of Segwit transactions (BIP 143):&lt;br/&gt;&amp;gt;&amp;gt; * nVersion&lt;br/&gt;&amp;gt;&amp;gt; * hashPrevouts&lt;br/&gt;&amp;gt;&amp;gt; * hashSequence&lt;br/&gt;&amp;gt;&amp;gt; * outpoint&lt;br/&gt;&amp;gt;&amp;gt; * scriptCode of the input&lt;br/&gt;&amp;gt;&amp;gt; * value of the output spent by this input&lt;br/&gt;&amp;gt;&amp;gt; * nSequence of the input&lt;br/&gt;&amp;gt;&amp;gt; * hashOutputs&lt;br/&gt;&amp;gt;&amp;gt; * nLocktime&lt;br/&gt;&amp;gt;&amp;gt; * sighash type of the signature&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Anchor output switched the sighash type from SIGHASH_ALL to SIGHASH_SINGLE | SIGHASH_ANYONECANPAY for HTLC signatures sent to your counterparty. Thus it can spend non-cooperatively its HTLC outputs on its commitment transactions. I.e when Alice broadcasts her commitment transaction, every Bob&amp;#39;s signatures on Alice&amp;#39;s HTLC-Success/Timeout transactions are now flagging the new sighash type.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thus `hashPrevouts`, `hashSequence` (ANYONECANPAY) and `hashOutputs` (SINGLE) aren&amp;#39;t committed anymore. SINGLE only enforces commitment to the output scriptpubkey/amount at the same index that&lt;br/&gt;&amp;gt;&amp;gt; the spending input. Alice is free to attach additional inputs/outputs to her HTLC transaction. This change is aiming to let a single-party bump the feerate of 2nd-stage HTLC transactions in case of mempool-congestion, without counterparty cooperation and thus make HTLC funds safer.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The attached outputs are _not_ encumbered by a revokeable redeemscript for a potential punishment.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; That said, anchor ouput spec didn&amp;#39;t change disable the current fee mechanism already covering HTLC transactions. Pre/post-anchor channels are negotiating a feerate through `update_fee` exchange, initiated by the channel funder. This `update_fee` can be rejected by the receiver if it&amp;#39;s deemed unreasonable compared to your local fee estimator view, but as of today implementations are pretty liberal in their acceptance, admitting a divergence from a scale of 1 to no-bound at all.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This negotiated feerate (`feerate_per_kw`) is used by channel participants to compute effective fees which have to be deduced either from the funder balance output for commitment transactions or from HTLC output value for HTLC transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # The Vulnerability : a Penalty Escape Vector&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; By increasing the feerate thanks to `update_fee`, a malicious party can inflate fees committed on HTLC input/output pairs and redirect this inflated fee to a single-controlled output attached to these malleable pairs. This won&amp;#39;t be punishable by an honest party in case of revoked state broadcast and thus enable to partially escape the penalty.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As an example, Alice and Bob have a 100_000 sats channel. `feerate_per_kw` is 10000 sats.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; At state N, Alice balance is all on her side. She announces 10 outgoing HTLCs of value 7000 sats.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As Commitment tx weight with 10 outputs is 2844 (post-anchor), the absolute fee committed is 28440 sats.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As HTLC-timeout weight is 666 (post-anchor), the absolute fee committed is of 6660 sat, the HTLC tx output as counter-signed by Bob is of 340 sat. This absolute fee aims to pay the miner fee in case Alice needs to timeout HTLC onchain.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Her remaining balance is 1560 sat, above both dust_limit_satoshi and the channel reserve as constrained by Bob (likely 1%).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Alice waits for HTLCs to expire and advances state to N&#43;1. Then she empties her balance minus reserve by sending a HTLC relayed by Bob either to a colluding channel on the rest of network or back to an onchain address thanks to a swap service.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; At state N&#43;2, Alice finalizes HTLC-timeout of state N by capturing almost all of the absolute fee to a new P2WPKH output only controlled by her. She broadcasts the revoked commitment tx N and burns 28440 sats in commitment fee.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Her balance of 1560 sats is punished by Bob&amp;#39;s justice transaction.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; After confirmation and thus maturing of the CSV of 1 on her HTLC output Alice broadcasts her 10 HTLC-timeout sending back to her 6660 sat - 660 to pay a low-fee. Bob punishes the 10 HTLC-timeout outputs of 340 sats.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Alice gain =  99_000 (swap spend) &#43; 66_660 (HTLCs escape) - 1560 (commitment balance punishment) - 28440 (commitment fee) - 660*10 (HTLCs fees) - 340*10 (HTLCs output) = 125600 sats.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Alice&amp;#39;s gain is superior at channel value as it has been partially double-spend by bypassing the revocation punishment.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # Limitations of Attacker Success&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A first limitation of attack success which can be point of is the fact that post-anchor HTLC outputs are CSV&amp;#39;ed by 1, which means in theory a honest party can punish this output before the malicious spend them with the revoked HTLC txn. In practice a malicious party can attach a branch of descendants to its anchor output and that way only allowing one more mempool victim&amp;#39;s transaction on the revoked commitment. The victim must spend all outputs at once or otherwise they&amp;#39;re going to obstrucate each other at mempool acceptance.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Secondly, other limitations  are the per-implementation channel policy `max_accepted_htlcs`, `max_htlc_value_in_flight`, `channel_reserve` and acceptance bound of `update_fee`. A quick look at default policies, even if they vary between deploy implementations, let it think there is room to escape a substantial part of channel value.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Lastly, after the revoked commitment transaction is confirmed, both attacker and victim are in a feerate race to confirm either a justice transaction or a malicious HTLC-timeout. As fee estimator logic of the victim&amp;#39;s implementation is a public piece of knowledge, it shouldn&amp;#39;t be hard for the attacker to know the range of the first fee bid and override it by a bit to confirm it before the victim RBF at next block. Currently, not all implementations have RBF of justice transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As of today, if anchor output is deployed and given how LN implementations are managing fees/rebroadcast of onchain transactions, the chance of attack success sounds high in my opinion.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # Countermeasures&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Channel policies could be tighter, like bounded further down `max_accepted_htlcs` or restraining acceptance of `update_fee`. For the latter, it&amp;#39;s pretty hard as a) fee estimators diverge on mempool views b) an attacker can craft escape HTLC-txn in a period of high-fee and patiently waits a low-fee period to launch the exploitation.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Justice transactions can adopt a scorched earth approach binding their feerate to the max to increase odds of winning the feerate race and thus deter attackers. But this sounds like introducing a griefing attack vector. Your counterparty can burn more of your lawful balance in fees than you&amp;#39;ll punish its revoked balance.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A workable option would be to patch current anchor spec to remove `feerate_per_kw` appliance on 2nd-stage transactions, maybe just committing a minimal relay fee.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thoughts of further countermeasures ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think the vulnerability described is mostly right but please point any missing details.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;
    </content>
    <updated>2023-06-09T13:00:52Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxjg82lxeuf7ru29lxqx8epzcvt837gs2emnltrfeh4tcuk7cd4tszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ne0uhm</id>
    
      <title type="html">📅 Original date posted:2020-02-04 📝 Original message: 2) ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxjg82lxeuf7ru29lxqx8epzcvt837gs2emnltrfeh4tcuk7cd4tszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ne0uhm" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsx96clenhdmxjukg78s6u2xj0mpzw3673swpwrusr9tmd2x9fygdcdevsw4&#39;&gt;nevent1q…vsw4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-02-04&lt;br/&gt;📝 Original message:&lt;br/&gt;2) lnd is getting the API you need in the next release (v0.10), that&lt;br/&gt;let you subscribe to HTLC events. See PR&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/pull/3848&#34;&gt;https://github.com/lightningnetwork/lnd/pull/3848&lt;/a&gt;. The notification&lt;br/&gt;won&amp;#39;t be signed (but the stream uses TLS), but that can easily be&lt;br/&gt;added using the `signmessage` API:&lt;br/&gt;&lt;a href=&#34;https://api.lightning.community/#signmessage&#34;&gt;https://api.lightning.community/#signmessage&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Sun, Feb 2, 2020 at 1:46 PM Pavol Rusnak via Lightning-dev&lt;br/&gt;&amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi all!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I have a couple of unrelated questions, hope you can give me some pointers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1) Is c-lightning going to support Sphinx or other form of spontaneous payments?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 2) Can a lightning node (such as lnd or c-lightning) send a push notification (e.g. to a webhook) when it receives or routes a payment? If yes, is this notification cryptographically signed (for example with the node&amp;#39;s private key)? Is this documented somewhere?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; --&lt;br/&gt;&amp;gt; Best Regards / S pozdravom,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Pavol &amp;#34;stick&amp;#34; Rusnak&lt;br/&gt;&amp;gt; CTO, SatoshiLabs&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;
    </content>
    <updated>2023-06-09T12:58:30Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsras2ufdwgkpxmz7ng26m069kclzg087l98uvq2630jqcma7gn9qczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r973ft89d</id>
    
      <title type="html">📅 Original date posted:2019-10-30 📝 Original message: On ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsras2ufdwgkpxmz7ng26m069kclzg087l98uvq2630jqcma7gn9qczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r973ft89d" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsd48jzmp82mg4txh2fvrxjc7reptr28752nwds3pkddep57ersdrc5e00qq&#39;&gt;nevent1q…00qq&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-30&lt;br/&gt;📝 Original message:&lt;br/&gt;On Mon, Oct 28, 2019 at 6:16 PM David A. Harding &amp;lt;dave at dtrt.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; A parent transaction near the limit of 100,000 vbytes could have almost&lt;br/&gt;&amp;gt; 10,000 outputs paying OP_TRUE (10 vbytes per output).  If the children&lt;br/&gt;&amp;gt; were limited to 10,000 vbytes each (the current max carve-out size),&lt;br/&gt;&amp;gt; that allows relaying 100 mega-vbytes or nearly 400 MB data size (larger&lt;br/&gt;&amp;gt; than the default maximum mempool size in Bitcoin Core).&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks, Dave, I wasn&amp;#39;t aware the limits would allow this many outputs. And&lt;br/&gt;as your calculation shows, this opens up the potential for free relay of&lt;br/&gt;large amounts of data.&lt;br/&gt;&lt;br/&gt;We could start special casing to only allow this for &amp;#34;LN commitment-like&amp;#34;&lt;br/&gt;transactions, but this would be application specific changes, and your&lt;br/&gt;calculation shows that even with the BOLT2 numbers there still exists cases&lt;br/&gt;with a large number of children.&lt;br/&gt;&lt;br/&gt;We are moving forward with adding a 1 block delay to all outputs to utilize&lt;br/&gt;the current carve-out rule, and the changes aren&amp;#39;t that bad. See Joost&amp;#39;s&lt;br/&gt;post in &amp;#34;[PATCH] First draft of option_simplfied_commitment&amp;#34;&lt;br/&gt;&lt;br/&gt;- Johan&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/20191030/bc2a90f3/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191030/bc2a90f3/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:49Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs0ccq99tj8f4x5ctjhs6nvgkulpp6dn0xdy8xkmc7uz59n208g50gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97vfsz8d</id>
    
      <title type="html">📅 Original date posted:2019-10-28 📝 Original message: &amp;gt; ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs0ccq99tj8f4x5ctjhs6nvgkulpp6dn0xdy8xkmc7uz59n208g50gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97vfsz8d" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstjykd73xfggt6xphhrwephzk2qsrfg3y9axnu7ck7epwth9wfv0gt4pjm6&#39;&gt;nevent1q…pjm6&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-28&lt;br/&gt;📝 Original message:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don’te see how? Let’s imagine Party A has two spendable outputs, now&lt;br/&gt;&amp;gt; they stuff the package size on one of their spendable outlets until it is&lt;br/&gt;&amp;gt; right at the limit, add one more on their other output (to meet the&lt;br/&gt;&amp;gt; Carve-Out), and now Party B can’t do anything.&lt;br/&gt;&lt;br/&gt;Matt: With the proposed change, party B would always be able to add a child&lt;br/&gt;to its output, regardless of what games party A is playing.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thanks for the explanation, Jeremy!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; In terms of relay cost, if an ancestor can be replaced, it will invalidate&lt;br/&gt;&amp;gt; all it&amp;#39;s children, meaning that no one paid for that broadcasting. This can&lt;br/&gt;&amp;gt; be fixed by appropriately assessing Replace By Fee update fees to&lt;br/&gt;&amp;gt; encapsulate all descendants, but there are some tricky edge cases that make&lt;br/&gt;&amp;gt; this non-obvious to do.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Relay cost is the obvious problem with just naively removing all limits.&lt;br/&gt;Relaxing the current rules by allowing to add a child to each output as&lt;br/&gt;long as it has a single unconfirmed parent would still only allow free&lt;br/&gt;relay of O(size of parent) extra data (which might not be that bad? Similar&lt;br/&gt;to the carve-out rule we could put limits on the child size). This would be&lt;br/&gt;enough for the current LN use case (increasing fee of commitment tx), but&lt;br/&gt;not for OP_SECURETHEBAG I guess, as you need the tree of children, as you&lt;br/&gt;mention.&lt;br/&gt;&lt;br/&gt;I imagine walking the mempool wouldn&amp;#39;t change much, as you would only have&lt;br/&gt;one extra child per output. But here I&amp;#39;m just speculating, as I don&amp;#39;t know&lt;br/&gt;the code well enough know what the diff would look like.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; OP_SECURETHEBAG can help with the LN issue by putting all HTLCS into a&lt;br/&gt;&amp;gt; tree where they are individualized leaf nodes with a preceding CSV. Then,&lt;br/&gt;&amp;gt; the above fix would ensure each HTLC always has time to close properly as&lt;br/&gt;&amp;gt; they would have individualized lockpoints. This is desirable for some&lt;br/&gt;&amp;gt; additional reasons and not for others, but it should &amp;#34;work&amp;#34;.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;This is interesting for an LN commitment! You could really hide every&lt;br/&gt;output of the commitment within OP_STB, which could either allow bypassing&lt;br/&gt;the fee-pinning attack entirely (if the output cannot be spent unconfirmed)&lt;br/&gt;or adding fees to the commitment using SIGHASH_SINGLE|ANYONECANPAY.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sun, Oct 27, 2019 at 8:13 PM Jeremy &amp;lt;jlrubin at mit.edu&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The issues with mempool limits for OP_SECURETHEBAG are related, but have&lt;br/&gt;&amp;gt; distinct solutions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are two main categories of mempool issues at stake. One is relay&lt;br/&gt;&amp;gt; cost, the other is mempool walking.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In terms of relay cost, if an ancestor can be replaced, it will invalidate&lt;br/&gt;&amp;gt; all it&amp;#39;s children, meaning that no one paid for that broadcasting. This can&lt;br/&gt;&amp;gt; be fixed by appropriately assessing Replace By Fee update fees to&lt;br/&gt;&amp;gt; encapsulate all descendants, but there are some tricky edge cases that make&lt;br/&gt;&amp;gt; this non-obvious to do.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The other issue is walking the mempool -- many of the algorithms we use in&lt;br/&gt;&amp;gt; the mempool can be N log N or N^2 in the number of descendants. (simple&lt;br/&gt;&amp;gt; example: an input chain of length N to a fan out of N outputs that are all&lt;br/&gt;&amp;gt; spent, is O(N^2) to look up ancestors per-child, unless we&amp;#39;re caching).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The other sort of walking issue is where the indegree or outdegree for a&lt;br/&gt;&amp;gt; transaction is high. Then when we are computing descendants or ancestors we&lt;br/&gt;&amp;gt; will need to visit it multiple times. To avoid re-expanding a node, we&lt;br/&gt;&amp;gt; currently cache it with a set. This uses O(N) extra memory and makes O(N&lt;br/&gt;&amp;gt; Log N) (we use std::set not unordered_set) comparisons.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I just opened a PR which should help with some of the walking issues by&lt;br/&gt;&amp;gt; allowing us to cheaply cache which nodes we&amp;#39;ve visited on a run. It makes a&lt;br/&gt;&amp;gt; lot of previously O(N log N) stuff O(N) and doesn&amp;#39;t allocate as much new&lt;br/&gt;&amp;gt; memory. See: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/17268&#34;&gt;https://github.com/bitcoin/bitcoin/pull/17268&lt;/a&gt;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Now, for OP_SECURETHEBAG we want a particular property that is very&lt;br/&gt;&amp;gt; different from with lightning htlcs (as is). We want that an unlimited&lt;br/&gt;&amp;gt; number of child OP_SECURETHEBAG txns may extend from a confirmed&lt;br/&gt;&amp;gt; OP_SECURETHEBAG, and then at the leaf nodes, we want the same rule as&lt;br/&gt;&amp;gt; lightning (one dangling unconfirmed to permit channels).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; OP_SECURETHEBAG can help with the LN issue by putting all HTLCS into a&lt;br/&gt;&amp;gt; tree where they are individualized leaf nodes with a preceding CSV. Then,&lt;br/&gt;&amp;gt; the above fix would ensure each HTLC always has time to close properly as&lt;br/&gt;&amp;gt; they would have individualized lockpoints. This is desirable for some&lt;br/&gt;&amp;gt; additional reasons and not for others, but it should &amp;#34;work&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; --&lt;br/&gt;&amp;gt; @JeremyRubin &amp;lt;&lt;a href=&#34;https://twitter.com/JeremyRubin&amp;gt&#34;&gt;https://twitter.com/JeremyRubin&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; &amp;lt;&lt;a href=&#34;https://twitter.com/JeremyRubin&amp;gt&#34;&gt;https://twitter.com/JeremyRubin&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Fri, Oct 25, 2019 at 10:31 AM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I don’te see how? Let’s imagine Party A has two spendable outputs, now&lt;br/&gt;&amp;gt;&amp;gt; they stuff the package size on one of their spendable outlets until it is&lt;br/&gt;&amp;gt;&amp;gt; right at the limit, add one more on their other output (to meet the&lt;br/&gt;&amp;gt;&amp;gt; Carve-Out), and now Party B can’t do anything.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Oct 24, 2019, at 21:05, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ﻿&lt;br/&gt;&amp;gt;&amp;gt; It essentially changes the rule to always allow CPFP-ing the commitment&lt;br/&gt;&amp;gt;&amp;gt; as long as there is an output available without any descendants. It changes&lt;br/&gt;&amp;gt;&amp;gt; the commitment from &amp;#34;you always need at least, and exactly, one non-CSV&lt;br/&gt;&amp;gt;&amp;gt; output per party. &amp;#34; to &amp;#34;you always need at least one non-CSV output per&lt;br/&gt;&amp;gt;&amp;gt; party. &amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I realize these limits are there for a reason though, but I&amp;#39;m wondering&lt;br/&gt;&amp;gt;&amp;gt; if could relax them. Also now that jeremyrubin has expressed problems with&lt;br/&gt;&amp;gt;&amp;gt; the current mempool limits.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Thu, Oct 24, 2019 at 11:25 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I may be missing something, but I&amp;#39;m not sure how this changes anything?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If you have a commitment transaction, you always need at least, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; exactly, one non-CSV output per party. The fact that there is a size&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; limitation on the transaction that spends for carve-out purposes only&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; effects how many other inputs/outputs you can add, but somehow I doubt&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; its ever going to be a large enough number to matter.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; On 10/24/19 1:49 PM, Johan Torås Halseth wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; In an attempt to pave the way for more robust CPFP of on-chain&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; contracts&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; (Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; on&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; an implementation of a new commitment format for utilizing the Bring&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Your Own Fees strategy using CPFP, I’m wondering if the special case&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; rule should have been relaxed a bit, to avoid the need for adding a 1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; CSV to all outputs (in case of Lightning this means HTLC scripts would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; need to be changed to add the CSV delay).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Instead, what about letting the rule be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; The last transaction which is added to a package of dependent&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; transactions in the mempool must:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;   * Have no more than one unconfirmed parent.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; This would of course allow adding a large transaction to each output of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; the unconfirmed parent, which in effect would allow an attacker to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; exceed the MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; this a problem with the current mempool acceptance code in bitcoind? I&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; would imagine evicting transactions based on feerate when the max&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; mempool size is met handles this, but I’m asking since it seems like&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; there has been several changes to the acceptance code and eviction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; policy since the limit was first introduced.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; - Johan&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; &amp;lt;mailto:rusty at rustcorp.com.au&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Matt Corallo &amp;lt;lf-lists at mattcorallo.com&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;lt;mailto:lf-lists at mattcorallo.com&amp;gt;&amp;gt; writes:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; unless the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; next&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; next&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; wasn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     in the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     compatible; more&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt; My point was, because of block time variance, even that criteria&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     doesn&amp;#39;t hold up. If you assume a steady flow of new transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     one or two blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     likely to get confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     block variance within a 12 block window, this is a relatively&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; likely&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     scenario.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     [ Digging through old mail. ]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     2.  Ask bitcoind what current expidited fee is (or survey your&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; mempool).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     In this case, if you allow a simpified RBF where &amp;#39;you can replace&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; if&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     old tx isnt&amp;#39;,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     it works.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     We could further restrict it by marking the unilateral close&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; somehow to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (say,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     5kSipa?) in that case.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Cheers,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Rusty.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;lt;mailto:Lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191028/92777d7b/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191028/92777d7b/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:48Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsvu4n8x6fwd6kzcr0me0dx3g27gqldl42jm5prw9pws6d9aplyx0gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r972va3fn</id>
    
      <title type="html">📅 Original date posted:2019-10-24 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsvu4n8x6fwd6kzcr0me0dx3g27gqldl42jm5prw9pws6d9aplyx0gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r972va3fn" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsvp88p5w5zgcdgzxaz5shg39uhqvgm3gx40q0jy3cwwhs6xkc8mqcftp0m0&#39;&gt;nevent1q…p0m0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-24&lt;br/&gt;📝 Original message:&lt;br/&gt;Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&lt;br/&gt;In an attempt to pave the way for more robust CPFP of on-chain contracts&lt;br/&gt;(Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked on an&lt;br/&gt;implementation of a new commitment format for utilizing the Bring Your Own&lt;br/&gt;Fees strategy using CPFP, I’m wondering if the special case rule should&lt;br/&gt;have been relaxed a bit, to avoid the need for adding a 1 CSV to all&lt;br/&gt;outputs (in case of Lightning this means HTLC scripts would need to be&lt;br/&gt;changed to add the CSV delay).&lt;br/&gt;&lt;br/&gt;Instead, what about letting the rule be&lt;br/&gt;&lt;br/&gt;The last transaction which is added to a package of dependent&lt;br/&gt;transactions in the mempool must:&lt;br/&gt;  * Have no more than one unconfirmed parent.&lt;br/&gt;&lt;br/&gt;This would of course allow adding a large transaction to each output of the&lt;br/&gt;unconfirmed parent, which in effect would allow an attacker to exceed the&lt;br/&gt;MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is this a problem&lt;br/&gt;with the current mempool acceptance code in bitcoind? I would imagine&lt;br/&gt;evicting transactions based on feerate when the max mempool size is met&lt;br/&gt;handles this, but I’m asking since it seems like there has been several&lt;br/&gt;changes to the acceptance code and eviction policy since the limit was&lt;br/&gt;first introduced.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth, unless the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the next&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie. next&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package wasn&amp;#39;t in the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive compatible; more&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; My point was, because of block time variance, even that criteria doesn&amp;#39;t&lt;br/&gt;&amp;gt; hold up. If you assume a steady flow of new transactions and one or two&lt;br/&gt;&amp;gt; blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t likely to get&lt;br/&gt;&amp;gt; confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given block variance within a&lt;br/&gt;&amp;gt; 12 block window, this is a relatively likely scenario.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [ Digging through old mail. ]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt; 2.  Ask bitcoind what current expidited fee is (or survey your mempool).&lt;br/&gt;&amp;gt; 3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt; 4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In this case, if you allow a simpified RBF where &amp;#39;you can replace if&lt;br/&gt;&amp;gt; 1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3. old tx&lt;br/&gt;&amp;gt; isnt&amp;#39;,&lt;br/&gt;&amp;gt; it works.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We could further restrict it by marking the unilateral close somehow to&lt;br/&gt;&amp;gt; say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight (say,&lt;br/&gt;&amp;gt; 5kSipa?) in that case.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191024/065e650f/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191024/065e650f/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:46Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsfgjykx0yu44hc697pdhe7kufq6lf3fvehp5kwyy0em9hz8hmeaygzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97aa6r05</id>
    
      <title type="html">📅 Original date posted:2019-10-25 📝 Original message: It ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsfgjykx0yu44hc697pdhe7kufq6lf3fvehp5kwyy0em9hz8hmeaygzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97aa6r05" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs98x9je4esp87vwa7hz8r9fuuq080unkffmq4k0n2kza3uctqa2tc6pecj4&#39;&gt;nevent1q…ecj4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-25&lt;br/&gt;📝 Original message:&lt;br/&gt;It essentially changes the rule to always allow CPFP-ing the commitment as&lt;br/&gt;long as there is an output available without any descendants. It changes&lt;br/&gt;the commitment from &amp;#34;you always need at least, and exactly, one non-CSV&lt;br/&gt;output per party. &amp;#34; to &amp;#34;you always need at least one non-CSV output per&lt;br/&gt;party. &amp;#34;&lt;br/&gt;&lt;br/&gt;I realize these limits are there for a reason though, but I&amp;#39;m wondering if&lt;br/&gt;could relax them. Also now that jeremyrubin has expressed problems with the&lt;br/&gt;current mempool limits.&lt;br/&gt;&lt;br/&gt;On Thu, Oct 24, 2019 at 11:25 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; I may be missing something, but I&amp;#39;m not sure how this changes anything?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you have a commitment transaction, you always need at least, and&lt;br/&gt;&amp;gt; exactly, one non-CSV output per party. The fact that there is a size&lt;br/&gt;&amp;gt; limitation on the transaction that spends for carve-out purposes only&lt;br/&gt;&amp;gt; effects how many other inputs/outputs you can add, but somehow I doubt&lt;br/&gt;&amp;gt; its ever going to be a large enough number to matter.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On 10/24/19 1:49 PM, Johan Torås Halseth wrote:&lt;br/&gt;&amp;gt; &amp;gt; Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;&amp;gt; &amp;gt; 0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; In an attempt to pave the way for more robust CPFP of on-chain contracts&lt;br/&gt;&amp;gt; &amp;gt; (Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked on&lt;br/&gt;&amp;gt; &amp;gt; an implementation of a new commitment format for utilizing the Bring&lt;br/&gt;&amp;gt; &amp;gt; Your Own Fees strategy using CPFP, I’m wondering if the special case&lt;br/&gt;&amp;gt; &amp;gt; rule should have been relaxed a bit, to avoid the need for adding a 1&lt;br/&gt;&amp;gt; &amp;gt; CSV to all outputs (in case of Lightning this means HTLC scripts would&lt;br/&gt;&amp;gt; &amp;gt; need to be changed to add the CSV delay).&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Instead, what about letting the rule be&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The last transaction which is added to a package of dependent&lt;br/&gt;&amp;gt; &amp;gt; transactions in the mempool must:&lt;br/&gt;&amp;gt; &amp;gt;   * Have no more than one unconfirmed parent.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; This would of course allow adding a large transaction to each output of&lt;br/&gt;&amp;gt; &amp;gt; the unconfirmed parent, which in effect would allow an attacker to&lt;br/&gt;&amp;gt; &amp;gt; exceed the MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is&lt;br/&gt;&amp;gt; &amp;gt; this a problem with the current mempool acceptance code in bitcoind? I&lt;br/&gt;&amp;gt; &amp;gt; would imagine evicting transactions based on feerate when the max&lt;br/&gt;&amp;gt; &amp;gt; mempool size is met handles this, but I’m asking since it seems like&lt;br/&gt;&amp;gt; &amp;gt; there has been several changes to the acceptance code and eviction&lt;br/&gt;&amp;gt; &amp;gt; policy since the limit was first introduced.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; - Johan&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&lt;br/&gt;&amp;gt; &amp;gt; &amp;lt;mailto:rusty at rustcorp.com.au&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Matt Corallo &amp;lt;lf-lists at mattcorallo.com&lt;br/&gt;&amp;gt; &amp;gt;     &amp;lt;mailto:lf-lists at mattcorallo.com&amp;gt;&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth, unless&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the&lt;br/&gt;&amp;gt; next&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie.&lt;br/&gt;&amp;gt; next&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package wasn&amp;#39;t&lt;br/&gt;&amp;gt; &amp;gt;     in the&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive&lt;br/&gt;&amp;gt; &amp;gt;     compatible; more&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt; My point was, because of block time variance, even that criteria&lt;br/&gt;&amp;gt; &amp;gt;     doesn&amp;#39;t hold up. If you assume a steady flow of new transactions and&lt;br/&gt;&amp;gt; &amp;gt;     one or two blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t&lt;br/&gt;&amp;gt; &amp;gt;     likely to get confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given&lt;br/&gt;&amp;gt; &amp;gt;     block variance within a 12 block window, this is a relatively likely&lt;br/&gt;&amp;gt; &amp;gt;     scenario.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     [ Digging through old mail. ]&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt; &amp;gt;     2.  Ask bitcoind what current expidited fee is (or survey your&lt;br/&gt;&amp;gt; mempool).&lt;br/&gt;&amp;gt; &amp;gt;     3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt; &amp;gt;     4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     In this case, if you allow a simpified RBF where &amp;#39;you can replace if&lt;br/&gt;&amp;gt; &amp;gt;     1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3.&lt;br/&gt;&amp;gt; &amp;gt;     old tx isnt&amp;#39;,&lt;br/&gt;&amp;gt; &amp;gt;     it works.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     We could further restrict it by marking the unilateral close somehow&lt;br/&gt;&amp;gt; to&lt;br/&gt;&amp;gt; &amp;gt;     say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight (say,&lt;br/&gt;&amp;gt; &amp;gt;     5kSipa?) in that case.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Cheers,&lt;br/&gt;&amp;gt; &amp;gt;     Rusty.&lt;br/&gt;&amp;gt; &amp;gt;     _______________________________________________&lt;br/&gt;&amp;gt; &amp;gt;     Lightning-dev mailing list&lt;br/&gt;&amp;gt; &amp;gt;     Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &amp;gt;     &amp;lt;mailto:Lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191025/58a3d7b8/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191025/58a3d7b8/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:46Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsvghleyhqm02ta9cyguccad54lsavv5z2xfyyx7enuu4tux2g7jeczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ets8wj</id>
    
      <title type="html">📅 Original date posted:2019-04-03 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsvghleyhqm02ta9cyguccad54lsavv5z2xfyyx7enuu4tux2g7jeczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ets8wj" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszad2v8zxte7q37gaqf42gxnfggsyqgm0rhcs5danwn6t99gatz6cfaztll&#39;&gt;nevent1q…ztll&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-04-03&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Pierre and list folks,&lt;br/&gt;&lt;br/&gt;I haven&amp;#39;t looked at the technical implications of implementing this in&lt;br/&gt;detail, but I like the high-level direction this proposal is taking :)&lt;br/&gt;&lt;br/&gt;I think it nicely ties together several concepts that have been proposed&lt;br/&gt;earlier, and with the correct design could give the sender all the&lt;br/&gt;flexibility needed to craft payments according to its own&lt;br/&gt;reliability/privacy/fee tradeoff.&lt;br/&gt;&lt;br/&gt;In an ideal world we would have:&lt;br/&gt;- Multi-hop locks: hop decorrelation will be even more important when the&lt;br/&gt;sender no longer controls the whole payment path.&lt;br/&gt;&lt;br/&gt;- Packet switched routing: the sender can choose whether to route purely&lt;br/&gt;packet switched (only knowing the destination, no need to keep any routing&lt;br/&gt;table) or route purely onion-based (as today), or something in between. As&lt;br/&gt;Christian mentions, this is similar to how TOR/TCP works, and I like the&lt;br/&gt;flexibility this layering allows.&lt;br/&gt;&lt;br/&gt;- Rendezvous routing: such a proposal would be nice to combine with&lt;br/&gt;rendezvous routing. This way even the sender wouldn&amp;#39;t necessarily know if&lt;br/&gt;the &amp;#34;destination node&amp;#34; is just another trampoline. Maybe maybe this concern&lt;br/&gt;shouldn&amp;#39;t be on this layer though?&lt;br/&gt;&lt;br/&gt;- Fees: (as today) the sender would set the fees it is willing to pay&lt;br/&gt;between trampolines, and it could dynamically learn about fee levels needed&lt;br/&gt;to reach different parts of the network. Today we know the fee needed to&lt;br/&gt;reach the next hop, but here we could start out low (for the&lt;br/&gt;trampoline-to-trampoline fee) and let different trampolines return&lt;br/&gt;competing fee offers to get to the next hop.&lt;br/&gt;&lt;br/&gt;As mentioned, I haven&amp;#39;t thought about the technical implications of all&lt;br/&gt;this, and it would certainly require a lot of work to get this actually&lt;br/&gt;implemented.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Wed, Apr 3, 2019 at 5:42 AM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Pierre and list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     There is another unrelated issue: because trampoline nodes don&amp;#39;t know&lt;br/&gt;&amp;gt; &amp;gt;     anything about what happened before they received the onion, they may&lt;br/&gt;&amp;gt; &amp;gt;     unintentionnaly create overlapping routes. So we can&amp;#39;t simply use the&lt;br/&gt;&amp;gt; &amp;gt;     payment_hash as we currently do, we would have to use something a bit&lt;br/&gt;&amp;gt; &amp;gt;     more elaborate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Just to be clear, the issue is for example with a network like:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     A ------- B -------- C&lt;br/&gt;&amp;gt;              / \&lt;br/&gt;&amp;gt;             /   \&lt;br/&gt;&amp;gt;            /     \&lt;br/&gt;&amp;gt;           /       \&lt;br/&gt;&amp;gt;          D ------- E&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then, A creates an inner trampoline onion &amp;#34;E-&amp;gt;C&amp;#34;, and an outer onion&lt;br/&gt;&amp;gt; &amp;#34;A-&amp;gt;B-&amp;gt;E&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; E, on receiving the inner trampoline onion &amp;#34;E-&amp;gt;C&amp;#34;, finds that E-&amp;gt;B&lt;br/&gt;&amp;gt; direction is low capacity, so routes over the outer onion &amp;#34;E-&amp;gt;D-&amp;gt;B-&amp;gt;C&amp;#34; with&lt;br/&gt;&amp;gt; inner trampoline onion &amp;#34;C&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This creates an overall route A-&amp;gt;B-&amp;gt;E-&amp;gt;D-&amp;gt;B-&amp;gt;C.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; When the B-&amp;gt;C HTLC is resolved, B can instead claim the A-&amp;gt;B HTLC and just&lt;br/&gt;&amp;gt; fail the D-&amp;gt;B HTLC, thereby removing D and E from the route and claiming&lt;br/&gt;&amp;gt; their fees, even though they participated in the route.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; (maybe private keys?)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Do you refer to the changing from &amp;#34;H&amp;#34;TLC to &amp;#34;P&amp;#34;TLC point-locked timelocked&lt;br/&gt;&amp;gt; contracts?&lt;br/&gt;&amp;gt; i.e. instead of payment hash / preimage, we use payment point / scalar.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think a few ideas would be improved by this.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.  Trampoline payments, as described above.&lt;br/&gt;&amp;gt; 2.  Offline vending machines&lt;br/&gt;&amp;gt;     - Instead of storing a fixed number of invoices from the always-online&lt;br/&gt;&amp;gt; payment node, store a HD parent point and derive child points for payments.&lt;br/&gt;&amp;gt; 3.  Enables payment decorrelation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Perhaps we should consider switching to payment points/scalars sometime&lt;br/&gt;&amp;gt; soon.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&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/20190403/24eb7d58/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190403/24eb7d58/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:54:46Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsgg76u4mxtyjlnelnsae5pv9v3e5u6aeemuqsnkf6xlry39snk8hszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9750lnsr</id>
    
      <title type="html">📅 Original date posted:2018-11-27 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsgg76u4mxtyjlnelnsae5pv9v3e5u6aeemuqsnkf6xlry39snk8hszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9750lnsr" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsgrgv6tgt3n8nvk9lfd0ptv4688sxqk9z972asrr923t4664525fszg2dgg&#39;&gt;nevent1q…2dgg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-27&lt;br/&gt;📝 Original message:&lt;br/&gt;(excuse me for not yet understanding what this extra complexity gives us)&lt;br/&gt;&lt;br/&gt;To summarize: My suggestion was to only add an optional field to the&lt;br/&gt;invoice, and let the recepient wait until all funds have received before&lt;br/&gt;pulling the payment. No changes to the onion.&lt;br/&gt;&lt;br/&gt;We briefly discussed this during the last call, that the extra bit set in&lt;br/&gt;the onion will be necessary to support Partial Payments (PP?) in the&lt;br/&gt;spontaneous payments case.&lt;br/&gt;&lt;br/&gt;However, as we don&amp;#39;t yet have spontaneous payments specced out, wouldn&amp;#39;t&lt;br/&gt;this be something to be added at that point?&lt;br/&gt;&lt;br/&gt;I just feel not adding the extra bit to the onion would make the&lt;br/&gt;implementation of PP near trivial, and still don&amp;#39;t see the downsides of not&lt;br/&gt;adding it.&lt;br/&gt;&lt;br/&gt;Cheers, Johan&lt;br/&gt;&lt;br/&gt;On Mon, Nov 26, 2018, 09:10 ZmnSCPxj &amp;lt;ZmnSCPxj at protonmail.com wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I believe what Rusty refers to here is a probe by an intermediate node,&lt;br/&gt;&amp;gt; rather than a probe by the source node (who, as we know, already knows&lt;br/&gt;&amp;gt; whether the payee supports AMP or not, by the invoice).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sent with ProtonMail &amp;lt;&lt;a href=&#34;https://protonmail.com&amp;gt&#34;&gt;https://protonmail.com&amp;gt&lt;/a&gt;; Secure Email.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&lt;br/&gt;&amp;gt; On Monday, November 26, 2018 3:58 PM, Johan Torås Halseth &amp;lt;&lt;br/&gt;&amp;gt; johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This shouldn&amp;#39;t be problem, as the invoice will already indicate that the&lt;br/&gt;&amp;gt; node supports BaseAMP. If you have a reason to not reveal that you support&lt;br/&gt;&amp;gt; BAMP for certain invoices, you&amp;#39;ll just not specify it in the invoice, and&lt;br/&gt;&amp;gt; act non-BAMPy when receiving payments to this payment hash.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Of course, this will also be opt-in for both sides and won&amp;#39;t affect&lt;br/&gt;&amp;gt; existing nodes in any way.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Johan&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Wed, Nov 21, 2018 at 11:54 PM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; writes:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Seems like we can restrict the changes to BOLT11 by having the receiver&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; assume NAMP for incoming payments &amp;lt; invoice_amount. (with some timeout&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; course, but that would need to be the case even when the sender is&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; signalling NAMP).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This would effectively become a probe for Base AMP; if you get a partial&lt;br/&gt;&amp;gt;&amp;gt; payment error, it&amp;#39;s because the recipient didn&amp;#39;t support Base AMP.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Seems cleaner to have a flag, both on BOLT11 and inside the onion.  Then&lt;br/&gt;&amp;gt;&amp;gt; it&amp;#39;s explicitly opt-in for both sides and doesn&amp;#39;t affect existing nodes&lt;br/&gt;&amp;gt;&amp;gt; in any way.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181127/760d330d/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181127/760d330d/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:47Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsvzh9pk99k60fxkuypnujjc4dy65jph046yx2q6y0knq69cjcaqcqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97tpgm3u</id>
    
      <title type="html">📅 Original date posted:2018-11-26 📝 Original message: This ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsvzh9pk99k60fxkuypnujjc4dy65jph046yx2q6y0knq69cjcaqcqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97tpgm3u" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0cn6vkkxfcgwng4vjy5f63qeyag3pk7qjac360gkfg04afjarlag28d9xg&#39;&gt;nevent1q…d9xg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-26&lt;br/&gt;📝 Original message:&lt;br/&gt;This shouldn&amp;#39;t be problem, as the invoice will already indicate that the&lt;br/&gt;node supports BaseAMP. If you have a reason to not reveal that you support&lt;br/&gt;BAMP for certain invoices, you&amp;#39;ll just not specify it in the invoice, and&lt;br/&gt;act non-BAMPy when receiving payments to this payment hash.&lt;br/&gt;&lt;br/&gt;Of course, this will also be opt-in for both sides and won&amp;#39;t affect&lt;br/&gt;existing nodes in any way.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Wed, Nov 21, 2018 at 11:54 PM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt; Seems like we can restrict the changes to BOLT11 by having the receiver&lt;br/&gt;&amp;gt; &amp;gt; assume NAMP for incoming payments &amp;lt; invoice_amount. (with some timeout of&lt;br/&gt;&amp;gt; &amp;gt; course, but that would need to be the case even when the sender is&lt;br/&gt;&amp;gt; &amp;gt; signalling NAMP).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This would effectively become a probe for Base AMP; if you get a partial&lt;br/&gt;&amp;gt; payment error, it&amp;#39;s because the recipient didn&amp;#39;t support Base AMP.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Seems cleaner to have a flag, both on BOLT11 and inside the onion.  Then&lt;br/&gt;&amp;gt; it&amp;#39;s explicitly opt-in for both sides and doesn&amp;#39;t affect existing nodes&lt;br/&gt;&amp;gt; in any way.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Rusty.&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/20181126/67166a9b/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181126/67166a9b/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:46Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs9fuyrqscpf4pqls8k4mgsusrmg2ma4xp39hlcurwkec8w7yjhdsszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97y2d5p3</id>
    
      <title type="html">📅 Original date posted:2018-11-21 📝 Original message: Seems ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs9fuyrqscpf4pqls8k4mgsusrmg2ma4xp39hlcurwkec8w7yjhdsszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97y2d5p3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsya759vca5km373wums9hucl4dwhh946m0adxsvdmnp95048sduvc08k3cd&#39;&gt;nevent1q…k3cd&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-21&lt;br/&gt;📝 Original message:&lt;br/&gt;Seems like we can restrict the changes to BOLT11 by having the receiver&lt;br/&gt;assume NAMP for incoming payments &amp;lt; invoice_amount. (with some timeout of&lt;br/&gt;course, but that would need to be the case even when the sender is&lt;br/&gt;signalling NAMP).&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Wed, Nov 21, 2018 at 3:55 AM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Rusty,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; And do not play with `amount_to_forward`, as it&amp;#39;s an important&lt;br/&gt;&amp;gt; &amp;gt; signal to the final node that the previous node did not offer less value&lt;br/&gt;&amp;gt; &amp;gt; for the HTLC than it was supposed to. (You could steal the top bit to&lt;br/&gt;&amp;gt; &amp;gt; signal partial payment if you really want to).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I do not view this as playing with the existing `amt_to_forward`, but&lt;br/&gt;&amp;gt; rather retaining its previous use.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If it helps, we can rewrite the *current* pre-AMP spec as below:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;     ...&lt;br/&gt;&amp;gt;     * [`8` : `amt_to_forward` / `amt_to_pay`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ...&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * `amt_to_forward` - for **non-final** nodes, this is the value to forward&lt;br/&gt;&amp;gt; to the next node.&lt;br/&gt;&amp;gt;   Non-final nodes MUST check:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     incoming_htlc_amt - fee &amp;gt;= amt_to_forward&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * `amt_to_pay` - for **final** nodes, this is the value that is intended&lt;br/&gt;&amp;gt; to reach it.&lt;br/&gt;&amp;gt;   Final nodes MUST check:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     incoming_htlc_amt &amp;gt;= amt_to_pay&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then for Base AMP:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * `amt_to_pay` - for **final** nodes, this is the total value that is&lt;br/&gt;&amp;gt; intended to reach it.&lt;br/&gt;&amp;gt;   If `incomplete_payment` flag is not set, final nodes MUST check:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     incoming_htlc_amt &amp;gt;= amt_to_pay&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   If `incomplete_payment` flag is set, then final nodes must claim HTLCs&lt;br/&gt;&amp;gt; only if:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     sum(incoming_htlc_amt) &amp;gt;= amt_to_pay&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   Where `sum(incoming_htlc_amt)` is the total `incoming_htlc_amt` for all&lt;br/&gt;&amp;gt; incoming HTLCs terminating at this final node with the same `payment_hash`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Now perhaps we can argue that for AMP we should have two fields&lt;br/&gt;&amp;gt; `amt_to_pay_for_this_partial_payment` and `amt_to_pay_for_total_payment`&lt;br/&gt;&amp;gt; instead.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181121/8f56db8f/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181121/8f56db8f/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:45Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs00qymms56z9uf6xec8yxslx833f8n80qa7cftkwma4xuc3tfjztqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gm9h3h</id>
    
      <title type="html">📅 Original date posted:2018-11-13 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs00qymms56z9uf6xec8yxslx833f8n80qa7cftkwma4xuc3tfjztqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gm9h3h" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs8lxvpkwlhzdrasx3cg7seqwdknrmpyugqmdys6nghgdaj6k29p4q0jh5na&#39;&gt;nevent1q…h5na&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-13&lt;br/&gt;📝 Original message:&lt;br/&gt;Good evening Z and list,&lt;br/&gt;&lt;br/&gt;I&amp;#39;m wondering, since these payments are no longer atomic, should we name it&lt;br/&gt;accordingly?&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Tue, Nov 13, 2018 at 1:28 PM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I propose the below to support Base AMP.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The below would allow arbitrary merges of paths, but not arbitrary&lt;br/&gt;&amp;gt; splits.  I am uncertain about the safety of arbitrary splits.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ### The `multipath_merge_per_hop` type (`option_base_amp`)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This indicates that payment has been split by the sender using Base AMP,&lt;br/&gt;&amp;gt; and that the receiver should wait for the total intended payment before&lt;br/&gt;&amp;gt; forwarding or claiming the payment.&lt;br/&gt;&amp;gt; In case the receiving node is not the last node in the path, then&lt;br/&gt;&amp;gt; succeeding hops MUST be the same across all splits.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 1 (`termination_per_hop`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;   * [`8` : `short_channel_id`]&lt;br/&gt;&amp;gt;   * [`8` : `amt_to_forward`]&lt;br/&gt;&amp;gt;   * [`4` : `outgoing_cltv_value`]&lt;br/&gt;&amp;gt;   * [`8` : `intended_total_payment`]&lt;br/&gt;&amp;gt;   * [`4` : `zeros`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The contents of this hop will be the same across all paths of the Base AMP.&lt;br/&gt;&amp;gt; The `payment_hash` of the incoming HTLCs will also be the same across all&lt;br/&gt;&amp;gt; paths of the Base AMP.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; `intended_total_payment` is the total amount of money that this node&lt;br/&gt;&amp;gt; should expect to receive in all incoming paths to the same `payment_hash`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This may be the last hop of a payment onion, in which case the `HMAC` for&lt;br/&gt;&amp;gt; this hop will be `0` (the same rule as for `per_hop_type` 0).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The receiver:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * MUST impose a reasonable timeout for waiting to receive all component&lt;br/&gt;&amp;gt; paths, and fail all incoming HTLC offers for the `payment_hash`  if they&lt;br/&gt;&amp;gt; have not totalled equal to `intended_total_payment`.&lt;br/&gt;&amp;gt; * MUST NOT forward (if an intermediate node) or claim (if the final node)&lt;br/&gt;&amp;gt; unless it has received a total greater or equal to `intended_total_payment`&lt;br/&gt;&amp;gt; in all incoming HTLCs for the same `payment_hash`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The sender:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * MUST use the same `payment_hash` for all paths of a single multipath&lt;br/&gt;&amp;gt; payment.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&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/20181113/6342ecf1/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181113/6342ecf1/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:40Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsykc6ruvvelcxzjpn8qvn5pjcznjefqap0sqlyq0wy5t5tmlejz4szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97hfvtmq</id>
    
      <title type="html">📅 Original date posted:2018-11-09 📝 Original message: Neat! ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsykc6ruvvelcxzjpn8qvn5pjcznjefqap0sqlyq0wy5t5tmlejz4szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97hfvtmq" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs826lrspse3adc7jpe2hjp05pjjr8u9ryjrk49d0q5mdrwfnqhqysx3zmr4&#39;&gt;nevent1q…zmr4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-09&lt;br/&gt;📝 Original message:&lt;br/&gt;Neat! I think this is similar to what has been briefly discussed earlier&lt;br/&gt;about hybrid packet-switched/circuit-switched payment routing.&lt;br/&gt;&lt;br/&gt;B doesn&amp;#39;t have to care about how the payment gets from C to D, but she&lt;br/&gt;knows it must go through D, keeping privacy intact. This would be exactly&lt;br/&gt;equivalent to how TOR works today I would think.&lt;br/&gt;&lt;br/&gt;C must also make sure the detour route stays within the fee limit of course.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Fri, Nov 9, 2018 at 7:02 AM ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As was discussed directly in summit, we accept link-lvel payment splitting&lt;br/&gt;&amp;gt; (scid is not binding), and provisionally accept rendez-vous routing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It strikes me, that even if your node has only a single channel to the&lt;br/&gt;&amp;gt; next node (c-lightning), it is possible, to still perform link-level&lt;br/&gt;&amp;gt; payment splitting/re-routing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For instance, consider this below graph:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;       E&amp;lt;---D---&amp;gt;C&amp;lt;---B&lt;br/&gt;&amp;gt;            ^  /&lt;br/&gt;&amp;gt;            | /&lt;br/&gt;&amp;gt;            |L&lt;br/&gt;&amp;gt;            A&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In the above, B requests a route from B-&amp;gt;C-&amp;gt;D-&amp;gt;E.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, C cannot send to D, since the channel direction is saturated in&lt;br/&gt;&amp;gt; favor of D.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Alternately, C can route to D via A instead.  It holds the (encrypted)&lt;br/&gt;&amp;gt; route from D to E.  It can take that sub-route and treat it as a partial&lt;br/&gt;&amp;gt; route-to-payee under rendez-vous routing, as long as node A supports&lt;br/&gt;&amp;gt; rendez-vous routing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This can allow re-routing or payment splitting over multiple hops.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Even though C does not know the number of remaining hops between D and the&lt;br/&gt;&amp;gt; destination, its alternative is to earn nothing anyway as its only&lt;br/&gt;&amp;gt; alternative is to fail the routing.  At least with this, there is a chance&lt;br/&gt;&amp;gt; it can succeed to send the payment to the final destination.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&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/20181109/813c32fc/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181109/813c32fc/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:23Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsfvk8kwr3sz6jnv97hd5gmgsmj4y9u79uaqrz7upkcgm3sv6pcwxgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970m55ag</id>
    
      <title type="html">📅 Original date posted:2018-11-01 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsfvk8kwr3sz6jnv97hd5gmgsmj4y9u79uaqrz7upkcgm3sv6pcwxgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970m55ag" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs2whmxsw0vyqu4ru42hfpznt56w7vmkqhc5lkfdpng3t7xkawengq6jvqu0&#39;&gt;nevent1q…vqu0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-01&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Margherita,&lt;br/&gt;&lt;br/&gt;If you haven&amp;#39;t already, look into &amp;#34;data loss protection&amp;#34; as defined in the&lt;br/&gt;BOLTs. It is similar to to what you are suggesting, with A being able to&lt;br/&gt;tell B that it lost state for the A&amp;lt;-&amp;gt;B channel, and if B is cooperative it&lt;br/&gt;will help A recover its funds.&lt;br/&gt;&lt;br/&gt;You can also look into watchtowers, and static and dynamic channel backups,&lt;br/&gt;as they touch onto what you are describing.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Thu, Nov 1, 2018 at 12:59 AM Margherita Favaretto &amp;lt;s170065 at student.dtu.dk&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning dev-lightning community,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Last weekend, I had the opportunity to take part in &amp;#34;LightningHackdayNYC&amp;#34;.&lt;br/&gt;&amp;gt; It was an incredible event, thanks to all organizers, to all speakers and&lt;br/&gt;&amp;gt; all people available to share all own knowledge.&lt;br/&gt;&amp;gt; Discussing with the people of the community, I could define better the&lt;br/&gt;&amp;gt; problem that I&amp;#39;m focusing on and have some ideas for the solution.&lt;br/&gt;&amp;gt; I&amp;#39;ve created a project on GitHub:&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/margheritafav/LightningNetworkProject&#34;&gt;https://github.com/margheritafav/LightningNetworkProject&lt;/a&gt; , where you&lt;br/&gt;&amp;gt; could find a draft of my research, and also you are welcome to add your&lt;br/&gt;&amp;gt; comments and feedback.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To recap, the aim of the project is realizing a recovering protocol for&lt;br/&gt;&amp;gt; Lightning Network. As someone suggested me in the previous e-mails, Eltoo&lt;br/&gt;&amp;gt; is already solving this problem in part. With Eltoo, the nodes are able to&lt;br/&gt;&amp;gt; share the last status of the channel, so if one of the two nodes loses some&lt;br/&gt;&amp;gt; information, it can simply ask to the other node to share the most recent&lt;br/&gt;&amp;gt; status. Unfortunately, this mechanism doesn&amp;#39;t include the case that the&lt;br/&gt;&amp;gt; other node doesn&amp;#39;t share the last transaction, but instead an older one,&lt;br/&gt;&amp;gt; more favourable for own balance. My project aims to solve this particular&lt;br/&gt;&amp;gt; issue and make the protocol more solid to face completely the case of a&lt;br/&gt;&amp;gt; false positive node.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Idea: The main idea of the design is using the other connected nodes as a&lt;br/&gt;&amp;gt; back-up of own recent status.&lt;br/&gt;&amp;gt; *I**f a node A is connected to a node B and a node C, for each&lt;br/&gt;&amp;gt; transaction between A and B, A sends an encrypted information, regarding&lt;br/&gt;&amp;gt; the last commitment transaction with B, to C. For each commitment&lt;br/&gt;&amp;gt; transaction with C, A sends an encrypted information, regarding the&lt;br/&gt;&amp;gt; last commitment transaction with C, to B.*&lt;br/&gt;&amp;gt; In this way, if A loses the last transactions, she may ask the information&lt;br/&gt;&amp;gt; to the other connected node and update the status.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think that this idea can solve the current lack in Eltoo and I&amp;#39;m&lt;br/&gt;&amp;gt; planning to analyze more this solution in the next days. Any&lt;br/&gt;&amp;gt; thoughts/suggestions are really appreciated to proceed in the wisest way&lt;br/&gt;&amp;gt; and find a solution that can also cover all your needs. If someone of you&lt;br/&gt;&amp;gt; is interested in this research, I&amp;#39;m available to share more details about&lt;br/&gt;&amp;gt; the design of my idea and I&amp;#39;m open to discussion. Moreover, if someone is&lt;br/&gt;&amp;gt; already working on this research topic, please not hesitate to write me for&lt;br/&gt;&amp;gt; possible collaborations to work together.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thank you in advance,&lt;br/&gt;&amp;gt; Margherita Favaretto&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181101/0b2b32b3/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181101/0b2b32b3/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:52:00Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs2palzgrve8y6jusxmculcx9wftuhagmy39923rqne5v7skfawcwszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97kgn8y9</id>
    
      <title type="html">📅 Original date posted:2018-10-16 📝 Original message: &amp;gt; ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs2palzgrve8y6jusxmculcx9wftuhagmy39923rqne5v7skfawcwszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97kgn8y9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9384frqhwp5qwdnuxy48yj974hdjtkaqh9n46mdem65uktyled2clhvzlu&#39;&gt;nevent1q…vzlu&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-10-16&lt;br/&gt;📝 Original message:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is one of the cases where a simpler solution (relatively&lt;br/&gt;&amp;gt; speaking ^^) is to be preferred imho, allowing for future&lt;br/&gt;&amp;gt; iterations.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I think we should strive to splice in 1 on-chain tx, as if not the biggest&lt;br/&gt;benefit really is lost compared to just closing and reopening the channel.&lt;br/&gt;&lt;br/&gt;Complexity wise I don&amp;#39;t think it will be that much to gain from the 2-tx&lt;br/&gt;proposal as (if I understand the proposal correctly) there will be even&lt;br/&gt;more transaction types with new scripts to code up and maintain.&lt;br/&gt;&lt;br/&gt;On Tue, Oct 16, 2018 at 5:38 AM Christian Decker &amp;lt;decker.christian at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; ZmnSCPxj via Lightning-dev &amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;&amp;gt; writes:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; One thing that I think we should lift from the multiple funding output&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; approach is the &amp;#34;pre seating of inputs&amp;#34;. This is cool as it would allow&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; clients to generate addresses, that others could deposit to, and then&lt;br/&gt;&amp;gt; have&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; be spliced directly into the channel. Public derivation can be used,&lt;br/&gt;&amp;gt; along&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; with a script template to do it non-interactively, with the clients&lt;br/&gt;&amp;gt; picking&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; up these deposits, and initiating a splice in as needed.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I am uncertain what this means in particular, but let me try to&lt;br/&gt;&amp;gt; &amp;gt; restate what you are talking about in other terms:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 1.  Each channel has two public-key-derivation paths (BIP32) to create&lt;br/&gt;&amp;gt; onchain addresses.  One for each side of the channel.&lt;br/&gt;&amp;gt; &amp;gt; 2.  When somebody sends to one of the onchain addresses in the path,&lt;br/&gt;&amp;gt; their client detects this.&lt;br/&gt;&amp;gt; &amp;gt; 3.  The client initiates a splice-in automatically from this UTXO paying&lt;br/&gt;&amp;gt; to that address into the channel.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; It seems to me naively that the above can be done by the client&lt;br/&gt;&amp;gt; &amp;gt; software without any modifications to the Lightning Network BOLT&lt;br/&gt;&amp;gt; &amp;gt; protocol, as long as the BOLT protocol is capable of supporting *some*&lt;br/&gt;&amp;gt; &amp;gt; splice-in operation, i.e. it seems to be something that a client&lt;br/&gt;&amp;gt; &amp;gt; software can implement as a feature without requiring a BOLT change.&lt;br/&gt;&amp;gt; &amp;gt; Or is my above restatement different from what you are talking about?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; How about this restatement?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 1.  Each channel has two public-key-derivation paths (BIP32) to create&lt;br/&gt;&amp;gt; onchain addresses.  One for each side of the channel.&lt;br/&gt;&amp;gt; &amp;gt; 2.  The base of the above is actually a combined private-public keypair&lt;br/&gt;&amp;gt; of both sides (e.g. created via MuSig or some other protocol).  Thus the&lt;br/&gt;&amp;gt; addresses require cooperation of both parties to spend.&lt;br/&gt;&amp;gt; &amp;gt; 3.  When somebody sends to one of the onchain addresses in the path,&lt;br/&gt;&amp;gt; their client detects this.&lt;br/&gt;&amp;gt; &amp;gt; 4.  The client updates the current transaction state, such that the new&lt;br/&gt;&amp;gt; commit transaction has two inputs ( the original channel transaction and&lt;br/&gt;&amp;gt; the new UTXO).&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The above seems unsafe without trust in the other peer, as, the other&lt;br/&gt;&amp;gt; &amp;gt; peer can simply refuse to create the new commit transaction.  Since&lt;br/&gt;&amp;gt; &amp;gt; the address requires both parties to spend, the money cannot be spent&lt;br/&gt;&amp;gt; &amp;gt; and there is no backoff transaction that can be used.  But maybe you&lt;br/&gt;&amp;gt; &amp;gt; can describe some mechanism to ensure this, if this is what is meant&lt;br/&gt;&amp;gt; &amp;gt; instead?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This could easily be solved by making the destination address a Taproot&lt;br/&gt;&amp;gt; address, which by default is just a 2-of-2, but in the uncooperative&lt;br/&gt;&amp;gt; case it can reveal the script it commits to, which is just a timelocked&lt;br/&gt;&amp;gt; refund that requires a single-sig. The only problem with this is that&lt;br/&gt;&amp;gt; the refund would be non-interactive, and so the entirety of the funds,&lt;br/&gt;&amp;gt; that may be from a third-party, need to be claimed by one endpoint,&lt;br/&gt;&amp;gt; i.e., there is no splitting the funds in case of an uncollaborative&lt;br/&gt;&amp;gt; refund. Not sure how important that is though, since I don&amp;#39;t think&lt;br/&gt;&amp;gt; third-party funds will come from unrelated parties, e.g., most of these&lt;br/&gt;&amp;gt; funds will come from an on-chain wallet that is under the control of&lt;br/&gt;&amp;gt; either parties so the refund should go back to that party anyway.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Christian&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181016/5a6baacf/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181016/5a6baacf/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:51:47Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsrzguwu0zykksxsq7zp2vqltveplk92wg4jk24aj748l6ct560hkgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gr0gjl</id>
    
      <title type="html">📅 Original date posted:2018-10-10 📝 Original message: I ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsrzguwu0zykksxsq7zp2vqltveplk92wg4jk24aj748l6ct560hkgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gr0gjl" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs2kppz435h6l0av2v2xw4kr6emyd62nxttyag8hpe78mmvnhgjqlcz4vzqd&#39;&gt;nevent1q…vzqd&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-10-10&lt;br/&gt;📝 Original message:&lt;br/&gt;I agree the r-fields are useful to populate for public channels in many&lt;br/&gt;situations, but care must be taken to not _always_ try them first without&lt;br/&gt;accounting for potentially high fees on those channels.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;On Wed, Oct 10, 2018 at 5:46 AM Rusty Russell &amp;lt;rusty at blockstream.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Pierre &amp;lt;pm&#43;lists at acinq.fr&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; But there&amp;#39;s no reason to believe that the invoicer has more knowledge&lt;br/&gt;&amp;gt; about all but the last hop.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I disagree: there is a good chance that the receiver is a 24/7 running&lt;br/&gt;&amp;gt; &amp;gt; merchant/website, with a full up-to-date view of the network, whereas&lt;br/&gt;&amp;gt; &amp;gt; the payer is most likely a mobile wallet with less&lt;br/&gt;&amp;gt; &amp;gt; accurate/partial/out of date information.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; At least this is what we are seeing on the current mainnet. Routing&lt;br/&gt;&amp;gt; &amp;gt; table sync is hard on mobile clients, and I think that it makes sense&lt;br/&gt;&amp;gt; &amp;gt; that receivers &amp;#34;help&amp;#34; senders, after all incentives are aligned.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Good qualification; I agree.  Certainly if the payer knows its&lt;br/&gt;&amp;gt; information is less reliable it should prefer the provided route.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181010/f522d3b5/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181010/f522d3b5/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:51:33Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs02v7jyjncksgwatpeg6q4rtvwcvpats53x6esxn05jh2h8vw2krczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97yd7qc4</id>
    
      <title type="html">📅 Original date posted:2018-09-20 📝 Original message: I was ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs02v7jyjncksgwatpeg6q4rtvwcvpats53x6esxn05jh2h8vw2krczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97yd7qc4" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsfmh4emh4y3wzcghf37vc6uglph4n7h0mjqre2nes349chxd2zgwc352c6g&#39;&gt;nevent1q…2c6g&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-09-20&lt;br/&gt;📝 Original message:&lt;br/&gt;I was thinking you could just make many requests to get the same&lt;br/&gt;information, but if you always choose the same channel as long as its&lt;br/&gt;capacity meets the requirement, then not much is learnt :)&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Thu, Sep 20, 2018 at 9:26 AM Christian Decker &amp;lt;decker.christian at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; That might not be so desirable, since it leaks the current channel&lt;br/&gt;&amp;gt; capacity to the user. Depending on how fine grained the amount in the&lt;br/&gt;&amp;gt; invoice is and how the user can control it, he could do a binary search&lt;br/&gt;&amp;gt; over capacities and very reliably tell how much capacity you have and&lt;br/&gt;&amp;gt; track it over time. That is still the case for a single channel, but if&lt;br/&gt;&amp;gt; you always chose the same channel it reduces how much info is leaked.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Christian&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt; Any reason not to include _all_ (up to a limit) incoming channels with&lt;br/&gt;&amp;gt; &amp;gt; sufficient capacity?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Cheers,&lt;br/&gt;&amp;gt; &amp;gt; Johan&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; On Thu, Sep 20, 2018 at 4:12 AM Rusty Russell &amp;lt;rusty at blockstream.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;         I&amp;#39;m considering a change to c-lightning, where `invoice` would&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; automatically append an &amp;#39;r&amp;#39; field for a channel which has sufficient&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; *incoming* capacity for the amount (using a weighted probability across&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; our peers).&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;          This isn&amp;#39;t quite what &amp;#39;r&amp;#39; was for, but it would be a useful&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; hint for payment routing and also potentially for establishing an&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; initial channel.  This is an issue for the Blockstream Store which&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; deliberately doesn&amp;#39;t advertize an address any more to avoid&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; centralization.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Thoughts welcome!&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; &amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; &amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- 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/20180920/114dfd18/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180920/114dfd18/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:51:31Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsffs93u67u3pv69m99jxrtg5jhy47vv47kalder4jmemgpmkdupcczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97u9m55h</id>
    
      <title type="html">📅 Original date posted:2018-09-20 📝 Original message: Any ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsffs93u67u3pv69m99jxrtg5jhy47vv47kalder4jmemgpmkdupcczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97u9m55h" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsvqx9nn623v38h0j4z4jmxjvqx3uuggsnc39f5m5y23fywedvu5vqkfw4dh&#39;&gt;nevent1q…w4dh&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-09-20&lt;br/&gt;📝 Original message:&lt;br/&gt;Any reason not to include _all_ (up to a limit) incoming channels with&lt;br/&gt;sufficient capacity?&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;On Thu, Sep 20, 2018 at 4:12 AM Rusty Russell &amp;lt;rusty at blockstream.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;         I&amp;#39;m considering a change to c-lightning, where `invoice` would&lt;br/&gt;&amp;gt; automatically append an &amp;#39;r&amp;#39; field for a channel which has sufficient&lt;br/&gt;&amp;gt; *incoming* capacity for the amount (using a weighted probability across&lt;br/&gt;&amp;gt; our peers).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;          This isn&amp;#39;t quite what &amp;#39;r&amp;#39; was for, but it would be a useful&lt;br/&gt;&amp;gt; hint for payment routing and also potentially for establishing an&lt;br/&gt;&amp;gt; initial channel.  This is an issue for the Blockstream Store which&lt;br/&gt;&amp;gt; deliberately doesn&amp;#39;t advertize an address any more to avoid&lt;br/&gt;&amp;gt; centralization.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thoughts welcome!&lt;br/&gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180920/83c90ab3/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180920/83c90ab3/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:51:30Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqst0g49rpx5tz6t0vs8c6hgal7ma0d9072xntusrvuncusuwt73wtczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r978ugzg2</id>
    
      <title type="html">📅 Original date posted:2018-07-10 📝 Original message: A ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqst0g49rpx5tz6t0vs8c6hgal7ma0d9072xntusrvuncusuwt73wtczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r978ugzg2" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsr8r569zy2j4wz7zm2m747pj77vp92qqpvak3raxct6kyce398agsyfgyfg&#39;&gt;nevent1q…gyfg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-07-10&lt;br/&gt;📝 Original message:&lt;br/&gt;A simple way to see how rebalancing could be beneficial, is to observe that you only know the channel capacity (not the balance!) of the channels you don’t belong to.&lt;br/&gt;If everybody is being good stewards and are rebalancing their channels, then picking a route to send a payment over is more likely to succeed than if everybody only has channels depleted in one direction (extreme case).&lt;br/&gt;&lt;br/&gt;On Thu, Jul 5, 2018 at 12:06, Dmytro Piatkivskyi &amp;lt;dmytro.piatkivskyi at ntnu.no&amp;gt; wrote:&lt;br/&gt;Hi Olaoluwa,&lt;br/&gt;&lt;br/&gt;I¹m glad we¹re thinking the same direction.&lt;br/&gt;&lt;br/&gt;Generally, I think we (the community) worry too much about equilibrium.&lt;br/&gt;There is no really proof that it improves the network. On the other hand,&lt;br/&gt;money being locked in channel is of major issue. Some nodes may be used&lt;br/&gt;mostly for sending payments, whereas others mostly receiving. Therefore,&lt;br/&gt;the distribution of funds in channels should be dictated not by&lt;br/&gt;equilibrium but by nodes&amp;#39; plans to send and receive.&lt;br/&gt;&lt;br/&gt;&amp;gt; In this case, equilibrium means being able to recv as much as you can&lt;br/&gt;&amp;gt;send on all your channels.&lt;br/&gt;&lt;br/&gt;Now it seems there are two ways to define equilibrium. You have described&lt;br/&gt;one where each node is trying to keep the ability to send and receive at&lt;br/&gt;the same level. I¹ll repeat the above argument, some nodes may be used&lt;br/&gt;mostly for sending payments, whereas others mostly receiving. Therefore,&lt;br/&gt;such definition is unjustified from the individual viewpoint. Another&lt;br/&gt;definition of equilibrium is when a node distributes equally the available&lt;br/&gt;balance amongst the channels it has. Your argument still stands here as&lt;br/&gt;such equilibrium minimises the number of depleted channels.&lt;br/&gt;&lt;br/&gt;&amp;gt; The argument here is that by maintaining this balance, one is likely to&lt;br/&gt;&amp;gt;reduce the number of routing failures from failed HTLC forwarding, as the&lt;br/&gt;&amp;gt;channel is equally likely to be able to carry an HTLC in either direction.&lt;br/&gt;&lt;br/&gt;If a node has no balance, its channels are depleted. There is nothing we&lt;br/&gt;can do with this. Such nodes are bad for topology and should be&lt;br/&gt;discouraged. Possibly by the autopilot.&lt;br/&gt;&lt;br/&gt;&amp;gt; However if a few sources/sinks dominate, then channels may regularly&lt;br/&gt;&amp;gt;become biased requiring more maintenance.&lt;br/&gt;&lt;br/&gt;Now you¹re bringing up even more important question. If we had balanced&lt;br/&gt;payments, LN could function without touching blockchain ever again&lt;br/&gt;indefinitely. Skewed traffic is a big problem. Re-balancing won¹t be of&lt;br/&gt;use here because having a fixed nodes¹ balances, there is only a limited&lt;br/&gt;max flow that can be pushed in a particular direction. I believe autopilot&lt;br/&gt;could mitigate the problem. Please, find my argument at the bottom of [1].&lt;br/&gt;&lt;br/&gt;[1] &lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues/677&#34;&gt;https://github.com/lightningnetwork/lnd/issues/677&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Dmytro&lt;br/&gt;&lt;br/&gt;From: Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt;&lt;br/&gt;Date: Tuesday, 3 July 2018 at 22:13&lt;br/&gt;To: Dmytro Piatkivskyi &amp;lt;dmytro.piatkivskyi at ntnu.no&amp;gt;&lt;br/&gt;Cc: &amp;#34;lightning-dev at lists.linuxfoundation.org&amp;#34;&lt;br/&gt;&amp;lt;lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;Subject: Re: [Lightning-dev] Rebalancing argument&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Hi Dmytro,&lt;br/&gt;&lt;br/&gt;Thanks for bringing this up! Sometime last year when I was at a developer&lt;br/&gt;meetup that cdecker also attended, we briefly discussed a similar&lt;br/&gt;question. We&lt;br/&gt;we&amp;#39;re discussing if &amp;#34;active rebalancing&amp;#34; was actually ever really&lt;br/&gt;necessary.&lt;br/&gt;&amp;gt;From my PoV, active rebalancing is rebalancing done for the purpose of&lt;br/&gt;being&lt;br/&gt;able to send/recv a particular payment. On white board, cdecer sketched&lt;br/&gt;out a&lt;br/&gt;similar argument as to Lemma 2 in that paper you linked: namely that there&lt;br/&gt;will&lt;br/&gt;exist an alternative path, therefore active rebalancing isn&amp;#39;t necessary.&lt;br/&gt;&lt;br/&gt;IMO, in a world pre-AMP, it is indeed necessary. Consider a node Bob that&lt;br/&gt;wishes to receive a payment of 0.5 BTC. Bob has two channels, one with 2&lt;br/&gt;BTC&lt;br/&gt;max capacity, and the other with 1 BTC max capacity. If channel 1 only has&lt;br/&gt;0.2&lt;br/&gt;available for him to receive, and channel 2 only has 0.3 available for him&lt;br/&gt;to&lt;br/&gt;receive, then without active rebalancing, he&amp;#39;s unable to receive the&lt;br/&gt;payment.&lt;br/&gt;However, if he completes a circular payment from channel 1 to channel 2&lt;br/&gt;(or the&lt;br/&gt;other way around), then he&amp;#39;s able to receive the payment (under ideal&lt;br/&gt;conditions).&lt;br/&gt;&lt;br/&gt;In a world post-AMP, then this would seem to no longer apply. Alice the&lt;br/&gt;sender&lt;br/&gt;may be able to utilize the aggregate bandwidth of the network to send&lt;br/&gt;minimally&lt;br/&gt;two payment flows (one 0.2 and one 0.3) to satisfy the payment. As a&lt;br/&gt;result,&lt;br/&gt;active rebalancing isn&amp;#39;t needed as payments can be split up to fully&lt;br/&gt;utilize&lt;br/&gt;the payment bandwidth at both the sender and the receiver.&lt;br/&gt;&lt;br/&gt;&amp;gt; total balances of nodes in the network define the feasibility of a&lt;br/&gt;&amp;gt;particular&lt;br/&gt;&amp;gt; transaction, not the distribution of balances.&lt;br/&gt;&lt;br/&gt;With multi-path payments this is precisely the case!&lt;br/&gt;&lt;br/&gt;However, there might be an argument in favor of &amp;#34;passive rebalancing&amp;#34;. I&lt;br/&gt;define&lt;br/&gt;passive rebalancing as rebalancing a node carries out independent of&lt;br/&gt;needing to&lt;br/&gt;send/receive payments themselves, in order to ensure an equilibrium state&lt;br/&gt;amongst the available balances of their channels. In this case, equilibrium&lt;br/&gt;means being able to recv as much as you can send on all your channels. The&lt;br/&gt;argument here is that by maintaining this balance, one is likely to reduce&lt;br/&gt;the&lt;br/&gt;number of routing failures from failed HTLC forwarding, as the channel is&lt;br/&gt;equally likely to be able to carry an HTLC in either direction.&lt;br/&gt;&lt;br/&gt;One relevant detail w.r.t to the necessity of active rebalancing is the&lt;br/&gt;directionality of payment flows in the network. If payment flows are more&lt;br/&gt;or&lt;br/&gt;less balanced (kinda like the ideal world Byran Vu describes in the post&lt;br/&gt;[1]),&lt;br/&gt;meaning people are sending out as much as they receive (so they get their&lt;br/&gt;paycheck streamed to them over LN, then stream BitFlix w/ that), then it&amp;#39;s&lt;br/&gt;possible passive rebalancing isn&amp;#39;t really necessary. However if a few&lt;br/&gt;sources/sinks dominate, then channels may regularly become biased requiring&lt;br/&gt;more maintenance.&lt;br/&gt;&lt;br/&gt;Also thanks for bringing this paper to my attention! Haven&amp;#39;t yet read it in&lt;br/&gt;full yet, but happy to discover that this isn&amp;#39;t completes new territory&lt;br/&gt;and is&lt;br/&gt;a problem that&amp;#39;s been explored in the existing literature.&lt;br/&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;https://blog.lightning.engineering/posts/2018/05/30/routing.html&#34;&gt;https://blog.lightning.engineering/posts/2018/05/30/routing.html&lt;/a&gt;&lt;br/&gt;&amp;lt;&lt;a href=&#34;https://blog.lightning.engineering/posts/2018/05/30/routing.html&amp;gt&#34;&gt;https://blog.lightning.engineering/posts/2018/05/30/routing.html&amp;gt&lt;/a&gt;;&lt;br/&gt;&lt;br/&gt;-- Laolu&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sun, Jul 1, 2018 at 5:21 AM Dmytro Piatkivskyi&lt;br/&gt;&amp;lt;dmytro.piatkivskyi at ntnu.no&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Hi everyone,&lt;br/&gt;&lt;br/&gt;I have been working academically on the Lightning network for a while now.&lt;br/&gt;I didn¹t not participate in the list to form my own vision of what it&lt;br/&gt;should be. So please, bear with me if I¹ll be saying nonsense sometimes.&lt;br/&gt;&lt;br/&gt;There has been a lot of discussion on sending cycle transactions to&lt;br/&gt;oneself to Œre-balance¹ the network. On LN mailing list&lt;br/&gt;&amp;lt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/00&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/00&lt;/a&gt;&lt;br/&gt;1005.html&amp;gt; [1] or numerous&lt;br/&gt;places elsewhere. There has been even a paper suggesting a smart&lt;br/&gt;mechanism to do the re-balancing (see Revive or Liquidity network [2]). My&lt;br/&gt;question is what do we actually get from it? [3] states that the&lt;br/&gt;distribution of funds in channels does not really affect&lt;br/&gt;the network liquidity. I can see cheaper fees or shorter paths if the&lt;br/&gt;network is kept balanced. But don¹t you think that a smart fee strategy&lt;br/&gt;will do the job?&lt;br/&gt;&lt;br/&gt;To save your time, [4] explains the gist from [3].&lt;br/&gt;&lt;br/&gt;[1]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/001&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-February/001&lt;/a&gt;&lt;br/&gt;005.html&lt;br/&gt;[2]&lt;br/&gt;&lt;a href=&#34;https://www.reddit.com/r/ethereum/comments/7bse33/were_very_happy_to_announ&#34;&gt;https://www.reddit.com/r/ethereum/comments/7bse33/were_very_happy_to_announ&lt;/a&gt;&lt;br/&gt;ce_the_liquiditynetwork/&lt;br/&gt;[3] &lt;a href=&#34;https://arxiv.org/abs/1007.0515&#34;&gt;https://arxiv.org/abs/1007.0515&lt;/a&gt;&lt;br/&gt;[4]&lt;br/&gt;&lt;a href=&#34;https://medium.com/@dimapiatkivskyi/why-would-you-re-balance-a-payment-netw&#34;&gt;https://medium.com/@dimapiatkivskyi/why-would-you-re-balance-a-payment-netw&lt;/a&gt;&lt;br/&gt;ork-796756ad4f31&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;_______________________________________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;_______________________________________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180710/aa9097bd/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180710/aa9097bd/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:51:01Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxcef27s5c5s3hsdjjn5flm46l4edgmaqp6jz4cegr0q2tgfdvqkczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97refxtc</id>
    
      <title type="html">📅 Original date posted:2018-02-08 📝 Original message: Yeah, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxcef27s5c5s3hsdjjn5flm46l4edgmaqp6jz4cegr0q2tgfdvqkczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97refxtc" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsp0h5jjj2dr85txx7vj240z39stewcfugtz5ca5vl5rm4jgjdqgsgdywdly&#39;&gt;nevent1q…wdly&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-02-08&lt;br/&gt;📝 Original message:&lt;br/&gt;Yeah, that is true, it would only give you the atomicity, not the decorrelation. I don’t see how you could get all the same properties using only one hash though. I guess the sender has no incentive to claim any of the payments before all of them have arrived, but you get no guarantee that partial payments cannot be made. Seems hard to do without introducing new primitives.&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Thu, Feb 8, 2018 at 12:44, Jim Posen &amp;lt;jim.posen at gmail.com&amp;gt; wrote:&lt;br/&gt;If using two hashes to deliver the payment while still getting a proof, I&amp;#39;m not sure what that provides above just sending regular lightning payments over multiple routes with one hash. Firstly, if there is a second hash, it would presumably be the same for all routes, making them linkable again, which AMP tries to solve. And secondly, the receiver has no incentive to claim any of the HTLCs before all of them are locked in, because in that case they are releasing the transaction receipt before fully being paid.&lt;br/&gt;&lt;br/&gt;On Thu, Feb 8, 2018 at 8:41 AM, Johan Torås Halseth &amp;lt; johanth at gmail.com [johanth at gmail.com] &amp;gt; wrote:&lt;br/&gt;An obvious way to make this compatible with proof-of-payment would be to require two hashes to claim the HTLC: the presage from the invoice payment hash (as today) &#43; the new hash introduced here. This would give the sender a receipt after only one of the HTLCs was claimed. Would require changes to the scripts of course.&lt;br/&gt;With Schnorr/EC operations this could probably be made more elegant, as mentioned.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;On Wed, Feb 7, 2018 at 18:21, Rusty Russell &amp;lt; rusty at rustcorp.com.au [rusty at rustcorp.com.au] &amp;gt; wrote:&lt;br/&gt;Olaoluwa Osuntokun &amp;lt; laolu32 at gmail.com [laolu32 at gmail.com] &amp;gt; writes:&lt;br/&gt;&amp;gt; Hi Y&amp;#39;all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A common question I&amp;#39;ve seen concerning Lightning is: &amp;#34;I have five $2&lt;br/&gt;&amp;gt; channels, is it possible for me to *atomically* send $6 to fulfill a&lt;br/&gt;&amp;gt; payment?&amp;#34;. The answer to this question is &amp;#34;yes&amp;#34;, provided that the receiver&lt;br/&gt;&lt;br/&gt;This is awesome! I&amp;#39;m kicking myself for not proposing it :)&lt;br/&gt;&lt;br/&gt;Unfortunately, your proposal defines a way to make multipath donations,&lt;br/&gt;not multipath payments :(&lt;br/&gt;&lt;br/&gt;In other words, you&amp;#39;ve lost proof of payment, which IMHO is critical.&lt;br/&gt;&lt;br/&gt;Fortunately, this can be fairly trivially fixed when we go to scriptless&lt;br/&gt;scripts or other equivalent decorrelation mechanism, when I think this&lt;br/&gt;mechanism becomes extremely powerful.&lt;br/&gt;&lt;br/&gt;&amp;gt; - Potential fee savings for larger payments, contingent on there being a&lt;br/&gt;&amp;gt; super-linear component to routed fees. It&amp;#39;s possible that with&lt;br/&gt;&amp;gt; modifications to the fee schedule, it&amp;#39;s actually *cheaper* to send&lt;br/&gt;&amp;gt; payments over multiple flows rather than one giant flow.&lt;br/&gt;&lt;br/&gt;This is a stretch. I&amp;#39;d stick with the increased reliability/privacy&lt;br/&gt;arguments which are overwhelmingly compelling IMHO.&lt;br/&gt;&lt;br/&gt;If I have any important feedback on deeper reading (and after a sccond&lt;br/&gt;coffee), I&amp;#39;ll send a separate email.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;Rusty.&lt;br/&gt;______________________________ _________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists. linuxfoundation.org [Lightning-dev at lists.linuxfoundation.org]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/ lightning-dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;______________________________ _________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists. linuxfoundation.org [Lightning-dev at lists.linuxfoundation.org]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/ lightning-dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;-------------- 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/20180208/edbfbd41/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180208/edbfbd41/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:49:01Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs8ku9w5ld6e7l6rs0mmdz4jlmr53x74wyrz90qt6mqqq9xq52552czyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97z3602j</id>
    
      <title type="html">📅 Original date posted:2018-02-08 📝 Original message: An ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs8ku9w5ld6e7l6rs0mmdz4jlmr53x74wyrz90qt6mqqq9xq52552czyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97z3602j" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsvxy0vfpd766w0tsl3exus244e2z0kavpzzl4lypfll0ks9uctr7glhcdlf&#39;&gt;nevent1q…cdlf&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-02-08&lt;br/&gt;📝 Original message:&lt;br/&gt;An obvious way to make this compatible with proof-of-payment would be to &lt;br/&gt;require two hashes to claim the HTLC: the presage from the invoice payment &lt;br/&gt;hash (as today) &#43; the new hash introduced here. This would give the sender &lt;br/&gt;a receipt after only one of the HTLCs was claimed. Would require changes to &lt;br/&gt;the scripts of course.&lt;br/&gt;With Schnorr/EC operations this could probably be made more elegant, as &lt;br/&gt;mentioned.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;On Wed, Feb 7, 2018 at 18:21, Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; writes:&lt;br/&gt; &amp;gt; Hi Y&amp;#39;all,&lt;br/&gt; &amp;gt;&lt;br/&gt; &amp;gt; A common question I&amp;#39;ve seen concerning Lightning is: &amp;#34;I have five $2&lt;br/&gt; &amp;gt; channels, is it possible for me to *atomically* send $6 to fulfill a&lt;br/&gt; &amp;gt; payment?&amp;#34;. The answer to this question is &amp;#34;yes&amp;#34;, provided that the &lt;br/&gt;receiver&lt;br/&gt;&lt;br/&gt;This is awesome! I&amp;#39;m kicking myself for not proposing it :)&lt;br/&gt;&lt;br/&gt;Unfortunately, your proposal defines a way to make multipath donations,&lt;br/&gt;not multipath payments :(&lt;br/&gt;&lt;br/&gt;In other words, you&amp;#39;ve lost proof of payment, which IMHO is critical.&lt;br/&gt;&lt;br/&gt;Fortunately, this can be fairly trivially fixed when we go to scriptless&lt;br/&gt;scripts or other equivalent decorrelation mechanism, when I think this&lt;br/&gt;mechanism becomes extremely powerful.&lt;br/&gt;&lt;br/&gt; &amp;gt; - Potential fee savings for larger payments, contingent on there being a&lt;br/&gt; &amp;gt; super-linear component to routed fees. It&amp;#39;s possible that with&lt;br/&gt; &amp;gt; modifications to the fee schedule, it&amp;#39;s actually *cheaper* to send&lt;br/&gt; &amp;gt; payments over multiple flows rather than one giant flow.&lt;br/&gt;&lt;br/&gt;This is a stretch. I&amp;#39;d stick with the increased reliability/privacy&lt;br/&gt;arguments which are overwhelmingly compelling IMHO.&lt;br/&gt;&lt;br/&gt;If I have any important feedback on deeper reading (and after a sccond&lt;br/&gt;coffee), I&amp;#39;ll send a separate email.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;Rusty.&lt;br/&gt;_______________________________________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180208/ec4e6b34/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180208/ec4e6b34/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:49:00Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsd2q3kmfzq92kpyx4eda44r70jwletm09q5auh6yzc0gkwxar5fggzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970v7my3</id>
    
      <title type="html">📅 Original date posted:2018-01-16 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsd2q3kmfzq92kpyx4eda44r70jwletm09q5auh6yzc0gkwxar5fggzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r970v7my3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsxgl8fpwx6apmrxj5ckv0qkfz55dt7pkyvqrak33m9qgg92nt5kkqy9sjxq&#39;&gt;nevent1q…sjxq&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-16&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Rusty,&lt;br/&gt;This is something I’ve been thinking a bit about, as I’ve stumbled into some of the edge cases you mention. Just to get on the same page: does the other side (non-funder) pay any fees in the current implementation? [1] suggests that the funder pays everything atm (on both sides’ commitment), so I reckon you are talking about dual-funder from here on.&lt;br/&gt;[1] &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#fee-payment&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#fee-payment&lt;/a&gt;&lt;br/&gt;Problem#1 If we can make each side pay the fee for the HTLCs they are adding (on both commitments!), in addition to your suggestion of having them set fees independently, we get a nice bonus: Any update Alice makes, can only decrease *her* balance, not Bob’s. She can add HTLCs (she must pay HTLC&#43;fee), do a fee update (potentially increasing the fees she must pay), or settle/fail HTLCs (can not decrease her balance). This is in contrast to the current spec, where an added HTLC can make Bob pay the fee (if he’s funder), and a fee update can make Bob not afford the new fee (the race you mentioned).&lt;br/&gt;I think this will work without the check (2) you mention, since if Alice sends a fee update, then it will apply only to her HTLCs, and as mentioned can only decrease her balance. It doesn’t matter if Bob adds `max_accepted_htlcs` at the same time, since those fees will then be subtracted from his balance, and is not affected by the fee update.&lt;br/&gt;This would make a lot of the edge cases go away, and would make it a lot easier to verify that a node is not violating its channel reserve. Let me know if I’m missing something.&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Tue, Jan 16, 2018 at 0:55, Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;Hi all,&lt;br/&gt;&lt;br/&gt;Wanted to post some thinking on this for everyone to mull over,&lt;br/&gt;though I know we&amp;#39;re all busy.&lt;br/&gt;&lt;br/&gt;Your consideration and feedback gratefully accepted!&lt;br/&gt;&lt;br/&gt;Problem #1&lt;br/&gt;==========&lt;br/&gt;For simplicity, one side (funder) sets fees, but other side&lt;br/&gt;needs to check they&amp;#39;re sufficient, and not insanely high (as *they* end&lt;br/&gt;up paying for HTLC txs). If they disagree, they close channel; this&lt;br/&gt;happens a fair bit on testnet, for example, and will be worse with&lt;br/&gt;different backends (eg. different bitcoind versions, or btcd, etc).&lt;br/&gt;&lt;br/&gt;Solution&lt;br/&gt;--------&lt;br/&gt;Have both sides set fees independently. I specify what fees my&lt;br/&gt;commitment tx and HTLC txs will have, you do the same. This works in&lt;br/&gt;well with dual-funder proposals.&lt;br/&gt;&lt;br/&gt;Implementation:&lt;br/&gt;--------------&lt;br/&gt;c-lightning did something similar pre-spec. The way it works is both&lt;br/&gt;sides set an initial fee in `open_channel`: this is the only point at&lt;br/&gt;which the counterparty checks it&amp;#39;s reasonable.&lt;br/&gt;&lt;br/&gt;You send an `update_fee` message like now, but it has no effect on the&lt;br/&gt;other side: it&amp;#39;s applied to *you* when they &amp;#39;revoke_and_ack&amp;#39;, like any&lt;br/&gt;other change.&lt;br/&gt;&lt;br/&gt;You disallow any `update_fee` which the other side could not afford with&lt;br/&gt;(1) all their current HTLCs, AND (2) the `max_accepted_htlcs` from you.&lt;br/&gt;That covers the race where one side sets fees and the other adds a heap&lt;br/&gt;of HTLCs and the two cross over.&lt;br/&gt;&lt;br/&gt;Also disallow any new HTLCs you can&amp;#39;t pay fees for (given same&lt;br/&gt;worst-case calculation as above), and if the one side can&amp;#39;t afford fees,&lt;br/&gt;pull from its reserve and other side as necessary (this can only happen&lt;br/&gt;during initial phase, and is the same logic as now).&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Problem #2&lt;br/&gt;==========&lt;br/&gt;Predicting the future is hard. Today&amp;#39;s sufficient fee may be a gross&lt;br/&gt;overpayment or insufficient tomorrow.&lt;br/&gt;&lt;br/&gt;Solution&lt;br/&gt;--------&lt;br/&gt;Allow multiple simultaneous fee levels.&lt;br/&gt;&lt;br/&gt;Implementation:&lt;br/&gt;---------------&lt;br/&gt;This means multiple signatures in each `commitment_signed` message,&lt;br/&gt;which is more work and more storage. But since our nSequence is &amp;lt;&lt;br/&gt;0xFFFFFFFE anyway, all transactions are RBF-ready except&lt;br/&gt;closing_transaction. We might want to change that; we already allow&lt;br/&gt;re-negotiation of closing tx by reconnecting anyway.&lt;br/&gt;_______________________________________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180117/bebe4a64/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180117/bebe4a64/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:34Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs20gw4jurasmft3utx445l0uw5lgu7yksxtvu9kc87aalzz3zchcszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97nmtcur</id>
    
      <title type="html">📅 Original date posted:2018-01-16 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs20gw4jurasmft3utx445l0uw5lgu7yksxtvu9kc87aalzz3zchcszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97nmtcur" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsrngnhkkgyykhjyrnssqje6uqmqgqv2cwegx5srfnm4h9kmqyecjqan6tfr&#39;&gt;nevent1q…6tfr&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-16&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Jonathan,&lt;br/&gt;This is definitely a problem! I have a mainnet channel I force closed 2 weeks ago that is still not mined :(&lt;br/&gt;With current spec I guess it is not much that can be done other than crossing fingers. For future specs maybe someone could come up with some SIGHASH flag magic to either (1) allow adding an extra input that could go to fees, or (2) add both a new input and output, where the difference goes to fees. I believe this would change the TXID of the commitment transaction, but not sure if that’s a problem? (Watchtowers comes to mind).&lt;br/&gt;If keeping the TXID intact is important, one solution would be to always add a small (1 satoshi?) output to every commitment transaction, that anyone can spend. So if the commitment transaction has a fee too low, you could do CPFP on this small output, making it confirm. You could even make a batch sweep of many such outputs, and they would be (un)fairly cheap since they don’t need a signature. Do you think this would work?&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sun, Jan 14, 2018 at 2:30, Jonathan Underwood &amp;lt;junderwood at bitcoinbank.co.jp&amp;gt; wrote:&lt;br/&gt;Hey everybody.&lt;br/&gt;Say that the last time we updated channel state, we assumed 40 satoshi/byte was enough to get confirmed, then I leave the channel for a few weeks, come back to find my partner fell off the face of the internet.&lt;br/&gt;I perform unilateral close with my output on CSV timelock... but it turns out there’s 500 MB of txes at around 100 satoshi/byte and lets say my transaction will never get confirmed at 40 sat/byte.&lt;br/&gt;What course of action can I take?&lt;br/&gt;1. to_local output can&amp;#39;t be redeemed until the commitment transaction (which will &amp;#34;never confirm&amp;#34;) is confirmed &#43; the CSV timeout.&lt;br/&gt;2. to_remote output probably won&amp;#39;t be redeemed as the other person is offline.&lt;br/&gt;The only remedy I can think of is hope that the other person comes back online and CPFPs your to_remote output for you... but at that point it would be better for them to just amicably close with normal outputs... so basically your only hope is wait for other person to come online.&lt;br/&gt;&lt;br/&gt;Since CSV will cause script verification to fail, a CPFP transaction will not be propagated.&lt;br/&gt;If we can&amp;#39;t CPFP, the CSV timer won&amp;#39;t start (it starts once the CSV containing output is confirmed).&lt;br/&gt;Seems like a problem.&lt;br/&gt;Anyone have any solutions?&lt;br/&gt;Thanks, Jon&lt;br/&gt;--&lt;br/&gt;-----------------&lt;br/&gt;Jonathan Underwood ビットバンク社 チーフビットコインオフィサー -----------------&lt;br/&gt;暗号化したメッセージをお送りの方は下記の公開鍵をご利用下さい。&lt;br/&gt;指紋: 0xCE5EA9476DE7D3E45EBC3FDAD998682F3590FEA3&lt;br/&gt;_______________________________________________ Lightning-dev mailing list Lightning-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180117/1a4ee0f6/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180117/1a4ee0f6/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:33Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqstd38syhsndc2m0fg96cch6g0edm2nxtfs5efv8eu87k976fgewzqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97w525pc</id>
    
      <title type="html">📅 Original date posted:2018-01-12 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqstd38syhsndc2m0fg96cch6g0edm2nxtfs5efv8eu87k976fgewzqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97w525pc" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9c4g4erdzl08f5sq8kufntjx7t9sy0znaxhcs5dukakuac5e3vtspl6enz&#39;&gt;nevent1q…6enz&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-12&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi Pierre,&lt;br/&gt;You’re right, that looks very much like the same kind of situation!&lt;br/&gt;I agree, it looks from [2] that a node may fail the channel in this case, and that it probably should to not risk end up with all funds in an unpublishable tx. Seems like something that could be used as a DOS attack vector by a malicious counter party otherwise.&lt;br/&gt;&lt;br/&gt;Relevant to this: We use a node’s resulting output (that is, after subtracting fees) when checking that the channel_reserve is met. In these cases we can therefore end up violating the reserve, even though none of the nodes are actually violating the protocol. When this happens we don’t really end up with an unpublishable tx, as the fees are still high enough, and I guess each node can choose what to do. I think we will just fail the channel to not have to deal with this as a special case.&lt;br/&gt;Anyway, I think these are cases that are not very likely to occur, especially with the right choice of parameters as you mention. And because of this it might be less error-prone to just fail the channel instead of trying to recover from it.&lt;br/&gt;Thanks! - Johan&lt;br/&gt;On Fri, Jan 12, 2018 at 12:56, Pierre &amp;lt;pm&#43;lists at acinq.fr&amp;gt; wrote:&lt;br/&gt;Hi Johan,&lt;br/&gt;&lt;br/&gt;That&amp;#39;s an interesting corner case. I think it shares some similarities&lt;br/&gt;with the race condition described in BOLT 2 [1], which handling is&lt;br/&gt;specified in BOLT 3 [2].&lt;br/&gt;&lt;br/&gt;Note that what matters really is the timing of the&lt;br/&gt;`commit_sig`/`revoke_and_ack` messages, not the `update_add_htlc`s,&lt;br/&gt;because of the acknowledgment logic that excludes remote&amp;#39;s unsigned&lt;br/&gt;updates. A side effect is that there can be multiple HTLCs on each&lt;br/&gt;side.&lt;br/&gt;&lt;br/&gt;Each party will end up receiving a commitment tx which has&lt;br/&gt;insufficient (possibly zero) fees. At that point according to [2] it&lt;br/&gt;may decide to fail the channel, using its previous commitment (which&lt;br/&gt;it hasn&amp;#39;t yet revoked). Currently eclair won&amp;#39;t fail the channel, but I&lt;br/&gt;think we probably should, especially if we are the fundee and would&lt;br/&gt;end up with all funds in an unpublishable tx. The funder could face&lt;br/&gt;the same situation if the pending htlcs have a high value (at this&lt;br/&gt;point its main output is zero anyway).&lt;br/&gt;&lt;br/&gt;An appropriate choice of channel parameters (`mainly&lt;br/&gt;max_htlc_value_in_flight_msat`, `channel_reserve_satoshis`,&lt;br/&gt;`max_accepted_htlcs`) could probably reduce the probability of this&lt;br/&gt;happening.&lt;br/&gt;&lt;br/&gt;Hope that helps,&lt;br/&gt;&lt;br/&gt;Pierre&lt;br/&gt;&lt;br/&gt;[1] &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#updating-fees-update_fee&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#updating-fees-update_fee&lt;/a&gt;&lt;br/&gt;[2] &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#fee-payment&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#fee-payment&lt;/a&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/20180112/c18884a0/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180112/c18884a0/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:32Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsqcvnll9qy68dsue24n2whvx5kq760ueg24cf28yc7ruvn53k0n3czyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r979l7u9y</id>
    
      <title type="html">📅 Original date posted:2018-01-12 📝 Original message: Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsqcvnll9qy68dsue24n2whvx5kq760ueg24cf28yc7ruvn53k0n3czyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r979l7u9y" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsrgnc9c4ykyual53xvlf4uv57lc66utmqah7ygtmuuruv05hg663qn45f76&#39;&gt;nevent1q…5f76&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-12&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi all,&lt;br/&gt;I am wondering how Eclair and c-lightning is handling the following case, as I wasn’t able to derive exactly how to handle it from the BOLTs. If it is described somewhere, please point me to it, if not, let’s agree on a strategy, and get it in :)&lt;br/&gt;Let&amp;#39;s say Alice is the funder of the channel (meaning she is paying all fees) between Alice and Bob. She wants to add an HTLC, and has just enough balance available for the HTLC &#43; the extra fee for adding it to the commitment transaction. At the same time Bob wants to add an HTLC, and sees that Alice has enough balance to be able to pay the fee for receiving this HTLC (add it to her commitment tx).&lt;br/&gt;They both send the AddHTLC at the same time, thinking Alice has enough balance available, but she doesn&amp;#39;t have enough to cover her own HTLC&#43;fee, in addition to the fee for adding Bob&amp;#39;s. Adding both the HTLCs to her commitment transaction will either 1) violate the channel reserve requirement, or 2) deplete her channel completely if the channel reserve is set to 0.&lt;br/&gt;What is the expected way of handling this case, from both Alice and Bob’s point of view?&lt;br/&gt;Cheers, Johan&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/20180112/8844551f/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180112/8844551f/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:31Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsr5pa0wqp320crnvv4yaqzwyhqft6te62t6x22324h39qpa5w5qwgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97p8mea4</id>
    
      <title type="html">📅 Original date posted:2018-01-11 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsr5pa0wqp320crnvv4yaqzwyhqft6te62t6x22324h39qpa5w5qwgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97p8mea4" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqswst4m07t6fld4luddq333huyz68v2cp6czdne50p0t3dejfhme6qy7jmep&#39;&gt;nevent1q…jmep&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-11&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Cezary,&lt;br/&gt;I initially read the issue you created as a bug filing, my bad. I’ve updated it to reflect that it is a feature request.&lt;br/&gt;Cheers! Johan&lt;br/&gt;&lt;br/&gt;On Thu, Jan 11, 2018 at 18:16, Cezary Dziemian &amp;lt;cezary.dziemian at gmail.com&amp;gt; wrote:&lt;br/&gt;I made issue 5 days ago: &lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues/564&#34;&gt;https://github.com/lightningnetwork/lnd/issues/564&lt;/a&gt; [&lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues/564&#34;&gt;https://github.com/lightningnetwork/lnd/issues/564&lt;/a&gt;]&lt;br/&gt;2018-01-11 0:21 GMT&#43;01:00 Olaoluwa Osuntokun &amp;lt; laolu32 at gmail.com [laolu32 at gmail.com] &amp;gt; :&lt;br/&gt;&lt;br/&gt;Hi Cezary,&lt;br/&gt;I invite you to make an issue on lnd&amp;#39;s issue tracker: &lt;a href=&#34;https://github.com/&#34;&gt;https://github.com/&lt;/a&gt; lightningnetwork/lnd/issues [&lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues&#34;&gt;https://github.com/lightningnetwork/lnd/issues&lt;/a&gt;] . This list isn&amp;#39;t the place for support requests/features for individual implementations.&lt;br/&gt;On Tue, Jan 9, 2018 at 5:21 AM Cezary Dziemian &amp;lt; cezary.dziemian at gmail.com [cezary.dziemian at gmail.com] &amp;gt; wrote:&lt;br/&gt;Good news, thanks.&lt;br/&gt;&lt;br/&gt;Do Lightning Labs also have plan to introduce this soon? I prefer to stay with lnd, as we already know this implementation better, but if this option will not be introduced soon, we have to switch to use c-lightning.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Cezary&lt;br/&gt;2018-01-09 5:31 GMT&#43;01:00 Rusty Russell &amp;lt; rusty at rustcorp.com.au [rusty at rustcorp.com.au] &amp;gt; :&lt;br/&gt;ZmnSCPxj via Lightning-dev &amp;lt; lightning-dev at lists. linuxfoundation.org [lightning-dev at lists.linuxfoundation.org] &amp;gt; writes:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Cezary,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Currently, c-lightning can PAY amountless invoices via the &amp;#34;pay&amp;#34; command, but cannot CREATE them via the c-lightning &amp;#34;invoice&amp;#34; command.&lt;br/&gt;&lt;br/&gt;Good point, I&amp;#39;ve filed an issue for this, so we don&amp;#39;t lose it:&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://github.com/&#34;&gt;https://github.com/&lt;/a&gt; ElementsProject/lightning/ issues/534 [&lt;a href=&#34;https://github.com/ElementsProject/lightning/issues/534&#34;&gt;https://github.com/ElementsProject/lightning/issues/534&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;&amp;gt; To pay an amountless invoice lntb... 4 satoshis in c-lightning: lightning-cli pay lntb.. 4000&lt;br/&gt;&lt;br/&gt;Note that I&amp;#39;d prefer the &amp;#34;msatoshi&amp;#34; field to be a magic string&lt;br/&gt;(eg. &amp;#34;any&amp;#34;) rather than omitting the parameter, since it&amp;#39;s too easy for&lt;br/&gt;a bug to omit the parameter.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Rusty.&lt;br/&gt;&lt;br/&gt;______________________________ _________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists. linuxfoundation.org [Lightning-dev at lists.linuxfoundation.org]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/ lightning-dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;_______________________________________________ Lightning-dev mailing list Lightning-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180111/36620dd6/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180111/36620dd6/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:25Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsflvdqzl6f8jzl0ttkmkpl28etudp5ce4n60gsg76gpz0d5fq03pgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97jln77t</id>
    
      <title type="html">📅 Original date posted:2018-01-02 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsflvdqzl6f8jzl0ttkmkpl28etudp5ce4n60gsg76gpz0d5fq03pgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97jln77t" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs96xr27vp7ax7x30xs4q7f0lj4g5cex5kjuyc6dmp05mw8gpzya4gel7ff9&#39;&gt;nevent1q…7ff9&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-02&lt;br/&gt;📝 Original message:&lt;br/&gt;That’s correct :)&lt;br/&gt;&lt;br/&gt;On Tue, Jan 2, 2018 at 15:34, Praveen Baratam &amp;lt;praveen.baratam at gmail.com&amp;gt; wrote:&lt;br/&gt;Thank you for explaining @Hafeez &amp;amp; @Johan&lt;br/&gt;Now that all the BIPs necessary for LN including SegWit (Softfork) are active on the mainnet, are we just waiting for the LN implementation to mature or are there any other issues? ᐧ&lt;br/&gt;On Tue, Jan 2, 2018 at 8:01 PM, Johan Torås Halseth &amp;lt; johanth at gmail.com [johanth at gmail.com] &amp;gt; wrote:&lt;br/&gt;Hi,&lt;br/&gt;Before you can safely broadcast the funding transaction, the two parties involved in a channel must have signed a commitment transaction spending the output from the funding transaction. Without segwit, the funding transaction can be malleated, leaving the commitment transaction invalid, and funds locked up if one of the parties stops cooperating.&lt;br/&gt;&lt;br/&gt;Cheers, Johan&lt;br/&gt;On Tue, Jan 2, 2018 at 15:11, Hafeez Bana &amp;lt; hafeez.bana at gmail.com [hafeez.bana at gmail.com] &amp;gt; wrote:&lt;br/&gt;to fix transaction malleability&lt;br/&gt;&lt;br/&gt;On Tue, Jan 2, 2018 at 1:53 PM, Praveen Baratam &amp;lt; praveen.baratam at gmail.com [praveen.baratam at gmail.com] &amp;gt; wrote:&lt;br/&gt;Why is SegWit required for LN? If we wait for the funding transaction to be confirmed , we can then safely create and update unconfirmed commitment transactions...&lt;br/&gt;I don&amp;#39;t see how SegWit is important here... Am I missing something?&lt;br/&gt;&lt;br/&gt;--&lt;br/&gt;Dr. Praveen Baratam&lt;br/&gt;about.me [&lt;a href=&#34;http://about.me/praveen.baratam&#34;&gt;http://about.me/praveen.baratam&lt;/a&gt;] ᐧ&lt;br/&gt;______________________________ _________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfound ation.org [Lightning-dev at lists.linuxfoundation.org]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/lightning -dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;______________________________ _________________ Lightning-dev mailing list Lightning-dev at lists. linuxfoundation.org [Lightning-dev at lists.linuxfoundation.org] &lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/ lightning-dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;--&lt;br/&gt;Dr. Praveen Baratam&lt;br/&gt;about.me [&lt;a href=&#34;http://about.me/praveen.baratam&#34;&gt;http://about.me/praveen.baratam&lt;/a&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/20180102/bbc8938a/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180102/bbc8938a/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:21Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs96xr27vp7ax7x30xs4q7f0lj4g5cex5kjuyc6dmp05mw8gpzya4gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r975mewdc</id>
    
      <title type="html">📅 Original date posted:2018-01-02 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs96xr27vp7ax7x30xs4q7f0lj4g5cex5kjuyc6dmp05mw8gpzya4gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r975mewdc" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsvgxaj5avxrksc76sc9q6rd7mptyrxq8xnptdqtdf6mknj2u8zf0cqcdnne&#39;&gt;nevent1q…dnne&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-01-02&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi,&lt;br/&gt;Before you can safely broadcast the funding transaction, the two parties involved in a channel must have signed a commitment transaction spending the output from the funding transaction. Without segwit, the funding transaction can be malleated, leaving the commitment transaction invalid, and funds locked up if one of the parties stops cooperating.&lt;br/&gt;&lt;br/&gt;Cheers, Johan&lt;br/&gt;On Tue, Jan 2, 2018 at 15:11, Hafeez Bana &amp;lt;hafeez.bana at gmail.com&amp;gt; wrote:&lt;br/&gt;to fix transaction malleability&lt;br/&gt;&lt;br/&gt;On Tue, Jan 2, 2018 at 1:53 PM, Praveen Baratam &amp;lt; praveen.baratam at gmail.com [praveen.baratam at gmail.com] &amp;gt; wrote:&lt;br/&gt;Why is SegWit required for LN? If we wait for the funding transaction to be confirmed , we can then safely create and update unconfirmed commitment transactions...&lt;br/&gt;I don&amp;#39;t see how SegWit is important here... Am I missing something?&lt;br/&gt;&lt;br/&gt;--&lt;br/&gt;Dr. Praveen Baratam&lt;br/&gt;about.me [&lt;a href=&#34;http://about.me/praveen.baratam&#34;&gt;http://about.me/praveen.baratam&lt;/a&gt;] ᐧ&lt;br/&gt;______________________________ _________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists. linuxfoundation.org [Lightning-dev at lists.linuxfoundation.org]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;. org/mailman/listinfo/ lightning-dev [&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;_______________________________________________ Lightning-dev mailing list Lightning-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180102/f5facf90/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180102/f5facf90/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:48:20Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsdp2gdwzqklhwtksq77f3h3snaep390yk5r3k42r5dtueyxxqnphgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97007yx9</id>
    
      <title type="html">📅 Original date posted:2017-12-12 📝 Original message: Just ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsdp2gdwzqklhwtksq77f3h3snaep390yk5r3k42r5dtueyxxqnphgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97007yx9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsylu67zsfkk7zhc93qskrm0ccg426zdxsz0dnj05lavu6qhsv0tnc3zfq7r&#39;&gt;nevent1q…fq7r&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2017-12-12&lt;br/&gt;📝 Original message:&lt;br/&gt;Just a few quick comments, as any improvements to BOLT#11 are very much appreciated :)&lt;br/&gt;&lt;br/&gt;* I think we should set a reasonable max length for invoices, that MUST be met. This would simplify internal database logic (since you don’t have to plan for invoices infinitely big), and could make sure the error detection is fair for all supported lengths. Not sure if 1023 is enough, considering possibly multiple `r` tags and a juicy description. * Agree with UTF-8 support, and up to 640 bytes length ( this can be made explicit in the Bolt, as now it is limited by the 5 bit length field) :) * Why must the description hash URL be part of the invoice? I always imagined this would be used between clients that already had agreed on payment for some kind of data, and that this hash would just ensure you were paying the correct one.&lt;br/&gt;- Johan (please explain the Japanese lightning meme plz)&lt;br/&gt;On Tue, Dec 12, 2017 at 6:15, Jonathan Underwood &amp;lt;junderwood at bitcoinbank.co.jp&amp;gt; wrote:&lt;br/&gt;I made a payment request using UTF-8 description here: lntb1pdz7e9epp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0e5l2jffz6amujxz82mtagde82dv8jku2jac79k0yxnjmr0l3f4y5x0jxt46vmcrc0ukzh7l99vdmkezsettfwr4gqnhs2ndx8wdqgfsp82rnvp&lt;br/&gt;&lt;br/&gt;using this code: (I just separated encode from sign)&lt;br/&gt;ln.sign(ln.encode({ tags:[ { tagName:&amp;#39;payment_hash&amp;#39;, data:&amp;#39;0001020304050607080900010203040506070809000102030405060708090102&amp;#39; }, { tagName:&amp;#39;description&amp;#39;, data:&amp;#39;ナンセンス 1杯&amp;#39; } ] }, false), Buffer.from(&amp;#39;e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734&amp;#39;, &amp;#39;hex&amp;#39;)).paymentRequest&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Full results:&lt;br/&gt;{ &amp;#34;coinType&amp;#34;: &amp;#34;testnet&amp;#34;, &amp;#34;payeeNodeKey&amp;#34;: &amp;#34;03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad&amp;#34;, &amp;#34;paymentRequest&amp;#34;: &amp;#34;lntb1pdz7e9epp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0e5l2jffz6amujxz82mtagde82dv8jku2jac79k0yxnjmr0l3f4y5x0jxt46vmcrc0ukzh7l99vdmkezsettfwr4gqnhs2ndx8wdqgfsp82rnvp&amp;#34;, &amp;#34;recoveryFlag&amp;#34;: 1, &amp;#34;satoshis&amp;#34;: null, &amp;#34;signature&amp;#34;: &amp;#34;cd3ea92522d777c9184756d7d437275358795b8a9771e2d9e434e5b1bff14d49433e465d74cde0787f2c2bfbe52b1bbb6450cad6970ea804ef054da63b9a0426&amp;#34;, &amp;#34;tags&amp;#34;: [ { &amp;#34;tagName&amp;#34;: &amp;#34;payment_hash&amp;#34;, &amp;#34;data&amp;#34;: &amp;#34;0001020304050607080900010203040506070809000102030405060708090102&amp;#34; }, { &amp;#34;tagName&amp;#34;: &amp;#34;description&amp;#34;, &amp;#34;data&amp;#34;: &amp;#34;ナンセンス 1杯&amp;#34; } ], &amp;#34;timestamp&amp;#34;: 1513055417, &amp;#34;timestampString&amp;#34;: &amp;#34;2017-12-12T05:10:17.000Z&amp;#34; }&lt;br/&gt;&lt;br/&gt;_______________________________________________ Lightning-dev mailing list Lightning-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20171212/35cb4bc6/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20171212/35cb4bc6/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:47:58Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsdyppke0rnswlyfhjvnjpr58wwwlucu529dn6skv6979n88kmzxcszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ahsv6t</id>
    
      <title type="html">📅 Original date posted:2017-12-07 📝 Original message: Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsdyppke0rnswlyfhjvnjpr58wwwlucu529dn6skv6979n88kmzxcszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97ahsv6t" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqspdqyhhafvnsjm2e4d24hxm34m2jgj7fewndgmfr5wxtrpehp2tqcgkga7a&#39;&gt;nevent1q…ga7a&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2017-12-07&lt;br/&gt;📝 Original message:&lt;br/&gt;Hi, Edward! Welcome to the mailing list :)&lt;br/&gt;The fees can indeed be set for each direction of the channel, check out &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#the-channel_update-message&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#the-channel_update-message&lt;/a&gt; [&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#the-channel_update-message&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#the-channel_update-message&lt;/a&gt;]&lt;br/&gt;Basically each node in the channel can announce the fee til will take to route a payment in the direction leading “away” from it. We also have something called “channel reserves” ensuring that each node always has some balance at stake in case an old state is broadcast.&lt;br/&gt;Cheers! Johan&lt;br/&gt;&lt;br/&gt;On Wed, Dec 6, 2017 at 12:04, Edziu Marynarz &amp;lt;edziumarynarz at gmail.com&amp;gt; wrote:&lt;br/&gt;I tried to find this information in the BOLT documents but I couldn&amp;#39;t find it. Is it possible to set up the channel so that the fee depends on the direction, i.e. a different fee on the receive direction and different on the send one? Why such functionality?&lt;br/&gt;Imagine that you start with a bidirectional channel to Alice and a channel to Bob with 1000 satoshi each. For some reasons, the network routes most of the transactions from Alice to you and then to Bob and you end up with 1900 satoshi in the Alice channel and only 100 satoshi in the Bob one. The route will stop working and if there is little traffic in the other direction you will have to close the channels to rebalance them or wait a very long time for the rebalancing.&lt;br/&gt;If the fee could depend on the direction, one could start to ramp up fees on the receiving end of the channel that is getting large and lower the one that is empty to prevent the imbalance.&lt;br/&gt;There is also a risk factor involved. The lightning network channels get riskier on the receive side the more the channel value deviates from the original state since the counterparty may try to broadcast the old state so you may want to regulate this imbalance with fees. It would be best if the LN applications could do it automatically.&lt;br/&gt;Regards,&lt;br/&gt;Edward&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/20171207/df6d2847/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20171207/df6d2847/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:47:54Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsqz59n5rqfxh5yxhwc0cyazxcaz5j7xr4t2rpykthf8kgsvkdwlqqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97s0a7us</id>
    
      <title type="html">📅 Original date posted:2017-11-03 📝 Original message: I ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsqz59n5rqfxh5yxhwc0cyazxcaz5j7xr4t2rpykthf8kgsvkdwlqqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97s0a7us" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsd0rj0jjw8sm04xpsdjetdvjlg30qxpg6athqqhvr3j2vz5vgttgc80fa8w&#39;&gt;nevent1q…fa8w&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2017-11-03&lt;br/&gt;📝 Original message:&lt;br/&gt;I think this might have been discussed somewhere, sometime before: couldn’t we add an lightning parameter to the bitcoin: url, making the QR codes backwards compatible?&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Fri, Nov 3, 2017 at 2:20, Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;Hi Cezary,&lt;br/&gt;&lt;br/&gt;This is indeed the right place for such questions at the moment.&lt;br/&gt;&lt;br/&gt;Cezary Dziemian &amp;lt;cezary.dziemian at gmail.com&amp;gt; writes:&lt;br/&gt;&amp;gt; 1. After LN starts, some group of users will use it, other not. If for&lt;br/&gt;&amp;gt; example, I would like to receive payment for coffee from some user, I don&amp;#39;t&lt;br/&gt;&amp;gt; know if user uses LN or not. So, when someone buy something from me, do I&lt;br/&gt;&amp;gt; need to ask him what kind of payment he would like to use (LN or on-chain)?&lt;br/&gt;&amp;gt; The best would be, if I show him some qr code contains both public address&lt;br/&gt;&amp;gt; and LN invoice and his wallet could choose how to pay. But this cannot be&lt;br/&gt;&amp;gt; done this way, right?&lt;br/&gt;&lt;br/&gt;Yes, the transition is kind of painful. You can use a BOLT 11 QR code,&lt;br/&gt;which can contain a fallback address, but that still requires their app&lt;br/&gt;understand BOLT11 enough to extract it.&lt;br/&gt;&lt;br/&gt;If they understand the BIP70 payment protocol, it could include an&lt;br/&gt;alternate payment mechanism, but it seems nobody actually uses this.&lt;br/&gt;&lt;br/&gt;&amp;gt; 2. Lets imagine, that someone send me invoice. I send payment and someone&lt;br/&gt;&amp;gt; in the middle doesn&amp;#39;t cooperate fast. My payment is waiting and until time&lt;br/&gt;&amp;gt; lock period lapse I don&amp;#39;t know if my payment will be processed or not. What&lt;br/&gt;&amp;gt; to do then?&lt;br/&gt;&lt;br/&gt;This is the worst case, yes. It&amp;#39;s actually two cases: one where the&lt;br/&gt;payment has failed, and one where it has succeeded and you don&amp;#39;t know&lt;br/&gt;yet.&lt;br/&gt;&lt;br/&gt;If it&amp;#39;s succeeded you&amp;#39;ll get your goods (the recipient sees nothing&lt;br/&gt;wrong), so you don&amp;#39;t care that you have to wait for the money to be&lt;br/&gt;deducted.&lt;br/&gt;&lt;br/&gt;If it hasn&amp;#39;t, it&amp;#39;s almost certainly going to fail, and you can either&lt;br/&gt;wait or try again with a new invoice (your wallet won&amp;#39;t let to pay the&lt;br/&gt;same one twice unless it&amp;#39;s definitely failed). For 1.1 you&amp;#39;d be able to&lt;br/&gt;reuse the same invoice safely, as long as the merchant was honest if it&lt;br/&gt;received two payments and rejects the second.&lt;br/&gt;&lt;br/&gt;&amp;gt; 3. Am I right that this decremental time lock is strongly related with&lt;br/&gt;&amp;gt; block confirmation time? If there would be currency that have very fast&lt;br/&gt;&amp;gt; confirmation time (like 5 seconds) then time lock period could be short&lt;br/&gt;&amp;gt; what can potentially solve problem described in paragraph 2?&lt;br/&gt;&lt;br/&gt;Somewhat, but not that low, because you still need a margin to turn&lt;br/&gt;around payments. In practice, if payments are so unreliable that you&lt;br/&gt;have to worry about this case, then something&amp;#39;s horribly wrong!&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Rusty.&lt;br/&gt;_______________________________________________&lt;br/&gt;Lightning-dev mailing list&lt;br/&gt;Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20171103/381678d3/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20171103/381678d3/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:47:36Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsx4uqmsnqlkd65c6vwne2rmnpsjtu568l7t2l9929xwcnpxhupcuqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97m6fu9m</id>
    
      <title type="html">📅 Original date posted:2017-09-04 📝 Original message: I ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsx4uqmsnqlkd65c6vwne2rmnpsjtu568l7t2l9929xwcnpxhupcuqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97m6fu9m" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs946hwnhwpthul3fcf2z3j3htrqw3ctd8eaazjgrmy9xj085sjeqs258lje&#39;&gt;nevent1q…8lje&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2017-09-04&lt;br/&gt;📝 Original message:&lt;br/&gt;I haven’t looked too closely at your proposal, but the first thing that hit me (2 weeks ago, sorry for not answering right away), is that instead of the basic flood-the-network-about-channels algorithm that currently is being used, this makes each route discovery request behave more or less like flooding (ask everybody within your local topology)?&lt;br/&gt;Also it will be interesting to see when the network starts developing, I suspect that if you keep every node within 3 hops in your local topology, you end up storing most of the network anyway. So I think the routing algorithms will be far easier to optimize and analyze after some real world data :)&lt;br/&gt;That being said, interesting idea, I’m not dismissing it :D&lt;br/&gt;&lt;br/&gt;On Tue, Aug 22, 2017 at 3:08, Billy Tetrud &amp;lt;billy.tetrud at gmail.com&amp;gt; wrote:&lt;br/&gt;Hey Guys,&lt;br/&gt;I&amp;#39;m testing this mailing list out for the first time, so I&amp;#39;m probably gonna be doing it wrong.&lt;br/&gt;I want to talk about route discovery and route generation in the lightning network. It seems there&amp;#39;s a couple types of things going on with routing: * Super basic flood-the-network style routing to get things up and running, as I believe is implicitly proposed here: &lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&lt;/a&gt; [&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&lt;/a&gt;]&lt;br/&gt;   &lt;br/&gt; * More involved research projects that may not reach fruition any time soon. Eg this: &lt;a href=&#34;http://bitfury.com/content/5-white-papers-research/whitepaper_flare_an_approach_to_routing_in_lightning_network_7_7_2016.pdf&#34;&gt;http://bitfury.com/content/5-white-papers-research/whitepaper_flare_an_approach_to_routing_in_lightning_network_7_7_2016.pdf&lt;/a&gt; [&lt;a href=&#34;http://bitfury.com/content/5-white-papers-research/whitepaper_flare_an_approach_to_routing_in_lightning_network_7_7_2016.pdf&#34;&gt;http://bitfury.com/content/5-white-papers-research/whitepaper_flare_an_approach_to_routing_in_lightning_network_7_7_2016.pdf&lt;/a&gt;]&lt;br/&gt;   &lt;br/&gt;&lt;br/&gt;I&amp;#39;d like to discuss a near-term approach that can replace the basic flood-the-network style route discovery, but isn&amp;#39;t so complicated that it needs a ton of study and work. This won&amp;#39;t be the end-all solution to route discovery, but should take us a lot further than flood-the-network.&lt;br/&gt;I propose a protocol where each node knows about its own local network topology, and to find a final route, a transaction originator queries a number of its connections for routes to the intended destination. By doing this, it means that nodes are *not* receiving or storing the entire network topology, which makes route discovery a lot less taxing on the network (in terms of bandwidth and storage space).&lt;br/&gt;To go into more detail...&lt;br/&gt;When a node joins the network: 1. it broadcasts its information to all its channels (pretty much as proposed here [&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&lt;/a&gt;] ) announcing its relevant channel information 2. it requests local network topology information from all its channels for information about channels 1 hop beyond its direct connection (ie it will receive information about which addresses those channels are connected to, and their related fee info / etc) 3. it then requests topology information for channels 2 hops beyond, etc until it has filled its cache to its satisfaction (the user can choose some amount of megabytes as its limit of network topology data to store) 4. it also subscribes to topology changes for nodes at those distances (eg if a node has requested information from 3 hops away, it will receive info about any new channels or removed channels that fall within that distance)&lt;br/&gt;When a node receives an announcement message from a node joining the network: 1. it will store that node&amp;#39;s info in its cache 2. it will also forward that info to any node that&amp;#39;s subscribed to topology changes that fall within the relevant distance&lt;br/&gt;When a node wants to construct a route for a transaction: 1. It checks to see if it has a path to that node in its cache. If it does, it finds the cost of the cheapest path it has. 2. It asks all the channels on the edge of its cached local view for their cheapest path (however you want to define cheapest), specifying that it only care about paths with a maximum cost of the cheapest path it has already found in its cache. For example, if the node has nodes up to 3 hops away in its cache, it will *only* ask the nodes 3 hops away (it will not ask its direct connections, nor nodes 2 hops away, since it already has enough information to ignore them) 3. When it gets all its responses, it constructs a path&lt;br/&gt;When a node receives a path request from a node: 1. It checks its cache for its cheapest cache-only path 2. It asks nodes on the edge of its cached local view for their cheapest path, specifying that it only cares about paths with a maximum cost of either its cheapest cache-only path or the max-cost specified by the requesting node minus the channel cost between it and the requesting node (whichever is cheaper). A node on the edge of its cached local view is *not* asked for route information if the cost to that node exceeds the max-cost this relay node would specify. 3. It reports the results that satisfy the max-cost requirements of the requesting node&lt;br/&gt;And that&amp;#39;s it. All the route information can be encrypted and signed so relaying nodes can&amp;#39;t read the information inside, and so the requesting source node can verify which nodes sent that information.&lt;br/&gt;This protocol should keep both node-announcement messages *and* route request messages highly localized.&lt;br/&gt;Thoughts?&lt;br/&gt;~BT&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/20170904/66bc1247/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20170904/66bc1247/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:47:31Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsf7u7cz33v2e562de6z4a728xtmnrgdpvheju5a8qzgfmjszzexzszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97r89uyv</id>
    
      <title type="html">📅 Original date posted:2023-06-02 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsf7u7cz33v2e562de6z4a728xtmnrgdpvheju5a8qzgfmjszzexzszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97r89uyv" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqswj478pxp0l386w2envev3r6ccc48nuj67tvm6z763dwrn730cwkqghdwg2&#39;&gt;nevent1q…dwg2&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-06-02&lt;br/&gt;🗒️ Summary of this message: COCV can be used as an alternative to CTV, simplifying the process of embedding data in the next output and deciding its script.&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;It was briefly mentioned in the original post, but wanted to show how&lt;br/&gt;simple it is to use COCV as an alternative to CTV, removing that&lt;br/&gt;dependency.&lt;br/&gt;&lt;br/&gt;&amp;gt; In particular, it also inherits the choice of using OP_CTV as a primitive,&lt;br/&gt;&amp;gt; building on top of the bitcoin-inquisition&amp;#39;s current branch that has already&lt;br/&gt;&amp;gt; merged OP_CTV. Reasonable vaults would be possible without CTV, but they&lt;br/&gt;&amp;gt; would be less efficient, particularly in the case of sending to many addresses&lt;br/&gt;&amp;gt; in a single unvaulting flow.&lt;br/&gt;&lt;br/&gt;Instead of specifying a CTV hash as embedded data, one could embed the&lt;br/&gt;(commitment to the) outputs of the withdrawal transaction. Then&lt;br/&gt;instead of a single OP_CTV, one OP_COCV per output to match against&lt;br/&gt;the embedded data. Less efficient in case of many outputs as you&lt;br/&gt;mention, but simple enough to be interesting.&lt;br/&gt;&lt;br/&gt;Here&amp;#39;s an example how to use MATT as a CTV replacement:&lt;br/&gt;&lt;a href=&#34;https://github.com/halseth/tapsim/blob/b07f29804cf32dce0168ab5bb40558cbb18f2e76/examples/matt/ctv2/README.md&#34;&gt;https://github.com/halseth/tapsim/blob/b07f29804cf32dce0168ab5bb40558cbb18f2e76/examples/matt/ctv2/README.md&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, May 2, 2023 at 10:22 AM Salvatore Ingala via bitcoin-dev&lt;br/&gt;&amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Michael,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I can&amp;#39;t make any claim of expertise on the field (especially on the&lt;br/&gt;&amp;gt; other proposals that you mentioned), so this post necessarily includes&lt;br/&gt;&amp;gt; my opinions − and possibly my biases.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The core functionality of MATT is quite simple, and could be adapted&lt;br/&gt;&amp;gt; to any version of the scripting system: basically, COCV allows to&lt;br/&gt;&amp;gt; &amp;#34;embed&amp;#34; some data in the next output, and decide its script; CICV&lt;br/&gt;&amp;gt; allows &amp;#34;reading&amp;#34; this data.&lt;br/&gt;&amp;gt; The design I proposed on taproot is surely not the only possible way,&lt;br/&gt;&amp;gt; but it&amp;#39;s the most simple/elegant I could come up with. Moreover, it&lt;br/&gt;&amp;gt; doesn&amp;#39;t seem very useful to spend time trying to get it to work on&lt;br/&gt;&amp;gt; pre-taproot Script, due to the obvious advantages of those ideas when&lt;br/&gt;&amp;gt; deployed on taproot (like having taptrees, and all the nice properties&lt;br/&gt;&amp;gt; of Schnorr signatures).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; CICV/COCV can certainly be considered an additional form of&lt;br/&gt;&amp;gt; introspection: you&amp;#39;re checking that the script of an input/output&lt;br/&gt;&amp;gt; equals a certain value, which is not possible in today&amp;#39;s Script.&lt;br/&gt;&amp;gt; I think that&amp;#39;s generally true for all covenant proposals.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Unlike some other proposals, MATT is not yet fully formalized, so I&lt;br/&gt;&amp;gt; generally call &amp;#34;MATT&amp;#34; the combination of CICV&#43;COCV, plus some other&lt;br/&gt;&amp;gt; small set of opcodes that is yet to be defined exactly. I would say it&lt;br/&gt;&amp;gt; fits in the same family as APO/OP_CTV/OP_VAULT, per your bucketization.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The previous posts about MATT, fraud proofs, etc. are an exploration of&lt;br/&gt;&amp;gt; the deeper things that are enabled by the MATT opcodes. The claim is&lt;br/&gt;&amp;gt; that a set of changes that is (arguably) quite small and easy to analyze&lt;br/&gt;&amp;gt; is enough to express general smart contracts − thanks to fraud proofs.&lt;br/&gt;&amp;gt; However, fraud proofs themselves are a quite advanced application of&lt;br/&gt;&amp;gt; the new opcodes, and are not needed for most/all of the things that&lt;br/&gt;&amp;gt; people are trying to build today with the other covenant proposals.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Since you mention Simplicity: my current understanding is that its&lt;br/&gt;&amp;gt; endeavour of replacing Script with a better language is orthogonal to&lt;br/&gt;&amp;gt; the discussion about what features (e.g.: introspection, covenants)&lt;br/&gt;&amp;gt; should be in the language.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; All the covenant proposals listed above are technically a lot smaller&lt;br/&gt;&amp;gt; and easier to audit than both the SegWit and the Taproot soft forks,&lt;br/&gt;&amp;gt; both in terms of code and conceptual complexity.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Therefore, if we _do_ want the features that they enable, the required&lt;br/&gt;&amp;gt; engineering for a soft-fork is relatively straightforward, and there is&lt;br/&gt;&amp;gt; not much of a reason to wait for Simplicity. It will be trivial to &amp;#34;port&amp;#34; any&lt;br/&gt;&amp;gt; constructions we might create today with covenants to Simplicity scripts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we _do not_ want those features, then the decision would rather be&lt;br/&gt;&amp;gt; guided by other considerations, like potential risks to bitcoin caused&lt;br/&gt;&amp;gt; by the effect of those features on miners&amp;#39; incentives. These&lt;br/&gt;&amp;gt; concerns are not answered by Simplicity, as far as I understand:&lt;br/&gt;&amp;gt; you would then want to implement Simplicity _without_ those features.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&amp;gt; Salvatore&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mon, 1 May 2023 at 16:18, Michael Folkson &amp;lt;michaelfolkson at protonmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Salvatore&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Can you clarify for me which bucket this proposal sits? We have APO, CTV, OP_VAULT etc that are proposals to add additional functionality to SegWit version 1, Tapleaf version 0 scripts. We have Simplicity that would need a new Tapleaf version (e.g. Tapleaf version 1). And then there are CISA like proposals that would need a new SegWit version (e.g. SegWit version 2). It looks to me like your proposal is in the first bucket (same as APO, CTV etc) as it is just introducing new opcode functionality to existing script with no deeper introspection needed but previous and current discussion of fraud proofs, MATT frameworks etc made me initially think it was going to require more than that.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks&lt;br/&gt;&amp;gt;&amp;gt; Michael&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; --&lt;br/&gt;&amp;gt;&amp;gt; Michael Folkson&lt;br/&gt;&amp;gt;&amp;gt; Email: michaelfolkson at protonmail.com&lt;br/&gt;&amp;gt;&amp;gt; GPG: A2CF5D71603C92010659818D2A75D601B23FEE0F&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Learn about Bitcoin: &lt;a href=&#34;https://www.youtube.com/@portofbitcoin&#34;&gt;https://www.youtube.com/@portofbitcoin&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ------- Original Message -------&lt;br/&gt;&amp;gt;&amp;gt; On Monday, April 24th, 2023 at 20:37, Salvatore Ingala via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hello list,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; TL;DR: the core opcodes of MATT can build vaults with a very similar design&lt;br/&gt;&amp;gt;&amp;gt; to OP_VAULT. Code example here:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin-inquisition/bitcoin/compare/24.0...bigspider:bitcoin-inquisition:matt-vault&#34;&gt;https://github.com/bitcoin-inquisition/bitcoin/compare/24.0...bigspider:bitcoin-inquisition:matt-vault&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In my previous emails about the MATT proposal for smart contracts in&lt;br/&gt;&amp;gt;&amp;gt; bitcoin [1], I mostly focused on proving its generality; that is, it&lt;br/&gt;&amp;gt;&amp;gt; allows arbitrary smart contracts thanks to fraud proofs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; While I still find this &amp;#34;completeness&amp;#34; result compelling, I spent more time&lt;br/&gt;&amp;gt;&amp;gt; thinking about the framework itself; the construction is not very interesting&lt;br/&gt;&amp;gt;&amp;gt; if it turns simple things into complicated ones. Luckily, this is not the case.&lt;br/&gt;&amp;gt;&amp;gt; In particular, in this email we will not merkleize anything (other than taptrees).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This post describes some progress into formalizing the semantics of the core&lt;br/&gt;&amp;gt;&amp;gt; opcodes, and demonstrates how they could be used to create vaults that seem&lt;br/&gt;&amp;gt;&amp;gt; comparable to the ones built with OP_VAULT [2], despite using general purpose&lt;br/&gt;&amp;gt;&amp;gt; opcodes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; An implementation and some minimal tests matching the content of this&lt;br/&gt;&amp;gt;&amp;gt; e-mail can be found in the link above, using the bitcoin-inquisition as the&lt;br/&gt;&amp;gt;&amp;gt; base branch.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Note that the linked code is not well tested and is only intended for&lt;br/&gt;&amp;gt;&amp;gt; exploratory and demonstrative purposes; therefore, bugs are likely at this&lt;br/&gt;&amp;gt;&amp;gt; stage.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##########################&lt;br/&gt;&amp;gt;&amp;gt; # PART 1: MATT&amp;#39;s core&lt;br/&gt;&amp;gt;&amp;gt; ##########################&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In this section, I will discuss plausible semantics for the core opcodes for MATT.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The two core opcodes are defined below as OP_CHECKINPUTCONTRACTVERIFY and&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKOUTPUTCONTRACTVERIFY.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (the initial posts named them OP_CHECK{INPUT,OUTPUT}COVENANTVERIFY)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; They enhance Script with the following capabilities:&lt;br/&gt;&amp;gt;&amp;gt; - decide the taptree of the output&lt;br/&gt;&amp;gt;&amp;gt; - embed some (dynamically computed) data in the output&lt;br/&gt;&amp;gt;&amp;gt; - access the embedded data in the current UTXO (if any)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The opcodes below are incomplete, as they only control the output&amp;#39;s Script and&lt;br/&gt;&amp;gt;&amp;gt; not the amounts; more on that below.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Other than that, the semantics should be quite close to the &amp;#34;right&amp;#34; one for&lt;br/&gt;&amp;gt;&amp;gt; the MATT framework.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### The opcodes&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; case OP_CHECKINPUTCONTRACTVERIFY:&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; // OP_CHECKINPUTCONTRACTVERIFY is only available in Tapscript&lt;br/&gt;&amp;gt;&amp;gt; if (sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) return set_error(serror, SCRIPT_ERR_BAD_OPCODE);&lt;br/&gt;&amp;gt;&amp;gt; // (x d -- )&lt;br/&gt;&amp;gt;&amp;gt; if (stack.size() &amp;lt; 2)&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);&lt;br/&gt;&amp;gt;&amp;gt; valtype&amp;amp; x = stacktop(-2);&lt;br/&gt;&amp;gt;&amp;gt; valtype&amp;amp; d = stacktop(-1);&lt;br/&gt;&amp;gt;&amp;gt; if (x.size() != 32 || d.size() != 32)&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);&lt;br/&gt;&amp;gt;&amp;gt; const XOnlyPubKey nakedXOnlyKey{Span&amp;lt;const unsigned char&amp;gt;{x.data(), x.data() &#43; 32}};&lt;br/&gt;&amp;gt;&amp;gt; const uint256 data(d);&lt;br/&gt;&amp;gt;&amp;gt; if (!execdata.m_internal_key.has_value())&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); // TODO&lt;br/&gt;&amp;gt;&amp;gt; // Verify that tweak(lift_x(x), d) equals the internal pubkey&lt;br/&gt;&amp;gt;&amp;gt; if (!execdata.m_internal_key.value().CheckDoubleTweak(nakedXOnlyKey, &amp;amp;data, nullptr))&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_WRONGCONTRACTDATA);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt; break;&lt;br/&gt;&amp;gt;&amp;gt; case OP_CHECKOUTPUTCONTRACTVERIFY:&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; // OP_CHECKOUTPUTCONTRACTVERIFY is only available in Tapscript&lt;br/&gt;&amp;gt;&amp;gt; if (sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) return set_error(serror, SCRIPT_ERR_BAD_OPCODE);&lt;br/&gt;&amp;gt;&amp;gt; // (out_i x taptree d -- )&lt;br/&gt;&amp;gt;&amp;gt; if (stack.size() &amp;lt; 4)&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);&lt;br/&gt;&amp;gt;&amp;gt; int out_i = CScriptNum(stacktop(-4), fRequireMinimal).getint();&lt;br/&gt;&amp;gt;&amp;gt; valtype&amp;amp; x = stacktop(-3);&lt;br/&gt;&amp;gt;&amp;gt; valtype&amp;amp; taptree = stacktop(-2);&lt;br/&gt;&amp;gt;&amp;gt; valtype&amp;amp; d = stacktop(-1);&lt;br/&gt;&amp;gt;&amp;gt; auto outps = checker.GetTxvOut();&lt;br/&gt;&amp;gt;&amp;gt; // Return error if the evaluation context is unavailable&lt;br/&gt;&amp;gt;&amp;gt; if (!outps)&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); // TODO&lt;br/&gt;&amp;gt;&amp;gt; if (x.size() != 32 || taptree.size() != 32 || (d.size() != 0 &amp;amp;&amp;amp; d.size() != 32))&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);&lt;br/&gt;&amp;gt;&amp;gt; if (out_i &amp;lt; 0 || out_i &amp;gt;= (int)outps-&amp;gt;size())&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);&lt;br/&gt;&amp;gt;&amp;gt; const XOnlyPubKey nakedXOnlyKey{Span&amp;lt;const unsigned char&amp;gt;{x.data(), x.data() &#43; 32}};&lt;br/&gt;&amp;gt;&amp;gt; const uint256 data(d);&lt;br/&gt;&amp;gt;&amp;gt; const uint256 *data_ptr = (d.size() == 0 ? nullptr : &amp;amp;data);&lt;br/&gt;&amp;gt;&amp;gt; const uint256 merkle_tree(taptree);&lt;br/&gt;&amp;gt;&amp;gt; CScript scriptPubKey = outps-&amp;gt;at(out_i).scriptPubKey;&lt;br/&gt;&amp;gt;&amp;gt; if (scriptPubKey.size() != 1 &#43; 1 &#43; 32 || scriptPubKey[0] != OP_1 || scriptPubKey[1] != 32)&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_WRONGCONTRACTDATA);&lt;br/&gt;&amp;gt;&amp;gt; const XOnlyPubKey outputXOnlyKey{Span&amp;lt;const unsigned char&amp;gt;{scriptPubKey.data() &#43; 2, scriptPubKey.data() &#43; 34}};&lt;br/&gt;&amp;gt;&amp;gt; // Verify that taptweak(tweak(lift_x(x), d), taptree) equals the internal pubkey&lt;br/&gt;&amp;gt;&amp;gt; if (!outputXOnlyKey.CheckDoubleTweak(nakedXOnlyKey, data_ptr, &amp;amp;merkle_tree))&lt;br/&gt;&amp;gt;&amp;gt; return set_error(serror, SCRIPT_ERR_WRONGCONTRACTDATA);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; popstack(stack);&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt; break;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Commentary&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; CheckDoubleTweak function (implemented in the branch) gets an x-only pubkey,&lt;br/&gt;&amp;gt;&amp;gt; optionally some data, and optionally taptree&amp;#39;s merkle root.&lt;br/&gt;&amp;gt;&amp;gt; It verifies that the x-only pubkey being tested equals the given naked pubkey,&lt;br/&gt;&amp;gt;&amp;gt; optionally tweaked with the embedded data, optionally tweaked with the tagged&lt;br/&gt;&amp;gt;&amp;gt; hash of the merkle tree per BIP-0341 [3].&lt;br/&gt;&amp;gt;&amp;gt; Making both the tweaks optional allows to simplify the code, and also to obtain&lt;br/&gt;&amp;gt;&amp;gt; more compact scripts in some spending paths.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In words:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - OP_CHECKINPUTCONTRACTVERIFY: verify that the current input&amp;#39;s internal key&lt;br/&gt;&amp;gt;&amp;gt; contains some embedded data (which would typically be passed through the&lt;br/&gt;&amp;gt;&amp;gt; witness stack)&lt;br/&gt;&amp;gt;&amp;gt; - OP_CHECKOUTPUTCONTRACTVERIFY: verify that a given output is a certain P2TR&lt;br/&gt;&amp;gt;&amp;gt; output script containing the desired embedded data.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; TBD if the tweaking used for the embedded data tweak should use a tagged hash;&lt;br/&gt;&amp;gt;&amp;gt; omitted for simplicity in this demo implementation.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Amount preservation&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the code above and in the linked demo implementation, the opcodes only&lt;br/&gt;&amp;gt;&amp;gt; operate on the scriptPubkey; a complete implementation would want to make sure&lt;br/&gt;&amp;gt;&amp;gt; that amounts are correctly preserved.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The most direct and general way to address this would be to allow direct&lt;br/&gt;&amp;gt;&amp;gt; introspection on the output amounts. This has the complication that output&lt;br/&gt;&amp;gt;&amp;gt; amounts require 64-bits arithmetics, as discussed in the context of other&lt;br/&gt;&amp;gt;&amp;gt; proposals, for example: [4].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; One more limited approach that works well for many interesting contracts&lt;br/&gt;&amp;gt;&amp;gt; is that of the deferred checks, implemented in OP_VAULT [2].&lt;br/&gt;&amp;gt;&amp;gt; The idea is that all the amounts of the inputs that commit to the same output&lt;br/&gt;&amp;gt;&amp;gt; script with OP_CHECKOUTPUTCONTRACTVERIFY are added together, and the script&lt;br/&gt;&amp;gt;&amp;gt; interpreter requires that the amount of that output is not smaller than the&lt;br/&gt;&amp;gt;&amp;gt; total amount of those inputs. This check is therefore transaction-wide rather&lt;br/&gt;&amp;gt;&amp;gt; than being tested during the input&amp;#39;s script evaluation.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This behaviour is adequate for vaults and likely suitable for many other&lt;br/&gt;&amp;gt;&amp;gt; applications; however, it&amp;#39;s not the most general approach. I didn&amp;#39;t try to&lt;br/&gt;&amp;gt;&amp;gt; implement it yet, and defer the decision on the best approach to a later time.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Extensions&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The opcodes above are not enough for the full generality of MATT: one would&lt;br/&gt;&amp;gt;&amp;gt; need to add an opcode like OP_SHA256CAT to allow the data embedding to commit&lt;br/&gt;&amp;gt;&amp;gt; to multiple pieces of data.&lt;br/&gt;&amp;gt;&amp;gt; This is not used in today&amp;#39;s post, therefore I left it out of these code examples.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; It would be easy to extend OP_CHECKOUTPUTCONTRACTVERIFY to also apply for&lt;br/&gt;&amp;gt;&amp;gt; an arbitrary input (typically, different from the currently executed one); there&lt;br/&gt;&amp;gt;&amp;gt; are likely use cases for that, allowing to define contracts with more complex&lt;br/&gt;&amp;gt;&amp;gt; cross-input semantics, but I preferred to keep things simple.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Of course, one could also entirely replace CICV/COCV with generic full&lt;br/&gt;&amp;gt;&amp;gt; introspection on inputs/output&amp;#39;s program, plus opcodes for elliptic curve math&lt;br/&gt;&amp;gt;&amp;gt; and tagged hashes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##########################&lt;br/&gt;&amp;gt;&amp;gt; # PART 2: Vaults with MATT&lt;br/&gt;&amp;gt;&amp;gt; ##########################&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the rest of this post, I will document the first attempt at creating a vault&lt;br/&gt;&amp;gt;&amp;gt; using the opcodes described.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; While not an attempt at cloning exactly the functionality of OP_VAULT [2],&lt;br/&gt;&amp;gt;&amp;gt; it borrows heavily from the excellent work that was done there.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In particular, it also inherits the choice of using OP_CTV as a primitive,&lt;br/&gt;&amp;gt;&amp;gt; building on top of the bitcoin-inquisition&amp;#39;s current branch that has already&lt;br/&gt;&amp;gt;&amp;gt; merged OP_CTV. Reasonable vaults would be possible without CTV, but they&lt;br/&gt;&amp;gt;&amp;gt; would be less efficient, particularly in the case of sending to many addresses&lt;br/&gt;&amp;gt;&amp;gt; in a single unvaulting flow.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Distilling OP_VAULT&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Abstracting from the implementation details, I mentally model a vault as a&lt;br/&gt;&amp;gt;&amp;gt; simple state machine with 2 states: [V] and [U]:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [V]: the initial vault UTXO(s);&lt;br/&gt;&amp;gt;&amp;gt; [U]: the utxo produced by the &amp;#34;trigger transaction&amp;#34; during unvaulting.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On the typical path: one or more [V] UTXOs are sent to the [U] state, and after&lt;br/&gt;&amp;gt;&amp;gt; a timelock set on [U] expires, [U] is spent to one or several destinations.&lt;br/&gt;&amp;gt;&amp;gt; Crucially, the destination outputs and amounts are already decided when [V] is&lt;br/&gt;&amp;gt;&amp;gt; spent into [U].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; At any time before the funds are spent from [U], they can always be spent by&lt;br/&gt;&amp;gt;&amp;gt; sending them to some specified recovery path.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; There are two key elements that are part of OP_VAULT&amp;#39;s semantics, and could be&lt;br/&gt;&amp;gt;&amp;gt; generalized:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; − Forcing the script/amount of the next stepon&lt;br/&gt;&amp;gt;&amp;gt; − Storing some data for future Script&amp;#39;s access (in the vault&amp;#39;s case, a hash&lt;br/&gt;&amp;gt;&amp;gt; that commits to the final withdrawal transaction).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; CICV/COCV generalize both to arbitrary scripts (taptrees) and state machines,&lt;br/&gt;&amp;gt;&amp;gt; and to dynamical and witness-dependent data embedded in the pubkey of a P2TR&lt;br/&gt;&amp;gt;&amp;gt; output.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Vault parameters&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A contract that represents a vault has the following parameters (hardcoded in&lt;br/&gt;&amp;gt;&amp;gt; the script when the vault is created):&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - alternate_pk: a key that can be used any time.&lt;br/&gt;&amp;gt;&amp;gt; - spend_delay: the relative timelock before the withdrawal can be finalized;&lt;br/&gt;&amp;gt;&amp;gt; - recover_pk: a pubkey for a P2TR output where funds can be sent at any time.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The alternate_pk is a pubkey that can optionally be used as the key-path&lt;br/&gt;&amp;gt;&amp;gt; spending condition for both states [V] and [U]. If such a spending condition is not&lt;br/&gt;&amp;gt;&amp;gt; desired, it can be replaced with a NUMS point, making the key-path unspendable.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The spend_delay is the number of blocks that must be mined before the final&lt;br/&gt;&amp;gt;&amp;gt; withdrawal transaction&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In this example we also use an unvault_pk needed to authorize the unvaulting&lt;br/&gt;&amp;gt;&amp;gt; process (that is, spend [V] into [U]); this could be replaced with any miniscript&lt;br/&gt;&amp;gt;&amp;gt; or other conditions expressible in Script.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### P2TR structure for [V] (vault)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; internal key: alternate_pk&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Script 1: &amp;#34;trigger&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; # witness: &amp;lt;out_i&amp;gt; &amp;lt;ctv-hash&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;alternate_pk&amp;gt;,&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;merkle root of U&amp;#39;s taptree&amp;gt;,&lt;br/&gt;&amp;gt;&amp;gt; 2, OP_ROLL,&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKOUTPUTCONTRACTVERIFY,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;unvault_pk&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKSIG&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Script 2: &amp;#34;recover&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; # witness: &amp;lt;out_i&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; recover_pk,&lt;br/&gt;&amp;gt;&amp;gt; OP_0, # no data tweak&lt;br/&gt;&amp;gt;&amp;gt; OP_0, # no taptweak&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKOUTPUTCONTRACTVERIFY,&lt;br/&gt;&amp;gt;&amp;gt; OP_TRUE&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;trigger&amp;#34; script requires in the witness an output index and the ctv-hash&lt;br/&gt;&amp;gt;&amp;gt; that describes the withdrawal transaction.&lt;br/&gt;&amp;gt;&amp;gt; COCV forces the output to contain the ctv-hash as embedded data.&lt;br/&gt;&amp;gt;&amp;gt; That&amp;#39;s followed by the unvaulting condition − in this example, a simple&lt;br/&gt;&amp;gt;&amp;gt; signature check.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;recover&amp;#34; script doesn&amp;#39;t require any signature, and it simply forces&lt;br/&gt;&amp;gt;&amp;gt; the output specified in the witness to be a P2TR output with recover_pk as its&lt;br/&gt;&amp;gt;&amp;gt; pubkey.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (Omitting the &amp;#34;recover&amp;#34; script in [V] would reduce the size of the witness by&lt;br/&gt;&amp;gt;&amp;gt; 32 bytes in the expected case, and might be preferred for some users)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### P2TR structure for [U] (unvaulting state)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; internal key: alternate_pk (tweaked with ctv_hash)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Script 1: &amp;#34;withdrawal&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; # witness: &amp;lt;ctv_hash&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; OP_DUP,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # check that the top of the stack is the&lt;br/&gt;&amp;gt;&amp;gt; # embedded data in the current input&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;alternate_pk&amp;gt;, OP_SWAP,&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKINPUTCONTRACTVERIFY,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # Check timelock&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;spend_delay&amp;gt;,&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKSEQUENCEVERIFY,&lt;br/&gt;&amp;gt;&amp;gt; OP_DROP,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; # Check that the transaction output is as expected&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKTEMPLATEVERIFY&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Script 2: &amp;#34;recover&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; # witness: &amp;lt;out_i&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {&lt;br/&gt;&amp;gt;&amp;gt; &amp;lt;recover_pk&amp;gt;,&lt;br/&gt;&amp;gt;&amp;gt; OP_0,&lt;br/&gt;&amp;gt;&amp;gt; OP_0,&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKOUTPUTCONTRACTVERIFY,&lt;br/&gt;&amp;gt;&amp;gt; OP_TRUE&lt;br/&gt;&amp;gt;&amp;gt; }&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;withdrawal&amp;#34; finalizes the transaction, by checking that the timelock expired and&lt;br/&gt;&amp;gt;&amp;gt; the outputs satisfy the CTV hash that was committed to in the previous transaction.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;recover&amp;#34; script is identical as before.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Differences with OP_VAULT vaults&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Here I refer to the latest version of OP_VAULT at the time of writing. [5]&lt;br/&gt;&amp;gt;&amp;gt; It is not a thorough analysis.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Unlike the implementation based on OP_VAULT, the [V] utxos don&amp;#39;t have an option&lt;br/&gt;&amp;gt;&amp;gt; to add an additional output that is sent back to the same exact vault.&lt;br/&gt;&amp;gt;&amp;gt; Supporting this use case seems to require a more general way of handling the&lt;br/&gt;&amp;gt;&amp;gt; distribution of amounts than what I discussed in the section above: that would&lt;br/&gt;&amp;gt;&amp;gt; in fact need to be generalized to the case of multiple&lt;br/&gt;&amp;gt;&amp;gt; OP_CHECKOUTPUTCONTRACTVERIFY opcodes executed for the same input.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; By separating the ctv-hash (which is considered &amp;#34;data&amp;#34;) from the scripts in the&lt;br/&gt;&amp;gt;&amp;gt; taptree, one entirely avoids the need to dynamically create taptrees and&lt;br/&gt;&amp;gt;&amp;gt; replace leaves in the covenant-encumbered UTXOs; in fact, the taptrees of [V]&lt;br/&gt;&amp;gt;&amp;gt; and [U] are already set in stone when [V] utxos are created, and only the&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;data&amp;#34; portion of [U]&amp;#39;s scriptPubKey is dynamically computed. In my opinion,&lt;br/&gt;&amp;gt;&amp;gt; this makes it substantially easier to program &amp;#34;state machines&amp;#34; that control the&lt;br/&gt;&amp;gt;&amp;gt; behavior of coins, of which vaults are a special case.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I hope you&amp;#39;ll find this interesting, and look forward to your comments.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Salvatore Ingala&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1] - &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021223.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-November/021223.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2] - &lt;a href=&#34;https://github.com/bitcoin/bips/pull/1421&#34;&gt;https://github.com/bitcoin/bips/pull/1421&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [3] - &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [4] - &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019420.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019420.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [5] - &lt;a href=&#34;https://github.com/bitcoin/bips/blob/7112f308b356cdf0c51d917dbdc1b98e30621f80/bip-0345.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/7112f308b356cdf0c51d917dbdc1b98e30621f80/bip-0345.mediawiki&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;
    </content>
    <updated>2023-06-07T23:22:06Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsx7h0235rp8p6azasyy3h3hpmt59j2se3k0ewc325ugdgdh0lqejczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r976nvtvr</id>
    
      <title type="html">📅 Original date posted:2023-05-26 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsx7h0235rp8p6azasyy3h3hpmt59j2se3k0ewc325ugdgdh0lqejczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r976nvtvr" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqswp803wyaacepy24arqes7h0hc0ak0f3633e5l8xe3pgkut3pfyhc2kpgyn&#39;&gt;nevent1q…pgyn&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-05-26&lt;br/&gt;🗒️ Summary of this message: OP_CICV and OP_COCV, along with OP_CAT, enable interesting use cases such as CoinPools, allowing easy checking of input data and enforcing new commitments on output. Suggestions for further extension are proposed.&lt;br/&gt;📝 Original message:Hi, Salvatore.&lt;br/&gt;&lt;br/&gt;As a further exploration of this idea, I implemented a&lt;br/&gt;proof-of-concept of OP_CICV and OP_COCV in btcd[1] that together with&lt;br/&gt;OP_CAT enables a set of interesting use cases.&lt;br/&gt;&lt;br/&gt;One such use case is, as mentioned earlier, CoinPools[2]. The opcodes&lt;br/&gt;let you easily check the &amp;#34;dynamically committed data&amp;#34; of an input you&lt;br/&gt;are spending, and enforce a new commitment on the output. The idea is&lt;br/&gt;to have the set of participants in the pool, and their balances, be&lt;br/&gt;the UTXOs committed data, and  use this to validate the legitimacy of&lt;br/&gt;a transaction, determining whether it permits a peer to exit with a&lt;br/&gt;portion of the pooled funds.&lt;br/&gt;&lt;br/&gt;Doing what you suggested above, having the input and output commit to&lt;br/&gt;a merkle tree of participants and balances, we are able to quite&lt;br/&gt;elegantly verify the coin pool exit clause. Here is a working example&lt;br/&gt;of how that could look like: [3]. Obviously this lacks a lot before it&lt;br/&gt;is a working CoinPool implementation, but it demonstrates how&lt;br/&gt;OP_C[I/O]V introduces &amp;#34;memory&amp;#34; to Bitcoin script.&lt;br/&gt;&lt;br/&gt;Having done this exercise, I have a few suggestions on how one could&lt;br/&gt;further extend the proposal:&lt;br/&gt;&lt;br/&gt;1. In the current proposal for OP_CHECKOUTPUTCONTRACTVERIFY, the&lt;br/&gt;opcodes check whether the output key Q is key X tweaked with data D&lt;br/&gt;and taproot T: Q == tweak(tweak(X,D), T).&lt;br/&gt;&lt;br/&gt;OP_CHECKINPUTCONTRACTVERIFY on the other hand, works on the input&lt;br/&gt;internal key, and does not care about the taptree on the input: P ==&lt;br/&gt;tweak(X,D), where Q = tweak(P, T). In most cases this is probably good&lt;br/&gt;enough, since you are already executing the current script and that&lt;br/&gt;way know the spender has provided the correct taproot.&lt;br/&gt;&lt;br/&gt;However, in the coin pool script mentioned above, I found that I&lt;br/&gt;wanted to re-use the same taproot for the output (recursively). I&lt;br/&gt;believe this would be a quite common use case. To solve this I&lt;br/&gt;committed the taproot as part of the data itself: D&amp;#39; = hash(T&#43;D),&lt;br/&gt;which was then verified by OP_CICV. If you are aware of more efficient&lt;br/&gt;alternatives, I am eager to hear them.&lt;br/&gt;&lt;br/&gt;A simpler way IMO, would be to make OP_CICV and OP_COCV symmetrical:&lt;br/&gt;Have OP_CICV take an optional taproot and do the same check as is done&lt;br/&gt;for the output: Q == tweak(tweak(X,D), T).&lt;br/&gt;&lt;br/&gt;2.To make fully functioning CoinPools, one would need functionality&lt;br/&gt;similar to OP_MERKLESUB[4]: remove some data from the merkle tree, and&lt;br/&gt;remove a key from the aggregated internal key.This suggestion may&lt;br/&gt;surpass the intended scope of this proposal, and would likely&lt;br/&gt;necessitate the availability of multiple EC operations to accommodate&lt;br/&gt;various key schemes. If we had opcodes for adding and removing keys&lt;br/&gt;from the internal key this would be even more powerful.&lt;br/&gt;&lt;br/&gt;I look forward to hearing your thoughts on these suggestions and&lt;br/&gt;further exploring the possibilities of the proposal!&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;[1] &lt;a href=&#34;https://github.com/halseth/btcd/pull/1/commits/90a4065bdcd8029fe3325514a250490cba66fddd&#34;&gt;https://github.com/halseth/btcd/pull/1/commits/90a4065bdcd8029fe3325514a250490cba66fddd&lt;/a&gt;&lt;br/&gt;[2] &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017964.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/017964.html&lt;/a&gt;&lt;br/&gt;[3] &lt;a href=&#34;https://github.com/halseth/tapsim/tree/matt-demo/examples/matt/coinpool&#34;&gt;https://github.com/halseth/tapsim/tree/matt-demo/examples/matt/coinpool&lt;/a&gt;&lt;br/&gt;[4] &lt;a href=&#34;https://github.com/ariard/bips/blob/coinpool-bips/bip-merklesub.mediawiki&#34;&gt;https://github.com/ariard/bips/blob/coinpool-bips/bip-merklesub.mediawiki&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Fri, May 5, 2023 at 11:18 PM Salvatore Ingala&lt;br/&gt;&amp;lt;salvatore.ingala at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Thu, 4 May 2023 at 10:34, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; It sounds like we can generalize the description of the construct to:&lt;br/&gt;&amp;gt; &amp;gt; Access to (the hash of) embedded data of inputs and outputs, and the&lt;br/&gt;&amp;gt; &amp;gt; enforcement of output keys and (static) taptrees. In other words, as&lt;br/&gt;&amp;gt; &amp;gt; long as you can dynamically compute the output embedded data in&lt;br/&gt;&amp;gt; &amp;gt; Script, you can enforce more or less anything (since you can make the&lt;br/&gt;&amp;gt; &amp;gt; output script enforce presenting a witness &amp;#34;satisfying&amp;#34; the embedded&lt;br/&gt;&amp;gt; &amp;gt; data).&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Does that sound about right?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes. Fraud proofs allow us to extend beyond what Script can do (with the&lt;br/&gt;&amp;gt; necessary tradeoffs), but there is plenty that can be done without them.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; For instance, I believe you could simulate coin pools pretty easily:&lt;br/&gt;&amp;gt; &amp;gt; Commit to the set of pubkeys and amounts owned by the participants in&lt;br/&gt;&amp;gt; &amp;gt; the pool, and an output taptree where each participant has their own&lt;br/&gt;&amp;gt; &amp;gt; spending path. Now, to exit the pool unilaterally, the participant&lt;br/&gt;&amp;gt; &amp;gt; must present a proof that their pubkey&#43;amount is committed to in the&lt;br/&gt;&amp;gt; &amp;gt; input and an output where it is no longer committed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t think one would want to have a tapleaf for each participant:&lt;br/&gt;&amp;gt; that would make you pay log n hashes just to reveal the tapleaf, and&lt;br/&gt;&amp;gt; then you still need to pay log n hashes to access the embedded data.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Instead, the &amp;#34;unilateral withdrawal Script&amp;#34; can be the same for all the&lt;br/&gt;&amp;gt; participants. The witness would be the Merkle proof, plus perhaps some&lt;br/&gt;&amp;gt; additional information to identify the leaf in the tree (depending on&lt;br/&gt;&amp;gt; how the Merkle tree is implemented). In a complete Merkle tree for&lt;br/&gt;&amp;gt; N = 2^n participants, the witness could contain the n hashes that allow&lt;br/&gt;&amp;gt; to prove the value of the leaf, plus n bits to identify the path to the&lt;br/&gt;&amp;gt; leaf (0/1 for &amp;#39;left/right&amp;#34; child), since Script doesn&amp;#39;t have enough&lt;br/&gt;&amp;gt; opcodes to extract the bits from the leaf index.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The data in the leaf can contain a commitment to all the information&lt;br/&gt;&amp;gt; relevant for that participant (e.g.: their balance and pubkey, in a&lt;br/&gt;&amp;gt; CoinPool construction).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then, the same witness can easily be reused to compute the new Merkle&lt;br/&gt;&amp;gt; root after the data in the leaf is modified (for example, setting the&lt;br/&gt;&amp;gt; amount to 0 for one participant).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; A question that arises is how one would efficiently (in Script) prove&lt;br/&gt;&amp;gt; &amp;gt; the inclusion/exclusion of the data in the commitment. One could&lt;br/&gt;&amp;gt; &amp;gt; naively hash all the data twice during script execution (once for the&lt;br/&gt;&amp;gt; &amp;gt; input, once for the output), but that is costly. It would be natural&lt;br/&gt;&amp;gt; &amp;gt; to show merkle tree inclusion/exclusion in script, but perhaps there&lt;br/&gt;&amp;gt; &amp;gt; are more efficient ways to prove it?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A Merkle tree as described above commits to an entire vector that you&lt;br/&gt;&amp;gt; can index positionally. That&amp;#39;s quite versatile, and easier to handle&lt;br/&gt;&amp;gt; than more complex constructions like accumulators with exclusion proofs.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A Merkle proof for 2^7 = 128 participants requires about 8 hashes, so&lt;br/&gt;&amp;gt; around 250 bytes in total of witness size; 2^10 = 1024 should bring that&lt;br/&gt;&amp;gt; to the ballpark of 350 bytes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&amp;gt; Salvatore Ingala
    </content>
    <updated>2023-06-07T23:21:09Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsq0ewsy3umk5ugralynnkvwk5cs8c25p0j3zrk300g05x5xc04q6gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97plxudl</id>
    
      <title type="html">📅 Original date posted:2023-05-30 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsq0ewsy3umk5ugralynnkvwk5cs8c25p0j3zrk300g05x5xc04q6gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97plxudl" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstqne5z930rylz39fs9fdzjwv652ylx2knh9rx7zyxgg9r04f37agvxtz9j&#39;&gt;nevent1q…tz9j&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-05-30&lt;br/&gt;🗒️ Summary of this message: The proposal for coin pools achieves the first part of removing data from the merkle tree, but removal of a public key from the taproot internal key is out of scope. Falling back to &amp;#34;old style multisig&amp;#34; can provide some benefits. There may be reasonable CoinPools designs without additional opcodes.&lt;br/&gt;📝 Original message:I should clarify: the current proposal already achieves the first part&lt;br/&gt;needed for coin pools: removing some data from the merkle tree (I was&lt;br/&gt;indeed referring to the embedded data, not the taptree).&lt;br/&gt;&lt;br/&gt;The thing that is missing is removal of a public key from the taproot&lt;br/&gt;internal key, but as mentioned I do agree that this is out of scope&lt;br/&gt;for this proposal.&lt;br/&gt;&lt;br/&gt;I believe you can get many of the benefits by falling back to &amp;#34;old&lt;br/&gt;style multisig&amp;#34; in case someone exits the pool, by having a tap leaf&lt;br/&gt;defining a multisig check amongst the remaining pubkeys.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;&amp;gt; It seems likely that efficient use of the taproot internal pubkey with&lt;br/&gt;&amp;gt; &amp;#34;dynamic key aggregation&amp;#34; is not possible with the current semantics&lt;br/&gt;&amp;gt; (unless one ventures into the fraud proof machinery, which seems&lt;br/&gt;&amp;gt; overkill!).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, in constructions with MATT opcodes, I would never expect the&lt;br/&gt;&amp;gt; need for data to be stored in the taptree. In particular, for the case&lt;br/&gt;&amp;gt; of CoinPools, the pubkeys of the members could also be stored in the&lt;br/&gt;&amp;gt; embedded data, having a single &amp;#34;unilateral withdrawal&amp;#34; tapleaf.&lt;br/&gt;&amp;gt; Removing a key would then amount to replacing it with a fixed NUMS key&lt;br/&gt;&amp;gt; and computing the new root (re-using the same Merkle proof).&lt;br/&gt;&amp;gt; Note that this is not a lot costlier than using a tapleaf per user:&lt;br/&gt;&amp;gt; instead of paying the cost for the Merkle proof in the control block,&lt;br/&gt;&amp;gt; you pay for it explicitly in the Script witness.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Therefore, I would expect there to be reasonable CoinPools designs&lt;br/&gt;&amp;gt; without additional opcodes − but I am only moderately confident as&lt;br/&gt;&amp;gt; this is beyond the level of sophistication I&amp;#39;ve been exploring so far.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sun, May 28, 2023 at 12:24 PM Salvatore Ingala&lt;br/&gt;&amp;lt;salvatore.ingala at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Exciting to finally see some merkleization, which was only confined&lt;br/&gt;&amp;gt; within the meme, up to this point!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; A simpler way IMO, would be to make OP_CICV and OP_COCV symmetrical:&lt;br/&gt;&amp;gt; &amp;gt; Have OP_CICV take an optional taproot and do the same check as is&lt;br/&gt;&amp;gt; &amp;gt; done for the output: Q == tweak(tweak(X,D), T).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think that&amp;#39;s an excellent suggestion, which I was already exploring&lt;br/&gt;&amp;gt; for a different purpose: bringing externally signed data onto the&lt;br/&gt;&amp;gt; stack. My goal there was to allow eltoo-style replacement.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Until recently, I thought that a clean/efficient version of eltoo&lt;br/&gt;&amp;gt; would require OP_CHECKSIGFROMSTACK or ANYPREVOUT. However, extending&lt;br/&gt;&amp;gt; OP_CHECKINPUTCONTRACTVERIFY to enable introspection of other inputs&lt;br/&gt;&amp;gt; allows a reasonable workaround: producing a separate UTXO signed with&lt;br/&gt;&amp;gt; ANYONECANPAY, with the required data embedded as usual. Spending that&lt;br/&gt;&amp;gt; UTXO together with the channel&amp;#39;s UTXO allows one to get that data&lt;br/&gt;&amp;gt; on the stack (with its signature already checked by consensus rules).&lt;br/&gt;&amp;gt; I drafted this idea in a gist [1].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Remark: it still seems easier (and probably slightly more efficient)&lt;br/&gt;&amp;gt; to build eltoo replacement with CSFS or APO in addition to MATT&lt;br/&gt;&amp;gt; opcodes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A possible semantics for OP_CHECKINPUTCONTRACTVERIFY could then be&lt;br/&gt;&amp;gt; exactly symmetrical to that of OP_CHECKOUTPUTCONTRACTVERIFY, with&lt;br/&gt;&amp;gt; the exception that the special input index -1 would represent the&lt;br/&gt;&amp;gt; current input.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Pushing this further, another option that could be be worth exploring&lt;br/&gt;&amp;gt; is to have a single OP_CHECK_IN_OUT_CONTRACT_VERIFY opcode, with the&lt;br/&gt;&amp;gt; same semantics as OP_CHECKOUTPUTCONTRACTVERIFY from [2], but with an&lt;br/&gt;&amp;gt; additional `flags` argument, which is a bitmap where:&lt;br/&gt;&amp;gt; - the lowest-significant bit determines if the index refers to inputs&lt;br/&gt;&amp;gt;   or outputs (where input index -1 refers to the current input)&lt;br/&gt;&amp;gt; - the second bit specifies if amounts should be preserved with&lt;br/&gt;&amp;gt;   deferred checks as described in [2] (only applicable to outputs)&lt;br/&gt;&amp;gt; - other bits are OP_SUCCESS and reserved for future behaviors.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This would make the opcodes 1-2 bytes larger, but might allow greater&lt;br/&gt;&amp;gt; flexibility, and keep some room for future extensions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 2.To make fully functioning CoinPools, one would need functionality&lt;br/&gt;&amp;gt; &amp;gt; similar to OP_MERKLESUB[4]: remove some data from the merkle tree,&lt;br/&gt;&amp;gt; &amp;gt; and remove a key from the aggregated internal key.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It seems likely that efficient use of the taproot internal pubkey with&lt;br/&gt;&amp;gt; &amp;#34;dynamic key aggregation&amp;#34; is not possible with the current semantics&lt;br/&gt;&amp;gt; (unless one ventures into the fraud proof machinery, which seems&lt;br/&gt;&amp;gt; overkill!).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, in constructions with MATT opcodes, I would never expect the&lt;br/&gt;&amp;gt; need for data to be stored in the taptree. In particular, for the case&lt;br/&gt;&amp;gt; of CoinPools, the pubkeys of the members could also be stored in the&lt;br/&gt;&amp;gt; embedded data, having a single &amp;#34;unilateral withdrawal&amp;#34; tapleaf.&lt;br/&gt;&amp;gt; Removing a key would then amount to replacing it with a fixed NUMS key&lt;br/&gt;&amp;gt; and computing the new root (re-using the same Merkle proof).&lt;br/&gt;&amp;gt; Note that this is not a lot costlier than using a tapleaf per user:&lt;br/&gt;&amp;gt; instead of paying the cost for the Merkle proof in the control block,&lt;br/&gt;&amp;gt; you pay for it explicitly in the Script witness.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Therefore, I would expect there to be reasonable CoinPools designs&lt;br/&gt;&amp;gt; without additional opcodes − but I am only moderately confident as&lt;br/&gt;&amp;gt; this is beyond the level of sophistication I&amp;#39;ve been exploring so far.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&amp;gt; Salvatore&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] - &lt;a href=&#34;https://gist.github.com/bigspider/041ebd0842c0dcc74d8af087c1783b63&#34;&gt;https://gist.github.com/bigspider/041ebd0842c0dcc74d8af087c1783b63&lt;/a&gt;&lt;br/&gt;&amp;gt; [2] - &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021588.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021588.html&lt;/a&gt;
    </content>
    <updated>2023-06-07T23:21:09Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqswgav5q0cf6jwczmyracqq6rratdr6em72r9edsxssctt56msz4zgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97d45t79</id>
    
      <title type="html">📅 Original date posted:2023-05-04 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqswgav5q0cf6jwczmyracqq6rratdr6em72r9edsxssctt56msz4zgzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97d45t79" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsgeavevzr9jpumqgn727l99000gul95dt98s9wplxy3naad6d2jgs5cd3ta&#39;&gt;nevent1q…d3ta&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-05-04&lt;br/&gt;🗒️ Summary of this message: The construct allows access to embedded data of inputs and outputs, and enforcement of output keys and static taptrees. Merkle tree inclusion/exclusion in script could be used for efficient proof.&lt;br/&gt;📝 Original message:Thank you for the example.&lt;br/&gt;&lt;br/&gt;It sounds like we can generalize the description of the construct to:&lt;br/&gt;Access to (the hash of) embedded data of inputs and outputs, and the&lt;br/&gt;enforcement of output keys and (static) taptrees. In other words, as&lt;br/&gt;long as you can dynamically compute the output embedded data in&lt;br/&gt;Script, you can enforce more or less anything (since you can make the&lt;br/&gt;output script enforce presenting a witness &amp;#34;satisfying&amp;#34; the embedded&lt;br/&gt;data).&lt;br/&gt;&lt;br/&gt;Does that sound about right?&lt;br/&gt;&lt;br/&gt;For instance, I believe you could simulate coin pools pretty easily:&lt;br/&gt;Commit to the set of pubkeys and amounts owned by the participants in&lt;br/&gt;the pool, and an output taptree where each participant has their own&lt;br/&gt;spending path. Now, to exit the pool unilaterally, the participant&lt;br/&gt;must present a proof that their pubkey&#43;amount is committed to in the&lt;br/&gt;input and an output where it is no longer committed.&lt;br/&gt;&lt;br/&gt;A question that arises is how one would efficiently (in Script) prove&lt;br/&gt;the inclusion/exclusion of the data in the commitment. One could&lt;br/&gt;naively hash all the data twice during script execution (once for the&lt;br/&gt;input, once for the output), but that is costly. It would be natural&lt;br/&gt;to show merkle tree inclusion/exclusion in script, but perhaps there&lt;br/&gt;are more efficient ways to prove it?&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, May 2, 2023 at 12:44 AM Salvatore Ingala via bitcoin-dev&lt;br/&gt;&amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I apologize for a couple of oversights in my last e-mail.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The first is that m_B can&amp;#39;t be committed as-is in the contract&amp;#39;s&lt;br/&gt;&amp;gt; embedded data, with the current semantics of OP_COCV, which&lt;br/&gt;&amp;gt; only allows 32-byte values. A solution could be to store its&lt;br/&gt;&amp;gt; hash SHA256(m_B), instead.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (I didn&amp;#39;t test the Scripts, so there could be other bugs − hopefully the&lt;br/&gt;&amp;gt; general idea is clear, anyway)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mon, 1 May 2023 at 15:11, Salvatore Ingala &amp;lt;salvatore.ingala at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If the internal_pubkey is a musig-aggregated key of Alice and Bob,&lt;br/&gt;&amp;gt;&amp;gt; the game can be settled entirely offline after the first transaction.&lt;br/&gt;&amp;gt;&amp;gt; Simply, Bob communicates his move to Alice, Alice reveals her move to&lt;br/&gt;&amp;gt;&amp;gt; Bob, and they can settle the bet. The game would be played without&lt;br/&gt;&amp;gt;&amp;gt; any script being executed, therefore all transactions could look like&lt;br/&gt;&amp;gt;&amp;gt; any other P2TR, with the only possible fingerprinting being due to the&lt;br/&gt;&amp;gt;&amp;gt; input amounts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is incomplete: Alice can&amp;#39;t trust Bob by revealing her move, as&lt;br/&gt;&amp;gt; he could then cheat on-chain and play a different move.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The fix should be straightforward, after adding the requirement that the&lt;br/&gt;&amp;gt; internal pubkey of [S1] is a musig2 of both players.&lt;br/&gt;&amp;gt; After Bob reveals his move (say, Rock), Alice will only agree to continue&lt;br/&gt;&amp;gt; the game off-chain if Bob pre-signs transactions for the state [S1] (where&lt;br/&gt;&amp;gt; m_B = Paper, and m_B = Scissors) that send all the money to Alice.&lt;br/&gt;&amp;gt; This guarantees that a cheating Bob is punished.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best,&lt;br/&gt;&amp;gt; Salvatore Ingala&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;
    </content>
    <updated>2023-06-07T23:21:08Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsfh9yxn56ckc4ccqapgydf7pz59v7fs4rvrukaj8jwk38x47gwhjqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97uhnp2c</id>
    
      <title type="html">📅 Original date posted:2023-04-28 🗒️ Summary of this ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsfh9yxn56ckc4ccqapgydf7pz59v7fs4rvrukaj8jwk38x47gwhjqzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97uhnp2c" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs87qze5msd9rhc9hkr7pnnkhpytaepmm3z0pnkhpny8ywc27gchkqsfcjva&#39;&gt;nevent1q…cjva&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-04-28&lt;br/&gt;🗒️ Summary of this message: A person is interested in a proposal for powerful capabilities using simple opcodes. They ask for an example of encoding a state transition in Bitcoin script for a simple game.&lt;br/&gt;📝 Original message:Hi, Salvatore.&lt;br/&gt;&lt;br/&gt;I find this proposal very interesting. Especially since you seemingly&lt;br/&gt;can achieve such powerful capabilities by such simple opcodes.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m still trying to grok how this would look like on-chain (forget&lt;br/&gt;about the off-chain part for now), if we were to play out such a&lt;br/&gt;computation.&lt;br/&gt;&lt;br/&gt;Let&amp;#39;s say you have a simple game like &amp;#34;one player tic-tac-toe&amp;#34; with&lt;br/&gt;only two tiles: [ _ | _ ]. The player wins if he can get two in a row&lt;br/&gt;(pretty easy game tbh).&lt;br/&gt;&lt;br/&gt;Could you give a complete example how you would encode one such state&lt;br/&gt;transition (going from [ X, _ ] -&amp;gt; [ X, X ] for instance) in Bitcoin&lt;br/&gt;script?&lt;br/&gt;&lt;br/&gt;Feel free to choose a different game or program if you prefer :)&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, Dec 13, 2022 at 2:08 PM Billy Tetrud via bitcoin-dev&lt;br/&gt;&amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Re Verkle trees, that&amp;#39;s a very interesting construction that would be super useful as a tool for something like Utreexo. A potentially substantial downside is that it seems the cryptography used to get those nice properties of Verkle trees isn&amp;#39;t quantum safe. While a lot of things in Bitcoin seems to be going down the path of quantum-unsafe (I&amp;#39;m looking at you, taproot), there are still a lot of people who think quantum safety is important in a lot of contexts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Thu, Dec 1, 2022 at 5:52 AM Salvatore Ingala via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hello Rijndael,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Wed, 30 Nov 2022 at 23:09, Rijndael &amp;lt;rot13maxi at protonmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Hello Salvatore,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I found my answer re-reading your original post:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; During the arbitration phase (say at the i-th leaf node of M_T), any party can win the challenge by providing correct values for tr_i = (st_i, op_i, st_{i &#43; 1}). Crucially, only one party is able to provide correct values, and Script can verify that indeed the state moves from st_i to st_{i &#43; 1} by executing op_i. The challenge is over.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; You are correct, the computation step encoded in a leaf needs to be simple enough for Script to verify it.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For the academic purpose of proving completeness (that is, any computation can be successfully &amp;#34;proved&amp;#34; by the availability of the corresponding fraud proof), one can imagine reducing the computation all the way down to a circuit, where each step (leaf) is as simple as what can be checked with {OP_NOT, OP_BOOLAND, OP_BOOLOR, OP_EQUAL}.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In practice, you would want to utilize Script to its fullest, so for example you wouldn&amp;#39;t compile a SHA256 computation to something else – you&amp;#39;d rather use OP_SHA256 directly.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; That raises leads to a different question: Alice initially posts a commitment to an execution trace of `f(x) = y`, `x`, and `y`. Bob Disagrees with `y` so starts the challenge protocol. Is there a commitment to `f`? In other words, the dispute protocol (as I read it) finds the leftmost step in Alice and Bob&amp;#39;s execution traces that differ, and then rewards the coins to the participant who&amp;#39;s &amp;#34;after-value&amp;#34; is computed by the step&amp;#39;s operation applied to the &amp;#34;before value&amp;#34;. But if the participants each present valid steps but with different operations, who wins? In other words, Alice could present [64, DECREMENT, 63] and Bob could present [64, INCREMENT, 65]. Those steps don&amp;#39;t match, but both are valid. Is there something to ensure that before the challenge protocol starts, that the execution trace that Alice posts is for the right computation and not a different computation that yields a favorable result for her (and for which she can generate a valid merkle tree)?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The function f is already hard-coded in the contract itself, by means of the tree of scripts − that already commits to the possible futures. Therefore, once you are at state S14, you know that you are verifying the 6th step of the computation; and the operation in the 6th step of the computation depends solely on f, not its inputs. In fact, you made me realize that I could drop op_i from the i-th leaf commitment, and just embed the information in the Script of that corresponding state.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Note that the states S0 to S14 of the 256x game are not _all_ the possible states, but only the ones that occurred in that execution of the contract (corresponding to a path from the root to the leaf of the Merkle tree of the computation trace), and therefore the ones that materialized in a UTXO. Different choices made by the parties (by providing different data, and therefore choosing different branches) would lead to a different leaf, and therefore to different (but in a certain sense &amp;#34;symmetric&amp;#34;) states.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ========&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Since we are talking about the fact that f is committed to in the contract, I&amp;#39;ll take the chance to extend on this a bit with a fun construction on top.&lt;br/&gt;&amp;gt;&amp;gt; It is well-known in the academic literature of state channels that you can create contracts where even the function (&amp;#34;program&amp;#34;, or &amp;#34;contract&amp;#34;) is not decided when the channel is created.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Since f is generic, we can choose f itself to be a universal Turing machine. That is, we can imagine a function f(code, data) that executes a program (&amp;#34;code&amp;#34;) on the &amp;#34;data&amp;#34; given to it as input.&lt;br/&gt;&amp;gt;&amp;gt; Since we can do fraud proofs on statements &amp;#34;f(code, data) == output&amp;#34;, we could build contracts where the &amp;#34;code&amp;#34; itself is chosen later.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For example, one could build a universal state channel, where parties can enter any contract among themselves (e.g.: start playing a chess game) entirely inside the channel. The state of this universal channel would contain all the states of the individual contracts that are currently open in the channel, and even starting/closing contracts can happen entirely off-chain.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I believe these constructions are practical (the code of universal Turing machines is not really complicated), so it might be worth exploring further to figure out useful applications of this approach (supercharging lightning?).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We should probably start by implementing testnet rock-paper-scissors in MATT, though :)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Best,&lt;br/&gt;&amp;gt;&amp;gt; Salvatore Ingala&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;
    </content>
    <updated>2023-06-07T23:20:59Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsyrst0xl6223qwfks6grc04rppg6q3vt3hxxfws77a058pr6nrk7szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9795nsv6</id>
    
      <title type="html">📅 Original date posted:2022-11-07 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsyrst0xl6223qwfks6grc04rppg6q3vt3hxxfws77a058pr6nrk7szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9795nsv6" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszph0a3qrp5z3jltv4qza44jag3lvveedt74qdz34luj2ry3g2kcg4jfdgm&#39;&gt;nevent1q…fdgm&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-11-07&lt;br/&gt;📝 Original message:Hi Laolu,&lt;br/&gt;&lt;br/&gt;Yeah, that is definitely the main downside, as Ruben also mentioned:&lt;br/&gt;tokens are &amp;#34;burned&amp;#34; if they get sent to an already spent UTXO, and&lt;br/&gt;there is no way to block those transfers.&lt;br/&gt;&lt;br/&gt;And I do agree with your concern about losing the blockchain as the&lt;br/&gt;main synchronization point, that seems indeed to be a prerequisite for&lt;br/&gt;making the scheme safe in terms of re-orgs and asynchronicity.&lt;br/&gt;&lt;br/&gt;I do think the scheme itself is sound though (maybe not off-chain, see&lt;br/&gt;below): it prevents double spending and as long as the clients adhere&lt;br/&gt;to the &amp;#34;rule&amp;#34; of not sending to a spent UTXO you&amp;#39;ll be fine (if not&lt;br/&gt;your tokens will be burned, the same way as if you don&amp;#39;t satisfy the&lt;br/&gt;Taro script when spending).&lt;br/&gt;&lt;br/&gt;Thinking more about the examples you gave, I think you are right it&lt;br/&gt;won&amp;#39;t easily be compatible with LN channels though:&lt;br/&gt;If you want to refill an existing channel with tokens, you need the&lt;br/&gt;channel counterparties to start signing new commitments that include&lt;br/&gt;spending the newly sent tokens. A problem arises however, if the&lt;br/&gt;channel is force-closed with a pre-existing commitment from before the&lt;br/&gt;token transfer took place. Since this commitment will be spending the&lt;br/&gt;funding UTXO, but not the new tokens, the tokens will be burned. And&lt;br/&gt;that seems to be harder to deal with (Eltoo style channels could be an&lt;br/&gt;avenue to explore, if one could override the broadcasted commitment).&lt;br/&gt;&lt;br/&gt;Tl;dr: I think you&amp;#39;re right, the scheme is not compatible with LN.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Sat, Nov 5, 2022 at 1:36 AM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hi Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I haven&amp;#39;t really been able to find a precise technical explanation of the&lt;br/&gt;&amp;gt; &amp;#34;utxo teleport&amp;#34; scheme, but after thinking about your example use cases a&lt;br/&gt;&amp;gt; bit, I don&amp;#39;t think the scheme is actually sound. Consider that the scheme&lt;br/&gt;&amp;gt; attempts to target transmitting &amp;#34;ownership&amp;#34; to a UTXO. However, by the time&lt;br/&gt;&amp;gt; that transaction hits the chain, the UTXO may no longer exist. At that&lt;br/&gt;&amp;gt; point, what happens to the asset? Is it burned? Can you retry it again? Does&lt;br/&gt;&amp;gt; it go back to the sender?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As a concrete example, imagine I have a channel open, and give you an&lt;br/&gt;&amp;gt; address to &amp;#34;teleport&amp;#34; some additional assets to it. You take that addr, then&lt;br/&gt;&amp;gt; make a transaction to commit to the transfer. However, the block before you&lt;br/&gt;&amp;gt; commit to the transfer, my channel closes for w/e reason. As a result, when&lt;br/&gt;&amp;gt; the transaction committing to the UTXO (blinded or not), hits the chain, the&lt;br/&gt;&amp;gt; UTXO no longer exists. Alternatively, imagine the things happen in the&lt;br/&gt;&amp;gt; expected order, but then a re-org occurs, and my channel close is mined in a&lt;br/&gt;&amp;gt; block before the transfer. Ultimately, as a normal Bitcoin transaction isn&amp;#39;t&lt;br/&gt;&amp;gt; used as a serialization point, the scheme seems to lack a necessary total&lt;br/&gt;&amp;gt; ordering to ensure safety.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we look at Taro&amp;#39;s state transition model in contrast, everything is fully&lt;br/&gt;&amp;gt; bound to a single synchronization point: a normal Bitcoin transaction with&lt;br/&gt;&amp;gt; inputs consumed and outputs created. All transfers, just like Bitcoin&lt;br/&gt;&amp;gt; transactions, end up consuming assets from the set of inputs, and&lt;br/&gt;&amp;gt; re-creating them with a different distribution with the set of outputs. As a&lt;br/&gt;&amp;gt; result, Taro transfers inherit the same re-org safety traits as regular&lt;br/&gt;&amp;gt; Bitcoin transactions. It also isn&amp;#39;t possible to send to something that won&amp;#39;t&lt;br/&gt;&amp;gt; ultimately exist, as sends create new outputs just like Bitcoin&lt;br/&gt;&amp;gt; transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Taro&amp;#39;s state transition model also means anything you can do today with&lt;br/&gt;&amp;gt; Bitcoin/LN also apply. As an example, it would be possible for you to&lt;br/&gt;&amp;gt; withdrawn from your exchange into a Loop In address (on chain to off chain&lt;br/&gt;&amp;gt; swap), and have everything work as expected, with you topping off your&lt;br/&gt;&amp;gt; channel. Stuff like splicing, and other interactive transaction construction&lt;br/&gt;&amp;gt; schemes (atomic swaps, MIMO swaps, on chain auctions, etc) also just work.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Ignoring the ordering issue I mentioned above, I don&amp;#39;t think this is a great&lt;br/&gt;&amp;gt; model for anchoring assets in channels either. With Taro, when you make the&lt;br/&gt;&amp;gt; channel, you know how many assets are committed since they&amp;#39;re all committed&lt;br/&gt;&amp;gt; to in the funding output when the channel is created. However, let&amp;#39;s say we&lt;br/&gt;&amp;gt; do teleporting instead: at which point would we recognize the new asset&lt;br/&gt;&amp;gt; &amp;#34;deposits&amp;#34;? What if we close before a pending deposits confirms, how can one&lt;br/&gt;&amp;gt; regain those funds? Once again you lose the serialization of events/actions&lt;br/&gt;&amp;gt; the blockchain provides. I think you&amp;#39;d also run into similar issues when you&lt;br/&gt;&amp;gt; start to think about how these would even be advertised on a hypothetical&lt;br/&gt;&amp;gt; gossip network.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think one other drawback of the teleport model iiuc is that: it either&lt;br/&gt;&amp;gt; requires an OP_RETURN, or additional out of band synchronization to complete&lt;br/&gt;&amp;gt; the transfer. Since it needs to commit to w/e hash description of the&lt;br/&gt;&amp;gt; teleport, it either needs to use an OP_RETURN (so the receiver can see the&lt;br/&gt;&amp;gt; on chain action), or the sender needs to contact the receiver to initiate&lt;br/&gt;&amp;gt; the resolution of the transfer (details committed to in a change addr or&lt;br/&gt;&amp;gt; w/e).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With Taro, sending to an address creates an on-chain taproot output just&lt;br/&gt;&amp;gt; like sending to a P2TR address. The creation of the output directly creates&lt;br/&gt;&amp;gt; the new asset anchor/output as well, which allows the receiver to look for&lt;br/&gt;&amp;gt; that address on chain just like a normal on chain transaction. To 3rd party&lt;br/&gt;&amp;gt; observers, it just looks like a normal P2TR transfer. In order to finalize&lt;br/&gt;&amp;gt; the receipt of the asset, the receiver needs to obtain the relevant&lt;br/&gt;&amp;gt; provenance proofs, which can be obtained from a multi-verse gRPC/HTTP&lt;br/&gt;&amp;gt; service keyed by the input outpoint and output index. In short, the send&lt;br/&gt;&amp;gt; process is fully async, with the sender and receiver using the blockchain&lt;br/&gt;&amp;gt; itself as a synchronization point like a normal Bitcoin wallet.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; -- Laolu
    </content>
    <updated>2023-06-07T23:16:39Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsp8n92xjqfm25yf0c9eqg8vt044z5hghwap8mjl0zad35r2726kyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r977770v6</id>
    
      <title type="html">📅 Original date posted:2022-11-03 📝 Original message:Hi, I ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsp8n92xjqfm25yf0c9eqg8vt044z5hghwap8mjl0zad35r2726kyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r977770v6" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs947kpew2fkfpd7cq9nagztxqrvrnwgx3aztpgm6yhaj9rxlju0gclqqvj4&#39;&gt;nevent1q…qvj4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-11-03&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;I wanted to chime in on the &amp;#34;teleport&amp;#34; feature explained by Ruben, as I&lt;br/&gt;think exploring something similar for Taro could be super useful in an LN&lt;br/&gt;setting.&lt;br/&gt;&lt;br/&gt;In today&amp;#39;s Taro, to transfer tokens you have to spend a UTXO, and present a&lt;br/&gt;proof showing that there are tokens committed to in the output you are&lt;br/&gt;spending. Let&amp;#39;s say this UTXO is &amp;#39;utxo:0&amp;#39;.&lt;br/&gt;&lt;br/&gt;In contrast, to spend teleported tokens, you would still spend utxo:0, but&lt;br/&gt;you would only have to present a proof that _some txout_ on-chain have&lt;br/&gt;committed tokens to utxo:0.&lt;br/&gt;&lt;br/&gt;As Ruben points out, this makes it possible to send tokens to an already&lt;br/&gt;spent TXO, essentially burning the tokens.&lt;br/&gt;&lt;br/&gt;However, it opens up some exciting possibilities IMO. You can in essence&lt;br/&gt;use this to &amp;#34;re-fill&amp;#34; UTXOs with tokens, which is very interesting for LN&lt;br/&gt;channels:&lt;br/&gt;&lt;br/&gt;- You could &amp;#34;add&amp;#34; tokens to your already open channels. The only thing&lt;br/&gt;needed is for the channel participants to be presented the proof that&lt;br/&gt;tokens were sent to the funding output, and they can update their&lt;br/&gt;commitment transaction to start spending these tokens.&lt;br/&gt;- You can &amp;#34;top-up&amp;#34; all your channels in a single on-chain tx. Since a&lt;br/&gt;single output can commit tokens to several UTXOs, you could with a single&lt;br/&gt;on-chain transaction add tokens to many channels without opening and&lt;br/&gt;closing them.&lt;br/&gt;&lt;br/&gt;RGB also has the ability to &amp;#34;blind&amp;#34; the UTXO that tokens get teleported to,&lt;br/&gt;hiding the recipient UTXO. This is cool, since I could withdraw tokens from&lt;br/&gt;an exchange directly into my LN channel, without revealing my channel UTXO.&lt;br/&gt;&lt;br/&gt;I found the explanation of the teleport feature in this blog post pretty&lt;br/&gt;good:&lt;br/&gt;&lt;a href=&#34;https://medium.com/@FedericoTenga/understanding-rgb-protocol-7dc7819d3059&#34;&gt;https://medium.com/@FedericoTenga/understanding-rgb-protocol-7dc7819d3059&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sun, Apr 10, 2022 at 6:52 PM Ruben Somsen &amp;lt;rsomsen at gmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Laolu,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;happy to hear that someone was actually able to extract enough details&lt;br/&gt;&amp;gt; from the RGB devs/docs to be able to analyze it properly&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Actually, even though I eventually puzzled everything together, this did&lt;br/&gt;&amp;gt; not go well for me either. There is a ton of documentation, but it&amp;#39;s a maze&lt;br/&gt;&amp;gt; of unhelpful details, and none of it clearly maps out the fundamental&lt;br/&gt;&amp;gt; design. I was also disappointed by the poor response I received when asking&lt;br/&gt;&amp;gt; questions, and I ended up getting chastised for helping others understand&lt;br/&gt;&amp;gt; it and pointing out potential flaws[1][2][3].Given my experience, I think&lt;br/&gt;&amp;gt; the project is not in great shape, so the decision to rebuild from scratch&lt;br/&gt;&amp;gt; seems right to me.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That said, in my opinion the above should not factor into the decision of&lt;br/&gt;&amp;gt; whether RGB should be credited in the Taro documentation. The design&lt;br/&gt;&amp;gt; clearly precedes (and seems to have inspired) Taro, so in my opinion this&lt;br/&gt;&amp;gt; should be acknowledged. Also, the people that are responsible for the&lt;br/&gt;&amp;gt; current shape of RGB aren&amp;#39;t the people who originated the idea, so it would&lt;br/&gt;&amp;gt; not be fair to the originators either (Peter Todd, Alekos Filini, Giacomo&lt;br/&gt;&amp;gt; Zucco).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;assets can be burnt if a user doesn&amp;#39;t supply a valid witness&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I am in agreement with what you said, but it is not clear to me whether we&lt;br/&gt;&amp;gt; are on the same page. What I tried to say was that it does not make sense&lt;br/&gt;&amp;gt; to build scripting support into Taro, because you can&amp;#39;t actually do&lt;br/&gt;&amp;gt; anything interesting with it due to this limitation. The only type of smart&lt;br/&gt;&amp;gt; contract you can build is one where you limit what the owner (as defined by&lt;br/&gt;&amp;gt; Bitcoin&amp;#39;s script) can do with their own Taro tokens, or else he will burn&lt;br/&gt;&amp;gt; them – not very useful. Anything involving a conditional transfer of&lt;br/&gt;&amp;gt; ownership to either A or B (i.e. any meaningful type of script) won&amp;#39;t work.&lt;br/&gt;&amp;gt; Do you see what I mean, or should I elaborate further?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;TAPLEAF_UPDATE_VERIFY can actually be used to further _bind_ Taro transitions&lt;br/&gt;&amp;gt; at the Bitcoin level, without Bitcoin explicitly needing to be aware&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That is conceptually quite interesting. So theoretically you could get&lt;br/&gt;&amp;gt; Bitcoin covenants to enforce certain spending conditions on Taro assets.&lt;br/&gt;&amp;gt; Not sure how practical that ends up being, but intriguing to consider.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;asset issuer to do a &amp;#34;re-genesis&amp;#34;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, RGB suggested the same thing, and this can work under some&lt;br/&gt;&amp;gt; circumstances, but note that this won&amp;#39;t help for tokens that aim to have a&lt;br/&gt;&amp;gt; publicly audited supply, as the proof that a token was legitimately&lt;br/&gt;&amp;gt; re-issued is the history of the previous token (so you&amp;#39;d actually be making&lt;br/&gt;&amp;gt; things worse, as now everyone has to verify it). And of course the idea&lt;br/&gt;&amp;gt; also requires the issuer to be active, which may not always be the case.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;I&amp;#39;m not familiar with how the RGB &amp;#34;teleport&amp;#34; technique works [...] Can&lt;br/&gt;&amp;gt; you point me to a coherent explanation of the technique&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To my knowledge no good explanation exists. &amp;#34;Teleporting&amp;#34; is just what I&lt;br/&gt;&amp;gt; thought was a good way of describing it. Basically, in your design when&lt;br/&gt;&amp;gt; Alice wants to send a Taro token to Bob, Alice has to spend her own output,&lt;br/&gt;&amp;gt; make a new output for Bob, and make a change output for herself. Inside the&lt;br/&gt;&amp;gt; Taro tree you&amp;#39;ll then point to the index of Bob&amp;#39;s output in order to assign&lt;br/&gt;&amp;gt; the tokens to his new output. Instead of pointing to the index, you could&lt;br/&gt;&amp;gt; point to the outpoint (txid, index) of an existing UTXO owned by Bob, thus&lt;br/&gt;&amp;gt; &amp;#34;teleporting&amp;#34; the Taro tokens to this UTXO. This saves on-chain space, as&lt;br/&gt;&amp;gt; now you don&amp;#39;t have to create a new output for Bob (but now you have to&lt;br/&gt;&amp;gt; ensure Bob doesn&amp;#39;t spend from this output while you&amp;#39;re simultaneously&lt;br/&gt;&amp;gt; sending tokens to it, as I mentioned in my previous post, as this would&lt;br/&gt;&amp;gt; destroy the tokens).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The above also reminds me of another potential issue which you need to be&lt;br/&gt;&amp;gt; aware of, if you&amp;#39;re not already. Similar to my comment about how the&lt;br/&gt;&amp;gt; location of the Taro tree inside the taproot tree needs to be deterministic&lt;br/&gt;&amp;gt; for the verifier, the output in which you place the Taro tree also needs to&lt;br/&gt;&amp;gt; be. If it&amp;#39;s not, then you can commit to a different Taro tree in each&lt;br/&gt;&amp;gt; output of the transaction, allowing you to secretly fork the history.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Hope this helps.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Ruben&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] &lt;a href=&#34;https://twitter.com/SomsenRuben/status/1397267261619064836&#34;&gt;https://twitter.com/SomsenRuben/status/1397267261619064836&lt;/a&gt;&lt;br/&gt;&amp;gt; [2] &lt;a href=&#34;https://twitter.com/SomsenRuben/status/1397559406565462017&#34;&gt;https://twitter.com/SomsenRuben/status/1397559406565462017&lt;/a&gt;&lt;br/&gt;&amp;gt; [3] &lt;a href=&#34;https://twitter.com/afilini/status/1397484341236797441&#34;&gt;https://twitter.com/afilini/status/1397484341236797441&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Fri, Apr 8, 2022 at 7:48 PM Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; (this might be a double post as it ran into the size limit)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Ruben,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks! I don&amp;#39;t really consider things final until we have a good set of&lt;br/&gt;&amp;gt;&amp;gt; test&lt;br/&gt;&amp;gt;&amp;gt; vectors in the final set, after which we&amp;#39;d start to transition the set of&lt;br/&gt;&amp;gt;&amp;gt; documents beyond the draft state.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Seeing as there&amp;#39;s a large amount of overlap with RGB, a protocol which&lt;br/&gt;&amp;gt;&amp;gt; I have&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; examined quite extensively, I believe some of the issues I uncovered in&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; project also apply here.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m happy to hear that someone was actually able to extract enough&lt;br/&gt;&amp;gt;&amp;gt; details from&lt;br/&gt;&amp;gt;&amp;gt; the RGB devs/docs to be able to analyze it properly! In the past I tried&lt;br/&gt;&amp;gt;&amp;gt; to ask&lt;br/&gt;&amp;gt;&amp;gt; their developers questions about how things like transfers worked[1][2],&lt;br/&gt;&amp;gt;&amp;gt; but it&lt;br/&gt;&amp;gt;&amp;gt; seemed either people didn&amp;#39;t know, or they hadn&amp;#39;t finished the core design&lt;br/&gt;&amp;gt;&amp;gt; (large TBD sections) as they were working on adding other components to&lt;br/&gt;&amp;gt;&amp;gt; create&lt;br/&gt;&amp;gt;&amp;gt; a &amp;#34;new new Internet&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Furthermore, the Taro script is not enforced by Bitcoin, meaning those&lt;br/&gt;&amp;gt;&amp;gt; who&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; control the Bitcoin script can always choose to ignore the Taro script&lt;br/&gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; destroy the Taro assets as a result.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is correct, as a result in most contexts, an incentive exists for the&lt;br/&gt;&amp;gt;&amp;gt; holder of an asset to observe the Taro validation rules as otherwise,&lt;br/&gt;&amp;gt;&amp;gt; their&lt;br/&gt;&amp;gt;&amp;gt; assets are burnt in the process from the PoV of asset verifiers. In the&lt;br/&gt;&amp;gt;&amp;gt; single&lt;br/&gt;&amp;gt;&amp;gt; party case things are pretty straight forward, but more care needs to be&lt;br/&gt;&amp;gt;&amp;gt; taken&lt;br/&gt;&amp;gt;&amp;gt; in cases where one attempts to express partial application and permits&lt;br/&gt;&amp;gt;&amp;gt; anyone&lt;br/&gt;&amp;gt;&amp;gt; to spend a UTXO in question.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; By strongly binding all assets to Bitcoin UTXOs, we resolve issues&lt;br/&gt;&amp;gt;&amp;gt; related to&lt;br/&gt;&amp;gt;&amp;gt; double spending or duplicate assets, but needs to mind the fact that&lt;br/&gt;&amp;gt;&amp;gt; assets can&lt;br/&gt;&amp;gt;&amp;gt; be burnt if a user doesn&amp;#39;t supply a valid witness. There&amp;#39;re likely ways&lt;br/&gt;&amp;gt;&amp;gt; to get&lt;br/&gt;&amp;gt;&amp;gt; around this by lessening the binding to Bitcoin UTXO&amp;#39;s, but then the&lt;br/&gt;&amp;gt;&amp;gt; system&lt;br/&gt;&amp;gt;&amp;gt; would need to be able to collect, retain and order all the set of possible&lt;br/&gt;&amp;gt;&amp;gt; spends, essentially requiring a parallel network. The core of the system&lt;br/&gt;&amp;gt;&amp;gt; as it&lt;br/&gt;&amp;gt;&amp;gt; stands today is pretty simple (which was an explicit design goal to avoid&lt;br/&gt;&amp;gt;&amp;gt; getting forever distracted by the large design space), with a minimal&lt;br/&gt;&amp;gt;&amp;gt; implementation being relatively compact given all the Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; context/design&lt;br/&gt;&amp;gt;&amp;gt; re-use.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Also one cool trait of the way commitments are designed is that the Taro&lt;br/&gt;&amp;gt;&amp;gt; commitment impact the final derived taproot output key. As a result,&lt;br/&gt;&amp;gt;&amp;gt; potential&lt;br/&gt;&amp;gt;&amp;gt; Script extensions like TAPLEAF_UPDATE_VERIFY can actually be used to&lt;br/&gt;&amp;gt;&amp;gt; further&lt;br/&gt;&amp;gt;&amp;gt; _bind_ Taro transitions at the Bitcoin level, without Bitcoin explicitly&lt;br/&gt;&amp;gt;&amp;gt; needing to be aware of the Taro rules. In short, covenants can allow&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; Script to bind Taro state transitions, without any of the logic bleeding&lt;br/&gt;&amp;gt;&amp;gt; over,&lt;br/&gt;&amp;gt;&amp;gt; as the covenant just checks for a certain output key, which is a function&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt; the Taro commitment being present.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; There are two possible designs here: a.) The token history remains&lt;br/&gt;&amp;gt;&amp;gt; separate –&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Dave receives Alice&amp;#39;s 2 tokens, Bob&amp;#39;s tokens are split and he receives&lt;br/&gt;&amp;gt;&amp;gt; 2 (or&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 3 from Bob 1 from Alice).  b.) The token history gets merged – Dave&lt;br/&gt;&amp;gt;&amp;gt; receives&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; 4 tokens (linking the new output with both Alice and Bob&amp;#39;s history).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Mechanically, with respect to the way the change/UTXOs work in the&lt;br/&gt;&amp;gt;&amp;gt; system, both&lt;br/&gt;&amp;gt;&amp;gt; are expressible: Dave can chose to merge them into a single UTXO (with the&lt;br/&gt;&amp;gt;&amp;gt; appropriate witnesses included for each of them), or Dave can keep them&lt;br/&gt;&amp;gt;&amp;gt; distinct in the asset tree. You&amp;#39;re correct in that asset issuers may opt&lt;br/&gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt; issue assets in denominations vs allowing them to be fully divisible.&lt;br/&gt;&amp;gt;&amp;gt; Ultimately, the compatibility with the LN layer will be the primary way&lt;br/&gt;&amp;gt;&amp;gt; to keep&lt;br/&gt;&amp;gt;&amp;gt; asset histories compressed, without relying on another trust model, or&lt;br/&gt;&amp;gt;&amp;gt; relying&lt;br/&gt;&amp;gt;&amp;gt; on the incentive of an asset issuer to do a &amp;#34;re-genesis&amp;#34; which would&lt;br/&gt;&amp;gt;&amp;gt; effectively re-create assets in a supply-preserving manner (burn N units,&lt;br/&gt;&amp;gt;&amp;gt; then&lt;br/&gt;&amp;gt;&amp;gt; produce a new genesis outpoint for N units). Alternatively,&lt;br/&gt;&amp;gt;&amp;gt; implementations can&lt;br/&gt;&amp;gt;&amp;gt; also chose to utilize a checkpointing system similar to what some Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; full&lt;br/&gt;&amp;gt;&amp;gt; node clients do today.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;  is that you end up with a linked transaction graph, just like in&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This is correct, the protocol doesn&amp;#39;t claim to achieve better privacy&lt;br/&gt;&amp;gt;&amp;gt; guarantees than the base chain. However inheriting this transaction graph&lt;br/&gt;&amp;gt;&amp;gt; model&lt;br/&gt;&amp;gt;&amp;gt; imo makes it easier for existing Bitcoin developers to interact with the&lt;br/&gt;&amp;gt;&amp;gt; system, and all the data structures are very familiar tooling wise.&lt;br/&gt;&amp;gt;&amp;gt; However any&lt;br/&gt;&amp;gt;&amp;gt; privacy enhancing protocol used for on-chain top-level Bitcoin UTXOs can&lt;br/&gt;&amp;gt;&amp;gt; also&lt;br/&gt;&amp;gt;&amp;gt; be applied to Taro, so people can use things like coinswap and coinjoin,&lt;br/&gt;&amp;gt;&amp;gt; along&lt;br/&gt;&amp;gt;&amp;gt; with LN to shed prior coin lineages.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; This implies the location of the Taro tree inside the taproot tree is&lt;br/&gt;&amp;gt;&amp;gt; not&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; fixed. What needs to be prevented here is that a taproot tree contains&lt;br/&gt;&amp;gt;&amp;gt; more&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; than one Taro tree, as that would enable the owner of the commitment to&lt;br/&gt;&amp;gt;&amp;gt; show&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; different histories to different people.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Great observation, I patched a similar issue much earlier in the design&lt;br/&gt;&amp;gt;&amp;gt; process&lt;br/&gt;&amp;gt;&amp;gt; by strongly binding all signatures to a prevOut super-set (so the outpoint&lt;br/&gt;&amp;gt;&amp;gt; along with the unique key apth down into the tree), which prevents&lt;br/&gt;&amp;gt;&amp;gt; duplicating&lt;br/&gt;&amp;gt;&amp;gt; the asset across outputs, as signature verification would fail.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In terms of achieving this level of binding within the Taro tree itself,&lt;br/&gt;&amp;gt;&amp;gt; I can&lt;br/&gt;&amp;gt;&amp;gt; think of three options:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   1. Require the Taro commitment to be in the first/last position within&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;   (fully sorted?) Tapscript tree, and also require its sibling to be the&lt;br/&gt;&amp;gt;&amp;gt; hash&lt;br/&gt;&amp;gt;&amp;gt;   of some set string (all zeroes or w/e). We&amp;#39;d require the sibling to the&lt;br/&gt;&amp;gt;&amp;gt; empty&lt;br/&gt;&amp;gt;&amp;gt;   as the tapscript hashes are sorted before hashing so you sort of lose&lt;br/&gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;   final ordering information.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   2. Include the position of the Taro commitment within the tapscript tree&lt;br/&gt;&amp;gt;&amp;gt;   within the sighash digest (basically the way the single input in the&lt;br/&gt;&amp;gt;&amp;gt; virtual&lt;br/&gt;&amp;gt;&amp;gt;   transaction is created from the TLV structure).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   3. Include the position of the Taro commitment within the tapscript&lt;br/&gt;&amp;gt;&amp;gt; tree as&lt;br/&gt;&amp;gt;&amp;gt;   part of the message that&amp;#39;s hashed to derive asset IDs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; AFAICT, #1 resolves the issue entirely, #2 renders transfers outside of&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; canonical history invalid, and #2 minds hte asset ID to the initial&lt;br/&gt;&amp;gt;&amp;gt; position&lt;br/&gt;&amp;gt;&amp;gt; meaning you can track a canonical lineage from the very start.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Finally, let me conclude with two questions. Could you clarify the&lt;br/&gt;&amp;gt;&amp;gt; purpose of&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; the sparse merkle tree in your design?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Sure, it does a few things:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * Non-inclusion proofs so I can do things like prove to your I&amp;#39;m no&lt;br/&gt;&amp;gt;&amp;gt; longer&lt;br/&gt;&amp;gt;&amp;gt;     committing to my 1-of-1 holographic beefzard card when we swap.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * The key/tree structure means that the tree is history independent,&lt;br/&gt;&amp;gt;&amp;gt; meaning&lt;br/&gt;&amp;gt;&amp;gt;     that if you and I insert the same things into the tree in a different&lt;br/&gt;&amp;gt;&amp;gt;     order, we&amp;#39;ll get the same root hash. This is useful for things like&lt;br/&gt;&amp;gt;&amp;gt;     tracking all the issuance events for a given asset, or allowing two&lt;br/&gt;&amp;gt;&amp;gt;     entities to sync their knowledge/history of a single asset, or a set&lt;br/&gt;&amp;gt;&amp;gt; of&lt;br/&gt;&amp;gt;&amp;gt;     assets.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * Each asset/script mapping to a unique location within the tree means&lt;br/&gt;&amp;gt;&amp;gt; it&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;     easy to ensure uniqueness of certain items/commitments (not possible&lt;br/&gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt;     commit to the same asset ID twice in the tree as an example).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;   * The merkle-sum trait means I that validation is made simpler, as you&lt;br/&gt;&amp;gt;&amp;gt; just&lt;br/&gt;&amp;gt;&amp;gt;     check that the input&#43;output commitment sum to the same value, and I&lt;br/&gt;&amp;gt;&amp;gt; can&lt;br/&gt;&amp;gt;&amp;gt;     also verify that if we&amp;#39;re swapping, then you aren&amp;#39;t committing to more&lt;br/&gt;&amp;gt;&amp;gt;     units that exist (so I make sure I don&amp;#39;t get an invalid split).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; And the second question – when transferring Taro token ownership from&lt;br/&gt;&amp;gt;&amp;gt; one&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Bitcoin UTXO to another, do you generate a new UTXO for the recipient&lt;br/&gt;&amp;gt;&amp;gt; or do&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; you support the ability to &amp;#34;teleport&amp;#34; the tokens to an existing UTXO&lt;br/&gt;&amp;gt;&amp;gt; like how&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; RGB does it? If the latter, have you given consideration to timing&lt;br/&gt;&amp;gt;&amp;gt; issues&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; that might occur when someone sends tokens to an existing UTXO that&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; simultaneously happens to get spent by the owner?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So for interactive transfers, the UTXOs generated as just the ones part&lt;br/&gt;&amp;gt;&amp;gt; of the&lt;br/&gt;&amp;gt;&amp;gt; MIMO transaction. When sending via the address format, a new non-dust&lt;br/&gt;&amp;gt;&amp;gt; output is&lt;br/&gt;&amp;gt;&amp;gt; created which holds the new commitment, and uses an internal key provided&lt;br/&gt;&amp;gt;&amp;gt; by&lt;br/&gt;&amp;gt;&amp;gt; the receiver, so only they can move the UTXO. Admittedly, I&amp;#39;m not&lt;br/&gt;&amp;gt;&amp;gt; familiar with&lt;br/&gt;&amp;gt;&amp;gt; how the RGB &amp;#34;teleport&amp;#34; technique works, I checked out some slide decks a&lt;br/&gt;&amp;gt;&amp;gt; while&lt;br/&gt;&amp;gt;&amp;gt; back, but they were mostly about all the new components they were&lt;br/&gt;&amp;gt;&amp;gt; creating and&lt;br/&gt;&amp;gt;&amp;gt; their milestone of 1 million lines of code. Can you point me to a coherent&lt;br/&gt;&amp;gt;&amp;gt; explanation of the technique? I&amp;#39;d love to compare/contrast so we can&lt;br/&gt;&amp;gt;&amp;gt; analyze&lt;br/&gt;&amp;gt;&amp;gt; the diff tradeoffs being made here.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks for an initial round of feedback/analysis, I&amp;#39;ll be updating the&lt;br/&gt;&amp;gt;&amp;gt; draft&lt;br/&gt;&amp;gt;&amp;gt; over the next few days to better spell things out and particularly that&lt;br/&gt;&amp;gt;&amp;gt; commitment/sighash uniqueness trait.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://twitter.com/roasbeef/status/1330654936074371073?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&#34;&gt;https://twitter.com/roasbeef/status/1330654936074371073?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://twitter.com/roasbeef/status/1330692571736117249?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&#34;&gt;https://twitter.com/roasbeef/status/1330692571736117249?s=20&amp;amp;t=feV0kWAjJ6MTQlFm06tSxA&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221103/a53b523d/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221103/a53b523d/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T23:16:37Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxu04v5m76lllj2zcnhde7kqkvn5e3xmulpxcawue9crn9vcp9m7gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9735jj84</id>
    
      <title type="html">📅 Original date posted:2022-10-27 📝 Original message:Hi, ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxu04v5m76lllj2zcnhde7kqkvn5e3xmulpxcawue9crn9vcp9m7gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9735jj84" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqswvqaan0a50phhz9tn67ls6z0u8lnacga8rjjl34kscr6pzadgwtqg443wg&#39;&gt;nevent1q…43wg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-27&lt;br/&gt;📝 Original message:Hi, Greg.&lt;br/&gt;&lt;br/&gt;I find this proposal super interesting, and IIUC something that seems&lt;br/&gt;fairly &amp;#34;safe&amp;#34; to allow (assuming V3).&lt;br/&gt;&lt;br/&gt;For LN having the commitment transaction pay a non-zero fee is a cause for&lt;br/&gt;a lot of complexity in the channel state machine. Something like this would&lt;br/&gt;remove a lot of edge cases and add more flexibility around adding HTLCs.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Thu, Oct 20, 2022 at 3:42 PM Greg Sanders via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; So it doesn&amp;#39;t look like I&amp;#39;m ignoring a good question:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; No solid noninteractive ideas, unless we get some very flexible sighash&lt;br/&gt;&amp;gt; softfork. Interactively, I think you can get collaborative fee bumps under&lt;br/&gt;&amp;gt; the current consensus regime and ephemeral anchors. The child will just be&lt;br/&gt;&amp;gt; built with inputs from different people.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Wed, Oct 19, 2022 at 11:12 AM James O&amp;#39;Beirne &amp;lt;james.obeirne at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m also very happy to see this proposal, since it gets us closer to&lt;br/&gt;&amp;gt;&amp;gt; having a mechanism that allows the contribution to feerate in an&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;unauthenticated&amp;#34; way, which seems to be a very helpful feature for vaults&lt;br/&gt;&amp;gt;&amp;gt; and other contracting protocols.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; One possible advantage of the sponsors interface -- and I&amp;#39;m curious for&lt;br/&gt;&amp;gt;&amp;gt; your input here Greg -- is that with sponsors, assuming we relaxed the &amp;#34;one&lt;br/&gt;&amp;gt;&amp;gt; sponsor per sponsoree&amp;#34; constraint, multiple uncoordinated parties can&lt;br/&gt;&amp;gt;&amp;gt; collaboratively bump a tx&amp;#39;s feerate. A simple example would be a batch&lt;br/&gt;&amp;gt;&amp;gt; withdrawal from an exchange could be created with a low feerate, and then&lt;br/&gt;&amp;gt;&amp;gt; multiple users with a vested interest of expedited confirmation could all&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;chip in&amp;#34; to raise the feerate with multiple sponsor transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Having a single ephemeral output seems to create a situation where a&lt;br/&gt;&amp;gt;&amp;gt; single UTXO has to shoulder the burden of CPFPing a package. Is there some&lt;br/&gt;&amp;gt;&amp;gt; way we could (possibly later) amend the ephemeral anchor interface to allow&lt;br/&gt;&amp;gt;&amp;gt; for this kind of collaborative sponsoring? Could you maybe see &amp;#34;chained&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; ephemeral anchors that would allow this?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Tue, Oct 18, 2022 at 12:52 PM Jeremy Rubin via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Excellent proposal and I agree it does capture much of the spirit of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; sponsors w.r.t. how they might be used for V3 protocols.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The only drawbacks I see is they don&amp;#39;t work for lower tx version&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; contracts, so there&amp;#39;s still something to be desired there, and that the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; requirement to sweep the output must be incentive compatible for the miner,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; or else they won&amp;#39;t enforce it (pass the buck onto the future bitcoiners).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The Ephemeral UTXO concept can be a consensus rule (see&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://rubin.io/public/pdfs/multi-txn-contracts.pdf&#34;&gt;https://rubin.io/public/pdfs/multi-txn-contracts.pdf&lt;/a&gt; &amp;#34;Intermediate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; UTXO&amp;#34;) we add later on in lieu of managing them by incentive, so maybe it&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a cleanup one can punt.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; One question I have is if V3 is designed for lightning, and this is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; designed for lightning, is there any sense in requiring these outputs for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; v3? That might help with e.g. anonymity set, as well as potentially keep&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the v3 surface smaller.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Oct 18, 2022 at 11:51 AM Greg Sanders via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; does that effectively mark output B as unspendable once the child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; gets confirmed?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Not at all. It&amp;#39;s a normal spend like before, since the parent has been&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; confirmed. It&amp;#39;s completely unrestricted, not being bound to any&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; V3/ephemeral anchor restrictions on size, version, etc.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Oct 18, 2022 at 11:47 AM Arik Sosman via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi Greg,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Thank you very much for sharing your proposal!&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I think there&amp;#39;s one thing about the second part of your proposal that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I&amp;#39;m missing. Specifically, assuming the scenario of a v3 transaction with&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; three outputs, A, B, and the ephemeral anchor OP_TRUE. If a child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction spends A and OP_TRUE, does that effectively mark output B as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unspendable once the child gets confirmed? If so, isn&amp;#39;t the implication&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; therefore that to safely spend a transaction with an ephemeral anchor, all&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; outputs must be spent? Thanks!&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Best,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Arik&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Oct 18, 2022, at 6:52 AM, Greg Sanders via bitcoin-dev wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hello Everyone,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Following up on the &amp;#34;V3 Transaction&amp;#34; discussion here&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-September/020937.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-September/020937.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; , I would like to elaborate a bit further on some potential follow-on work&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; that would make pinning severely constrained in many setups].&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; V3 transactions may solve bip125 rule#3 and rule#5 pinning attacks&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; under some constraints[0]. This means that when a replacement is to be made&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and propagated, it costs the expected amount of fees to do so. This is a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; great start. What&amp;#39;s left in this subset of pinning is *package limit*&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; pinning. In other words, a fee-paying transaction cannot enter the mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; due to the existing mempool package it is being added to already being too&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; large in count or vsize.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Zooming into the V3 simplified scenario for sake of discussion, though&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this problem exists in general today:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; V3 transactions restrict the package limit of a V3 package to one&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; parent and one child. If the parent transaction includes two outputs which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can be immediately spent by separate parties, this allows one party to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; disallow a spend from the other. In Gloria&amp;#39;s proposal for ln-penalty, this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is worked around by reducing the number of anchors per commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction to 1, and each version of the commitment transaction has a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unique party&amp;#39;s key on it. The honest participant can spend their version&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; with their anchor and package RBF the other commitment transaction safely.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; What if there&amp;#39;s only one version of the commitment transaction, such&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; as in other protocols like duplex payment channels, eltoo? What about multi&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; party payments?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; In the package RBF proposal, if the parent transaction is identical to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; an existing transaction in the mempool, the parent will be detected and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; removed from the package proposal. You are then left with a single V3 child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction, which is then proposed for entry into the mempool. In the case&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; of another parent output already being spent, this is simply rejected,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; regardless of feerate of the new child.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I have two proposed solutions, of which I strongly prefer the latter:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1) Expand a carveout for &amp;#34;sibling eviction&amp;#34;, where if the new child is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; paying &amp;#34;enough&amp;#34; to bump spends from the same parent, it knocks its sibling&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; out of the mempool and takes the one child slot. This would solve it, but&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is a new eviction paradigm that would need to be carefully worked through.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2) Ephemeral Anchors (my real policy-only proposal)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Ephemeral Anchors is a term which means an output is watermarked as an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; output that MUST be spent in a V3 package. We mark this anchor by being the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bare script `OP_TRUE` and of course make these outputs standard to relay&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and spend with empty witness data.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Also as a simplifying assumption, we require the parent transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; with such an output to be 0-fee. This makes mempool reasoning simpler in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; case the child-spend is somehow evicted, guaranteeing the parent will be as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; well.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Implications:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; a) If the ephemeral anchor MUST be spent, we can allow *any* value,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; even dust, even 0, without worrying about bloating the utxo set. We relax&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this policy for maximum smart contract flexibility and specification&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; simplicity..&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; b) Since this anchor MUST be spent, any spending of other outputs in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the same parent transaction MUST directly double-spend prior spends of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ephemeral anchor. This causes the 1 block CSV timelock on outputs to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; removed in these situations. This greatly magnifies composability of smart&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; contracts, as now we can do things like safely splice directly into new&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; channels, into statechains, your custodial wallet account, your cold&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; wallet, wherever, without requiring other wallets to support arbitrary&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; scripts. Also it hurts that 1 CSV time locked scripts may not be miniscript&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; compatible to begin with...&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; c) *Anyone* can bump the transaction, without any transaction key&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; material. This is essentially achieving Jeremy&amp;#39;s Transaction Sponsors (&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-September/018168.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-September/018168.html&lt;/a&gt;)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; proposal without consensus changes. As long as someone gets a fully signed&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; parent, they can execute a bump with minimal wallet tooling. If a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction author doesn’t want a “sponsor”, do not include the output.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; d) Lightning Carve-out(&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-October/002240.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-October/002240.html&lt;/a&gt;)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is superseded by this logic, as we are not restricted to two immediately&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; spendable output scenarios. In its place, robust multi-party fee bumping is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; possible.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; e) This also benefits more traditional wallet scenarios, as change&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; outputs can no longer be pinned, and RBF/CPFP becomes robust. Payees in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; simple spends cannot pin you. Batched payouts become a lot less painful.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This was one of the motivating use cases that created the term “pinning” in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the first place(&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015717.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015717.html&lt;/a&gt;),&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; even if LN/L2 discussion has largely overtaken it due to HTLC theft risks.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Open Question(s):&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    1.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    If we allow non-zero value in ephemeral outputs, does this open up&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    a MEV we are worried about? Wallets should toss all the value directly to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    fees, and add their own additional fees on top, otherwise miners have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    incentive to make the smallest utxo burn transaction to claim those funds.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    They just confirmed your parent transaction anyways, so do we care?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    2.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    SIGHASH_GROUP like constructs would allow uncommitted ephemeral&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    anchors to be added at spend time, depending on spending requirements.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    SIGHASH_SINGLE already allows this.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hopefully this gives people something to consider as we move forward&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in thinking about mempool design within the constraints we have today.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Greg&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 0: With V3 transactions where you have &amp;#34;veto power&amp;#34; over all the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; inputs in that transaction. Therefore something like ANYONECANPAY is still&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; broken. We need a more complex solution, which I’m punting for the sake of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; progress.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221027/c66de0f3/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221027/c66de0f3/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T23:15:36Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxe6x2auw0t94rr4w7mj76k398xr3e35n27eahtvq2nlerjnactagzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9750cstz</id>
    
      <title type="html">📅 Original date posted:2019-10-30 📝 Original message:On ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxe6x2auw0t94rr4w7mj76k398xr3e35n27eahtvq2nlerjnactagzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9750cstz" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9pg0plupyxp98lta2x6kv5u6gurv0srcs49qvzrws8c03ec52kdsmxsu2n&#39;&gt;nevent1q…su2n&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-30&lt;br/&gt;📝 Original message:On Mon, Oct 28, 2019 at 6:16 PM David A. Harding &amp;lt;dave at dtrt.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; A parent transaction near the limit of 100,000 vbytes could have almost&lt;br/&gt;&amp;gt; 10,000 outputs paying OP_TRUE (10 vbytes per output).  If the children&lt;br/&gt;&amp;gt; were limited to 10,000 vbytes each (the current max carve-out size),&lt;br/&gt;&amp;gt; that allows relaying 100 mega-vbytes or nearly 400 MB data size (larger&lt;br/&gt;&amp;gt; than the default maximum mempool size in Bitcoin Core).&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks, Dave, I wasn&amp;#39;t aware the limits would allow this many outputs. And&lt;br/&gt;as your calculation shows, this opens up the potential for free relay of&lt;br/&gt;large amounts of data.&lt;br/&gt;&lt;br/&gt;We could start special casing to only allow this for &amp;#34;LN commitment-like&amp;#34;&lt;br/&gt;transactions, but this would be application specific changes, and your&lt;br/&gt;calculation shows that even with the BOLT2 numbers there still exists cases&lt;br/&gt;with a large number of children.&lt;br/&gt;&lt;br/&gt;We are moving forward with adding a 1 block delay to all outputs to utilize&lt;br/&gt;the current carve-out rule, and the changes aren&amp;#39;t that bad. See Joost&amp;#39;s&lt;br/&gt;post in &amp;#34;[PATCH] First draft of option_simplfied_commitment&amp;#34;&lt;br/&gt;&lt;br/&gt;- Johan&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/20191030/bc2a90f3/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191030/bc2a90f3/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:21:27Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsxcl6xwf9vewy5fehcea4apta60mctdtpqzl8lk0f8z5efl53sfyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97nwv532</id>
    
      <title type="html">📅 Original date posted:2019-10-28 📝 Original message:&amp;gt; ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsxcl6xwf9vewy5fehcea4apta60mctdtpqzl8lk0f8z5efl53sfyszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97nwv532" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszmfxkfj8gr44ntsyccmq7mlvnprrfku76rxngx9zs4atmq68dkeqt77x3g&#39;&gt;nevent1q…7x3g&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-28&lt;br/&gt;📝 Original message:&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don’te see how? Let’s imagine Party A has two spendable outputs, now&lt;br/&gt;&amp;gt; they stuff the package size on one of their spendable outlets until it is&lt;br/&gt;&amp;gt; right at the limit, add one more on their other output (to meet the&lt;br/&gt;&amp;gt; Carve-Out), and now Party B can’t do anything.&lt;br/&gt;&lt;br/&gt;Matt: With the proposed change, party B would always be able to add a child&lt;br/&gt;to its output, regardless of what games party A is playing.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thanks for the explanation, Jeremy!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; In terms of relay cost, if an ancestor can be replaced, it will invalidate&lt;br/&gt;&amp;gt; all it&amp;#39;s children, meaning that no one paid for that broadcasting. This can&lt;br/&gt;&amp;gt; be fixed by appropriately assessing Replace By Fee update fees to&lt;br/&gt;&amp;gt; encapsulate all descendants, but there are some tricky edge cases that make&lt;br/&gt;&amp;gt; this non-obvious to do.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Relay cost is the obvious problem with just naively removing all limits.&lt;br/&gt;Relaxing the current rules by allowing to add a child to each output as&lt;br/&gt;long as it has a single unconfirmed parent would still only allow free&lt;br/&gt;relay of O(size of parent) extra data (which might not be that bad? Similar&lt;br/&gt;to the carve-out rule we could put limits on the child size). This would be&lt;br/&gt;enough for the current LN use case (increasing fee of commitment tx), but&lt;br/&gt;not for OP_SECURETHEBAG I guess, as you need the tree of children, as you&lt;br/&gt;mention.&lt;br/&gt;&lt;br/&gt;I imagine walking the mempool wouldn&amp;#39;t change much, as you would only have&lt;br/&gt;one extra child per output. But here I&amp;#39;m just speculating, as I don&amp;#39;t know&lt;br/&gt;the code well enough know what the diff would look like.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; OP_SECURETHEBAG can help with the LN issue by putting all HTLCS into a&lt;br/&gt;&amp;gt; tree where they are individualized leaf nodes with a preceding CSV. Then,&lt;br/&gt;&amp;gt; the above fix would ensure each HTLC always has time to close properly as&lt;br/&gt;&amp;gt; they would have individualized lockpoints. This is desirable for some&lt;br/&gt;&amp;gt; additional reasons and not for others, but it should &amp;#34;work&amp;#34;.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;This is interesting for an LN commitment! You could really hide every&lt;br/&gt;output of the commitment within OP_STB, which could either allow bypassing&lt;br/&gt;the fee-pinning attack entirely (if the output cannot be spent unconfirmed)&lt;br/&gt;or adding fees to the commitment using SIGHASH_SINGLE|ANYONECANPAY.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Sun, Oct 27, 2019 at 8:13 PM Jeremy &amp;lt;jlrubin at mit.edu&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Johan,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The issues with mempool limits for OP_SECURETHEBAG are related, but have&lt;br/&gt;&amp;gt; distinct solutions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are two main categories of mempool issues at stake. One is relay&lt;br/&gt;&amp;gt; cost, the other is mempool walking.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In terms of relay cost, if an ancestor can be replaced, it will invalidate&lt;br/&gt;&amp;gt; all it&amp;#39;s children, meaning that no one paid for that broadcasting. This can&lt;br/&gt;&amp;gt; be fixed by appropriately assessing Replace By Fee update fees to&lt;br/&gt;&amp;gt; encapsulate all descendants, but there are some tricky edge cases that make&lt;br/&gt;&amp;gt; this non-obvious to do.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The other issue is walking the mempool -- many of the algorithms we use in&lt;br/&gt;&amp;gt; the mempool can be N log N or N^2 in the number of descendants. (simple&lt;br/&gt;&amp;gt; example: an input chain of length N to a fan out of N outputs that are all&lt;br/&gt;&amp;gt; spent, is O(N^2) to look up ancestors per-child, unless we&amp;#39;re caching).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The other sort of walking issue is where the indegree or outdegree for a&lt;br/&gt;&amp;gt; transaction is high. Then when we are computing descendants or ancestors we&lt;br/&gt;&amp;gt; will need to visit it multiple times. To avoid re-expanding a node, we&lt;br/&gt;&amp;gt; currently cache it with a set. This uses O(N) extra memory and makes O(N&lt;br/&gt;&amp;gt; Log N) (we use std::set not unordered_set) comparisons.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I just opened a PR which should help with some of the walking issues by&lt;br/&gt;&amp;gt; allowing us to cheaply cache which nodes we&amp;#39;ve visited on a run. It makes a&lt;br/&gt;&amp;gt; lot of previously O(N log N) stuff O(N) and doesn&amp;#39;t allocate as much new&lt;br/&gt;&amp;gt; memory. See: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/17268&#34;&gt;https://github.com/bitcoin/bitcoin/pull/17268&lt;/a&gt;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Now, for OP_SECURETHEBAG we want a particular property that is very&lt;br/&gt;&amp;gt; different from with lightning htlcs (as is). We want that an unlimited&lt;br/&gt;&amp;gt; number of child OP_SECURETHEBAG txns may extend from a confirmed&lt;br/&gt;&amp;gt; OP_SECURETHEBAG, and then at the leaf nodes, we want the same rule as&lt;br/&gt;&amp;gt; lightning (one dangling unconfirmed to permit channels).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; OP_SECURETHEBAG can help with the LN issue by putting all HTLCS into a&lt;br/&gt;&amp;gt; tree where they are individualized leaf nodes with a preceding CSV. Then,&lt;br/&gt;&amp;gt; the above fix would ensure each HTLC always has time to close properly as&lt;br/&gt;&amp;gt; they would have individualized lockpoints. This is desirable for some&lt;br/&gt;&amp;gt; additional reasons and not for others, but it should &amp;#34;work&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; --&lt;br/&gt;&amp;gt; @JeremyRubin &amp;lt;&lt;a href=&#34;https://twitter.com/JeremyRubin&amp;gt&#34;&gt;https://twitter.com/JeremyRubin&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt; &amp;lt;&lt;a href=&#34;https://twitter.com/JeremyRubin&amp;gt&#34;&gt;https://twitter.com/JeremyRubin&amp;gt&lt;/a&gt;;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Fri, Oct 25, 2019 at 10:31 AM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I don’te see how? Let’s imagine Party A has two spendable outputs, now&lt;br/&gt;&amp;gt;&amp;gt; they stuff the package size on one of their spendable outlets until it is&lt;br/&gt;&amp;gt;&amp;gt; right at the limit, add one more on their other output (to meet the&lt;br/&gt;&amp;gt;&amp;gt; Carve-Out), and now Party B can’t do anything.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Oct 24, 2019, at 21:05, Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ﻿&lt;br/&gt;&amp;gt;&amp;gt; It essentially changes the rule to always allow CPFP-ing the commitment&lt;br/&gt;&amp;gt;&amp;gt; as long as there is an output available without any descendants. It changes&lt;br/&gt;&amp;gt;&amp;gt; the commitment from &amp;#34;you always need at least, and exactly, one non-CSV&lt;br/&gt;&amp;gt;&amp;gt; output per party. &amp;#34; to &amp;#34;you always need at least one non-CSV output per&lt;br/&gt;&amp;gt;&amp;gt; party. &amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I realize these limits are there for a reason though, but I&amp;#39;m wondering&lt;br/&gt;&amp;gt;&amp;gt; if could relax them. Also now that jeremyrubin has expressed problems with&lt;br/&gt;&amp;gt;&amp;gt; the current mempool limits.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Thu, Oct 24, 2019 at 11:25 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I may be missing something, but I&amp;#39;m not sure how this changes anything?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If you have a commitment transaction, you always need at least, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; exactly, one non-CSV output per party. The fact that there is a size&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; limitation on the transaction that spends for carve-out purposes only&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; effects how many other inputs/outputs you can add, but somehow I doubt&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; its ever going to be a large enough number to matter.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; On 10/24/19 1:49 PM, Johan Torås Halseth wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; In an attempt to pave the way for more robust CPFP of on-chain&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; contracts&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; (Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; on&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; an implementation of a new commitment format for utilizing the Bring&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Your Own Fees strategy using CPFP, I’m wondering if the special case&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; rule should have been relaxed a bit, to avoid the need for adding a 1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; CSV to all outputs (in case of Lightning this means HTLC scripts would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; need to be changed to add the CSV delay).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Instead, what about letting the rule be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; The last transaction which is added to a package of dependent&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; transactions in the mempool must:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;   * Have no more than one unconfirmed parent.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; This would of course allow adding a large transaction to each output of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; the unconfirmed parent, which in effect would allow an attacker to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; exceed the MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; this a problem with the current mempool acceptance code in bitcoind? I&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; would imagine evicting transactions based on feerate when the max&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; mempool size is met handles this, but I’m asking since it seems like&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; there has been several changes to the acceptance code and eviction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; policy since the limit was first introduced.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; - Johan&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; &amp;lt;mailto:rusty at rustcorp.com.au&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Matt Corallo &amp;lt;lf-lists at mattcorallo.com&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;lt;mailto:lf-lists at mattcorallo.com&amp;gt;&amp;gt; writes:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; unless the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; next&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; next&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; wasn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     in the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     compatible; more&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;gt; My point was, because of block time variance, even that criteria&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     doesn&amp;#39;t hold up. If you assume a steady flow of new transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     one or two blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     likely to get confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     block variance within a 12 block window, this is a relatively&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; likely&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     scenario.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     [ Digging through old mail. ]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     2.  Ask bitcoind what current expidited fee is (or survey your&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; mempool).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     In this case, if you allow a simpified RBF where &amp;#39;you can replace&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; if&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     old tx isnt&amp;#39;,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     it works.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     We could further restrict it by marking the unilateral close&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; somehow to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; (say,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     5kSipa?) in that case.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Cheers,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Rusty.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &amp;lt;mailto:Lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;     &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191028/92777d7b/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191028/92777d7b/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:21:26Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsdmu0z07awt9nc9yacfdd94f7fxl8zcrf5wway2nndr0c2welme6szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97wy5nqg</id>
    
      <title type="html">📅 Original date posted:2019-10-25 📝 Original message:It ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsdmu0z07awt9nc9yacfdd94f7fxl8zcrf5wway2nndr0c2welme6szyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97wy5nqg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9me4z8r6nxny49m5a3y274m9m32ac95ld6juy76d5pzg7dhk06aqx36yep&#39;&gt;nevent1q…6yep&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-25&lt;br/&gt;📝 Original message:It essentially changes the rule to always allow CPFP-ing the commitment as&lt;br/&gt;long as there is an output available without any descendants. It changes&lt;br/&gt;the commitment from &amp;#34;you always need at least, and exactly, one non-CSV&lt;br/&gt;output per party. &amp;#34; to &amp;#34;you always need at least one non-CSV output per&lt;br/&gt;party. &amp;#34;&lt;br/&gt;&lt;br/&gt;I realize these limits are there for a reason though, but I&amp;#39;m wondering if&lt;br/&gt;could relax them. Also now that jeremyrubin has expressed problems with the&lt;br/&gt;current mempool limits.&lt;br/&gt;&lt;br/&gt;On Thu, Oct 24, 2019 at 11:25 PM Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; I may be missing something, but I&amp;#39;m not sure how this changes anything?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you have a commitment transaction, you always need at least, and&lt;br/&gt;&amp;gt; exactly, one non-CSV output per party. The fact that there is a size&lt;br/&gt;&amp;gt; limitation on the transaction that spends for carve-out purposes only&lt;br/&gt;&amp;gt; effects how many other inputs/outputs you can add, but somehow I doubt&lt;br/&gt;&amp;gt; its ever going to be a large enough number to matter.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Matt&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On 10/24/19 1:49 PM, Johan Torås Halseth wrote:&lt;br/&gt;&amp;gt; &amp;gt; Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;&amp;gt; &amp;gt; 0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; In an attempt to pave the way for more robust CPFP of on-chain contracts&lt;br/&gt;&amp;gt; &amp;gt; (Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked on&lt;br/&gt;&amp;gt; &amp;gt; an implementation of a new commitment format for utilizing the Bring&lt;br/&gt;&amp;gt; &amp;gt; Your Own Fees strategy using CPFP, I’m wondering if the special case&lt;br/&gt;&amp;gt; &amp;gt; rule should have been relaxed a bit, to avoid the need for adding a 1&lt;br/&gt;&amp;gt; &amp;gt; CSV to all outputs (in case of Lightning this means HTLC scripts would&lt;br/&gt;&amp;gt; &amp;gt; need to be changed to add the CSV delay).&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Instead, what about letting the rule be&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The last transaction which is added to a package of dependent&lt;br/&gt;&amp;gt; &amp;gt; transactions in the mempool must:&lt;br/&gt;&amp;gt; &amp;gt;   * Have no more than one unconfirmed parent.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; This would of course allow adding a large transaction to each output of&lt;br/&gt;&amp;gt; &amp;gt; the unconfirmed parent, which in effect would allow an attacker to&lt;br/&gt;&amp;gt; &amp;gt; exceed the MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is&lt;br/&gt;&amp;gt; &amp;gt; this a problem with the current mempool acceptance code in bitcoind? I&lt;br/&gt;&amp;gt; &amp;gt; would imagine evicting transactions based on feerate when the max&lt;br/&gt;&amp;gt; &amp;gt; mempool size is met handles this, but I’m asking since it seems like&lt;br/&gt;&amp;gt; &amp;gt; there has been several changes to the acceptance code and eviction&lt;br/&gt;&amp;gt; &amp;gt; policy since the limit was first introduced.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; - Johan&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&lt;br/&gt;&amp;gt; &amp;gt; &amp;lt;mailto:rusty at rustcorp.com.au&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Matt Corallo &amp;lt;lf-lists at mattcorallo.com&lt;br/&gt;&amp;gt; &amp;gt;     &amp;lt;mailto:lf-lists at mattcorallo.com&amp;gt;&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth, unless&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the&lt;br/&gt;&amp;gt; next&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie.&lt;br/&gt;&amp;gt; next&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package wasn&amp;#39;t&lt;br/&gt;&amp;gt; &amp;gt;     in the&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive&lt;br/&gt;&amp;gt; &amp;gt;     compatible; more&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &amp;gt; My point was, because of block time variance, even that criteria&lt;br/&gt;&amp;gt; &amp;gt;     doesn&amp;#39;t hold up. If you assume a steady flow of new transactions and&lt;br/&gt;&amp;gt; &amp;gt;     one or two blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t&lt;br/&gt;&amp;gt; &amp;gt;     likely to get confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given&lt;br/&gt;&amp;gt; &amp;gt;     block variance within a 12 block window, this is a relatively likely&lt;br/&gt;&amp;gt; &amp;gt;     scenario.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     [ Digging through old mail. ]&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt; &amp;gt;     2.  Ask bitcoind what current expidited fee is (or survey your&lt;br/&gt;&amp;gt; mempool).&lt;br/&gt;&amp;gt; &amp;gt;     3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt; &amp;gt;     4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     In this case, if you allow a simpified RBF where &amp;#39;you can replace if&lt;br/&gt;&amp;gt; &amp;gt;     1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3.&lt;br/&gt;&amp;gt; &amp;gt;     old tx isnt&amp;#39;,&lt;br/&gt;&amp;gt; &amp;gt;     it works.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     We could further restrict it by marking the unilateral close somehow&lt;br/&gt;&amp;gt; to&lt;br/&gt;&amp;gt; &amp;gt;     say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight (say,&lt;br/&gt;&amp;gt; &amp;gt;     5kSipa?) in that case.&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     Cheers,&lt;br/&gt;&amp;gt; &amp;gt;     Rusty.&lt;br/&gt;&amp;gt; &amp;gt;     _______________________________________________&lt;br/&gt;&amp;gt; &amp;gt;     Lightning-dev mailing list&lt;br/&gt;&amp;gt; &amp;gt;     Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &amp;gt;     &amp;lt;mailto:Lightning-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;     &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191025/58a3d7b8/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191025/58a3d7b8/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:21:24Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs24qdk6z43fv40wzclhj84n6phfxk6009x4dlzf5az7c3ffrdh74gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gqcx5e</id>
    
      <title type="html">📅 Original date posted:2019-10-24 📝 Original ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs24qdk6z43fv40wzclhj84n6phfxk6009x4dlzf5az7c3ffrdh74gzyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97gqcx5e" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsf42u3rcm65lpckv8h9xfhw25wwmfvr3kdu5af54ezufdmux2wl0g4xzw35&#39;&gt;nevent1q…zw35&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-24&lt;br/&gt;📝 Original message:Reviving this old thread now that the recently released RC for bitcoind&lt;br/&gt;0.19 includes the above mentioned carve-out rule.&lt;br/&gt;&lt;br/&gt;In an attempt to pave the way for more robust CPFP of on-chain contracts&lt;br/&gt;(Lightning commitment transactions), the carve-out rule was added in&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt;. However, having worked on an&lt;br/&gt;implementation of a new commitment format for utilizing the Bring Your Own&lt;br/&gt;Fees strategy using CPFP, I’m wondering if the special case rule should&lt;br/&gt;have been relaxed a bit, to avoid the need for adding a 1 CSV to all&lt;br/&gt;outputs (in case of Lightning this means HTLC scripts would need to be&lt;br/&gt;changed to add the CSV delay).&lt;br/&gt;&lt;br/&gt;Instead, what about letting the rule be&lt;br/&gt;&lt;br/&gt;The last transaction which is added to a package of dependent&lt;br/&gt;transactions in the mempool must:&lt;br/&gt;  * Have no more than one unconfirmed parent.&lt;br/&gt;&lt;br/&gt;This would of course allow adding a large transaction to each output of the&lt;br/&gt;unconfirmed parent, which in effect would allow an attacker to exceed the&lt;br/&gt;MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is this a problem&lt;br/&gt;with the current mempool acceptance code in bitcoind? I would imagine&lt;br/&gt;evicting transactions based on feerate when the max mempool size is met&lt;br/&gt;handles this, but I’m asking since it seems like there has been several&lt;br/&gt;changes to the acceptance code and eviction policy since the limit was&lt;br/&gt;first introduced.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Matt Corallo &amp;lt;lf-lists at mattcorallo.com&amp;gt; writes:&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Thus, even if you imagine a steady-state mempool growth, unless the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;#34;near the top of the mempool&amp;#34; criteria is &amp;#34;near the top of the next&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; block&amp;#34; (which is obviously *not* incentive-compatible)&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; I was defining &amp;#34;top of mempool&amp;#34; as &amp;#34;in the first 4 MSipa&amp;#34;, ie. next&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; block, and assumed you&amp;#39;d only allow RBF if the old package wasn&amp;#39;t in the&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; top and the replacement would be.  That seems incentive compatible; more&lt;br/&gt;&amp;gt; &amp;gt;&amp;gt; than the current scheme?&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; My point was, because of block time variance, even that criteria doesn&amp;#39;t&lt;br/&gt;&amp;gt; hold up. If you assume a steady flow of new transactions and one or two&lt;br/&gt;&amp;gt; blocks come in &amp;#34;late&amp;#34;, suddenly &amp;#34;top 4MWeight&amp;#34; isn&amp;#39;t likely to get&lt;br/&gt;&amp;gt; confirmed until a few blocks come in &amp;#34;early&amp;#34;. Given block variance within a&lt;br/&gt;&amp;gt; 12 block window, this is a relatively likely scenario.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [ Digging through old mail. ]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Doesn&amp;#39;t really matter.  Lightning close algorithm would be:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.  Give bitcoind unileratal close.&lt;br/&gt;&amp;gt; 2.  Ask bitcoind what current expidited fee is (or survey your mempool).&lt;br/&gt;&amp;gt; 3.  Give bitcoind child &amp;#34;push&amp;#34; tx at that total feerate.&lt;br/&gt;&amp;gt; 4.  If next block doesn&amp;#39;t contain unilateral close tx, goto 2.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In this case, if you allow a simpified RBF where &amp;#39;you can replace if&lt;br/&gt;&amp;gt; 1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3. old tx&lt;br/&gt;&amp;gt; isnt&amp;#39;,&lt;br/&gt;&amp;gt; it works.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It allows someone 100k of free tx spam, sure.  But it&amp;#39;s simple.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We could further restrict it by marking the unilateral close somehow to&lt;br/&gt;&amp;gt; say &amp;#34;gonna be pushed&amp;#34; and further limiting the child tx weight (say,&lt;br/&gt;&amp;gt; 5kSipa?) in that case.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Rusty.&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191024/065e650f/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191024/065e650f/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:21:23Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsry9qgwgx4xdq5jm5kjc7dxq8cqmr3m0x3l3awxu59wvek34hj6mczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9775dz4q</id>
    
      <title type="html">📅 Original date posted:2018-05-23 📝 Original ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsry9qgwgx4xdq5jm5kjc7dxq8cqmr3m0x3l3awxu59wvek34hj6mczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r9775dz4q" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsr0tq6dcly52jqxdkn22u565a60lm3hmpf87xlypehpruty2g592gw4etpk&#39;&gt;nevent1q…etpk&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-05-23&lt;br/&gt;📝 Original message:Thanks, Jimpo!&lt;br/&gt;&lt;br/&gt;This is very encouraging, I think. I sorta assumed that separating the&lt;br/&gt;elements into their own sub-filters would hurt the compression a lot more.&lt;br/&gt;Can the compression ratio/false positive rate be tweaked with the&lt;br/&gt;sub-filters in mind?&lt;br/&gt;&lt;br/&gt;With the total size of the separated filters being no larger than the&lt;br/&gt;combined filters, I see no benefit of combined filters? Committing to them&lt;br/&gt;all in the headers would also save space, and we could ensure nodes are&lt;br/&gt;serving all sub-filters.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;On Wed, May 23, 2018 at 9:38 AM, Jim Posen &amp;lt;jim.posen at gmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; So I checked filter sizes (as a proportion of block size) for each of the&lt;br/&gt;&amp;gt; sub-filters. The graph is attached.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As interpretation, the first ~120,000 blocks are so small that the&lt;br/&gt;&amp;gt; Golomb-Rice coding can&amp;#39;t compress the filters that well, which is why the&lt;br/&gt;&amp;gt; filter sizes are so high proportional to the block size. Except for the&lt;br/&gt;&amp;gt; input filter, because the coinbase input is skipped, so many of them have 0&lt;br/&gt;&amp;gt; elements. But after block 120,000 or so, the filter compression converges&lt;br/&gt;&amp;gt; pretty quickly to near the optimal value. The encouraging thing here is&lt;br/&gt;&amp;gt; that if you look at the ratio of the combined size of the separated filters&lt;br/&gt;&amp;gt; vs the size of a filter containing all of them (currently known as the&lt;br/&gt;&amp;gt; basic filter), they are pretty much the same size. The mean of the ratio&lt;br/&gt;&amp;gt; between them after block 150,000 is 99.4%. So basically, not much&lt;br/&gt;&amp;gt; compression efficiently is lost by separating the basic filter into&lt;br/&gt;&amp;gt; sub-filters.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Tue, May 22, 2018 at 5:42 PM, Jim Posen &amp;lt;jim.posen at gmail.com&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; My suggestion was to advertise a bitfield for each filter type the node&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; serves,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; where the bitfield indicates what elements are part of the filters. This&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; essentially&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; removes the notion of decided filter types and instead leaves the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; decision to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; full-nodes.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think it makes more sense to construct entirely separate filters for&lt;br/&gt;&amp;gt;&amp;gt; the different types of elements and allow clients to download only the ones&lt;br/&gt;&amp;gt;&amp;gt; they care about. If there are enough elements per filter, the compression&lt;br/&gt;&amp;gt;&amp;gt; ratio shouldn&amp;#39;t be much worse by splitting them up. This prevents the&lt;br/&gt;&amp;gt;&amp;gt; exponential blowup in the number of filters that you mention, Johan, and it&lt;br/&gt;&amp;gt;&amp;gt; works nicely with service bits for advertising different filter types&lt;br/&gt;&amp;gt;&amp;gt; independently.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So if we created three separate filter types, one for output scripts, one&lt;br/&gt;&amp;gt;&amp;gt; for input outpoints, and one for TXIDs, each signaled with a separate&lt;br/&gt;&amp;gt;&amp;gt; service bit, are people good with that? Or do you think there shouldn&amp;#39;t be&lt;br/&gt;&amp;gt;&amp;gt; a TXID filter at all, Matt? I didn&amp;#39;t include the option of a prev output&lt;br/&gt;&amp;gt;&amp;gt; script filter or rolling that into the block output script filter because&lt;br/&gt;&amp;gt;&amp;gt; it changes the security model (cannot be proven to be correct/incorrect&lt;br/&gt;&amp;gt;&amp;gt; succinctly).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Then there&amp;#39;s the question of whether to separate or combine the headers.&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;d lean towards keeping them separate because it&amp;#39;s simpler that way.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/7df6715a/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180523/7df6715a/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:12:15Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqsw8exvz35whg54wr82v7vxpp3n7lhgtkmg7rz7eujt3du5hmz2klczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97rthaan</id>
    
      <title type="html">📅 Original date posted:2018-05-22 📝 Original message:Maybe ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqsw8exvz35whg54wr82v7vxpp3n7lhgtkmg7rz7eujt3du5hmz2klczyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97rthaan" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsddhd0dkf27zhnangn5j6h9w6eurje5g9dzqjwaygxxdquvuas8fg8cgmyq&#39;&gt;nevent1q…gmyq&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-05-22&lt;br/&gt;📝 Original message:Maybe I didn&amp;#39;t make it clear, but the distinction is that the current track&lt;br/&gt;allocates&lt;br/&gt;one service bit for each &amp;#34;filter type&amp;#34;, where it has to be agreed upon up&lt;br/&gt;front what&lt;br/&gt;elements such a filter type contains.&lt;br/&gt;&lt;br/&gt;My suggestion was to advertise a bitfield for each filter type the node&lt;br/&gt;serves,&lt;br/&gt;where the bitfield indicates what elements are part of the filters. This&lt;br/&gt;essentially&lt;br/&gt;removes the notion of decided filter types and instead leaves the decision&lt;br/&gt;to&lt;br/&gt;full-nodes.&lt;br/&gt;&lt;br/&gt;This would require a &amp;#34;getcftypes&amp;#34; message, of course.&lt;br/&gt;&lt;br/&gt;- Johan&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, May 22, 2018 at 3:16 AM, Olaoluwa Osuntokun &amp;lt;laolu32 at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; What if instead of trying to decide up front which subset of elements&lt;br/&gt;&amp;gt; will&lt;br/&gt;&amp;gt; &amp;gt; be most useful to include in the filters, and the size tradeoff, we let&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; full-node decide which subsets of elements it serves filters for?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is already the case. The current &amp;#34;track&amp;#34; is to add new service bits&lt;br/&gt;&amp;gt; (while we&amp;#39;re in the uncommitted phase) to introduce new fitler types. Light&lt;br/&gt;&amp;gt; clients can then filter out nodes before even connecting to them.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; -- Laolu&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mon, May 21, 2018 at 1:35 AM Johan Torås Halseth &amp;lt;johanth at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Most light wallets will want to download the minimum amount of data&lt;br/&gt;&amp;gt;&amp;gt; required to operate, which means they would ideally download the smallest&lt;br/&gt;&amp;gt;&amp;gt; possible filters containing the subset of elements they need.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; What if instead of trying to decide up front which subset of elements&lt;br/&gt;&amp;gt;&amp;gt; will be most useful to include in the filters, and the size tradeoff, we&lt;br/&gt;&amp;gt;&amp;gt; let the full-node decide which subsets of elements it serves filters for?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For instance, a full node would advertise that it could serve filters for&lt;br/&gt;&amp;gt;&amp;gt; the subsets 110 (txid&#43;script&#43;outpoint), 100 (txid only), 011 (script&#43;outpoint)&lt;br/&gt;&amp;gt;&amp;gt; etc. A light client could then choose to download the minimal filter type&lt;br/&gt;&amp;gt;&amp;gt; covering its needs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The obvious benefit of this would be minimal bandwidth usage for the&lt;br/&gt;&amp;gt;&amp;gt; light client, but there are also some less obvious ones. We wouldn’t have&lt;br/&gt;&amp;gt;&amp;gt; to decide up front what each filter type should contain, only the possible&lt;br/&gt;&amp;gt;&amp;gt; elements a filter can contain (more can be added later without breaking&lt;br/&gt;&amp;gt;&amp;gt; existing clients). This, I think, would let the most served filter types&lt;br/&gt;&amp;gt;&amp;gt; grow organically, with full-node implementations coming with sane defaults&lt;br/&gt;&amp;gt;&amp;gt; for served filter types (maybe even all possible types as long as the&lt;br/&gt;&amp;gt;&amp;gt; number of elements is small), letting their operator add/remove types at&lt;br/&gt;&amp;gt;&amp;gt; will.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The main disadvantage of this as I see it, is that there’s an exponential&lt;br/&gt;&amp;gt;&amp;gt; blowup in the number of possible filter types in the number of element&lt;br/&gt;&amp;gt;&amp;gt; types. However, this would let us start out small with only the elements we&lt;br/&gt;&amp;gt;&amp;gt; need, and in the worst case the node operators just choose to serve the&lt;br/&gt;&amp;gt;&amp;gt; subsets corresponding to what now is called “regular” &#43; “extended” filters&lt;br/&gt;&amp;gt;&amp;gt; anyway, requiring no more resources.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This would also give us some data on what is the most widely used filter&lt;br/&gt;&amp;gt;&amp;gt; types, which could be useful in making the decision on what should be part&lt;br/&gt;&amp;gt;&amp;gt; of filters to eventually commit to in blocks.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - Johan&lt;br/&gt;&amp;gt;&amp;gt; On Sat, May 19, 2018 at 5:12, Olaoluwa Osuntokun via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Thu, May 17, 2018 at 2:44 PM Jim Posen via bitcoin-dev &amp;lt;bitcoin-&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Monitoring inputs by scriptPubkey vs input-txid also has a massive&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; advantage for parallel filtering: You can usually known your pubkeys&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; well in advance, but if you have to change what you&amp;#39;re watching block&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; N&#43;1 for based on the txids that paid you in N you can&amp;#39;t filter them&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in parallel.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Yes, I&amp;#39;ll grant that this is a benefit of your suggestion.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Yeah parallel filtering would be pretty nice. We&amp;#39;ve implemented a serial&lt;br/&gt;&amp;gt;&amp;gt; filtering for btcwallet [1] for the use-case of rescanning after a seed&lt;br/&gt;&amp;gt;&amp;gt; phrase import. Parallel filtering would help here, but also we don&amp;#39;t yet&lt;br/&gt;&amp;gt;&amp;gt; take advantage of batch querying for the filters themselves. This would&lt;br/&gt;&amp;gt;&amp;gt; speed up the scanning by quite a bit.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I really like the filtering model though, it really simplifies the code,&lt;br/&gt;&amp;gt;&amp;gt; and we can leverage identical logic for btcd (which has RPCs to fetch the&lt;br/&gt;&amp;gt;&amp;gt; filters) as well.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]: &lt;a href=&#34;https://github.com/Roasbeef/btcwallet/blob/master/chain/&#34;&gt;https://github.com/Roasbeef/btcwallet/blob/master/chain/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; neutrino.go#L180&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________ bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation&#34;&gt;https://lists.linuxfoundation&lt;/a&gt;.&lt;br/&gt;&amp;gt;&amp;gt; org/mailman/listinfo/bitcoin-dev&lt;br/&gt;&amp;gt;&amp;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/20180522/cdeb1da6/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180522/cdeb1da6/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:12:14Z</updated>
  </entry>

  <entry>
    <id>https://njump.me/nevent1qqs0tumxlqejncxzmyg0vsvvhku7jykwyxttaxp853pcmss92qswrdszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97p8y293</id>
    
      <title type="html">📅 Original date posted:2018-05-21 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://njump.me/nevent1qqs0tumxlqejncxzmyg0vsvvhku7jykwyxttaxp853pcmss92qswrdszyqyxd2wla952ec4peu307g89x35ys2qcfca98qsjmhdw92amg9r97p8y293" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs2z08af3q8j3n6uf89j9wh090pwvxs004ng4h4ytn3f240929vplcn86y0t&#39;&gt;nevent1q…6y0t&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-05-21&lt;br/&gt;📝 Original message:Hi all,&lt;br/&gt;Most light wallets will want to download the minimum amount of data required to operate, which means they would ideally download the smallest possible filters containing the subset of elements they need.&lt;br/&gt;What if instead of trying to decide up front which subset of elements will be most useful to include in the filters, and the size tradeoff, we let the full-node decide which subsets of elements it serves filters for?&lt;br/&gt;&lt;br/&gt;For instance, a full node would advertise that it could serve filters for the subsets 110 (txid&#43;script&#43;outpoint), 100 (txid only), 011 ( script&#43;outpoint) etc. A light client could then choose to download the minimal filter type covering its needs.&lt;br/&gt;The obvious benefit of this would be minimal bandwidth usage for the light client, but there are also some less obvious ones. We wouldn’t have to decide up front what each filter type should contain, only the possible elements a filter can contain (more can be added later without breaking existing clients). This, I think, would let the most served filter types grow organically, with full-node implementations coming with sane defaults for served filter types (maybe even all possible types as long as the number of elements is small), letting their operator add/remove types at will.&lt;br/&gt;The main disadvantage of this as I see it, is that there’s an exponential blowup in the number of possible filter types in the number of element types. However, this would let us start out small with only the elements we need, and in the worst case the node operators just choose to serve the subsets corresponding to what now is called “regular” &#43; “extended” filters anyway, requiring no more resources.&lt;br/&gt;This would also give us some data on what is the most widely used filter types, which could be useful in making the decision on what should be part of filters to eventually commit to in blocks.&lt;br/&gt;- Johan On Sat, May 19, 2018 at 5:12, Olaoluwa Osuntokun via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;On Thu, May 17, 2018 at 2:44 PM Jim Posen via bitcoin-dev &amp;lt;bitcoin- Monitoring inputs by scriptPubkey vs input-txid also has a massive&lt;br/&gt;advantage for parallel filtering: You can usually known your pubkeys&lt;br/&gt;well in advance, but if you have to change what you&amp;#39;re watching block&lt;br/&gt;N&#43;1 for based on the txids that paid you in N you can&amp;#39;t filter them&lt;br/&gt;in parallel.&lt;br/&gt;&lt;br/&gt;Yes, I&amp;#39;ll grant that this is a benefit of your suggestion.&lt;br/&gt;Yeah parallel filtering would be pretty nice. We&amp;#39;ve implemented a serial filtering for btcwallet [1] for the use-case of rescanning after a seed phrase import. Parallel filtering would help here, but also we don&amp;#39;t yet take advantage of batch querying for the filters themselves. This would speed up the scanning by quite a bit.&lt;br/&gt;I really like the filtering model though, it really simplifies the code, and we can leverage identical logic for btcd (which has RPCs to fetch the filters) as well.&lt;br/&gt;[1]: &lt;a href=&#34;https://github.com/Roasbeef/btcwallet/blob/master/chain/neutrino.go#L180&#34;&gt;https://github.com/Roasbeef/btcwallet/blob/master/chain/neutrino.go#L180&lt;/a&gt; [&lt;a href=&#34;https://github.com/Roasbeef/btcwallet/blob/master/chain/neutrino.go#L180&#34;&gt;https://github.com/Roasbeef/btcwallet/blob/master/chain/neutrino.go#L180&lt;/a&gt;]&lt;br/&gt;_______________________________________________ bitcoin-dev mailing list bitcoin-dev at lists.linuxfoundation.org &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;-------------- 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/20180521/d4626f97/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180521/d4626f97/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:12:13Z</updated>
  </entry>

</feed>