Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Machine-to-machine LN payments

3 messages, May 14 to 17, 2020. Started by Eugene.

Eugene (2), William Casarin

Permalink First message in the Wayback Machine

Eugene permalink original

Hello, list,

I haven't closely following the Lightning Network's state of affairs since late 2018 and I wondering, is it possible to support the following use-case with LN:

1. A user subscribes to the service by opening a channel with it
2. User sets his LN node to "trust" invoices that come from said service
3. On subscription renewal, service sends an invoice to the client's LN node
4. Since the client's node is "trusting" service's node, it pays invoice straight away

User, of course, may cancel the subscription at any time by removing service's LN node public key from the list of "trusted". Or the user can set a limit on the amount and the frequency of payments that would be accepted from the trusted node.

For that matter, the questions are:

1. Is it possible to send invoices just by LN means? (Should we use TLVs?)
2. Is it possible to enable automatic machine-to-machine payments? As in the example above, by accepting invoices from "trusted" nodes.

Best regards, Eugene

William Casarin in reply to Eugene permalink original

Eugene via Lightning-dev <lightning-dev at lists.linuxfoundation.org> writes:

Quoted text (15 lines)
> Hello, list,
>
> I haven't closely following the Lightning Network's state of affairs since late 2018 and I wondering, is it possible to support the following use-case with LN:
>
> 1. A user subscribes to the service by opening a channel with it
> 2. User sets his LN node to "trust" invoices that come from said service
> 3. On subscription renewal, service sends an invoice to the client's LN node
> 4. Since the client's node is "trusting" service's node, it pays invoice straight away
>
> User, of course, may cancel the subscription at any time by removing service's LN node public key from the list of "trusted". Or the user can set a limit on the amount and the frequency of payments that would be accepted from the trusted node.
>
> For that matter, the questions are:
>
> 1. Is it possible to send invoices just by LN means? (Should we use TLVs?)
> 2. Is it possible to enable automatic machine-to-machine payments? As in the example above, by accepting invoices from "trusted" nodes.

Offers[0] should support these use cases

Cheers, Will

[0] https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2019/bolt-12-offers#m-5af7de84
Eugene in reply to Eugene permalink original

Hello,

I found a way for one client to initiate a payment from the other by using spontaneous keysend payments:

1. Payee sends keysend payment of negligible amount (1 sat?)
2. Payer accepts keysend and verifies that it comes from a trusted node
3. Payer makes a keysend payment of required amount back to Payee
4. Payee accepts payment

Step two should probably be implemented by a custom plugin that checks incoming keysend messages and pays valid ones back.

The flow above is basically uses keysend to send an invoice to Payer to be paid. I wonder if there's an other way to send an invoice through LN by Payer's node public key?

Cheers, Eugene

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Friday, 15 May 2020 01:13, Eugene via Lightning-dev <lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (18 lines)
> Hello, list,
>
> I haven't closely following the Lightning Network's state of affairs since late 2018 and I wondering, is it possible to support the following use-case with LN:
>
> 1. A user subscribes to the service by opening a channel with it
> 2. User sets his LN node to "trust" invoices that come from said service
> 3. On subscription renewal, service sends an invoice to the client's LN node
> 4. Since the client's node is "trusting" service's node, it pays invoice straight away
>
> User, of course, may cancel the subscription at any time by removing service's LN node public key from the list of "trusted". Or the user can set a limit on the amount and the frequency of payments that would be accepted from the trusted node.
>
> For that matter, the questions are:
>
> 1. Is it possible to send invoices just by LN means? (Should we use TLVs?)
> 2. Is it possible to enable automatic machine-to-machine payments? As in the example above, by accepting invoices from "trusted" nodes.
>
> Best regards,
> Eugene