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