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