<oembed><type>rich</type><version>1.0</version><author_name>npub17kxcmv2v95tlmhupv768wal5ukzwycqeewc8nq5ghyp6ys7a466qrkudlg</author_name><author_url>https://nostr.ae/npub17kxcmv2v95tlmhupv768wal5ukzwycqeewc8nq5ghyp6ys7a466qrkudlg</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-12-17&#xA;📝 Original message:&#xA;Hi ZmnSCPxj,&#xA;&#xA;So, are you saying there needs to be a new command &#34;signfakeinvoice&#34; at the&#xA;protocol level?&#xA;&#xA;If that was there, how much work/hours would it be to build the poor man&#39;s&#xA;rendez-vous at the application level?&#xA;&#xA;If the above were to be implemented, when the payer pays the invoice, it&#39;s&#xA;then automatically split and sent to two (or more) recipients?&#xA;&#xA;Lastly, would it make more sense to have split payments at the protocol&#xA;level?&#xA;&#xA;Thanks, Ronan&#xA;&#xA;On Thu, Dec 16, 2021 at 11:44 PM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&#xA;&gt; Good morning William,&#xA;&gt;&#xA;&gt;&#xA;&gt; &gt; Has anyone coded up a &#39;Poor man&#39;s rendez-vous&#39; demo yet? How hard would&#xA;&gt; &gt; it be, could it be done with a clightning plugin perhaps?&#xA;&gt;&#xA;&gt; Probably not *yet*; it needs each intermediate payee (i.e. the one that is&#xA;&gt; not the last one) to sign an invoice for which it does not know the&#xA;&gt; preimage.&#xA;&gt; Maybe call such a command `signfakeinvoice`.&#xA;&gt;&#xA;&gt; However, if a command to do the above is implemented (it would have to&#xA;&gt; generate and sign the invoice, but not insert it into the database at all),&#xA;&gt; then intermediate payees can use `htlc_accepted` hook for the &#34;rendez-vous&#34;.&#xA;&gt;&#xA;&gt; So to generate the invoice:&#xA;&gt;&#xA;&gt; * Arrange the payees in some agreed fixed order.&#xA;&gt; * Last payee generates a normal invoice.&#xA;&gt; * From last payee to second, each one:&#xA;&gt;   * Passes its invoice to the previous payee.&#xA;&gt;   * The previous payee then creates its own signed invoice with&#xA;&gt; `signfakeinvoice` to itself, adding its payout plus a fee budget, as well&#xA;&gt; as adding its own delay budget.&#xA;&gt;   * The previous payee plugin stores the next-payee invoice and the&#xA;&gt; details of its own invoice to db, such as by `datastore` command.&#xA;&gt; * The first payee sends the sender the invoice.&#xA;&gt;&#xA;&gt; On payment:&#xA;&gt;&#xA;&gt; * The sender sends the payment to the first hop.&#xA;&gt; * From first payee to second-to-last:&#xA;&gt;   * Triggers `htlc_accepted` hook, and plugin checks if the incoming&#xA;&gt; payment has a hash that is in this scheme stored in the database.&#xA;&gt;   * The plugin gathers `htlc_accepted` hook invocations until they sum up&#xA;&gt; to the expected amount (this handles multipath between payees).&#xA;&gt;   * The plugin marks that it has gathered all `htlc_accepted` hooks for&#xA;&gt; that hash in durable storage a.k.a. `datastore` (this handles a race&#xA;&gt; condition where the plugin is able to respond to some `htlc_accepted`&#xA;&gt; hooks, but the node is restarted before all of them were able to be&#xA;&gt; recorded by C-Lightning in its own database --- this makes the plugin skip&#xA;&gt; the &#34;gathering&#34; step above, once it has already gathered them all before).&#xA;&gt;   * The plugin checks if there is already an outgoing payment for that&#xA;&gt; hash (this handles the case where our node gets restarted in the meantime&#xA;&gt; --- C-Lightning will reissue `htlc_accepted` on startup)&#xA;&gt;     * If the outgoing payment exists and is pending, wait for it to&#xA;&gt; resolve to either success or failure.&#xA;&gt;     * If the outgoing payment exists and succeeded, resolve all the&#xA;&gt; gathered `htlc_accepted` hooks.&#xA;&gt;     * If the outgoing payment exists and failed, fail all the gathered&#xA;&gt; `htlc_accepted` hooks.&#xA;&gt;     * Otherwise, perform a `pay`, giving `maxfeepercent` and `maxdelay`&#xA;&gt; based on its fee budget and delay budget.&#xA;&gt;       When the `pay` succeeds or fails, propagate it to the gathered&#xA;&gt; `htlc_accepted` hooks.&#xA;&gt; * The last payee just receives a normal payment using the normal&#xA;&gt; invoice-receive scheme.&#xA;&gt;&#xA;&gt; Regards,&#xA;&gt; ZmnSCPxj&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211217/f105a9e5/attachment.html&gt;</html></oembed>