<oembed><type>rich</type><version>1.0</version><author_name>npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n</author_name><author_url>https://nostr.ae/npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-02-07&#xA;📝 Original message:&#xA;This is a really neat idea.&#xA;&#xA;This is a question about non-interactive payments in general, but is there&#xA;any way to get a proof of payment? With regular invoices, knowledge of the&#xA;preimage serves as cryptographic proof that the payment was delivered.&#xA;&#xA;On Feb 6, 2018 6:26 PM, &#34;Conner Fromknecht&#34; &lt;conner at lightning.engineering&gt;&#xA;wrote:&#xA;&#xA;&gt;&#xA;&gt; Hi ZmnSCPxj and Laolu,&#xA;&gt;&#xA;&gt; &gt;  Indeed, the existence of per-hop fees (`fee_base_msat`) means,&#xA;&gt; splitting the&#xA;&gt; &gt;  payment over multiple flows will be, very likely, more expensive,&#xA;&gt; compared to&#xA;&gt; &gt;  using a single flow.&#xA;&gt;&#xA;&gt; As Laolu pointed out, we have yet to see how fees evolve on mainnet or&#xA;&gt; what will&#xA;&gt; emerge as a sane, default fee schedules. I agree that if the same&#xA;&gt; proportional&#xA;&gt; fee is used across all partial payments, then it could certainly be more&#xA;&gt; expensive.&#xA;&gt;&#xA;&gt; However, it could also be the case that you were paying a needlessly high&#xA;&gt; proportional fee to begin with, because paths of sufficient capacity to the&#xA;&gt; destination were scarce. In an AMP world, there will be an abundance of&#xA;&gt; channels&#xA;&gt; that can route small, partial payments, which may itself drive down the&#xA;&gt; competitive fee rate for smaller payments. Just a hypothesis, we shall see&#xA;&gt; where&#xA;&gt; supply meets demand!&#xA;&gt;&#xA;&gt; At the end of the day, the user can always fall back to regular payment if&#xA;&gt; they&#xA;&gt; expect to end up paying more fees using an AMP.&#xA;&gt;&#xA;&gt; &gt; (If we want to support multiple routes converging to an intermediate&#xA;&gt; node,&#xA;&gt; &gt; then continue routing to a different final node after routes have merged&#xA;&gt; (i.e.&#xA;&gt; &gt; A-&gt;B-&gt;C-&gt;D, and A-&gt;E-&gt;C-&gt;D, with the payment being merged by C, who&#xA;&gt; forwards&#xA;&gt; &gt; the combination to D), then we need to follow the current hop data&#xA;&gt; format, but&#xA;&gt; &gt; I think supporting AMP at final payees is actually enough...&#xA;&gt;&#xA;&gt; I think this is an interesting idea, sounds maybe like a&#xA;&gt; recursive/hierarchical&#xA;&gt; AMP? The ability to merge the payments seems like it would result in a&#xA;&gt; decent privacy&#xA;&gt; leak, as I believe an intermediary would have enough evidence to prove&#xA;&gt; that two&#xA;&gt; payments were merged/correlated. Simple traffic analysis would also reveal&#xA;&gt; a&#xA;&gt; discrepancy in the number of incoming and outgoing packets, and possibly&#xA;&gt; other&#xA;&gt; observable differences in routing (some) AMPs vs regular payments.&#xA;&gt;&#xA;&gt; FWIW the current proposal allows the paths of partial payments to overlap,&#xA;&gt; in such a scenario C would just forward the HTLCs independently. One could&#xA;&gt; send&#xA;&gt; them all along the same path if they desired! I&#39;m assuming the intent here&#xA;&gt; is to&#xA;&gt; try and reduce total fees?&#xA;&gt;&#xA;&gt; Minor correction^2:&#xA;&gt;&#xA;&gt; &gt; This should actually be (H(s_0 || s_1 || ...), s_i).&#xA;&gt;&#xA;&gt; This assumes the receiver knows the indexes of each share. Without this&#xA;&gt; knowledge they would have to brute force all orderings to check the&#xA;&gt; fingerprint.&#xA;&gt;&#xA;&gt; To maintain order invariance on the receiving end, I would propose sending&#xA;&gt; (0, s_i) for the first n-1 partial payments, and then (n, s_i) on the&#xA;&gt; final one.&#xA;&gt; As in the description of the basic AMP scheme, the receiver maintains a&#xA;&gt; persistent count of how many partial payments have been received for ID.&#xA;&gt; If the&#xA;&gt; receiver does not get the last payment last, the receiver just waits until&#xA;&gt; all n&#xA;&gt; have been received before deciding that its reconstructed value is BP.&#xA;&gt;&#xA;&gt; The receiver can verify they&#39;ve received the correct BP and n by&#xA;&gt; rederiving the&#xA;&gt; partial preimages r_i = H(BP || i) and checking that there are n&#xA;&gt; outstanding&#xA;&gt; payments, one for each h_i = H(r_i). This also saves the receiving node n&#xA;&gt; additional hash invocations.&#xA;&gt;&#xA;&gt; -Conner&#xA;&gt;&#xA;&gt; On Tue, Feb 6, 2018 at 4:04 PM Olaoluwa Osuntokun &lt;laolu32 at gmail.com&gt;&#xA;&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; Hi ZmnSCPxj,&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; This is excellent work!&#xA;&gt;&gt;&#xA;&gt;&gt; Thanks!&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&#xA;&gt;&gt; &gt; end-ot-end, `localfeatures` is not appropriate.&#xA;&gt;&gt;&#xA;&gt;&gt; Yep, it would need to be a global feature bit. In the case that we&#39;re&#xA;&gt;&gt; sending to a destination which isn&#39;t publicly advertised, then perhaps an&#xA;&gt;&gt; extension to BOLT-11 could be made to signal receiver support.&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; I believe, currently, fees have not this super-linear component&#xA;&gt;&gt;&#xA;&gt;&gt; Yep they don&#39;t. Arguably, we should also have a component that scales&#xA;&gt;&gt; according to the proposed CLTV value of the outgoing HTLC. At Scaling&#xA;&gt;&gt; Bitcoin Stanford, Aviv Zohar gave a talked titled &#34;How to Charge&#xA;&gt;&gt; Lightning&#34;&#xA;&gt;&gt; where the authors analyzed the possible evolution of fees on the network&#xA;&gt;&gt; (and also suggested adding this super-linear component to extend the&#xA;&gt;&gt; lifetime of channels).  However, the talk itself focused on a very simple&#xA;&gt;&gt; &#34;mega super duper hub&#34; topology. Towards the end he alluded to a&#xA;&gt;&gt; forthcoming&#xA;&gt;&gt; paper that had more comprehensive analysis of more complex topologies. I&#xA;&gt;&gt; look forward to the publication of their finalized work.&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; Indeed, the existence of per-hop fees (`fee_base_msat`) means, splitting&#xA;&gt;&gt; &gt; the payment over multiple flows will be, very likely, more expensive,&#xA;&gt;&gt; &gt; compared to using a single flow.&#xA;&gt;&gt;&#xA;&gt;&gt; Well it&#39;s still to be seen how the fee structure on mainnet emerges once&#xA;&gt;&gt; the&#xA;&gt;&gt; network is still fully bootstrapped. AFAIK, most running on mainnet atm&#xA;&gt;&gt; are&#xA;&gt;&gt; using the default fee schedules for their respective implementations. For&#xA;&gt;&gt; example, the default fee_base_msat for lnd is 1000 msat (1 satoshi).&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; I believe the `realm` byte is intended for this.&#xA;&gt;&gt;&#xA;&gt;&gt; The realm byte is meant to signal &#34;forward this to the dogecoin channel&#34;.&#xA;&gt;&gt; ATM, we just default to 0 as &#34;Bitcoin&#34;. However, the byte itself only&#xA;&gt;&gt; really&#xA;&gt;&gt; need significance between the sender and the intermediate node. So there&#xA;&gt;&gt; isn&#39;t necessarily pressure to have a globally synchronized set of realm&#xA;&gt;&gt; bytes.&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; Thus, you can route over nodes that are unaware of AMP, and only provide&#xA;&gt;&gt; &gt; an AMP realm byte to the destination node, who, is able to reconstruct&#xA;&gt;&gt; this&#xA;&gt;&gt; &gt; your AMP data as per your algorithm.&#xA;&gt;&gt;&#xA;&gt;&gt; Yes, the intermediate nodes don&#39;t need to be aware of the end-to-end&#xA;&gt;&gt; protocol. For the final hop, there are actually 53 free bytes (before one&#xA;&gt;&gt; needs to signal the existence of EOBs):&#xA;&gt;&gt;&#xA;&gt;&gt;   * 1 byte realm&#xA;&gt;&gt;   * 8 bytes next addr (all zeroes to signal final dest)&#xA;&gt;&gt;   * 32 bytes hmac (also all zeroes for the final dest)&#xA;&gt;&gt;   * 12 bytes padding&#xA;&gt;&gt;&#xA;&gt;&gt; So any combo of these bytes can be used to signal more advanced protocols&#xA;&gt;&gt; to&#xA;&gt;&gt; the final destination.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; A correction from the prior email description:&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; We can further modify our usage of the per-hop payloads to send&#xA;&gt;&gt; &gt; (H(BP), s_i) to consume most of the EOB sent from sender to receiver.&#xA;&gt;&gt;&#xA;&gt;&gt; This should actually be (H(s_0 || s_1 || ...), s_i). So we still allow&#xA;&gt;&gt; them&#xA;&gt;&gt; to check this finger print to see if they have all the final shares, but&#xA;&gt;&gt; don&#39;t allow them to preemptively pull all the payments.&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; -- Laolu&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; On Mon, Feb 5, 2018 at 11:12 PM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Good morning Laolu,&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This is excellent work!&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Some minor comments...&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; (Atomic Multi-path Payments). It can be experimented with on Lightning&#xA;&gt;&gt;&gt; *today* with the addition of a new feature bit to gate this new&#xA;&gt;&gt;&gt; feature. The beauty of the scheme is that it requires no fundamental&#xA;&gt;&gt;&gt; changes&#xA;&gt;&gt;&gt; to the protocol as is now, as the negotiation is strictly *end-to-end*&#xA;&gt;&gt;&gt; between sender and receiver.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&#xA;&gt;&gt;&gt; end-ot-end, `localfeatures` is not appropriate.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   - Potential fee savings for larger payments, contingent on there being&#xA;&gt;&gt;&gt; a&#xA;&gt;&gt;&gt;     super-linear component to routed fees. It&#39;s possible that with&#xA;&gt;&gt;&gt;     modifications to the fee schedule, it&#39;s actually *cheaper* to send&#xA;&gt;&gt;&gt;     payments over multiple flows rather than one giant flow.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I believe, currently, fees have not this super-linear component.&#xA;&gt;&gt;&gt; Indeed, the existence of per-hop fees (`fee_base_msat`) means, splitting&#xA;&gt;&gt;&gt; the payment over multiple flows will be, very likely, more expensive,&#xA;&gt;&gt;&gt; compared to using a single flow.  Tiny roundoffs in computing the&#xA;&gt;&gt;&gt; proportional fees (`fee_proportional_millionths`) may make smaller&#xA;&gt;&gt;&gt; flows give a slight fee advantage, but I think the multiplication of&#xA;&gt;&gt;&gt; per-hop fees will dominate.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;   - Using smaller payments increases the set of possible paths a partial&#xA;&gt;&gt;&gt;     payment could have taken, which reduces the effectiveness of static&#xA;&gt;&gt;&gt;     analysis techniques involving channel capacities and the plaintext&#xA;&gt;&gt;&gt;     values being forwarded.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Strongly agree!&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; In order to include the three tuple within the per-hop payload for the&#xA;&gt;&gt;&gt; final&#xA;&gt;&gt;&gt; destination, we repurpose the _first_ byte of the un-used padding bytes&#xA;&gt;&gt;&gt; in&#xA;&gt;&gt;&gt; the payload to signal version 0x01 of the AMP protocol (note this is a&#xA;&gt;&gt;&gt; PoC&#xA;&gt;&gt;&gt; outline, we would need to standardize signalling of these 12 bytes to&#xA;&gt;&gt;&gt; support other protocols).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I believe the `realm` byte is intended for this.  Intermediate nodes do&#xA;&gt;&gt;&gt; not need to understand realm bytes that are understood by other nodes in&#xA;&gt;&gt;&gt; the route, including the realm bytes understood by the final destination,&#xA;&gt;&gt;&gt; as intermediate nodes cannot, indeed, read the hop data of other nodes.&#xA;&gt;&gt;&gt; Thus, you can route over nodes that are unaware of AMP, and only provide an&#xA;&gt;&gt;&gt; AMP realm byte to the destination node, who, is able to reconstruct this&#xA;&gt;&gt;&gt; your AMP data as per your algorithm.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Indeed, the `realm` byte controls the interpretation of the rest of the&#xA;&gt;&gt;&gt; 65-byte packet.  If you define, instead, a separate `realm` that is&#xA;&gt;&gt;&gt; understood by the destination node, you can redefine the entire 64 bytes of&#xA;&gt;&gt;&gt; the final hop data as you wish.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; If we support AMP only at final payees, we can completely redefine the&#xA;&gt;&gt;&gt; 64 bytes in the final hop data for the new AMP `realm`, and not consume the&#xA;&gt;&gt;&gt; next hop (which would reduce route length by 1).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; (If we want to support multiple routes converging to an intermediate&#xA;&gt;&gt;&gt; node, then continue routing to a different final node after routes have&#xA;&gt;&gt;&gt; merged (i.e. A-&gt;B-&gt;C-&gt;D, and A-&gt;E-&gt;C-&gt;D, with the payment being merged by&#xA;&gt;&gt;&gt; C, who forwards the combination to D), then we need to follow the current&#xA;&gt;&gt;&gt; hop data format, but I think supporting AMP at final payees is actually&#xA;&gt;&gt;&gt; enough... AMP at intermediate nodes might not be used often enough by&#xA;&gt;&gt;&gt; senders for it to matter, as taking advantage of that seems more complex&#xA;&gt;&gt;&gt; than just asking your routing algo to provide you multiple routes to a&#xA;&gt;&gt;&gt; destination, which you are probably already doing)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; ----&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Overall, good work I think.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Regards,&#xA;&gt;&gt;&gt; ZmnSCPxj&#xA;&gt;&gt;&gt;&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; Lightning-dev mailing list&#xA;&gt;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&gt;&#xA;&gt;&#xA;&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;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180207/48a507f8/attachment-0001.html&gt;</html></oembed>