<oembed><type>rich</type><version>1.0</version><author_name>npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_name><author_url>https://nostr.ae/npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-02-06&#xA;📝 Original message:&#xA;Hi ZmnSCPxj,&#xA;&#xA;&gt; This is excellent work!&#xA;&#xA;Thanks!&#xA;&#xA;&gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&#xA;&gt; end-ot-end, `localfeatures` is not appropriate.&#xA;&#xA;Yep, it would need to be a global feature bit. In the case that we&#39;re&#xA;sending to a destination which isn&#39;t publicly advertised, then perhaps an&#xA;extension to BOLT-11 could be made to signal receiver support.&#xA;&#xA;&gt; I believe, currently, fees have not this super-linear component&#xA;&#xA;Yep they don&#39;t. Arguably, we should also have a component that scales&#xA;according to the proposed CLTV value of the outgoing HTLC. At Scaling&#xA;Bitcoin Stanford, Aviv Zohar gave a talked titled &#34;How to Charge Lightning&#34;&#xA;where the authors analyzed the possible evolution of fees on the network&#xA;(and also suggested adding this super-linear component to extend the&#xA;lifetime of channels).  However, the talk itself focused on a very simple&#xA;&#34;mega super duper hub&#34; topology. Towards the end he alluded to a forthcoming&#xA;paper that had more comprehensive analysis of more complex topologies. I&#xA;look forward to the publication of their finalized work.&#xA;&#xA;&gt; Indeed, the existence of per-hop fees (`fee_base_msat`) means, splitting&#xA;&gt; the payment over multiple flows will be, very likely, more expensive,&#xA;&gt; compared to using a single flow.&#xA;&#xA;Well it&#39;s still to be seen how the fee structure on mainnet emerges once the&#xA;network is still fully bootstrapped. AFAIK, most running on mainnet atm are&#xA;using the default fee schedules for their respective implementations. For&#xA;example, the default fee_base_msat for lnd is 1000 msat (1 satoshi).&#xA;&#xA;&gt; I believe the `realm` byte is intended for this.&#xA;&#xA;The realm byte is meant to signal &#34;forward this to the dogecoin channel&#34;.&#xA;ATM, we just default to 0 as &#34;Bitcoin&#34;. However, the byte itself only really&#xA;need significance between the sender and the intermediate node. So there&#xA;isn&#39;t necessarily pressure to have a globally synchronized set of realm&#xA;bytes.&#xA;&#xA;&gt; Thus, you can route over nodes that are unaware of AMP, and only provide&#xA;&gt; an AMP realm byte to the destination node, who, is able to reconstruct&#xA;this&#xA;&gt; your AMP data as per your algorithm.&#xA;&#xA;Yes, the intermediate nodes don&#39;t need to be aware of the end-to-end&#xA;protocol. For the final hop, there are actually 53 free bytes (before one&#xA;needs to signal the existence of EOBs):&#xA;&#xA;  * 1 byte realm&#xA;  * 8 bytes next addr (all zeroes to signal final dest)&#xA;  * 32 bytes hmac (also all zeroes for the final dest)&#xA;  * 12 bytes padding&#xA;&#xA;So any combo of these bytes can be used to signal more advanced protocols to&#xA;the final destination.&#xA;&#xA;&#xA;A correction from the prior email description:&#xA;&#xA;&gt; We can further modify our usage of the per-hop payloads to send&#xA;&gt; (H(BP), s_i) to consume most of the EOB sent from sender to receiver.&#xA;&#xA;This should actually be (H(s_0 || s_1 || ...), s_i). So we still allow them&#xA;to check this finger print to see if they have all the final shares, but&#xA;don&#39;t allow them to preemptively pull all the payments.&#xA;&#xA;&#xA;-- Laolu&#xA;&#xA;&#xA;On Mon, Feb 5, 2018 at 11:12 PM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&#xA;&gt; Good morning Laolu,&#xA;&gt;&#xA;&gt; This is excellent work!&#xA;&gt;&#xA;&gt; Some minor comments...&#xA;&gt;&#xA;&gt;&#xA;&gt; (Atomic Multi-path Payments). It can be experimented with on Lightning&#xA;&gt; *today* with the addition of a new feature bit to gate this new&#xA;&gt; feature. The beauty of the scheme is that it requires no fundamental&#xA;&gt; changes&#xA;&gt; to the protocol as is now, as the negotiation is strictly *end-to-end*&#xA;&gt; between sender and receiver.&#xA;&gt;&#xA;&gt;&#xA;&gt; I think, a `globalfeatures` odd bit could be used for this.  As it is&#xA;&gt; end-ot-end, `localfeatures` is not appropriate.&#xA;&gt;&#xA;&gt;   - Potential fee savings for larger payments, contingent on there being a&#xA;&gt;     super-linear component to routed fees. It&#39;s possible that with&#xA;&gt;     modifications to the fee schedule, it&#39;s actually *cheaper* to send&#xA;&gt;     payments over multiple flows rather than one giant flow.&#xA;&gt;&#xA;&gt;&#xA;&gt; I believe, currently, fees have not this super-linear component.  Indeed,&#xA;&gt; the existence of per-hop fees (`fee_base_msat`) means, splitting the&#xA;&gt; payment over multiple flows will be, very likely, more expensive, compared&#xA;&gt; to using a single flow.  Tiny roundoffs in computing the proportional fees&#xA;&gt; (`fee_proportional_millionths`) may make smaller flows give a slight fee&#xA;&gt; advantage, but I think the multiplication of per-hop fees will dominate.&#xA;&gt;&#xA;&gt;&#xA;&gt;   - Using smaller payments increases the set of possible paths a partial&#xA;&gt;     payment could have taken, which reduces the effectiveness of static&#xA;&gt;     analysis techniques involving channel capacities and the plaintext&#xA;&gt;     values being forwarded.&#xA;&gt;&#xA;&gt;&#xA;&gt; Strongly agree!&#xA;&gt;&#xA;&gt;&#xA;&gt; In order to include the three tuple within the per-hop payload for the&#xA;&gt; final&#xA;&gt; destination, we repurpose the _first_ byte of the un-used padding bytes in&#xA;&gt; the payload to signal version 0x01 of the AMP protocol (note this is a PoC&#xA;&gt; outline, we would need to standardize signalling of these 12 bytes to&#xA;&gt; support other protocols).&#xA;&gt;&#xA;&gt;&#xA;&gt; I believe the `realm` byte is intended for this.  Intermediate nodes do&#xA;&gt; not need to understand realm bytes that are understood by other nodes in&#xA;&gt; the route, including the realm bytes understood by the final destination,&#xA;&gt; as intermediate nodes cannot, indeed, read the hop data of other nodes.&#xA;&gt; Thus, you can route over nodes that are unaware of AMP, and only provide an&#xA;&gt; AMP realm byte to the destination node, who, is able to reconstruct this&#xA;&gt; your AMP data as per your algorithm.&#xA;&gt;&#xA;&gt; Indeed, the `realm` byte controls the interpretation of the rest of the&#xA;&gt; 65-byte packet.  If you define, instead, a separate `realm` that is&#xA;&gt; understood by the destination node, you can redefine the entire 64 bytes of&#xA;&gt; the final hop data as you wish.&#xA;&gt;&#xA;&gt; If we support AMP only at final payees, we can completely redefine the 64&#xA;&gt; bytes in the final hop data for the new AMP `realm`, and not consume the&#xA;&gt; next hop (which would reduce route length by 1).&#xA;&gt;&#xA;&gt; (If we want to support multiple routes converging to an intermediate node,&#xA;&gt; then continue routing to a different final node after routes have merged&#xA;&gt; (i.e. 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 the combination to D), then we need to follow the current hop data&#xA;&gt; format, but I think supporting AMP at final payees is actually enough...&#xA;&gt; AMP at intermediate nodes might not be used often enough by senders for it&#xA;&gt; to matter, as taking advantage of that seems more complex than just asking&#xA;&gt; your routing algo to provide you multiple routes to a destination, which&#xA;&gt; you are probably already doing)&#xA;&gt;&#xA;&gt; ----&#xA;&gt;&#xA;&gt; Overall, good work I think.&#xA;&gt;&#xA;&gt; Regards,&#xA;&gt; ZmnSCPxj&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180207/3e9cf18e/attachment.html&gt;</html></oembed>