<oembed><type>rich</type><version>1.0</version><title>Nadav Kohen [ARCHIVE] wrote</title><author_name>Nadav Kohen [ARCHIVE] (npub1ge…rtua0)</author_name><author_url>https://yabu.me/npub1geqdlge6ysz9qlq3w758422flnkgqklpu9veu80ehjprcd04ugyqkrtua0</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2019-10-09&#xA;📝 Original message:&#xA;Hi list,&#xA;&#xA;I&#39;m back again with another idea about Payment Points and fun things to do&#xA;with them! Hopefully this time I&#39;m not entirely just hashing out old ideas&#xA;in public like an out-of-the-loop person :)&#xA;&#xA;*TLDR: Adding and ECDH-ing points gives us AND and OR functionality which&#xA;we can compose to make cool lightning contracts like Multisig, Escrow, and&#xA;DLCs*&#xA;&#xA;So when looking at the following (likely incomplete) list of things you can&#xA;do with payment points:&#xA;&#xA;1) Payment De-correlation&#xA;2) &#34;Stuckless&#34; Payments&#xA;3) High AMP&#xA;4) Selling Signatures&#xA;5) Selling Pedersen De-commitment&#xA;6) Escrow Contracts&#xA;&#xA;I started of trying to classify what kind of thing these new features are&#xA;in hopes of coming across new ones. The first three I clumped into a group&#xA;I called &#34;Payment point addition allows us to do cool things while&#xA;maintaining the Proof of Payment (PoP) property&#34;. The next two (4 and 5) I&#xA;called &#34;Commitment applications where point is public&#34;. But ZmnSCPxj&#39;s&#xA;proposal for lightning escrow contracts (&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002028.html)&#xA;struck me as something different that might somehow be made more general.&#xA;&#xA;Essentially the idea is to use the point S + ECDH(B, E) where S is the&#xA;seller&#39;s point, B is the buyer&#39;s point and E is the escrow&#39;s point. This&#xA;means that the scalar can be discovered by the seller in collaboration with&#xA;the buyer or the escrow, that is, S AND (B OR E). I propose that under&#xA;certain circumstances (such as the parties involved being able to&#xA;interact), this can be generalized to have payments conditioned on&#xA;arbitrary AND/OR circuits.&#xA;&#xA; I believe that AND is very straightforward as you simply take two&#xA;conditions A and B and add them together to get a point that requires both&#xA;of their scalars are discoverable (except maybe under certain bad&#xA;circumstances that can be avoided where like B = C - A, this must be&#xA;guarded against).&#xA;&#xA;OR is harder but I think that it can be achieved in the two party case by&#xA;ECDH and in the n-party case by multi-party key exchanges (which I know&#xA;pretty much nothing about other than that they exist). Given some key&#xA;exchange protocol (preferably non-interactive), KE, KE(A_1, ..., A_n)&#xA;should result in a number known only to those who know any scalar a_1, ...,&#xA;a_n and no one else. Assuming this exists and we can manage to trustlessly&#xA;(in some possibly stretched sense of the word) compute shared keys&#xA;(including such things as KE(A+B, C)), then KE(A, B) acts as A OR B in our&#xA;payment condition contract.&#xA;&#xA;To restate the escrow contract idea in this setting, the payment is&#xA;conditioned on S + KE(B, E). Important to note is that not all parties must&#xA;know about the details of the payment itself: the Escrow in this example&#xA;knows nothing about this payment (other than that some payment exists)&#xA;unless there is a dispute.&#xA;&#xA;Lastly, note that contracts following this scheme look indistinguishable to&#xA;normal payments on the network, and are fully compatible with High AMPs&#xA;since we can simply take the payment point specified by our contract and&#xA;add that point to each partial payment point.&#xA;&#xA;Well this is all nice in theory, but is there anything that will actually&#xA;come out of this thinking? I&#39;ll detail the two things I&#39;ve thought of so&#xA;far for which I&#39;d love critique! I&#39;d also love to hear if anyone else&#xA;things of any cool application using this line of thought (or really&#xA;anything cool with payment points :P).&#xA;&#xA;Idea 1: &#34;MultiSignature&#34; Lightning Contracts&#xA;I mean &#34;MultiSignature&#34; here only in the sense that m-of-n parties must&#xA;agree to the payment in order for it to happen, no actual signatures are&#xA;used. A &#34;MultiSignature&#34; contract is simply a bunch of ANDs and ORs! For&#xA;example a 2-of-3 multisig between parties A, B, and C can be represented as&#xA;(A AND B) OR (B AND C) OR (C AND A). As such, if some seller has a point S&#xA;and three parties have points A, B, and C where a certain payment must go&#xA;through if any two of them think it should, then the payment point used for&#xA;the payment should be S + KE(A + B, B + C, C + A). We add S to this point&#xA;so that the scalar, s, can act as proof of payment. And that&#39;s it! I&#xA;haven&#39;t thought long enough to come up with any situation where this might&#xA;be useful but hoping someone who reads this will!&#xA;&#xA;Idea 2: DLCs Routed over Lightning&#xA;Say that some DLC oracle will either broadcast s_A or s_B whose public&#xA;points are S_A and S_B (which can be computed from public information as&#xA;per the DLC scheme). Then say that Alice and Bob enter into a contract&#xA;under which Alice wins some amount if s_A is broadcasted and Bob if s_B is&#xA;broadcasted. Say Alice has a point A and Bob has a point B. They each send&#xA;the other a payment with the amount that party must receive if they win&#xA;with the payment point A + S_A for Bob&#39;s payment to Alice and B + S_B for&#xA;Alice&#39;s payment to Bob. And this is it! If s_A is broadcasted then Alice&#xA;gets paid (and Bob gets proof of payment a, which is the scalar to A),&#xA;otherwise s_B is broadcasted and Bob gets paid (with Alice receiving b as&#xA;PoP). An interesting note is that under this scheme neither party is forced&#xA;to pay extra on-chain fees in the case of a counter-party who doesn&#39;t&#xA;cooperate whilst in the wrong.&#xA;One wrinkle with this scheme is that setup isn&#39;t trustless. Although it is&#xA;generally true that one party must sign the funding transaction for a DLC&#xA;before the other party for on-chain DLCs, at least there is the mitigation&#xA;that when your counter-party goes silent, you can move your input funds&#xA;invalidating the funding transaction you signed (at a cost because fees).&#xA;So what can we do here to ensure that both payments are setup at the same&#xA;time in the case that Alice and Bob don&#39;t trust each other?&#xA;Say that although they don&#39;t trust each other, they&#39;re both willing to&#xA;trust some escrow entity who generates some point E for their payment.&#xA;Alice&#39;s payment point to Bob becomes B + S_B + E and Bob&#39;s to Alice becomes&#xA;A + S_A + E. The escrow now waits to hear from Alice and Bob that they have&#xA;incoming payments setup and only once both of them attest to this (using&#xA;signatures, for example) does the escrow release the scalar to E to them&#xA;both. The escrow can also have a timeout at which it will never reveal the&#xA;scalar to E: forcing both parties to commit to the contract well before the&#xA;DLC event. In this way, trust has been moved from counter-party to&#xA;trustworthy (hopefully) escrow in such a way that the Escrow learns nothing&#xA;about the contract itself (other than that there is one of some kind).&#xA;I believe that this scheme can be extended to more events through the use&#xA;of multiple payments being setup (usually in both directions) but this&#xA;seems complicated and I&#39;ve rambled for long enough. One last note is that&#xA;DLC oracles can be composed in the usual way under this scheme (by&#xA;addition) and potentially even threshold multi-oracles can be supported in&#xA;this way, although this would require the oracles to attest to some shared&#xA;key&#39;s points with other oracles which isn&#39;t necessarily optimal.&#xA;&#xA;Best,&#xA;Nadav&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191009/630cee2b/attachment.html&gt;</html></oembed>