<oembed><type>rich</type><version>1.0</version><author_name>npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_name><author_url>https://nostr.ae/npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-06-20&#xA;📝 Original message:&#xA;Good morning Dave,&#xA;&#xA;&gt; ZmnSCPxj noted that pay-to-preimage doesn&#39;t work with PTLCs.[2] I was&#xA;&gt; hoping one of Bitcoin&#39;s several inventive cryptographers would come&#xA;&gt; along and describe how someone with an adaptor signature could use that&#xA;&gt; information to create a pubkey that could be put into a transaction with&#xA;&gt; a second output that OP_RETURN included the serialized adaptor&#xA;&gt; signature. The pubkey would be designed to be spendable by anyone with&#xA;&gt; the final signature in a way that revealed the hidden value to the&#xA;&gt; pubkey&#39;s creator, allowing them to resolve the PTLC. But if that&#39;s&#xA;&gt; fundamentally not possible, I think we could advocate for making&#xA;&gt; pay-to-revealed-adaptor-signature possible using something like&#xA;&gt; OP_CHECKSIGFROMSTACK.[3]&#xA;&#xA;&#xA;Not a cryptographer, I just play one on the Internet, but maybe the pay-for-signature construction could work...?&#xA;&#xA;Assuming a PTLC has a pointlocked branch, which involves signing with MuSig(A, B).&#xA;A offers to B the amount if B reveals the secret `t` behind `T = t * G`; A knows `T` but not `t`.&#xA;This is done by B handing over `R[B]` and `s&#39;[B]`:&#xA;&#xA;    R = R[A] + R[B] + T&#xA;    s&#39;[B] = r[B] + h(MuSig(A, B) | R | m) * b&#xA;&#xA;Then A provides its partial signature to B.&#xA;&#xA;    s[A] = r[A] + h(MuSig(A, B) | R | m) * a&#xA;&#xA;B has to complete the signature by:&#xA;&#xA;    s = s[A] + s&#39;[B] + t&#xA;&#xA;Since A knows both `s[A]` and `s&#39;[B]`, once it knows `s`, it can compute `t`.&#xA;&#xA;&#xA;Now, we can massage the equation for `s`:&#xA;&#xA;    s = r[A] + h(MuSig(A, B) | R | m) * a + r[B] + h(MuSig(A, B) | R | m) * b + t&#xA;    ; multiply both sides by G&#xA;    s * G = r[A] * G + h(MuSig(A, B) | R | m) * a * G + r[B] * G + h(MuSig(A, B) | R | m) * b * G + t * G&#xA;    ; replace with public points&#xA;    s * G = R[A] + h(MuSig(A, B) | R | m) * A + R[B] + h(MuSig(A, B) | R | m) * B + T&#xA;&#xA;Note that A can compute `s * G` above, because it generated `R[A]`, was given `R[B]` and `T`, and knows who `A` and `B` are.&#xA;&#xA;So what A needs to do is to offer a fund that can only be claimed by leaking knowledge of `s` behind `s * G`.&#xA;A can do this by creating a new keypair `A[p4s] = a[p4s] * G` and putting a fund into it.&#xA;&#xA;Then A generates an `R[A][p4s] = r[A][p4s] * G`, and computes:&#xA;&#xA;    R[p4s] = R[A][p4s] + s * G&#xA;    s&#39;[A][p4s] = r[A][p4s] + h(A | R[p4s] | m) * a[p4s]&#xA;&#xA;The signed message could be a signature to `SIGHASH_NONE`, finally an actual use for that flag.&#xA;&#xA;A reveals publicly (in an `OP_RETURN` as you suggest):&#xA;&#xA;* `R[A][p4s]`&#xA;* `s * G`&#xA;* `s&#39;[A][p4s]`&#xA;* `A[p4s]` - Already the Schnorr output pubkey.&#xA;&#xA;In order to complete the above signature, a third party C has to learn `s` from B.&#xA;&#xA;The third party has to scan every onchain 1-of-1 signature for an `s` that matches `s * G`, so there is greater processing (point multiplies are more expensive than hashes, also there are more 1-of-1s).&#xA;But once learned, the third party can complete the signature and claim the funds.&#xA;And A then learns `s`, from which it can derive `t`.&#xA;&#xA;The third party learns about which channel (i.e. the UTXO that was spent to create the PTLC in the first place), but never learns `t` or `T`, which is a small but nice privacy bonus.&#xA;&#xA;&#xA;Regards,&#xA;ZmnSCPxj</html></oembed>