<oembed><type>rich</type><version>1.0</version><author_name>Lloyd Fournier [ARCHIVE] (npub1kh…y05yp)</author_name><author_url>https://nostr.ae/npub1khlhcuz0jrjwa0ayznq2q9agg4zvxfvx5x7jljrvwnpfzngrcf0q7y05yp</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-12-08&#xA;📝 Original message:&#xA;Hi thread,&#xA;&#xA;I was indeed mistaken. It does require four rounds for both parties to&#xA;fully transition to the next comimit tx and I don&#39;t think there is any easy&#xA;way around this. As you&#39;ve pointed out there it&#39;s still only three rounds&#xA;before the message is forwarded so no performance decrease for forwarding.&#xA;&#xA;I wanted to add a theoretical note that you might be aware of. The final&#xA;message &#34;Bob -&gt; Alice: revoke_and_ack&#34; is not strictly necessary. Alice&#xA;does not care about Bob revoking a commit tx that gives her strictly more&#xA;coins. Bob&#39;s new commit tx can use the same revocation key as the previous&#xA;one i.e. only the offerer of the PTLC/HTLC does a revocation and increments&#xA;their revocation key. Not sending messages you don&#39;t need to is usually&#xA;both more performant and simpler but given that it introduces some&#xA;asymmetry so I&#39;m not sure if it&#39;s worth it. It&#39;s also worth noting that&#xA;with fast forwards + symmetric commit tx you will need to do the full four&#xA;rounds always I think.&#xA;&#xA;Cheers,&#xA;&#xA;LL&#xA;&#xA;On Thu, 9 Dec 2021 at 02:03, Bastien TEINTURIER &lt;bastien at acinq.fr&gt; wrote:&#xA;&#xA;&gt; Hi again AJ and list,&#xA;&gt;&#xA;&gt; I have slightly re-worked your proposal, and came up with the following&#xA;&gt; (I also added the musig2 nonces for completeness):&#xA;&gt;&#xA;&gt; Alice -&gt; Bob: commitment_proposed&#xA;&gt;     channel id&#xA;&gt;     adaptor sigs for PTLCs to Bob in Alice&#39;s next commitment&#xA;&gt;     musig nonces for Alice to spend funding tx&#xA;&gt;     musig nonces for Bob to spend funding tx&#xA;&gt;&#xA;&gt; Bob -&gt; Alice: commitment_proposed&#xA;&gt;     channel id&#xA;&gt;     adaptor sigs for PTLCs to Alice in Bob&#39;s next commitment&#xA;&gt;     musig nonces for Alice to spend funding tx&#xA;&gt;     musig nonces for Bob to spend funding tx&#xA;&gt;&#xA;&gt; Bob -&gt; Alice: commitment_signed&#xA;&gt;     channel id&#xA;&gt;     signature for Alice to spend funding tx&#xA;&gt;     sigs for Alice to spend HTLCs and PTLCs from her next commitment&#xA;&gt;&#xA;&gt; Alice -&gt; Bob: revoke_and_ack&#xA;&gt;     channel id&#xA;&gt;     reveal previous commitment secret&#xA;&gt;     next commitment point&#xA;&gt;&#xA;&gt; Alice -&gt; Bob: commitment_signed&#xA;&gt;     channel id&#xA;&gt;     signature for Bob to spend funding tx&#xA;&gt;     sigs for Bob to spend HTLCs and PTLCs from his next commitment&#xA;&gt;&#xA;&gt; Bob -&gt; Alice: revoke_and_ack&#xA;&gt;     channel id&#xA;&gt;     reveal previous commitment secret&#xA;&gt;     next commitment point&#xA;&gt;&#xA;&gt; I believe it&#39;s exactly the same flow of data between peers as your&#xA;&gt; proposal, but I simply split the data into several messages. Let me&#xA;&gt; know if that&#39;s incorrect or if I missed a subtlety in your proposal.&#xA;&gt;&#xA;&gt; This has some small advantages:&#xA;&gt;&#xA;&gt; * commitment_signed and revoke_and_ack are mostly unchanged, we just&#xA;&gt; add a new message before the commit / revoke dance. The only change&#xA;&gt; happens in commitment_signed, where the signatures for PTLC-success&#xA;&gt; transactions will actually become adaptor signatures.&#xA;&gt; * the new adaptor signatures are in commitment_proposed instead of being&#xA;&gt; in commitment_signed, which ensures that we can still have 2*483&#xA;&gt; pending (H|P)TLCs: since the message size is limited to 65kB, we would&#xA;&gt; otherwise decrease our maximum to ~2*335 with your proposal (very rough&#xA;&gt; calculation)&#xA;&gt; * the messages are now symmetrical, which may be easier to reason about&#xA;&gt;&#xA;&gt; One thing to note is that we reversed the order in which participants&#xA;&gt; sign new commitments. We previously had Alice sign first, whereas now&#xA;&gt; if Alice initiates, Bob will sign the updated commitment first. This is&#xA;&gt; why we add only 0.5 RTT instead of 1 RTT compared to the current protocol.&#xA;&gt; I don&#39;t think this is an issue, but if someone sees a way to maliciously&#xA;&gt; exploit this, please share it!&#xA;&gt;&#xA;&gt; I updated my article [0], people jumping on the thread now may find it&#xA;&gt; helpful to better understand this discussion.&#xA;&gt;&#xA;&gt; Thanks,&#xA;&gt; Bastien&#xA;&gt;&#xA;&gt; [0] https://github.com/t-bast/lightning-docs/pull/16&#xA;&gt;&#xA;&gt; Le mer. 8 déc. 2021 à 11:00, Bastien TEINTURIER &lt;bastien at acinq.fr&gt; a&#xA;&gt; écrit :&#xA;&gt;&#xA;&gt;&gt; Hi AJ,&#xA;&gt;&gt;&#xA;&gt;&gt; I think the problem t-bast describes comes up here as well when you&#xA;&gt;&gt;&gt; collapse the fast-forwards (or, anytime you update the commitment&#xA;&gt;&gt;&gt; transaction even if you don&#39;t collapse them).&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Yes, exactly.&#xA;&gt;&gt;&#xA;&gt;&gt; I think doing a synchronous update of commitments to the channel state,&#xA;&gt;&gt;&gt; something like:&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; Alice -&gt; Bob: propose_new_commitment&#xA;&gt;&gt;&gt; channel id&#xA;&gt;&gt;&gt; adaptor sigs for PTLCs to Bob&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Bob -&gt; Alice: agree_new_commitment&#xA;&gt;&gt;&gt; channel id&#xA;&gt;&gt;&gt; adaptor sigs for PTLCs to Alice&#xA;&gt;&gt;&gt; sigs for Alice to spend HTLCs and PTLCs to Bob from her own&#xA;&gt;&gt;&gt; commitment tx&#xA;&gt;&gt;&gt; signature for Alice to spend funding tx&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Alice -&gt; Bob: finish_new_commitment_1&#xA;&gt;&gt;&gt; channel id&#xA;&gt;&gt;&gt; sigs for Bob to spend HTLCs and PTLCs to Alice from his own&#xA;&gt;&gt;&gt; commitment tx&#xA;&gt;&gt;&gt; signature for Bob to spend funding tx&#xA;&gt;&gt;&gt; reveal old prior commitment secret&#xA;&gt;&gt;&gt; new commitment nonce&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Bob -&gt; Alice: finish_new_commitment_2&#xA;&gt;&gt;&gt; reveal old prior commitment secret&#xA;&gt;&gt;&gt; new commitment nonce&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; would work pretty well.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; I agree, this is better than my naive addition of a `remote_ptlcs_signed`&#xA;&gt;&gt; message in both directions, and even though it changes the protocol&#xA;&gt;&gt; messages&#xA;&gt;&gt; it stays very close to the mechanisms we currently have.&#xA;&gt;&gt;&#xA;&gt;&gt; I&#39;ll spend some time specifying this in more details, to verify that we&#39;re&#xA;&gt;&gt; not missing anything. What I really like about this proposal is that we&#xA;&gt;&gt; can probably bundle that protocol change with `option_simplified_update`&#xA;&gt;&gt; [0]&#xA;&gt;&gt; without the adaptor sigs, and simply add the adaptor sigs as tlvs when we&#xA;&gt;&gt; do PTLCs. That lets us deploy this new update protocol separately from&#xA;&gt;&gt; PTLCs&#xA;&gt;&gt; and ensure it also simplifies the state machine and makes other features&#xA;&gt;&gt; such as splicing [1] and dynamic channel upgrades [2] easier.&#xA;&gt;&gt;&#xA;&gt;&gt; Thanks,&#xA;&gt;&gt; Bastien&#xA;&gt;&gt;&#xA;&gt;&gt; [0] https://github.com/lightning/bolts/pull/867&#xA;&gt;&gt; [1] https://github.com/lightning/bolts/pull/863&#xA;&gt;&gt; [2] https://github.com/lightning/bolts/pull/868&#xA;&gt;&gt;&#xA;&gt;&gt; Le mer. 8 déc. 2021 à 10:29, Anthony Towns &lt;aj at erisian.com.au&gt; a écrit :&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; On Tue, Dec 07, 2021 at 11:52:04PM +0000, ZmnSCPxj via Lightning-dev&#xA;&gt;&gt;&gt; wrote:&#xA;&gt;&gt;&gt; &gt; Alternately, fast-forwards, which avoid this because it does not&#xA;&gt;&gt;&gt; change commitment transactions on the payment-forwarding path.&#xA;&gt;&gt;&gt; &gt; You only change commitment transactions once you have enough changes&#xA;&gt;&gt;&gt; to justify collapsing them.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I think the problem t-bast describes comes up here as well when you&#xA;&gt;&gt;&gt; collapse the fast-forwards (or, anytime you update the commitment&#xA;&gt;&gt;&gt; transaction even if you don&#39;t collapse them).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; That is, if you have two PTLCs, one from A-&gt;B conditional on X, one&#xA;&gt;&gt;&gt; from B-&gt;A conditional on Y. Then if A wants to update the commitment tx,&#xA;&gt;&gt;&gt; she needs to&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   1) produce a signature to give to B to spend the funding tx&#xA;&gt;&gt;&gt;   2) produce an adaptor signature to authorise B to spend via X from his&#xA;&gt;&gt;&gt;      commitment tx&#xA;&gt;&gt;&gt;   3) produce a signature to allow B to recover Y after timeout from his&#xA;&gt;&gt;&gt;      commitment tx spending to an output she can claim if he cheats&#xA;&gt;&gt;&gt;   4) *receive* an adaptor signature from B to be able to spend the Y&#xA;&gt;&gt;&gt; output&#xA;&gt;&gt;&gt;      if B posts his commitment tx using A&#39;s signature in (1)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The problem is, she can&#39;t give B the result of (1) until she&#39;s received&#xA;&gt;&gt;&gt; (4) from B.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; It doesn&#39;t matter if the B-&gt;A PTLC conditional on Y is in the commitment&#xA;&gt;&gt;&gt; tx itself or within a fast-forward child-transaction -- any previous&#xA;&gt;&gt;&gt; adaptor sig will be invalidated because there&#39;s a new commitment&#xA;&gt;&gt;&gt; transaction, and if you allowed any way of spending without an adaptor&#xA;&gt;&gt;&gt; sig, B wouldn&#39;t be able to recover the secret and would lose funds.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; It also doesn&#39;t matter if the commitment transaction that A and B will&#xA;&gt;&gt;&gt; publish is the same or different, only that it&#39;s different from the&#xA;&gt;&gt;&gt; commitment tx that previous adaptor sigs committed to. (So ANYPREVOUT&#xA;&gt;&gt;&gt; would fix this if it were available)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; So I think this is still a relevant question, even if fast-forwards&#xA;&gt;&gt;&gt; make it a rare problem, that perhaps is only applicable to very heavily&#xA;&gt;&gt;&gt; used channels.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; (I said the following in email to t-bast already)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I think doing a synchronous update of commitments to the channel state,&#xA;&gt;&gt;&gt; something like:&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;    Alice -&gt; Bob: propose_new_commitment&#xA;&gt;&gt;&gt;        channel id&#xA;&gt;&gt;&gt;        adaptor sigs for PTLCs to Bob&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;    Bob -&gt; Alice: agree_new_commitment&#xA;&gt;&gt;&gt;        channel id&#xA;&gt;&gt;&gt;        adaptor sigs for PTLCs to Alice&#xA;&gt;&gt;&gt;        sigs for Alice to spend HTLCs and PTLCs to Bob from her own&#xA;&gt;&gt;&gt;          commitment tx&#xA;&gt;&gt;&gt;        signature for Alice to spend funding tx&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;    Alice -&gt; Bob: finish_new_commitment_1&#xA;&gt;&gt;&gt;        channel id&#xA;&gt;&gt;&gt;        sigs for Bob to spend HTLCs and PTLCs to Alice from his own&#xA;&gt;&gt;&gt;          commitment tx&#xA;&gt;&gt;&gt;        signature for Bob to spend funding tx&#xA;&gt;&gt;&gt;        reveal old prior commitment secret&#xA;&gt;&gt;&gt;        new commitment nonce&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;    Bob -&gt; Alice: finish_new_commitment_2&#xA;&gt;&gt;&gt;        reveal old prior commitment secret&#xA;&gt;&gt;&gt;        new commitment nonce&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; would work pretty well.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This adds half a round-trip compared to now:&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;    Alice -&gt; Bob: commitment_signed&#xA;&gt;&gt;&gt;    Bob -&gt; Alice: revoke_and_ack, commitment_signed&#xA;&gt;&gt;&gt;    Alice -&gt; Bob: revoke_and_ack&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The timings change like so:&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   Bob can use the new commitment after 1.5 round-trips (previously 0.5)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   Alice can be sure Bob won&#39;t use the old commitment after 2 round-trips&#xA;&gt;&gt;&gt;   (previously 1)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   Alice can use the new commitment after 1 round-trip (unchanged)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   Bob can be sure Alice won&#39;t use the old commitment after 1.5&#xA;&gt;&gt;&gt; round-trips&#xA;&gt;&gt;&gt;   (unchanged -- note: this is what&#39;s relevant for forwarding)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Making the funding tx a musig setup would mean also supplying 64B&#xA;&gt;&gt;&gt; of musig2 nonces along with the &#34;adaptor sigs&#34; in one direction,&#xA;&gt;&gt;&gt; and providing the other side&#39;s 64B of musig2 nonces back along with the&#xA;&gt;&gt;&gt; (now partial) signature for spending the funding tx (a total of 256B of&#xA;&gt;&gt;&gt; nonce data, not 128B).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Because it keeps both peers&#39; commitments synchronised to a single channel&#xA;&gt;&gt;&gt; state, I think the same protocol should work fine with the revocable&#xA;&gt;&gt;&gt; signatures on a single tx approach too, though I haven&#39;t tried working&#xA;&gt;&gt;&gt; through the details.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Fast forwards would then be reducing the 2 round-trip protocol to&#xA;&gt;&gt;&gt; update the state commitment to a 0.5 round-trip update, to reduce&#xA;&gt;&gt;&gt; latency when forwarding by the same amount as before (1.5 round-trips&#xA;&gt;&gt;&gt; to 0.5 round-trips).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Cheers,&#xA;&gt;&gt;&gt; aj&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&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/20211209/dcadd171/attachment-0001.html&gt;</html></oembed>