<oembed><type>rich</type><version>1.0</version><title>Nadav Kohen [ARCHIVE] wrote</title><author_name>Nadav Kohen [ARCHIVE] (npub1ge…rtua0)</author_name><author_url>https://yabu.me/npub1geqdlge6ysz9qlq3w758422flnkgqklpu9veu80ehjprcd04ugyqkrtua0</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;Hello all,&#xA;&#xA;I&#39;d like to give an update on the current state of thinking and coding&#xA;surrounding replacing Hash-TimeLock Contracts (HTLCs) with Point-TimeLock&#xA;Contracts (PTLCs) (aka Payment Hashes -&gt; Payment Points) in hopes of&#xA;sparking interest, discussion, development, etc.&#xA;&#xA;&#xA;We Want Payment Points!&#xA;-----------------------&#xA;&#xA;Using point-locks (in PTLCs) instead of hash-locks (in HTLCs) for lightning&#xA;payments is an all around improvement. HTLCs require the use of the same&#xA;hash across payment routes (barring fancy ZKPs which are inferior to PTLCs)&#xA;while PTLCs allow for payment de-correlation along routes. For an&#xA;introduction to the topic, see https://suredbits.com/payment-points-part-1/.&#xA;&#xA;In addition to improving privacy in this way and protecting against&#xA;wormhole attacks, PTLC-based lightning channels open the door to a large&#xA;variety of interesting applications that cannot be accomplished with HTLCs:&#xA;&#xA;Stuckless (retry-able) Payments with proof of payment (&#xA;https://suredbits.com/payment-points-part-2-stuckless-payments/)&#xA;&#xA;Escrow contracts over Lightning (&#xA;https://suredbits.com/payment-points-part-3-escrow-contracts/)&#xA;&#xA;High/DLOG AMP (&#xA;https://docs.google.com/presentation/d/15l4h2_zEY4zXC6n1NqsImcjgA0fovl_lkgkKu1O3QT0/edit#slide=id.g64c15419e7_0_40&#xA;)&#xA;&#xA;Stuckless + AMP (an improvement on Boomerang) (&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-October/002239.html&#xA;)&#xA;&#xA;Pay-for-signature (&#xA;https://suredbits.com/payment-points-part-4-selling-signatures/)&#xA;&#xA;Pay-for-commitment (&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-September/002166.html&#xA;)&#xA;&#xA;Monotonic access structures on payment completion (&#xA;https://suredbits.com/payment-points-monotone-access-structures/)&#xA;&#xA;Ideal Barrier Escrow Implementation (&#xA;https://suredbits.com/payment-points-implementing-barrier-escrows/)&#xA;&#xA;And allowing for Barrier Escrows, we can even have&#xA;&#xA;Atomic multi-payment setup (&#xA;https://suredbits.com/payment-points-and-barrier-escrows/)&#xA;&#xA;Lightning Discreet Log Contract (&#xA;https://suredbits.com/discreet-log-contracts-on-lightning-network/)&#xA;&#xA;Atomic multi-payment update (&#xA;https://suredbits.com/updating-and-transferring-lightning-payments/)&#xA;&#xA;Lightning Discreet Log Contract Novation/Transfer (&#xA;https://suredbits.com/transferring-lightning-dlcs/)&#xA;&#xA;There are likely even more things that can be done with Payment Points so&#xA;make sure to respond if I&#39;ve missed any known ones.&#xA;&#xA;&#xA;How Do We Get Payment Points?&#xA;-----------------------------&#xA;&#xA;Eventually, once we have Taproot, we can use 2p-Schnorr adaptor signatures&#xA;in Lightning channels. For a detailed thread by ZmnSCPxj, see here&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-December/002375.html&#xA;&#xA;In the meantime, Lloyd has written about a way to do 1p-ECDSA adaptor sigs (&#xA;https://github.com/LLFourn/one-time-VES) which can be paired with&#xA;OP_CHECKMULTISIG to allows us to execute PTLCs on Bitcoin today!&#xA;&#xA;Nickler has implemented this in a branch of secp256k1 (&#xA;https://github.com/jonasnick/secp256k1/pull/14) and I have implemented it&#xA;in Bouncy Castle in Bitcoin-S with some testing against this branch (&#xA;https://github.com/nkohen/bitcoin-s-core/tree/bouncy-adaptor). Do note that&#xA;as nickler states on his PR, &#34;IT IS EXTREMELY DANGEROUS AND RECKLESS TO USE&#xA;THIS MODULE IN PRODUCTION. DON&#39;T!&#34;&#xA;&#xA;A demo of an on-chain PTLC I executed using nickler&#39;s implementation on the&#xA;backend + bitcoin-s can be seen here https://youtu.be/w9o4v7Idjno&#xA;&#xA;And waxwing did a lovely write-up about the crypto itself&#xA;https://joinmarket.me/blog/blog/schnorrless-scriptless-scripts/&#xA;&#xA;I would be very interested in having a fork of (at least) one lightning&#xA;implementation (or Rust Lightning) to be a proof of concept ECDSA-PTLC node&#xA;with which we can test and play with the plethora of PTLC-based proposals&#xA;above.&#xA;&#xA;I believe this would only require a few changes to existing nodes:&#xA;&#xA;1) update_add_ptlc will have a 32 byte x-coordinate (of a point) rather&#xA;than a 32 byte hash. Additionally the onion&#39;s hop_data will contain a 32&#xA;byte scalar tweak for each hop. As per [link multi-hop locks]. The last&#xA;hop_data will instead include a 32 byte scalar equal to the sum of all&#xA;tweaks.&#xA;&#xA;2) commitment_signed will have 162 byte adaptor ptlc_signatures rather than&#xA;valid (71/72 byte) ECDSA signatures on PTLC-success transactions.&#xA;&#xA;3) The in-flight outputs on the commitment transaction itself become a&#xA;little simpler as we no longer need to explicitly check the payment&#xA;pre-image against a hash. Instead, delete all instances of &#34;OP_HASH160&#xA;&lt;RIPEMD160(payment_hash)&gt; OP_EQUALVERIFY&#34; in the scripts (leaving the rest&#xA;the same) and require no pre-image in the witness, only a valid signature.&#xA;The pre-image check is implicitly enforced by the &lt;remoteptlc_sig&gt; witness&#xA;since only an adaptor signature was provided by remote so that the payment&#xA;pre-image is required to create the valid signature (from which the&#xA;pre-image can be then deduced by comparing adaptor and valid signatures).&#xA;&#xA;If I&#39;ve missed any other changes that need to happen, do respond with them!&#xA;&#xA;I hope that as a community we can work towards having a PTLC-based&#xA;Lightning Network that is safe and stable as soon as possible, and so I&#xA;encourage further thinking, development and expirementation with PTLCs now&#xA;so that when Taproot is finally at our disposal we can cleanly start moving&#xA;towards a more ideal Lightning :)&#xA;&#xA;Best,&#xA;Nadav&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200422/a0197f12/attachment.html&gt;</html></oembed>