-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
The invoice registry is one area where flexibility can be really beneficial to users. Some examples:
- Stateless invoices
- Multi-destination invoices (fail over in case one node goes down)
- Pre-acceptance checks for spontaneous payments
Currently it isn't easy or fast to implement this functionality. The invoice registry code is relatively complex because of the many different code paths and changes need to land in a release first. Running a fork is often outside a node operator's comfort zone.
This issue is about adding the option to use lnd with an external invoice registry so that users can experiment more easily in this area and the path is opened up for alternative (open-source) registry implementations.
On the technical side, this doesn't look too difficult. The one important call that needs to be routed to an another process is:
NotifyExitHopHtlc(rHash lntypes.Hash,
amtPaid lnwire.MilliSatoshi, expiry uint32, currentHeight int32,
circuitKey channeldb.CircuitKey, hodlChan chan<- interface{},
payload Payload) (HtlcResolution, error)
Implementation could be via a bidirectional grpc stream.
So far LND doesn't connect out to other processes besides the chain backend. It is a question if other processes calling in to lnd such as htlc interceptor, channel acceptor, etc, is always the best choice. Maybe configuring lnd with a grpc endpoint for the invoice registry could work too.
First goal could be to add the grpc api for the invoice registry and then create an external registry using the code that currently lives within lnd. It can be the 'reference implementation'.