<oembed><type>rich</type><version>1.0</version><title>Rusty Russell [ARCHIVE] wrote</title><author_name>Rusty Russell [ARCHIVE] (npub1zw…hkhpx)</author_name><author_url>https://yabu.me/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2019-11-08&#xA;📝 Original message:&#xA;ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; writes:&#xA;&gt; First, please confirm my understanding of the message flow.&#xA;&gt; Suppose I have a donation offer on my website and Rusty wants to donate to me.&#xA;&gt; Then:&#xA;&gt;&#xA;&gt;          ZmnSCPxj                      Rusty&#xA;&gt;             |                            |&#xA;&gt;             +---------- `lno` ----------&gt;+ (via non-Lightning communication channel e.g. https)&#xA;&gt;             |                            |&#xA;&gt;             +&lt;---- `invoice_request` ----+ (via a normal Rusty-&gt;ZmnSCPxj payment)&#xA;&gt;             |                            |&#xA;&gt;             +---- `invoice_or_error` ---&gt;| (by failing the above payment and embedding in the failure blob)&#xA;&gt;             |                            |&#xA;&gt;             +&lt;------- `sendpay` ---------+ (via a normal Rusty-&gt;ZmnSCPxj payment)&#xA;&gt;&#xA;&gt; Is it approximately correct?&#xA;&#xA;Sorry for delayed response; yes, this is correct.&#xA;&#xA;&gt;&gt; gets an invoice request (`lni...`), and sends the invoice over the&#xA;&gt;&gt; lightning network, retreiving an empty reply.&#xA;&gt;&#xA;&gt; Here are completely pointless counterproposals for the offer and invoice-request HRPs:&#xA;&gt;&#xA;&gt; * Offers:&#xA;&gt;   * `lnpayme`&#xA;&gt;   * `lnbuyit`&#xA;&gt;   * `lnforsale`&#xA;&gt; * Invoice Requests:&#xA;&gt;   * `lnpaying`&#xA;&gt;   * `lnbuying`&#xA;&gt;   * `lnshutupandtakemymoney`&#xA;&gt;&#xA;&gt; `lno` and `lni` feel wrong to me.&#xA;&gt; 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.&#xA;&#xA;lnx and lny?  Nobody can interpret them at all, that way :)&#xA;&gt;&gt;     3.  type: 2 (`description`)&#xA;&gt;&gt;     4.  data:&#xA;&gt;&gt;         -   [`...*byte`:`description`]&#xA;&gt;&#xA;&gt; UTF-8?&#xA;&gt; Null-terminated?&#xA;&#xA;I was thinking UTF-8 like current field.&#xA;&#xA;&gt;&gt; -   MUST include `amount` if it includes `recurrence`.&#xA;&gt;&gt; -   if it includes `amount`:&#xA;&gt;&gt;     -   MUST specify `currency` as the ISO 4712 or BIP-0173, padded with zero bytes if required&#xA;&gt;&#xA;&gt; I cannot find ISO 4712, but could find ISO 4217.&#xA;&#xA;Oops, I fixed my typo wrong.  Thanks.&#xA;&#xA;&gt; BIP-173 does not have a list of currencies, but refers to SLIP-0173.&#xA;&gt; Some of the listed currencies there seem to have more than 4 characters.&#xA;&#xA;Oh, I&#39;d never seen SLIP-0173.  Cool, I increased it to 5; SLIP-0173 has&#xA;no limit but I find it hard to care about any of them anyway.&#xA;&#xA;&gt; Should I assume encoding is ASCII?&#xA;&gt; We will &#34;never&#34; see a non-ASCII currency code?&#xA;&#xA;Not really, but if you don&#39;t understand it you can&#39;t do much, ASCII or&#xA;no.&#xA;&#xA;&gt;&gt; The &#34;default offer&#34; of a node is a nominal offer used to send&#xA;&gt;&gt; unsolicited payments. It is generally not actually sent, but can be&#xA;&gt;&gt; used by any other node as if it has been. It has the following&#xA;&gt;&gt; fields:&#xA;&gt;&gt;&#xA;&gt;&gt; -   `offer_idenfitier`: zero-length&#xA;&gt;&gt; -   `d`: any&#xA;&gt;&gt; -   `n`: the node id of the recipient.&#xA;&gt;&#xA;&gt; 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?&#xA;&#xA;Yep!&#xA;&#xA;&gt;&gt; The `refund_proof` refers to a previous invoice paid by the sender for&#xA;&gt;&gt; the specific case of a `refund_for` offer. It provides proof of&#xA;&gt;&gt; payment (the `payment_preimage` and also a signature of the&#xA;&gt;&gt; `payment_hash` from the `key` which requested the being-refunded&#xA;&gt;&gt; invoice (which does not have to be the same as this `key`!).&#xA;&gt;&#xA;&gt; An earlier requirement mentions that writers of offers or invoice request MUST have `paths` in some condition.&#xA;&gt; The below does not have `paths`, but there is a &#34;human-readable&#34; alternate encoding which *does* have `paths`.&#xA;&gt; It might be better to clarify this point.&#xA;&#xA;The in-wire one doesn&#39;t have paths, since you respond by reply; you&#xA;don&#39;t need (and should not be able to) find the sender.&#xA;&#xA;The non-wire one needs a path, since you need to initiate a reply.&#xA;&#xA;&gt;&gt; The `directed` and `directed_reply` Messages&#xA;&gt;&gt;&#xA;&gt;&gt; ---------------------------------------------&#xA;&gt;&gt;&#xA;&gt;&gt; 1.  type: 384 (`directed`) (`option_directed_messages`)&#xA;&gt;&gt; 2.  data:&#xA;&gt;&gt;     -   [`chain_hash`:`chain_hash`]&#xA;&gt;&gt;     -   [`u64`:`id`]&#xA;&gt;&gt;     -   [`1366*byte`:`onion_routing_packet`]&#xA;&gt;&gt; 3.  type: 384 (`directed_reply`) (`option_directed_messages`)&#xA;&gt;&gt; 4.  data:&#xA;&gt;&gt;     -   [`chain_hash`:`chain_hash`]&#xA;&gt;&gt;     -   [`u64`:`id`]&#xA;&gt;&gt;     -   [`u16`:`len`]&#xA;&gt;&gt;     -   [`len*byte`:`reply`]&#xA;&gt;&#xA;&gt; This new `directed` message will be the mechanism for sending invoice requests and receiving invoice request responses?&#xA;&#xA;Yes.&#xA;&#xA;&gt; What incentive is there for a forwarding node to actually forward a `directed` message?&#xA;&#xA;It&#39;s a strong liveness indicator to the sender, so they&#39;re likely to use&#xA;the same path for the actual payment.&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>