Rusty Russell [ARCHIVE] on Nostr: 📅 Original date posted:2019-11-08 📝 Original message: ZmnSCPxj <ZmnSCPxj at ...
📅 Original date posted:2019-11-08
📝 Original message:
ZmnSCPxj <ZmnSCPxj at protonmail.com> writes:
> First, please confirm my understanding of the message flow.
> Suppose I have a donation offer on my website and Rusty wants to donate to me.
> Then:
>
> ZmnSCPxj Rusty
> | |
> +---------- `lno` ---------->+ (via non-Lightning communication channel e.g. https)
> | |
> +<---- `invoice_request` ----+ (via a normal Rusty->ZmnSCPxj payment)
> | |
> +---- `invoice_or_error` --->| (by failing the above payment and embedding in the failure blob)
> | |
> +<------- `sendpay` ---------+ (via a normal Rusty->ZmnSCPxj payment)
>
> Is it approximately correct?
Sorry for delayed response; yes, this is correct.
>> gets an invoice request (`lni...`), and sends the invoice over the
>> lightning network, retreiving an empty reply.
>
> Here are completely pointless counterproposals for the offer and invoice-request HRPs:
>
> * Offers:
> * `lnpayme`
> * `lnbuyit`
> * `lnforsale`
> * Invoice Requests:
> * `lnpaying`
> * `lnbuying`
> * `lnshutupandtakemymoney`
>
> `lno` and `lni` feel wrong to me.
> Their juxtaposition implies `lno` == output and `lni` == input to me, due to the use of `o` and `i`, though `lno` is where you get money in exchange for product and `lni` is the request-for-service.
lnx and lny? Nobody can interpret them at all, that way :)
>> 3. type: 2 (`description`)
>> 4. data:
>> - [`...*byte`:`description`]
>
> UTF-8?
> Null-terminated?
I was thinking UTF-8 like current field.
>> - MUST include `amount` if it includes `recurrence`.
>> - if it includes `amount`:
>> - MUST specify `currency` as the ISO 4712 or BIP-0173, padded with zero bytes if required
>
> I cannot find ISO 4712, but could find ISO 4217.
Oops, I fixed my typo wrong. Thanks.
> BIP-173 does not have a list of currencies, but refers to SLIP-0173.
> Some of the listed currencies there seem to have more than 4 characters.
Oh, I'd never seen SLIP-0173. Cool, I increased it to 5; SLIP-0173 has
no limit but I find it hard to care about any of them anyway.
> Should I assume encoding is ASCII?
> We will "never" see a non-ASCII currency code?
Not really, but if you don't understand it you can't do much, ASCII or
no.
>> The "default offer" of a node is a nominal offer used to send
>> unsolicited payments. It is generally not actually sent, but can be
>> used by any other node as if it has been. It has the following
>> fields:
>>
>> - `offer_idenfitier`: zero-length
>> - `d`: any
>> - `n`: the node id of the recipient.
>
> In essence, this is an implicitly-existing offer that never expires, and which can be used by any node at any time to construct an invoice request?
Yep!
>> The `refund_proof` refers to a previous invoice paid by the sender for
>> the specific case of a `refund_for` offer. It provides proof of
>> payment (the `payment_preimage` and also a signature of the
>> `payment_hash` from the `key` which requested the being-refunded
>> invoice (which does not have to be the same as this `key`!).
>
> An earlier requirement mentions that writers of offers or invoice request MUST have `paths` in some condition.
> The below does not have `paths`, but there is a "human-readable" alternate encoding which *does* have `paths`.
> It might be better to clarify this point.
The in-wire one doesn't have paths, since you respond by reply; you
don't need (and should not be able to) find the sender.
The non-wire one needs a path, since you need to initiate a reply.
>> The `directed` and `directed_reply` Messages
>>
>> ---------------------------------------------
>>
>> 1. type: 384 (`directed`) (`option_directed_messages`)
>> 2. data:
>> - [`chain_hash`:`chain_hash`]
>> - [`u64`:`id`]
>> - [`1366*byte`:`onion_routing_packet`]
>> 3. type: 384 (`directed_reply`) (`option_directed_messages`)
>> 4. data:
>> - [`chain_hash`:`chain_hash`]
>> - [`u64`:`id`]
>> - [`u16`:`len`]
>> - [`len*byte`:`reply`]
>
> This new `directed` message will be the mechanism for sending invoice requests and receiving invoice request responses?
Yes.
> What incentive is there for a forwarding node to actually forward a `directed` message?
It's a strong liveness indicator to the sender, so they're likely to use
the same path for the actual payment.
Cheers,
Rusty.
Published at
2023-06-09 12:57:16Event JSON
{
"id": "02524566b7737a023490eecd5ad7abd7e1d1be1105fc8eeaef763b242172a7dd",
"pubkey": "13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425",
"created_at": 1686315436,
"kind": 1,
"tags": [
[
"e",
"a9016896e78ef5f5473204edd89280667686b471d7f529d125afce8e0e678ed9",
"",
"root"
],
[
"e",
"fb3e4f8e74929930f92dd3ad3360ec0d2be60d04f1ebd14a46aa666f7fcc635f",
"",
"reply"
],
[
"p",
"4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861"
]
],
"content": "📅 Original date posted:2019-11-08\n📝 Original message:\nZmnSCPxj \u003cZmnSCPxj at protonmail.com\u003e writes:\n\u003e First, please confirm my understanding of the message flow.\n\u003e Suppose I have a donation offer on my website and Rusty wants to donate to me.\n\u003e Then:\n\u003e\n\u003e ZmnSCPxj Rusty\n\u003e | |\n\u003e +---------- `lno` ----------\u003e+ (via non-Lightning communication channel e.g. https)\n\u003e | |\n\u003e +\u003c---- `invoice_request` ----+ (via a normal Rusty-\u003eZmnSCPxj payment)\n\u003e | |\n\u003e +---- `invoice_or_error` ---\u003e| (by failing the above payment and embedding in the failure blob)\n\u003e | |\n\u003e +\u003c------- `sendpay` ---------+ (via a normal Rusty-\u003eZmnSCPxj payment)\n\u003e\n\u003e Is it approximately correct?\n\nSorry for delayed response; yes, this is correct.\n\n\u003e\u003e gets an invoice request (`lni...`), and sends the invoice over the\n\u003e\u003e lightning network, retreiving an empty reply.\n\u003e\n\u003e Here are completely pointless counterproposals for the offer and invoice-request HRPs:\n\u003e\n\u003e * Offers:\n\u003e * `lnpayme`\n\u003e * `lnbuyit`\n\u003e * `lnforsale`\n\u003e * Invoice Requests:\n\u003e * `lnpaying`\n\u003e * `lnbuying`\n\u003e * `lnshutupandtakemymoney`\n\u003e\n\u003e `lno` and `lni` feel wrong to me.\n\u003e Their juxtaposition implies `lno` == output and `lni` == input to me, due to the use of `o` and `i`, though `lno` is where you get money in exchange for product and `lni` is the request-for-service.\n\nlnx and lny? Nobody can interpret them at all, that way :)\n\u003e\u003e 3. type: 2 (`description`)\n\u003e\u003e 4. data:\n\u003e\u003e - [`...*byte`:`description`]\n\u003e\n\u003e UTF-8?\n\u003e Null-terminated?\n\nI was thinking UTF-8 like current field.\n\n\u003e\u003e - MUST include `amount` if it includes `recurrence`.\n\u003e\u003e - if it includes `amount`:\n\u003e\u003e - MUST specify `currency` as the ISO 4712 or BIP-0173, padded with zero bytes if required\n\u003e\n\u003e I cannot find ISO 4712, but could find ISO 4217.\n\nOops, I fixed my typo wrong. Thanks.\n\n\u003e BIP-173 does not have a list of currencies, but refers to SLIP-0173.\n\u003e Some of the listed currencies there seem to have more than 4 characters.\n\nOh, I'd never seen SLIP-0173. Cool, I increased it to 5; SLIP-0173 has\nno limit but I find it hard to care about any of them anyway.\n\n\u003e Should I assume encoding is ASCII?\n\u003e We will \"never\" see a non-ASCII currency code?\n\nNot really, but if you don't understand it you can't do much, ASCII or\nno.\n\n\u003e\u003e The \"default offer\" of a node is a nominal offer used to send\n\u003e\u003e unsolicited payments. It is generally not actually sent, but can be\n\u003e\u003e used by any other node as if it has been. It has the following\n\u003e\u003e fields:\n\u003e\u003e\n\u003e\u003e - `offer_idenfitier`: zero-length\n\u003e\u003e - `d`: any\n\u003e\u003e - `n`: the node id of the recipient.\n\u003e\n\u003e In essence, this is an implicitly-existing offer that never expires, and which can be used by any node at any time to construct an invoice request?\n\nYep!\n\n\u003e\u003e The `refund_proof` refers to a previous invoice paid by the sender for\n\u003e\u003e the specific case of a `refund_for` offer. It provides proof of\n\u003e\u003e payment (the `payment_preimage` and also a signature of the\n\u003e\u003e `payment_hash` from the `key` which requested the being-refunded\n\u003e\u003e invoice (which does not have to be the same as this `key`!).\n\u003e\n\u003e An earlier requirement mentions that writers of offers or invoice request MUST have `paths` in some condition.\n\u003e The below does not have `paths`, but there is a \"human-readable\" alternate encoding which *does* have `paths`.\n\u003e It might be better to clarify this point.\n\nThe in-wire one doesn't have paths, since you respond by reply; you\ndon't need (and should not be able to) find the sender.\n\nThe non-wire one needs a path, since you need to initiate a reply.\n\n\u003e\u003e The `directed` and `directed_reply` Messages\n\u003e\u003e\n\u003e\u003e ---------------------------------------------\n\u003e\u003e\n\u003e\u003e 1. type: 384 (`directed`) (`option_directed_messages`)\n\u003e\u003e 2. data:\n\u003e\u003e - [`chain_hash`:`chain_hash`]\n\u003e\u003e - [`u64`:`id`]\n\u003e\u003e - [`1366*byte`:`onion_routing_packet`]\n\u003e\u003e 3. type: 384 (`directed_reply`) (`option_directed_messages`)\n\u003e\u003e 4. data:\n\u003e\u003e - [`chain_hash`:`chain_hash`]\n\u003e\u003e - [`u64`:`id`]\n\u003e\u003e - [`u16`:`len`]\n\u003e\u003e - [`len*byte`:`reply`]\n\u003e\n\u003e This new `directed` message will be the mechanism for sending invoice requests and receiving invoice request responses?\n\nYes.\n\n\u003e What incentive is there for a forwarding node to actually forward a `directed` message?\n\nIt's a strong liveness indicator to the sender, so they're likely to use\nthe same path for the actual payment.\n\nCheers,\nRusty.",
"sig": "21907038f94293d932ad5ffc1330e8c7be8cc1a97f4a6338540e3f85bfc77a4d53585d028cacda413054e325196dc49defa4efaf014c8603ce511a31499c44b3"
}