LearnThe idea

Wallet policies

What each installer template decides for you, and the rules every Liana policy follows.

A wallet policy answers one question for every coin: who can spend it, with how many signatures, after what wait. Liana's installer builds it from a template, then records it in the descriptor.

A policy lists paths, each with keys, a threshold and a wait

Each spending path names the keys that can sign, how many of them must sign, and how long a coin must stay unspent before the path opens. The primary spending path has no wait. Each recovery path has one, its timelock.

Take the smallest policy. Your key can spend a coin at any time. Your heir's key can spend it once it has stayed unspent for 52,596 blocks (about 1 year). Under SegWit (P2WSH), Liana writes that policy as one Miniscript expression:

Simple inheritance with the default timelock, keys named
or_d(pk(<Primary key>),and_v(v:pkh(<Inheritance key>),older(52596)))

or_d offers the two paths as alternatives. older(52596) is the wait, which every Bitcoin node checks. Miniscript reads the expression piece by piece.

The smallest Liana policy as a logic tree: an OR between a primary spending path with the Primary key at any time and a recovery path that needs the Inheritance key AND a wait of 52,596 blocks.

Every Liana policy has this shape: one primary spending path, then one or more recovery paths.

The installer offers three templates

On Choose wallet type, the first two templates fix the number of paths, keys and signatures. Build your own leaves them to you.

TemplatePrimary spending pathRecovery pathKeys
Simple inheritancePrimary key aloneInheritance key alone2
Expanding multisig2-of-2: Primary key #1, Primary key #22-of-3: both Primary keys and Recovery key3
Build your ownYour keys and thresholdOne path or more, each with its own keys, threshold and timelockYour choice

Set the timelock of each recovery path gives the default timelock. Choose a policy matches each template to the losses it covers.

Simple inheritance: one key now, a second key later

The Inheritance key can also be a spare of your own, stored far from the first. If you lose the Primary key, you wait out the timelock, then spend with the Inheritance key. A thief who takes the Primary key does not wait. Set up inheritance prepares the second key for an heir.

Expanding multisig: two keys now, any two of three later

When you set a Primary key, the installer places it in both paths. After the timelock, the set of keys that can sign expands from two to three.

The Recovery key never signs alone, so a thief needs two keys before and after the timelock. If you lose a Primary key, you wait out the timelock, then spend with the other one and the Recovery key, as Recover in Liana describes.

An Expanding multisig wallet before and after its 52,596-block timelock: the two Primary keys sign 2-of-2 at first, then any two of the three keys sign 2-of-3.

Build your own: every setting is open

Build your own starts with one primary key and one recovery path. Add key adds a key to a path, with a threshold you set. Add recovery path adds a path. A key can sit in several paths.

On the Set keys screen of the two other templates, Customize switches to Build your own and keeps every key, threshold and timelock you set. Choose a policy walks through each setting.

The installer enforces these rules

Before it generates the descriptor, the installer checks:

  • At least one recovery path: Liana does not let you remove the last one.
  • No missing key: Next stays unavailable until you set every key.
  • A timelock from 1 to 65,535 blocks: The timelock editor keeps Apply unavailable for any other value.
  • No two recovery paths with the same timelock: Liana shows No two recovery paths may become available at the very same date.
  • Each key once per path: Liana marks a key the path already holds with Key already used in this path.
  • Not only cosigner keys in a path: Requires Liana 15.0+ Liana shows A path cannot contain only cosigner keys.
  • Taproot on every signing device: Under Taproot (P2TR), the default, Next stays unavailable while a key comes from a device that cannot sign for it, as Pick the descriptor type shows.

Expanding multisig compared with a plain 2-of-3

Both cover the loss of one key:

Plain 2-of-3 multisigExpanding multisig
Keys a thief needs todayAny 2 of the 3Both Primary keys
After you lose one keyYou spend at onceYou wait out the timelock if it was a Primary key
UpkeepNoneSpend or refresh each coin within the timelock

The third key of a plain multisig is a live spending key that you guard as one. The Recovery key can do nothing for a coin that moved within the timelock. Refresh coins covers the upkeep. The Threat model page goes through each loss and theft.

A plain 2-of-3 multisig and an Expanding multisig on one time axis: both survive the loss of one key, but the plain wallet spends at once while the Expanding multisig, after losing a Primary key, waits up to 52,596 blocks.

A policy is fixed once the wallet exists

Each address commits to every key, threshold and timelock of the policy. Change one of them and every address changes. The result is a new descriptor, so a new wallet.

Check the policy on the descriptor backup screen, where the installer shows one line per path. Settings > Wallet shows the same lines later. To change a policy, you create a new wallet and send your coins to it, as Change a policy explains.

Next steps

Choose a policy turns what you want to survive into a template and its timelocks.

Looking for the policy a signing device registers?

Some signing devices use "wallet policy" in the BIP 388 sense, the form of the descriptor they register. See Descriptor registration.