<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:2018-11-14&#xA;📝 Original message:&#xA;Good morning list,&#xA;&#xA;In case it was not noticed, I made a pull request for Base AMP: https://github.com/lightningnetwork/lightning-rfc/pull/511&#xA;&#xA;This is primarily based on what Rusty suggested on-list, with sufficient MUST and SHOULD.&#xA;&#xA;Regards,&#xA;ZmnSCPxj&#xA;&#xA;&#xA;Sent with ProtonMail Secure Email.&#xA;&#xA;‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&#xA;On Wednesday, November 14, 2018 9:59 AM, ZmnSCPxj via Lightning-dev &lt;lightning-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Good morning Rusty,&#xA;&gt;&#xA;&gt; Someone pointed out to me that `intended_payment_amount` is unnecessary.&#xA;&gt; On reflection, this is correct.&#xA;&gt; Both intermediate nodes and the payee node need not have `intended_payment_amount`.&#xA;&gt;&#xA;&gt; Therefore....&#xA;&gt;&#xA;&gt; &gt; &gt; I propose the below to support Base AMP.&#xA;&gt; &gt;&#xA;&gt; &gt; I think the complexity outweighs the benefits for the moment. The&#xA;&gt; &gt; sender would have to make the onions identical past the merge point (so&#xA;&gt; &gt; any one of them could be used), the merge point has to now create a&#xA;&gt; &gt; many:1 map for HTLC redemption.&#xA;&gt; &gt; For the moment, I think we should stick with:&#xA;&gt; &gt; BOLT #4:&#xA;&gt; &gt;&#xA;&gt; &gt; 1.  type: `per_hop`&#xA;&gt; &gt; 2.  data:&#xA;&gt; &gt;     -   [`8`:`short_channel_id`]&#xA;&gt; &gt;     -   [`8`:`amt_to_forward`]&#xA;&gt; &gt;     -   [`4`:`outgoing_cltv_value`]&#xA;&gt; &gt;&#xA;&gt; &gt; -   -   [`12`:`padding`]&#xA;&gt; &gt; -   -   [`1`:`flags`]&#xA;&gt; &gt; -   -   [`11`:`padding`]&#xA;&gt; &gt;         And define bit 0 of `flags` as `incomplete_payment`. For the moment, it&#xA;&gt; &gt;         is only allowed for final nodes, and only if they put it in their BOLT11&#xA;&gt; &gt;         field.&#xA;&gt; &gt;&#xA;&gt;&#xA;&gt; We can do something even simpler.&#xA;&gt;&#xA;&gt; If `amt_to_forward` plus the fees charged by this node is greater than the actual incoming HTLC, this is an AMP attempt.&#xA;&gt; No additional flag needs to be added.&#xA;&gt; For final payment nodes, if the `amt_to_forward` is greater than the incoming HTLC value, this is an AMP attempt.&#xA;&gt;&#xA;&gt; The previous node could try to probe this by offering a smaller amount than it was instructed to give, but cannot differentiate between a stall because the payee is waiting for an AMP, or a stall due to some other unrelated error.&#xA;&gt;&#xA;&gt; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&#xA;&gt;&#xA;&gt; Of course, an explicit flag is more sensible as it is more explicit.&#xA;&gt;&#xA;&gt; For myself, I would rather a new `per_hop_type`, but whether to use a separate `per_hop_type` vs a byte in padding is largely a bikeshed issue and either is fine with me.&#xA;&gt; A concern is that nothing in our current spec requires that `padding` be all 0, such that reinterpreting byte 0 to be flags could cause interoperability problems.&#xA;&gt; So perhaps a new `per_hop_type` which has a 2-byte `flags` (for more future expansion) and a `padding` of 10 bytes which MUST be explicitly specced as &#34;MUST be all 0&#34;.&#xA;&gt;&#xA;&gt; An explicit flags field would also allow delivery of higher-layer application data in each payment, for whatever purpose a higher-layer application may want. E.g. bit 1 could mean &#34;the next hop 65 bytes is actually a 32-byte application ID and a 33-byte payload; this flag is valid only if this is the last hop.&#34;&#xA;&gt; Another bit can also be used to provide spontaneous payment, so e.g. bit 2 could mean &#34;this hop is the final hop (even if HMAC is nonzero); the HMAC of this hop is really the preimage to claim this payment.&#34;&#xA;&gt;&#xA;&gt; Regards,&#xA;&gt; ZmnSCPxj&#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</html></oembed>