DevelopersRun

Configure lianad

Every key lianad reads from its TOML file, with its type, its default and the values it accepts.

Pass the file to lianad --conf and to liana-cli --conf, which reads it to find the socket of lianad. Set every option in this file, since lianad reads none from the command line or the environment.

Start from a complete file

This file sets up a signet wallet with one recovery path, timelocked for 65,535 blocks (about 1 year and 3 months), on Bitcoin Core:

lianad.toml
data_directory = "/home/user/liana/signet"
log_level = "info"
main_descriptor = "wsh(or_d(pk([0dd8c6f0/48'/1'/0'/2']tpubDFMbZ7U5k5hEfsttnZTKMmwrGMHnqUGxhShsvBjHimXBpmAp5KmxpyGsLx2toCaQgYq5TipBLhTUtA2pRSB9b14m5KwSohTDoCHkk1EnqtZ/<0;1>/*),and_v(v:pkh([d4ab66f1/48'/1'/0'/2']tpubDEXYN145WM4rVKtcWpySBYiVQ229pmrnyAGJT14BBh2QJr7ABJswchDicZfFaauLyXhDad1nCoCZQEwAW87JPotP93ykC9WJvoASnBjYBxW/<0;1>/*),older(65535))))#7nvn6ssc"

[bitcoin_config]
network = "signet"
poll_interval_secs = 30

[bitcoind_config]
addr = "127.0.0.1:38332"
cookie_path = "/home/user/.bitcoin/signet/.cookie"

To use an Electrum server instead, replace the last section:

lianad.toml
[electrum_config]
addr = "ssl://electrum.example.org:50002"
validate_domain = true

Replace main_descriptor with your wallet's descriptor.

Your wallet already runs in Liana?

For a wallet that does not use Liana Connect, Liana's installer writes this same format to daemon.toml, in the wallet's data directory. Attach Liana to a running lianad starts lianad on that file.

Keep a copy of the descriptor outside this file

Your seed phrases alone cannot restore a Liana wallet. If this file holds the only copy of the descriptor, losing it can cost you the bitcoin in the wallet. See Back up your wallet.

Set the top-level keys

Write these keys above the first section header. TOML assigns a key written below a header to that section.

Prop

Type

Write a descriptor lianad accepts

If you write or edit a descriptor by hand, lianad accepts it only if:

  • It is wsh(...) or tr(...), with a primary spending path and at least one recovery path.
  • Each recovery path has its own older() value, from 1 to 65,535 blocks (about 1 year and 3 months).
  • Every key of a spending path has an origin, a multipath step of exactly two indexes and an unhardened wildcard, with no hardened step after the xpub: [0dd8c6f0/48'/1'/0'/2']tpubDFMb.../<0;1>/*.
  • Every key is an xpub when network is bitcoin, and a tpub on any other network.

Set the data directory

Use data_directory. The legacy data_dir behaves differently. With network = "signet":

You setlianad uses
data_directory = "/home/user/liana/signet"/home/user/liana/signet
data_dir = "/home/user/liana"/home/user/liana/signet
Both keysThe data_directory value
Neither, on Linux~/.liana/signet
Neither, on macOS~/Library/Application Support/Liana/signet

Write an absolute path. lianad does not expand ~ in the file.

Set the network and the polling interval

Add a [bitcoin_config] section. lianad refuses a file without it.

Prop

Type

Connect a Bitcoin backend

Add exactly one backend section.

Connect Bitcoin Core

Add a [bitcoind_config] section. Run lianad on the same machine as Bitcoin Core, under the same user. Bitcoin Core writes the watch-only wallet it keeps for lianad into the data directory, as lianad_watchonly_wallet. lianad creates that directory with mode 0700, so only its own user can write there.

Prop

Type

Prefer cookie_path, which keeps the password out of the file. Each option needs one precaution:

  • cookie_path: Restart lianad after every Bitcoin Core restart. Bitcoin Core writes a new cookie each time it starts, but lianad reads the cookie only once, at its own start.
  • auth: Keep the file private, since the password sits in it in clear text. On the Bitcoin Core side, set the password with rpcauth, which Bitcoin Core recommends over rpcpassword.

Connect an Electrum server

Add an [electrum_config] section.

Prop

Type

validate_domain = false turns off every certificate check

lianad then accepts any certificate, so a machine on the network path can pose as your server. Set it to false only for your own server with a self-signed certificate, on a network you control.

Fix a file lianad rejects

lianad prints a file error after Error parsing config:. It prints a startup error after Error starting Liana daemon:, unless log_level is "off".

The message containsFix
missing fieldAdd the key, above the first section header if it is a top-level key.
unknown variantWrite network in lowercase, from the list above.
Error parsing '...'Fix the quoted descriptor or log level.
one xpub is not for networkMatch the keys to network: xpubs for bitcoin, tpubs for the rest.
No Bitcoin backend entry in the configuration.Add a backend section, then check its name and every value in it. If this was the first start of a new data directory and you add a [bitcoind_config], also point data_directory to a new folder.
Failed to load database pathAn earlier start without a valid [bitcoind_config], such as one that failed on a missing backend section, created the database. lianad now skips creating its watch-only wallet in Bitcoin Core. Point data_directory to a new folder, then start again.
Reading bitcoind cookie fileFix cookie_path. Run lianad as a user that can read the cookie.
Network mismatch.Start Bitcoin Core on the network set in network.

lianad ignores any key it does not know, so a misspelled optional key keeps its default without a warning. An invalid or missing value inside a backend section makes lianad drop the whole section, which ends in the No Bitcoin backend entry error.

Next steps