ZmnSCPxj [ARCHIVE] on Nostr: 📅 Original date posted:2018-11-13 📝 Original message: Good morning Rusty, ...
📅 Original date posted:2018-11-13
📝 Original message:
Good morning Rusty,
Someone pointed out to me that `intended_payment_amount` is unnecessary.
On reflection, this is correct.
Both intermediate nodes and the payee node need not have `intended_payment_amount`.
Therefore....
> > I propose the below to support Base AMP.
>
> I think the complexity outweighs the benefits for the moment. The
> sender would have to make the onions identical past the merge point (so
> any one of them could be used), the merge point has to now create a
> many:1 map for HTLC redemption.
>
> For the moment, I think we should stick with:
>
> BOLT #4:
>
> 1. type: `per_hop`
> 2. data:
> - [`8`:`short_channel_id`]
> - [`8`:`amt_to_forward`]
> - [`4`:`outgoing_cltv_value`]
>
> - - [`12`:`padding`]
>
> - - [`1`:`flags`]
> - - [`11`:`padding`]
>
> And define bit 0 of `flags` as `incomplete_payment`. For the moment, it
> is only allowed for final nodes, and only if they put it in their BOLT11
> field.
>
We can do something even simpler.
If `amt_to_forward` plus the fees charged by this node is greater than the actual incoming HTLC, this is an AMP attempt.
No additional flag needs to be added.
For final payment nodes, if the `amt_to_forward` is greater than the incoming HTLC value, this is an AMP attempt.
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.
---
Of course, an explicit flag is more sensible as it is more explicit.
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.
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.
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 "MUST be all 0".
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 "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."
Another bit can also be used to provide spontaneous payment, so e.g. bit 2 could mean "this hop is the final hop (even if HMAC is nonzero); the HMAC of this hop is really the preimage to claim this payment."
Regards,
ZmnSCPxj
Published at
2023-06-09 12:52:42Event JSON
{
"id": "4e62759005fb41c3ec82ae2273117b25198f2ee7111e9e31f8c437d2e3551f66",
"pubkey": "4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861",
"created_at": 1686315162,
"kind": 1,
"tags": [
[
"e",
"809f1a75998ec1e3eebcb7a31f0cc9fe5473d678fb16cc9dfe25f3232ec33478",
"",
"root"
],
[
"e",
"a24b69f77ae3b6042605046a2fef407c4cb9d95294a3ac5df2564c0b66badc2e",
"",
"reply"
],
[
"p",
"13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425"
]
],
"content": "📅 Original date posted:2018-11-13\n📝 Original message:\nGood morning Rusty,\n\nSomeone pointed out to me that `intended_payment_amount` is unnecessary.\nOn reflection, this is correct.\nBoth intermediate nodes and the payee node need not have `intended_payment_amount`.\n\nTherefore....\n\n\u003e \u003e I propose the below to support Base AMP.\n\u003e\n\u003e I think the complexity outweighs the benefits for the moment. The\n\u003e sender would have to make the onions identical past the merge point (so\n\u003e any one of them could be used), the merge point has to now create a\n\u003e many:1 map for HTLC redemption.\n\u003e\n\u003e For the moment, I think we should stick with:\n\u003e\n\u003e BOLT #4:\n\u003e\n\u003e 1. type: `per_hop`\n\u003e 2. data:\n\u003e - [`8`:`short_channel_id`]\n\u003e - [`8`:`amt_to_forward`]\n\u003e - [`4`:`outgoing_cltv_value`]\n\u003e\n\u003e - - [`12`:`padding`]\n\u003e\n\u003e - - [`1`:`flags`]\n\u003e - - [`11`:`padding`]\n\u003e\n\u003e And define bit 0 of `flags` as `incomplete_payment`. For the moment, it\n\u003e is only allowed for final nodes, and only if they put it in their BOLT11\n\u003e field.\n\u003e\n\nWe can do something even simpler.\n\nIf `amt_to_forward` plus the fees charged by this node is greater than the actual incoming HTLC, this is an AMP attempt.\nNo additional flag needs to be added.\nFor final payment nodes, if the `amt_to_forward` is greater than the incoming HTLC value, this is an AMP attempt.\n\nThe 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.\n\n---\n\nOf course, an explicit flag is more sensible as it is more explicit.\n\nFor 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.\nA 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.\nSo 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 \"MUST be all 0\".\n\nAn 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 \"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.\"\nAnother bit can also be used to provide spontaneous payment, so e.g. bit 2 could mean \"this hop is the final hop (even if HMAC is nonzero); the HMAC of this hop is really the preimage to claim this payment.\"\n\nRegards,\nZmnSCPxj",
"sig": "b2c1cbfa1dd090e42c72c55e46648eaa83cb875e2bbce56a5190d92fe9df422960f3f23eb3ef0e611d5ad7cc5edc0c82497c4ad70a762d019e328b296a91f69a"
}