<div dir="ltr">Dear Rusty, <div><br></div><div>I am not getting this proposal (maybe I am lacking some technical basic understandings) however I decided to ask more questions in order to complete my onboarding process faster and hope this is fine. </div><div><br></div><div>My problem starts with the fact that I can&#39;t find the term &quot;lightning probe message&quot; in the current BOLTs  (actually the term probe only occures two times and these seem unrelated to what you are talking about) so I am confused what this is. </div><div>As far as I understand your proposal from a high level the payer is supposed to create an onion package which triggers the offering of HTLCs with some additional metadata so that the receipient of the final onion can answer with a BOLT11 invoice. What I don&#39;t get is the fact that a payment hash needs to be known in order to offer HTLCs.</div><div>Though I imagine you ment it differently I would not see a problem with the payer to know the preimage in advance as he is creating the entire onion on his behalf and sponanious without invoice anyway. However I don&#39;t get why a returned BOLT11 invoice is needed then. I assume that my previouse statement is wrong anyway since you don&#39;t mention anywhere how the preimage would be send from the payer to the payee.</div><div><br></div><div>In general I was wondering (already during the summit) why we don&#39;t include a connection oriented communication layer on top of the current protocol which would allow payer and payee to communicate more efficiently about payment and routing process and to negotiate stuff like spontaneos payments. I see two reasons against this: 1.) more synchronous communication makes stuff more complicated to implement and 2.) privacy concerns.</div><div>Am I missing something here? (and sorry for splitting the topic but I didn&#39;t want to start a new one when it actually seems to fit to this proposal. </div><div><br></div><div>best Rene</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 4:57 AM Rusty Russell &lt;<a href="mailto:rusty@rustcorp.com.au">rusty@rustcorp.com.au</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
    I want to propose a method of having reusable BOLT11 &quot;offers&quot; which<br>
provide almost-spontaneous payments as well as not requiring generating<br>
a BOLT11 invoice for each potential sale.<br>
<br>
An &quot;offer&quot; has a `p` field of 26 bytes (128 bits assuming top two are 0)<br>
(which is ignored by existing nodes).  The payer uses a new lightning<br>
probe message using the current onion format we use for HTLCs to<br>
retreive the complete invoice.<br>
<br>
The format of the final-hop lightning onion would contain:<br>
<br>
        [whatever-marker-we-need?][128-bit-`p`-field][[type,len,data]+]<br>
<br>
We would probably define a few optional types to start:<br>
<br>
1. quantity: for ordering multiple of an item, default 1.<br>
2. delivery-address: steal from <a href="https://www.w3.org/TR/vcard-rdf/#Delivery_Addressing_Properties" rel="noreferrer" target="_blank">https://www.w3.org/TR/vcard-rdf/#Delivery_Addressing_Properties</a> ?<br>
3. signature: basically a blob so payer can prove it was them.<br>
<br>
The return lightning message would contain a new bolt11 invoice (perhaps<br>
we optimize some fields by copying from the bolt11 offer if they don&#39;t<br>
appear?), and an additional field:<br>
<br>
        `m` (27) `data_length` 52.  Merkle hash of fields payer provided<br>
        in onion msg above, and the offer `p` value.<br>
<br>
The payer checks the signature is correct, `m` is correct, and uses the<br>
invoice to pay as normal.  The bolt11 offer + fields-from-onion + bolt11<br>
invoice + preimage is the complete proof of payment.<br>
<br>
Refinements<br>
-----------<br>
<br>
We can generate alternate leaves for the merkle tree (using<br>
SHA256(shared-secret | leafnum)) so revealing the `m` value doesn&#39;t risk<br>
revealing your delivery-address for example.<br>
<br>
The return needs to list the fields it *didn&#39;t* include in the merkle<br>
because it didn&#39;t accept them (the merchant doesn&#39;t want to be bound to<br>
conditions it doesn&#39;t understand!).<br>
<br>
We could add a `k` field to the bolt11 offer to allow the final invoice<br>
to delegated to a separate key.<br>
<br>
The default `x` (expiry) field for an offer which does not have an<br>
old-style 53-byte `p` field (ie. a &quot;pure&quot; offer) could be infinite.<br>
<br>
We could merkelize the delivery-address too :)<br>
<br>
I&#39;ve handwaved a bit over the detailed format, because there are other<br>
things we want to put in the onion padding, and because the return is<br>
similar to the &quot;soft-error&quot;/&quot;partial payment ack&quot; proposals.<br>
<br>
Results<br>
-------<br>
<br>
This gives us static invoicing, and a single static invoice (without an<br>
amount field) can thus be used to approximate &quot;spontaneous&quot; donations,<br>
while still providing proof of payment; indeed, providing<br>
non-transferrable proof-of-payment since the invoice now commits to the<br>
payer-provided signature.<br>
<br>
It also provides a platform for recurring payments: while we can do this<br>
with preimage-is-next-payment_hash, that requires pre-generation and<br>
isn&#39;t compatible with static invoices.<br>
<br>
I apologize that this wasn&#39;t fleshed out before the summit, but I<br>
overestimated the power of Scriptless Scripts so had mentally deferred<br>
this.<br>
<br>
Thanks!<br>
Rusty.<br>
_______________________________________________<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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><a href="https://www.rene-pickhardt.de" target="_blank">https://www.rene-pickhardt.de</a></div><div><br></div><div>Skype: rene.pickhardt <br></div><div><br></div><div>mobile: +49 (0)176 5762 3618   </div></div></div></div></div></div></div>