pull down to refresh

Liana (I): MiniScript Applied to Recovery and Inheritance

TL;DR: Liana allows you to define programmable spending paths using MiniScript + timelocks, so your bitcoin can have rescue, emergency, and inheritance plans without compromising daily usability. In this post we’ll see how to build policies like “if I don’t spend in 12 months, X inherits” or “emergency 1-of-1 path with delay” —and how to maintain a UX that doesn’t drive you crazy.

Connection With What We Saw Before

In the Nunchuk post we explored how a collaborative wallet manages roles (Key-User, Key-Backup, Key-Agent) and basic timelock policies.
Liana takes that logic further: it defines multiple spending routes, each with time-based conditions, so the wallet “decides” which path to use depending on inactivity.
Additionally, version v13.0 adds features like encrypted descriptor backup, xpub validations, and UI improvements that make experimenting with advanced policies safer and more convenient.

Core Idea: Programmable Policies With Timed Routes

  • In Liana, you don’t just have “main spend vs recovery”; you can have several recovery routes with different timelocks.
  • Examples:
    1. Primary: pk(A) — instant spend with your own key.
    2. Inheritance: and( after(12m), pk(Beneficiary) ) — if you don’t touch the wallet for 12 months.
    3. Emergency: and( after(3m), pk(Agent) ) — faster rescue path for urgent cases.
    4. Deep backup: and( after(24m), pk(DeepBackup) ) — last resort.
  • Liana internally translates these routes into MiniScript/descriptor, integrates validations, and manages them for you (expiry alerts, renewal).

How to Model These Policies Without Breaking Daily UX

RiskWhat to DoPractical Example
Too many routes = confusionLimit to 2 or 3 routes maxPrimary + inheritance + emergency
Timelocks too shortAdd margin (at least 3–12 months)Don’t set 7 days —you could trigger routes by mistake
Automatic renewal“Refresh” UTXOs before route expiryMake a “self-send” before the deadline
Early validationsVerify xpub/network when setting routesLiana v13 already includes UI validations to avoid network errors

Concrete Example in MiniScript / Descriptor

or(
  pk(A), 
  or(
    and_v(v:after(12m), pk(Beneficiary)), 
    and_v(v:after(3m), pk(Agent))
  )
)

Interpretation of the Example

  • Route 1 (short): Key A can always spend.
  • Route 2 (inheritance): if there’s no activity for 12 months, B can spend.
  • Route 3 (emergency): after 3 months, the agent can step in.

Risks and Limits to Mention

  • Each UTXO must be “refreshed” to extend its timelock, which implies periodic transactions.
  • In high-fee environments, refreshing can be costly, especially with many UTXOs.
  • If you configure routes with overlaps or conflicts, you may end up with states where no route can be used.
  • If you lose your descriptor or don’t have an encrypted backup, restoring becomes complex.

Useful Resources for Liana


Closing

  • Action today: use Liana on testnet and create a policy with at least two routes (primary + inheritance). Watch how it alerts you as expiry approaches.
  • Question for readers: What recovery (emergency) route would you implement: 3 months, 6 months, 1 year? Why?
In the next post (Liana II) we’ll cover technical operation: creating policies, signing transactions, monitoring expirations, and disaster scenarios (simulating device loss, deliberate expirations).
20 sats \ 1 reply \ @OT 3h
Each UTXO must be “refreshed” to extend its timelock, which implies periodic transactions.
I didn't know it was for each UTXO. Thought it was the wallet.
I think I'd like to get a feel for some of these ideas with signet. I think it would be an improvement on my current setup.
reply
In MiniScript/Liana, timelocks are applied to each UTXO, not to the wallet as a whole. That's why we talk about periodically "refreshing" them, since each output has its own independent timelock.
Testing on Signet is a great idea! 👌
reply
Do you know of any backup/recovery procedures? I think I would like to practice recoveries fairly often.
if you lose your descriptor or don’t have an encrypted backup, restoring becomes complex.
reply
Yes, the best practice is to have two backups: the seed phrase (BIP-39) and the configuration file (BIP-129, encrypted if possible).
With both of these, restoring your wallet is very easy. I'm going to practice restoring a wallet on the test network (testnet/signet).
reply