@model LightningNodeViewModel @{ Layout = "_LayoutWalletSetup.cshtml"; ViewData.SetActivePage(StoreNavPages.LightningSettings, "Connect to a Lightning node", Context.GetStoreData().Id); } @section PageHeadContent { }

@ViewData["Title"]

@if (Model.CanUseInternalNode) {

Using the BTCPay Server internal node for this store requires no further configuration. Click the save button below to start accepting Bitcoin through the Lightning Network.

} else {

Your instance administrator has disabled the use of the Internal node for non-admin users.

}

BTCPay Server currently supports:

  • type=clightning;server=unix://root/.lightning/lightning-rpc
  • type=clightning;server=tcp://1.1.1.1:27743/

  • type=charge;server=https://charge:8080/;api-token=myapitoken...

  • type=eclair;server=https://eclair:8080/;password=eclairpassword...

Note that bitcoin-host and bitcoin-auth are optional, only useful if you want to use GetDepositAddress on Eclair:

  • type=eclair;server=https://eclair:8080/;password=eclairpassword;bitcoin-host=bitcoin.host;bitcoin-auth=btcpass

  • type=lnd-rest;server=https://mylnd:8080/;macaroon=abef263adfe...
  • type=lnd-rest;server=https://mylnd:8080/;macaroon=abef263adfe...;certthumbprint=abef263adfe...

For the macaroon options you need to provide a macaroon with the invoices:write permission (e.g. invoice.macaroon, see details). If you want to display the node connection details, it also needs the info:read permission.
The path to the LND data directory may vary, the following examples assume /root/.lnd.

The macaroon parameter expects the HEX value, it can be obtained using this command:

xxd -p -c 256 /root/.lnd/data/chain/bitcoin/mainnet/invoice.macaroon | tr -d '\n'

You can omit certthumbprint if the certificate is trusted by your machine.
The certthumbprint can be obtained using this command:

openssl x509 -noout -fingerprint -sha256 -in /root/.lnd/tls.cert | sed -e 's/.*=//;s/://g'

If your LND REST server is using HTTP or HTTPS with an untrusted certificate, you can set allowinsecure=true as a fallback.

  • type=lndhub;server=https://login:password@lndhub.io

The credentials and server address are shown as a lndhub:// URL on the "Export/Backup" screen in BlueWallet.

You can also use this LNDhub-URL as the connection string and BTCPay Server converts it into the expected type=lndhub connection string format:

  • lndhub://login:password@@https://lndhub.io
@section PageFootContent { }