<div dir="ltr">Good evening Z and list,<div><br></div><div>I&#39;m wondering, since these payments are no longer atomic, should we name it accordingly?</div><div><br></div><div>Cheers,</div><div>Johan</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 1:28 PM ZmnSCPxj via Lightning-dev &lt;<a href="mailto:lightning-dev@lists.linuxfoundation.org">lightning-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Good morning list,<br></div><div><br></div><div>I propose the below to support Base AMP.<br></div><div><br></div><div>The below would allow arbitrary merges of paths, but not arbitrary splits.  I am uncertain about the safety of arbitrary splits.<br></div><div><br></div><div>### The `multipath_merge_per_hop` type (`option_base_amp`)<br></div><div><br></div><div>This indicates that payment has been split by the sender using Base AMP, and that the receiver should wait for the total intended payment before forwarding or claiming the payment.<br></div><div>In case the receiving node is not the last node in the path, then succeeding hops MUST be the same across all splits.<br></div><div><br></div><div>1. type: 1 (`termination_per_hop`)<br></div><div>2. data:<br></div><div>  * [`8` : `short_channel_id`]<br></div><div>  * [`8` : `amt_to_forward`]<br></div><div>  * [`4` : `outgoing_cltv_value`]<br></div><div>  * [`8` : `intended_total_payment`]<br></div><div>  * [`4` : `zeros`]<br></div><div><br></div><div>The contents of this hop will be the same across all paths of the Base AMP.<br></div><div>The `payment_hash` of the incoming HTLCs will also be the same across all paths of the Base AMP.<br></div><div><br></div><div>`intended_total_payment` is the total amount of money that this node should expect to receive in all incoming paths to the same `payment_hash`.<br></div><div><br></div><div>This may be the last hop of a payment onion, in which case the `HMAC` for this hop will be `0` (the same rule as for `per_hop_type` 0).<br></div><div><br></div><div>The receiver:<br></div><div><br></div><div>* MUST impose a reasonable timeout for waiting to receive all component paths, and fail all incoming HTLC offers for the `payment_hash`  if they have not totalled equal to `intended_total_payment`.<br></div><div>* MUST NOT forward (if an intermediate node) or claim (if the final node) unless it has received a total greater or equal to `intended_total_payment` in all incoming HTLCs for the same `payment_hash`.<br></div><div><br></div><div>The sender:<br></div><div><br></div><div>* MUST use the same `payment_hash` for all paths of a single multipath payment.<br></div><div><br></div><div>Regards,<br></div><div>ZmnSCPxj<br></div>_______________________________________________<br>
Lightning-dev mailing list<br>
<a href="mailto:Lightning-dev@lists.linuxfoundation.org" target="_blank">Lightning-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev</a><br>
</blockquote></div>