LNLink Setup
Follow this guide to get LNLink working with your node in no time!
Generating an LNLink QR Code
lnlink is a QR code format that enables direct connection and authentication to your lightning node over the lightning network.
THIS QRCODE CONTAINS SENSITIVE INFORMATION THAT GIVES ANYONE ACCESS TO YOUR LIGHTNING NODE. DO NOT SHOW IT TO ANYONE.
You can generate an LNLink from your commando-enabled c-lightning node with this script (call it lnlink, chmod +x lnlink). requires jq:
#!/usr/bin/env bash nodehost=$(lightning-cli getinfo | jq -r '. as $r | .address[0] | "\($r.id)@\(.address):\(.port)"') token=$(lightning-cli commando-rune "$@" | jq -r '.rune | @uri') echo "lnlink:$nodehost?token=$token"
You can create a QR code from this LNLink in your terminal with qrcode-terminal
$ npm -g install qrcode-terminal $ qrcode-terminal $(./lnlink) Create an lnlink that expires in a month (see token restrictions) $ qrcode-terminal $(./lnlink "restrictions=time<$(date +%s -d 'now + 1 month')")
LNLink QR Format
An lnlink looks like this:
An lnlink is a URI with the following elements
- lnlink: scheme
- nodeid@hostname and optional port (defaults to 9735)
- token querystring param - a urlencoded auth token (base64 rune in the case of c-lightning)
This is enough information to connect directly to a lightning node running a commando-compatible custom message handler