Initializing Lightning Network Daemon (LND)

2. Lightning Network Daemon (LND)

In the previous chapter we configured the wallet password and saved it in the walletunlock file. In this chapter we initialize the LND node by creating the wallet, recording the seed phrase, and enabling automatic unlocking. By the end, the node will be ready to acquire liquidity and start receiving payments.

2.1 Creating the Wallet

We run the following:

cat app-data/lnd/walletunlock

This returns the password created in the previous step.

+6Mn31qVwLC-

We copy it and run:

docker exec -it node_lnd lncli create

This takes us to the wallet creation wizard.

Image 1: Wallet encryption key.

Wallet encryption key
  1. We enter the password from the walletunlock file twice.

Image 2: Creating a new wallet.

Create new wallet
  1. We enter n to create a new wallet.

Image 3: Creating a passphrase for the wallet.

Create passphrase
  1. We press Enter to skip the passphrase.

Image 4: LND wallet seed phrase.

Seed phrase
  1. We copy the seed phrase in a safe place away from the internet.
Note: This seed does not comply with the BIP39 standard, so if you try to restore it in a wallet like Sparrow, Electrum, or another, you will not see the on-chain funds.

Now we edit the lnd.conf file and look for the line wallet-unlock-file.

nano app-data/lnd/lnd.conf

Image 5: lnd.conf file parameter wallet-unlock-file.

lnd.conf file
  1. We remove the # symbol from the beginning of the line wallet-unlock-file.

We save and exit the file ctrl+s and ctrl+x.

2.2 Acquiring Liquidity (Inbound Channels)

To receive payments in the Mint or LNbits, the node needs inbound liquidity. Being a new node, it has no open channels, so we must rent or buy initial liquidity through specialized markets.

If we already have Bitcoin we can open channels directly from the node, which gives us capacity to send payments. However, to receive payments we specifically need inbound liquidity, and obtaining it through the services listed below is usually more practical and cost-effective, especially at the start.

2.2.1 Recommended Liquidity Services

  • LNBig: Allows requesting direct channels to the node. Ideal for fast liquidity and high capacity.
  • Amboss Magma: Marketplace where we can buy inbound liquidity channels. Allows filtering by reputation, duration, and cost.
  • Zeus LSP: Liquidity provider integrated with the Zeus wallet, allows opening channels easily.
  • LN Server: Channel opening service with different capacity options.

To use these services, we will need the node URI, which has the format:

pubkey@ip:9735 or pubkey@address.onion:9735

2.2.2 Getting the LND Node URI Address

We run:

docker exec -it node_lnd lncli getinfo

Image 6: Result of the lncli getinfo command.

lncli getinfo command
  1. Public key of the LND node.
  2. Node URI address both on Clearnet and Tor; either is valid for liquidity providers.