Search code examples
bitcoinlightning-network

lightning network, identity cahnnel


I want to make a service that allows to bind private user's channels to a user's account.

The user opens a private channel with my node. But I don't know which user exactly.

To identify the channel, I plan to ask the BOLT11 request from user, with a unique identifier in the description, like an SMS code. BOLT11 specifies the target address of the payment. I will find a route for this request and thus determine the user's channel.

Is such a scheme safe? Can a fraudster create a BOLT11 request for a channel that does not belong to him? Сan you suggest a better identification scheme?


Solution

  • Can a fraudster create a BOLT11 request for a channel that does not belong to him?

    Bolt 11 states:

    The recovery ID allows public-key recovery, so the identity of the payee node can be implied

    I'm not sure how every implementation matches the specification here. I would assume that all of them perform signature verification, but they might not expose public-key recovery functionality. Your idea of finding a path without actually paying the invoice might work.

    However it seems that what you need is actually to identify an existing private channel between your node and the user's. Private channels should be included as routing hints in the invoice, so it might even be easier to get it from there by just decoding the invoice.

    An alternative option would be to ask the user to pay an invoice generated by your node, a msat would be enough. For sure she won't be able to craft a payment with a node she doesn't control.