<oembed><type>rich</type><version>1.0</version><title>Bastien TEINTURIER [ARCHIVE] wrote</title><author_name>Bastien TEINTURIER [ARCHIVE] (npub17f…ntr0s)</author_name><author_url>https://yabu.me/npub17fjkngg0s0mfx4uhhz6n4puhflwvrhn2h5c78vdr5xda4mvqx89swntr0s</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2021-12-06&#xA;📝 Original message:&#xA;Good morning list,&#xA;&#xA;There was a great recent post on the mailing list detailing how we could&#xA;do PTLCs on lightning with a lot of other goodies [0]. This proposal&#xA;contained heavy changes to the transaction structure and the update&#xA;protocol. While it&#39;s certainly something we&#39;ll want to do in the long&#xA;run, I wanted to explore the minimal set of changes we would need to be&#xA;able to deploy PTLCs as soon as possible.&#xA;&#xA;The current result is a somewhat high-level article, where each section&#xA;could be a separate update of the lightning protocol [1].&#xA;&#xA;I tried to make PTLCs work with minimal changes to the transaction&#xA;structure and the update protocol, but they introduce a fundamental&#xA;change which forces us to make more changes than I&#39;d like.&#xA;&#xA;With HTLCs, the payment secret (the preimage of the payment hash) was&#xA;directly revealed in the witness of a spending transaction.&#xA;&#xA;With PTLCs, this isn&#39;t the case anymore. The payment secret is a private&#xA;key, and a spending transaction only reveals that key if you have a&#xA;matching adaptor signature. This forces us to make two changes:&#xA;&#xA;1. We must obtain adaptor signatures before sending our commit_sig&#xA;2. We must use a pre-signed HTLC-success transaction not only with our&#xA;local commit, but also with the remote commit&#xA;&#xA;This means that we will need more round-trips whenever we update our&#xA;commitment. I&#39;d like to find the right design trade-off where we don&#39;t&#xA;introduce too many changes in the protocol while minimizing the number&#xA;of additional round-trips.&#xA;&#xA;We currently exchange the following messages:&#xA;&#xA;Alice                       Bob&#xA;      update_add_htlc&#xA;  ---------------------------&gt;&#xA;      update_add_htlc&#xA;  ---------------------------&gt;&#xA;      update_add_htlc&#xA;  ---------------------------&gt;&#xA;        commit_sig&#xA;  ---------------------------&gt;&#xA;       revoke_and_ack&#xA;  &lt;---------------------------&#xA;        commit_sig&#xA;  &lt;---------------------------&#xA;       revoke_and_ack&#xA;  ---------------------------&gt;&#xA;&#xA;It works well because the commit_sig sent by Alice only contains signatures&#xA;for Bob&#39;s transactions (commit and htlc transactions), and the commit_sig&#xA;sent by Bob only contains signatures for Alice&#39;s transactions, and Alice&#xA;and Bob don&#39;t need anything else to spend outputs from either commitment.&#xA;&#xA;But with PTLCs, Bob needs a signature from Alice to be able to fulfill a&#xA;PTLC from Alice&#39;s commitment. And Alice needs Bob to provide an adaptor&#xA;signature for that transaction before she can give him her signature.&#xA;We don&#39;t have the clean ordering that we had before.&#xA;&#xA;The designs I came up with that keep the current messages and just insert&#xA;new ones are either too costly (too many additional round-trips) or too&#xA;complex (most likely broken in some edge cases).&#xA;&#xA;I believe we need to change the commit_sig / revoke_and_ack protocol if&#xA;we want to find the sweet spot I&#39;m looking for. I&#39;d like to collect ideas&#xA;from this list&#39;s participants on how we could do that. This is probably&#xA;something that should be bundled with option_simplified_commitment [2]&#xA;(or at least we must ensure that option_simplified_commitment is a first&#xA;step towards the protocol we&#39;ll need for PTLCs). It&#39;s also important to&#xA;note that the protocol changes must work for both HTLCs and PTLCs, and&#xA;shouldn&#39;t change the structure of the transactions (not more than the&#xA;simple addition of PTLC outputs done in [1]).&#xA;&#xA;Cheers,&#xA;Bastien&#xA;&#xA;[0]&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-October/003278.html&#xA;[1] https://github.com/t-bast/lightning-docs/pull/16&#xA;[2] https://github.com/lightning/bolts/pull/867&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211206/c474a332/attachment-0001.html&gt;</html></oembed>