<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:2018-11-15&#xA;📝 Original message:&#xA;Hi all,&#xA;&#xA;    I want to propose a method of having reusable BOLT11 &#34;offers&#34; which&#xA;provide almost-spontaneous payments as well as not requiring generating&#xA;a BOLT11 invoice for each potential sale.&#xA;&#xA;An &#34;offer&#34; has a `p` field of 26 bytes (128 bits assuming top two are 0)&#xA;(which is ignored by existing nodes).  The payer uses a new lightning&#xA;probe message using the current onion format we use for HTLCs to&#xA;retreive the complete invoice.&#xA;&#xA;The format of the final-hop lightning onion would contain:&#xA;&#xA;        [whatever-marker-we-need?][128-bit-`p`-field][[type,len,data]+]&#xA;&#xA;We would probably define a few optional types to start:&#xA;&#xA;1. quantity: for ordering multiple of an item, default 1.&#xA;2. delivery-address: steal from https://www.w3.org/TR/vcard-rdf/#Delivery_Addressing_Properties ?&#xA;3. signature: basically a blob so payer can prove it was them.&#xA;&#xA;The return lightning message would contain a new bolt11 invoice (perhaps&#xA;we optimize some fields by copying from the bolt11 offer if they don&#39;t&#xA;appear?), and an additional field:&#xA;&#xA;        `m` (27) `data_length` 52.  Merkle hash of fields payer provided&#xA;        in onion msg above, and the offer `p` value.&#xA;&#xA;The payer checks the signature is correct, `m` is correct, and uses the&#xA;invoice to pay as normal.  The bolt11 offer + fields-from-onion + bolt11&#xA;invoice + preimage is the complete proof of payment.&#xA;&#xA;Refinements&#xA;-----------&#xA;&#xA;We can generate alternate leaves for the merkle tree (using&#xA;SHA256(shared-secret | leafnum)) so revealing the `m` value doesn&#39;t risk&#xA;revealing your delivery-address for example.&#xA;&#xA;The return needs to list the fields it *didn&#39;t* include in the merkle&#xA;because it didn&#39;t accept them (the merchant doesn&#39;t want to be bound to&#xA;conditions it doesn&#39;t understand!).&#xA;&#xA;We could add a `k` field to the bolt11 offer to allow the final invoice&#xA;to delegated to a separate key.&#xA;&#xA;The default `x` (expiry) field for an offer which does not have an&#xA;old-style 53-byte `p` field (ie. a &#34;pure&#34; offer) could be infinite.&#xA;&#xA;We could merkelize the delivery-address too :)&#xA;&#xA;I&#39;ve handwaved a bit over the detailed format, because there are other&#xA;things we want to put in the onion padding, and because the return is&#xA;similar to the &#34;soft-error&#34;/&#34;partial payment ack&#34; proposals.&#xA;&#xA;Results&#xA;-------&#xA;&#xA;This gives us static invoicing, and a single static invoice (without an&#xA;amount field) can thus be used to approximate &#34;spontaneous&#34; donations,&#xA;while still providing proof of payment; indeed, providing&#xA;non-transferrable proof-of-payment since the invoice now commits to the&#xA;payer-provided signature.&#xA;&#xA;It also provides a platform for recurring payments: while we can do this&#xA;with preimage-is-next-payment_hash, that requires pre-generation and&#xA;isn&#39;t compatible with static invoices.&#xA;&#xA;I apologize that this wasn&#39;t fleshed out before the summit, but I&#xA;overestimated the power of Scriptless Scripts so had mentally deferred&#xA;this.&#xA;&#xA;Thanks!&#xA;Rusty.</html></oembed>