<oembed><type>rich</type><version>1.0</version><title>ZmnSCPxj [ARCHIVE] wrote</title><author_name>ZmnSCPxj [ARCHIVE] (npub1g5…3ms3l)</author_name><author_url>https://yabu.me/npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2019-10-10&#xA;📝 Original message:&#xA;Good morning list, and Nadav,&#xA;&#xA;&#xA;&gt;     I would also like to point out the below assumption, which underlies Bass Amplifier (&#34;multipath payments&#34;, &#34;base AMP&#34;) and its claim to atomicity:&#xA;&gt;&#xA;&gt; -   If we agree that my secret `s` is worth `m` millisatoshi, then I (as a perfectly rational economic agent) will not claim any payments conditional on my revelation of `s` that sum up to less than `m` millisatoshi: I will only claim all of them when I can get multiple payments conditional on my revelation of `s` that sum up to `m` millisatoshi or more.&#xA;&gt;     -   I now call this &#34;economically-rational atomicity&#34;, and describe also them mildly here: https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-March/001109.html&#xA;&gt;&#xA;&gt;         The above is exactly the behavior we want E to perform: only if it receives both requests to reveal its secret `e` behind `E`, will it actually reveal the secret.&#xA;&gt;         In our case, we turn the requests to E into partial payments of a single invoice (though of course, the payment from S to E would be in the asset that S wants rather than in Bitcoin).&#xA;&gt;         E would not like to &#34;sell short&#34; its secret `e` for less than the price of its service, thus if E is economically rational, it would only claim payments (and reveal `e`) once all incoming payments sum up to the price of its service.&#xA;&#xA;Right right, except an economically-rational actor will also accept a *single* payment that exceeds the price `m` miilisatoshi.&#xA;Meaning anyone can then subvert the behavior of the barrier escrow E.&#xA;For example, as soon as the exchange X is able to get the incoming premium payment conditional on release of the secret behind `X + E`, the exchange can simply directly send the entire payment asked by the escrow E for the secret behind `e` and claim the premium without actually performing the swap and forwarding to `S`.&#xA;&#xA;Fortunately, https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-March/001109.html also notes that it is possible to upgrade the High AMP with economically-rational security to a High AMP with computationally-intractable security.&#xA;The sketch given in that link is different, but we can use a conversion that utilizes points and scalars in much the same way as Nadav suggests as part of the framework.&#xA;&#xA;That is, we can create a High AMP with the following rules for the receiver:&#xA;&#xA;* If the receiver knows a secret `e` behind a point `E`, payment is demanded in exchange for the secret `e + z` behind a point `E + Z` instead.&#xA;  * The receiver is informed what `E` is being talked about, in some TLV to the receiver, as well as the point `Z`.&#xA;* Every branch of the multipath also includes, in some TLV, a secret `z[i]`.&#xA;  * `sum[i=1..n](z[i]) == z`, i.e. the sum of all the branch secrets is the secret `z` behind the point `Z`.&#xA;* Thus, only once the receiver acquires all branches as incoming payments, will it be able to reconstruct the secret `z` and thereby claim its payment (and incidentally reveal `e + z`; if the ultimate payer then knows `z` it is able to acquire `e` as proof-of-payment).&#xA;&#xA;So let us reconsider the protocol:&#xA;&#xA;* B, S, and X generate additional keypairs `b2, B2`, `s2, S2`, and `x2, X2` respectively and give the public keys to buyer B.&#xA;* B generates `Z` from `B2 + S2 + X2`.&#xA;* B sends the premium payment to X, in exchange for revelation of the secret behind `X + E + Z`.&#xA;* X sends the request to the barrier escrow E to reveal the secret behind `E + Z`, also providing its share of the secret behind `Z`, `x2`.&#xA;* B sends the payment to be swapped to the other asset to X, in exchange for revelation of the secret behind `S + E + Z`.&#xA;* X swaps the asset and forwards to S, in exchange for the revelation of the secret behind `S + E + Z`.&#xA;* S sends the request to the barrier escrow E to reveal the secret behind `E + Z`, also providing its share of the secret behind `Z`, `s2`.&#xA;* B sends the request to the barrier escrow E to reveal the secret behind `E + Z`, also providing its share of the secret behind `Z`, `b2`.&#xA;* E reconstructs `z` from `b2 + s2 + x2`, then reveals `e + z` to claim all the escrow service sub-payments.&#xA;* X learns `e + z` and is able to reveal `x + e + z` to claim the premium.&#xA;* S learns `e + z` and is able to reveal `s + e + z` to claim the premium.&#xA;* B learns `e + z`, `x + e + z`, and `s + e + z`, and is able to recover proof-of-payment for the premium as `(x + e + z) - (e + z)`, and proof-of-payment for the actual service or product as `(s + e + z) - (e + z)`.&#xA;&#xA;Regards,&#xA;ZmnSCPxj</html></oembed>