<oembed><type>rich</type><version>1.0</version><title>Olaoluwa Osuntokun [ARCHIVE] wrote</title><author_name>Olaoluwa Osuntokun [ARCHIVE] (npub19h…zkvn4)</author_name><author_url>https://yabu.me/npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-04-22&#xA;📝 Original message:&#xA;Hi Nadav,&#xA;&#xA;Thanks for the updates! Super cool to see this concept continue to evolve&#xA;and integrate new technologies as they pop up.&#xA;&#xA;&gt; I believe this would only require a few changes to existing nodes:&#xA;&#xA;Rather than a &#34;few changes&#34;, this would to date be the largest network-level&#xA;update undertaken to the Lightning Network thus far. In the past, we rolled&#xA;out the new onion blob format (which enables changes like this), but none of&#xA;the intermediate nodes actually need to modify their behavior. New payment&#xA;types like MPP+AMP only needed the _end points_ to update making this an&#xA;end-to-end update that has been rolled out so far in a de-synchronized&#xA;manner.&#xA;&#xA;Re-phrasing deploying this requires changes to: the core channel state&#xA;machine (the protocol we use to make commitment updates), HTLC scripts,&#xA;on-chain HTLC handling and resolution, path finding algorithms (to only see&#xA;out the new PTLC-enabled nodes), invoice changes and onion blob processing.&#xA;I&#39;d caution against underestimating how long all of this will take in&#xA;practice, and the degree of synchronization required to pull it all off&#xA;properly.&#xA;&#xA;For a few years now the question we&#39;ve all been pondering is: do we wait for&#xA;scnhorr to roll out multi-hop locks, or just use the latest ECDSA based&#xA;technique? As dual deployment is compatible (we can make the onion blobs for&#xA;both types the same), a path has always existed to first roll out with the&#xA;latest ECDSA based technique then follow up later to roll out the schnorr&#xA;version as well. However there&#39;s also a risk here as depending on how&#xA;quickly things can be rolled out, schnorr may become available&#xA;mid-development, which would possibly cause us to reconsider the ECDSA path&#xA;and have the network purely use scnhorr to make things nice and uniform.&#xA;&#xA;Zooming out for a bit, the solution space of &#34;how channels can look post&#xA;scriptless-scripts + taproot&#34; is rather large [1], and the addition of this&#xA;new technique allows for an even larger set of deployment possibilities.&#xA;This latest ECDSA variant is much simpler than the prior ones (which had a&#xA;few rounds of more involved ZKPs), but since it still uses OP_CMS, it can&#39;t&#xA;be used to modify the funding output.&#xA;&#xA;[1]:&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-December/002375.html&#xA;&#xA;-- Laolu&#xA;&#xA;&#xA;On Wed, Apr 22, 2020 at 8:13 AM Nadav Kohen &lt;nadav at suredbits.com&gt; wrote:&#xA;&#xA;&gt; Hello all,&#xA;&gt;&#xA;&gt; I&#39;d like to give an update on the current state of thinking and coding&#xA;&gt; surrounding replacing Hash-TimeLock Contracts (HTLCs) with Point-TimeLock&#xA;&gt; Contracts (PTLCs) (aka Payment Hashes -&gt; Payment Points) in hopes of&#xA;&gt; sparking interest, discussion, development, etc.&#xA;&gt;&#xA;&gt;&#xA;&gt; We Want Payment Points!&#xA;&gt; -----------------------&#xA;&gt;&#xA;&gt; Using point-locks (in PTLCs) instead of hash-locks (in HTLCs) for&#xA;&gt; lightning payments is an all around improvement. HTLCs require the use of&#xA;&gt; the same hash across payment routes (barring fancy ZKPs which are inferior&#xA;&gt; to PTLCs) while PTLCs allow for payment de-correlation along routes. For an&#xA;&gt; introduction to the topic, see&#xA;&gt; https://suredbits.com/payment-points-part-1/.&#xA;&gt;&#xA;&gt; In addition to improving privacy in this way and protecting against&#xA;&gt; wormhole attacks, PTLC-based lightning channels open the door to a large&#xA;&gt; variety of interesting applications that cannot be accomplished with HTLCs:&#xA;&gt;&#xA;&gt; Stuckless (retry-able) Payments with proof of payment (&#xA;&gt; https://suredbits.com/payment-points-part-2-stuckless-payments/)&#xA;&gt;&#xA;&gt; Escrow contracts over Lightning (&#xA;&gt; https://suredbits.com/payment-points-part-3-escrow-contracts/)&#xA;&gt;&#xA;&gt; High/DLOG AMP (&#xA;&gt; https://docs.google.com/presentation/d/15l4h2_zEY4zXC6n1NqsImcjgA0fovl_lkgkKu1O3QT0/edit#slide=id.g64c15419e7_0_40&#xA;&gt; )&#xA;&gt;&#xA;&gt; Stuckless + AMP (an improvement on Boomerang) (&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-October/002239.html&#xA;&gt; )&#xA;&gt;&#xA;&gt; Pay-for-signature (&#xA;&gt; https://suredbits.com/payment-points-part-4-selling-signatures/)&#xA;&gt;&#xA;&gt; Pay-for-commitment (&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-September/002166.html&#xA;&gt; )&#xA;&gt;&#xA;&gt; Monotonic access structures on payment completion (&#xA;&gt; https://suredbits.com/payment-points-monotone-access-structures/)&#xA;&gt;&#xA;&gt; Ideal Barrier Escrow Implementation (&#xA;&gt; https://suredbits.com/payment-points-implementing-barrier-escrows/)&#xA;&gt;&#xA;&gt; And allowing for Barrier Escrows, we can even have&#xA;&gt;&#xA;&gt; Atomic multi-payment setup (&#xA;&gt; https://suredbits.com/payment-points-and-barrier-escrows/)&#xA;&gt;&#xA;&gt; Lightning Discreet Log Contract (&#xA;&gt; https://suredbits.com/discreet-log-contracts-on-lightning-network/)&#xA;&gt;&#xA;&gt; Atomic multi-payment update (&#xA;&gt; https://suredbits.com/updating-and-transferring-lightning-payments/)&#xA;&gt;&#xA;&gt; Lightning Discreet Log Contract Novation/Transfer (&#xA;&gt; https://suredbits.com/transferring-lightning-dlcs/)&#xA;&gt;&#xA;&gt; There are likely even more things that can be done with Payment Points so&#xA;&gt; make sure to respond if I&#39;ve missed any known ones.&#xA;&gt;&#xA;&gt;&#xA;&gt; How Do We Get Payment Points?&#xA;&gt; -----------------------------&#xA;&gt;&#xA;&gt; Eventually, once we have Taproot, we can use 2p-Schnorr adaptor signatures&#xA;&gt; in Lightning channels. For a detailed thread by ZmnSCPxj, see here&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-December/002375.html&#xA;&gt;&#xA;&gt; In the meantime, Lloyd has written about a way to do 1p-ECDSA adaptor sigs&#xA;&gt; (https://github.com/LLFourn/one-time-VES) which can be paired with&#xA;&gt; OP_CHECKMULTISIG to allows us to execute PTLCs on Bitcoin today!&#xA;&gt;&#xA;&gt; Nickler has implemented this in a branch of secp256k1 (&#xA;&gt; https://github.com/jonasnick/secp256k1/pull/14) and I have implemented it&#xA;&gt; in Bouncy Castle in Bitcoin-S with some testing against this branch (&#xA;&gt; https://github.com/nkohen/bitcoin-s-core/tree/bouncy-adaptor). Do note&#xA;&gt; that as nickler states on his PR, &#34;IT IS EXTREMELY DANGEROUS AND RECKLESS&#xA;&gt; TO USE THIS MODULE IN PRODUCTION. DON&#39;T!&#34;&#xA;&gt;&#xA;&gt; A demo of an on-chain PTLC I executed using nickler&#39;s implementation on&#xA;&gt; the backend + bitcoin-s can be seen here https://youtu.be/w9o4v7Idjno&#xA;&gt;&#xA;&gt; And waxwing did a lovely write-up about the crypto itself&#xA;&gt; https://joinmarket.me/blog/blog/schnorrless-scriptless-scripts/&#xA;&gt;&#xA;&gt; I would be very interested in having a fork of (at least) one lightning&#xA;&gt; implementation (or Rust Lightning) to be a proof of concept ECDSA-PTLC node&#xA;&gt; with which we can test and play with the plethora of PTLC-based proposals&#xA;&gt; above.&#xA;&gt;&#xA;&gt; I believe this would only require a few changes to existing nodes:&#xA;&gt;&#xA;&gt; 1) update_add_ptlc will have a 32 byte x-coordinate (of a point) rather&#xA;&gt; than a 32 byte hash. Additionally the onion&#39;s hop_data will contain a 32&#xA;&gt; byte scalar tweak for each hop. As per [link multi-hop locks]. The last&#xA;&gt; hop_data will instead include a 32 byte scalar equal to the sum of all&#xA;&gt; tweaks.&#xA;&gt;&#xA;&gt; 2) commitment_signed will have 162 byte adaptor ptlc_signatures rather&#xA;&gt; than valid (71/72 byte) ECDSA signatures on PTLC-success transactions.&#xA;&gt;&#xA;&gt; 3) The in-flight outputs on the commitment transaction itself become a&#xA;&gt; little simpler as we no longer need to explicitly check the payment&#xA;&gt; pre-image against a hash. Instead, delete all instances of &#34;OP_HASH160&#xA;&gt; &lt;RIPEMD160(payment_hash)&gt; OP_EQUALVERIFY&#34; in the scripts (leaving the rest&#xA;&gt; the same) and require no pre-image in the witness, only a valid signature.&#xA;&gt; The pre-image check is implicitly enforced by the &lt;remoteptlc_sig&gt; witness&#xA;&gt; since only an adaptor signature was provided by remote so that the payment&#xA;&gt; pre-image is required to create the valid signature (from which the&#xA;&gt; pre-image can be then deduced by comparing adaptor and valid signatures).&#xA;&gt;&#xA;&gt; If I&#39;ve missed any other changes that need to happen, do respond with them!&#xA;&gt;&#xA;&gt; I hope that as a community we can work towards having a PTLC-based&#xA;&gt; Lightning Network that is safe and stable as soon as possible, and so I&#xA;&gt; encourage further thinking, development and expirementation with PTLCs now&#xA;&gt; so that when Taproot is finally at our disposal we can cleanly start moving&#xA;&gt; towards a more ideal Lightning :)&#xA;&gt;&#xA;&gt; Best,&#xA;&gt; Nadav&#xA;&gt; _______________________________________________&#xA;&gt; Lightning-dev mailing list&#xA;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200422/9849bd91/attachment-0001.html&gt;</html></oembed>