Is your feature request related to a problem? Please describe.
For our JIT channel implementation, Flow2.0 we require the use of wrapped invoices. Wrapped invoices are modified invoices that route the initial payment to the LSP (trustlessly) so the final hop can be made to the final recipient via zero-conf channel.
Unfortunately, there isn't a method to modify the invoice while updating LND. This means the wrapped invoice can only be distributed via explicit integrations with the LSP, making usage of JIT channels highly impractical.
Describe the solution you'd like
An invoice interceptor which behaves very much like the channel acceptor api. A simple high level flow might be:
Sender requests an invoice to send funds via btcpay server
Btcpay server requests invoice from Recipient node
Recipient node creates a classic bolt11 invoice
Recipient node submits the invoice to the invoice modifier (could be LSP)
Invoice modifier makes changes to invoice. For example changing the destination pubkey
Recipient node validates invoice (for example ensuring preimage hash has not been modified)
Recipient node stores invoice and issues response to Btcpay server
Sequence Diagram:
sequenceDiagram
participant Sender
participant BtcpayServer as Btcpay server
participant RecipientNode as Recipient node (LND)
participant InvoiceModifier as Invoice modifier (LSP)
Sender->>BtcpayServer: Request invoice to send funds
BtcpayServer->>RecipientNode: Request invoice
RecipientNode->>RecipientNode: Create classic bolt11 invoice
RecipientNode->>InvoiceModifier: Submit invoice for modification
InvoiceModifier->>RecipientNode: Return modified invoice (e.g., changed destination pubkey)
RecipientNode->>RecipientNode: Validate invoice (e.g., check preimage hash)
RecipientNode->>BtcpayServer: Store invoice and issue response
BtcpayServer->>Sender: Show Sender the modified invoice that supports the LSP function
Describe alternatives you've considered
Static config variables for every invoice created, defined in conf
Direct LSP integrations with every service atop LND
Additional context
This feature request is for our JIT channels LSP, but could be very useful to any system that wants to fiddle with how the recipient system routes payments. This feature would be very useful for 3rd party logic for hop-hints or virtual nodes. It allows for flexibility in implementing alternative solutions to complex payment acceptance needs.
Is your feature request related to a problem? Please describe. For our JIT channel implementation, Flow2.0 we require the use of wrapped invoices. Wrapped invoices are modified invoices that route the initial payment to the LSP (trustlessly) so the final hop can be made to the final recipient via zero-conf channel.
Unfortunately, there isn't a method to modify the invoice while updating LND. This means the wrapped invoice can only be distributed via explicit integrations with the LSP, making usage of JIT channels highly impractical.
Describe the solution you'd like An invoice interceptor which behaves very much like the channel acceptor api. A simple high level flow might be:
Sequence Diagram:
Describe alternatives you've considered
Additional context This feature request is for our JIT channels LSP, but could be very useful to any system that wants to fiddle with how the recipient system routes payments. This feature would be very useful for 3rd party logic for hop-hints or virtual nodes. It allows for flexibility in implementing alternative solutions to complex payment acceptance needs.