author: akumaigorodski
Suppose user has a balance on a certain service which he wishes to turn into an incoming channel and service supports such functionality. This would require many parameters, so the resulting QR may be overly dense and cause scanning issues. Additionally, the user has must ensure that a connection to target LN node is established before an incoming channel is requested.
-
User scans a LNURL QR code or accesses an
lightning:LNURL..
link withLN WALLET
andLN WALLET
decodes LNURL. -
LN WALLET
makes a GET request toLN SERVICE
using the decoded LNURL. -
LN WALLET
gets JSON response fromLN SERVICE
of form:{ "uri": string, // Remote node address of form node_key@ip_address:port_number "callback": string, // a second-level URL which would initiate an OpenChannel message from target LN node "k1": string, // random or non-random string to identify the user's LN WALLET when using the callback URL "tag": "channelRequest" // type of LNURL }
or
{"status": "ERROR", "reason": "error details..."}
-
LN WALLET
opens a connection to the target node usinguri
field. -
LN WALLET
issues a GET request toLN SERVICE
using<callback><?/&>k1=<k1>&remoteid=<Local LN node ID>&private=<1/0>
if user decides to proceed or<callback><?/&>k1=<k1>&remoteid=<Local LN node ID>&cancel=1
if user decides to cancel a channel midway. -
LN SERVICE
sends a{"status": "OK"}
or{"status": "ERROR", "reason": "error details..."}
JSON response. -
LN WALLET
awaits for incomingOpenChannel
message from the target node, which would initiate a channel opening.