<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-08&#xA;📝 Original message:&#xA;Hi AJ,&#xA;&#xA;I think the problem t-bast describes comes up here as well when you&#xA;&gt; collapse the fast-forwards (or, anytime you update the commitment&#xA;&gt; transaction even if you don&#39;t collapse them).&#xA;&#xA;&#xA;Yes, exactly.&#xA;&#xA;I think doing a synchronous update of commitments to the channel state,&#xA;&gt; something like:&#xA;&#xA;&#xA;&#xA;Alice -&gt; Bob: propose_new_commitment&#xA;&gt; channel id&#xA;&gt; adaptor sigs for PTLCs to Bob&#xA;&#xA;&#xA;&gt; Bob -&gt; Alice: agree_new_commitment&#xA;&gt; channel id&#xA;&gt; adaptor sigs for PTLCs to Alice&#xA;&gt; sigs for Alice to spend HTLCs and PTLCs to Bob from her own&#xA;&gt; commitment tx&#xA;&gt; signature for Alice to spend funding tx&#xA;&gt;&#xA;&gt; Alice -&gt; Bob: finish_new_commitment_1&#xA;&gt; channel id&#xA;&gt; sigs for Bob to spend HTLCs and PTLCs to Alice from his own&#xA;&gt; commitment tx&#xA;&gt; signature for Bob to spend funding tx&#xA;&gt; reveal old prior commitment secret&#xA;&gt; new commitment nonce&#xA;&gt;&#xA;&gt; Bob -&gt; Alice: finish_new_commitment_2&#xA;&gt; reveal old prior commitment secret&#xA;&gt; new commitment nonce&#xA;&gt;&#xA;&gt; would work pretty well.&#xA;&#xA;&#xA;I agree, this is better than my naive addition of a `remote_ptlcs_signed`&#xA;message in both directions, and even though it changes the protocol messages&#xA;it stays very close to the mechanisms we currently have.&#xA;&#xA;I&#39;ll spend some time specifying this in more details, to verify that we&#39;re&#xA;not missing anything. What I really like about this proposal is that we&#xA;can probably bundle that protocol change with `option_simplified_update` [0]&#xA;without the adaptor sigs, and simply add the adaptor sigs as tlvs when we&#xA;do PTLCs. That lets us deploy this new update protocol separately from PTLCs&#xA;and ensure it also simplifies the state machine and makes other features&#xA;such as splicing [1] and dynamic channel upgrades [2] easier.&#xA;&#xA;Thanks,&#xA;Bastien&#xA;&#xA;[0] https://github.com/lightning/bolts/pull/867&#xA;[1] https://github.com/lightning/bolts/pull/863&#xA;[2] https://github.com/lightning/bolts/pull/868&#xA;&#xA;Le mer. 8 déc. 2021 à 10:29, Anthony Towns &lt;aj at erisian.com.au&gt; a écrit :&#xA;&#xA;&gt; On Tue, Dec 07, 2021 at 11:52:04PM +0000, ZmnSCPxj via Lightning-dev wrote:&#xA;&gt; &gt; Alternately, fast-forwards, which avoid this because it does not change&#xA;&gt; commitment transactions on the payment-forwarding path.&#xA;&gt; &gt; You only change commitment transactions once you have enough changes to&#xA;&gt; justify collapsing them.&#xA;&gt;&#xA;&gt; I think the problem t-bast describes comes up here as well when you&#xA;&gt; collapse the fast-forwards (or, anytime you update the commitment&#xA;&gt; transaction even if you don&#39;t collapse them).&#xA;&gt;&#xA;&gt; That is, if you have two PTLCs, one from A-&gt;B conditional on X, one&#xA;&gt; from B-&gt;A conditional on Y. Then if A wants to update the commitment tx,&#xA;&gt; she needs to&#xA;&gt;&#xA;&gt;   1) produce a signature to give to B to spend the funding tx&#xA;&gt;   2) produce an adaptor signature to authorise B to spend via X from his&#xA;&gt;      commitment tx&#xA;&gt;   3) produce a signature to allow B to recover Y after timeout from his&#xA;&gt;      commitment tx spending to an output she can claim if he cheats&#xA;&gt;   4) *receive* an adaptor signature from B to be able to spend the Y output&#xA;&gt;      if B posts his commitment tx using A&#39;s signature in (1)&#xA;&gt;&#xA;&gt; The problem is, she can&#39;t give B the result of (1) until she&#39;s received&#xA;&gt; (4) from B.&#xA;&gt;&#xA;&gt; It doesn&#39;t matter if the B-&gt;A PTLC conditional on Y is in the commitment&#xA;&gt; tx itself or within a fast-forward child-transaction -- any previous&#xA;&gt; adaptor sig will be invalidated because there&#39;s a new commitment&#xA;&gt; transaction, and if you allowed any way of spending without an adaptor&#xA;&gt; sig, B wouldn&#39;t be able to recover the secret and would lose funds.&#xA;&gt;&#xA;&gt; It also doesn&#39;t matter if the commitment transaction that A and B will&#xA;&gt; publish is the same or different, only that it&#39;s different from the&#xA;&gt; commitment tx that previous adaptor sigs committed to. (So ANYPREVOUT&#xA;&gt; would fix this if it were available)&#xA;&gt;&#xA;&gt; So I think this is still a relevant question, even if fast-forwards&#xA;&gt; make it a rare problem, that perhaps is only applicable to very heavily&#xA;&gt; used channels.&#xA;&gt;&#xA;&gt; (I said the following in email to t-bast already)&#xA;&gt;&#xA;&gt; I think doing a synchronous update of commitments to the channel state,&#xA;&gt; something like:&#xA;&gt;&#xA;&gt;    Alice -&gt; Bob: propose_new_commitment&#xA;&gt;        channel id&#xA;&gt;        adaptor sigs for PTLCs to Bob&#xA;&gt;&#xA;&gt;    Bob -&gt; Alice: agree_new_commitment&#xA;&gt;        channel id&#xA;&gt;        adaptor sigs for PTLCs to Alice&#xA;&gt;        sigs for Alice to spend HTLCs and PTLCs to Bob from her own&#xA;&gt;          commitment tx&#xA;&gt;        signature for Alice to spend funding tx&#xA;&gt;&#xA;&gt;    Alice -&gt; Bob: finish_new_commitment_1&#xA;&gt;        channel id&#xA;&gt;        sigs for Bob to spend HTLCs and PTLCs to Alice from his own&#xA;&gt;          commitment tx&#xA;&gt;        signature for Bob to spend funding tx&#xA;&gt;        reveal old prior commitment secret&#xA;&gt;        new commitment nonce&#xA;&gt;&#xA;&gt;    Bob -&gt; Alice: finish_new_commitment_2&#xA;&gt;        reveal old prior commitment secret&#xA;&gt;        new commitment nonce&#xA;&gt;&#xA;&gt; would work pretty well.&#xA;&gt;&#xA;&gt; This adds half a round-trip compared to now:&#xA;&gt;&#xA;&gt;    Alice -&gt; Bob: commitment_signed&#xA;&gt;    Bob -&gt; Alice: revoke_and_ack, commitment_signed&#xA;&gt;    Alice -&gt; Bob: revoke_and_ack&#xA;&gt;&#xA;&gt; The timings change like so:&#xA;&gt;&#xA;&gt;   Bob can use the new commitment after 1.5 round-trips (previously 0.5)&#xA;&gt;&#xA;&gt;   Alice can be sure Bob won&#39;t use the old commitment after 2 round-trips&#xA;&gt;   (previously 1)&#xA;&gt;&#xA;&gt;   Alice can use the new commitment after 1 round-trip (unchanged)&#xA;&gt;&#xA;&gt;   Bob can be sure Alice won&#39;t use the old commitment after 1.5 round-trips&#xA;&gt;   (unchanged -- note: this is what&#39;s relevant for forwarding)&#xA;&gt;&#xA;&gt; Making the funding tx a musig setup would mean also supplying 64B&#xA;&gt; of musig2 nonces along with the &#34;adaptor sigs&#34; in one direction,&#xA;&gt; and providing the other side&#39;s 64B of musig2 nonces back along with the&#xA;&gt; (now partial) signature for spending the funding tx (a total of 256B of&#xA;&gt; nonce data, not 128B).&#xA;&gt;&#xA;&gt; Because it keeps both peers&#39; commitments synchronised to a single channel&#xA;&gt; state, I think the same protocol should work fine with the revocable&#xA;&gt; signatures on a single tx approach too, though I haven&#39;t tried working&#xA;&gt; through the details.&#xA;&gt;&#xA;&gt; Fast forwards would then be reducing the 2 round-trip protocol to&#xA;&gt; update the state commitment to a 0.5 round-trip update, to reduce&#xA;&gt; latency when forwarding by the same amount as before (1.5 round-trips&#xA;&gt; to 0.5 round-trips).&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; aj&#xA;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211208/e5173822/attachment.html&gt;</html></oembed>