Back to blog list
Descriptor
Backup
Self-Custody
BIP138

Published on Tue, Nov 24, 2026 by Loïc Morel

Understanding Bitcoin descriptors and BIP-0138 encrypted backups

It is often said that the mnemonic phrase alone is enough to recover a Bitcoin wallet. This is false. In this article I explain what a descriptor is, why making a backup of it is absolutely essential, and how the encrypted backup format of BIP-0138, now used by Liana, lets you copy it to as many private places as you want.

Blog image cover
Searching for the right derivation path.

Ever since hierarchical deterministic wallets appeared in the early 2010s,1 soon followed by the BIP-00392 mnemonic phrase standard, you often hear it said in the Bitcoin community that the most important thing is to back up that phrase carefully, and that it alone gives access to your bitcoins. That was still true a few years ago, but with the proliferation of script standards, niche use cases, and the arrival of advanced wallet setups, backing up only your seed is no longer a sufficient strategy today.

In this article, I’ll explain why your mnemonic phrase isn’t enough, what a descriptor is, why it’s just as critical to back up as your phrase, and how encrypted descriptor backups, now standardized by BIP-01383 and used by Liana, finally solve the descriptor backup dilemma.

Why isn’t the mnemonic phrase enough?

A Bitcoin wallet doesn’t really store your bitcoins. Those only exist as UTXOs recorded on the blockchain. What we call a wallet is really a set of keys that can unlock the UTXOs belonging to you, together with the spending rules that say how those keys must be used. In modern wallets, these keys are almost always derived deterministically from a single piece of base information: a seed, which you usually back up as a 12- or 24-word recovery phrase.2 That seed produces the master key, and from that master key, a tree-like derivation generates child keys, grandchild keys, and great-grandchild keys, all the way down to the keys that actually lock and unlock your bitcoins.

HD derivation tree from a seed phrase down to the keys locking UTXOs

The problem is that the master key says nothing about how you use it. To recover your funds, a piece of software also needs to know:

  • the script type used (wpkh for native SegWit? wsh(multi(...)) for multisig? tr(...) for Taproot?);
  • the derivation path used (m/84'/0'/0'? m/48'/0'/0'/2'?);
  • for a multisig, you also need the list of all the participating public keys…

To really understand this, let’s use an analogy. Imagine your bitcoins sit inside a vault. That vault is the receiving address. To open it, you need one very specific key. On your side, you hold an enormous keyring with billions upon billions of keys. That’s your seed, which gives you access to all of them. The key that opens the vault is somewhere on that huge keyring, but if you don’t know which one actually opens it, it’s as if you simply didn’t have it at all. Testing them one by one is impossible. Your Bitcoin wallet’s descriptor is precisely what lets you know straight away which key opens the vault, without having to search for it.

Seed as a keyring of billions of keys, with the descriptor pointing to the right one

The single-sig case: recovery by light brute force

For a single-sig wallet that follows the standards, you can usually manage without the descriptor. Modern software uses normalized derivation paths, standardized by BIP-0044,4 0049,5 0084,6 and 00867 for single-sig. Here they are:

Address type Standard path Address prefix
Single-sig Legacy (P2PKH) m/44'/0'/0' 1...
Single-sig Nested SegWit (P2SH-P2WPKH) m/49'/0'/0' 3...
Single-sig native SegWit (P2WPKH) m/84'/0'/0' bc1q...
Single-sig Taproot (P2TR) m/86'/0'/0' bc1p...

In derivation path notation, ' and h mean the same thing: a hardened derivation. You may come across either notation depending on the software you use.

In practice, when you try to recover a single-sig wallet, the procedure varies from one wallet to another. Generally, you’re either asked for the script type, or directly for the derivation path if you know it. Otherwise, the wallet software tries these standard paths one after another, checks whether it finds any transactions, and rebuilds your wallet.

This procedure is already a form of light brute force, but it only works sometimes, and only if you followed the standards! As soon as you use a non-standard derivation path, the software sees an empty wallet even though the seed is correct, simply because it isn’t looking in the right place.

Wallet software trying the four standard single-sig derivation paths in order

And as script types diversify, specialized use cases multiply, and more complex setups appear, this information becomes harder and harder to guess. What used to be recoverable by trial and error turns into private data that can no longer be recovered.

I say this from experience. Since I’d written a lot of content in the past about how wallets work, many bitcoiners came to me for help recovering wallets that were stuck because of wrong derivation paths. And I also believe that a Bitcoin user shouldn’t have to know or understand hierarchical wallet derivation in order to recover their funds on their own.

Backing up the descriptor solves this problem. So even if it isn’t always strictly necessary, I think that to keep things simple and stop people from losing their funds, we should now communicate clearly about the right way to back up any wallet, whatever it is. Backing up a Bitcoin wallet means: phrase + descriptor.

The multisig case: backing up the descriptor isn’t optional

With a multisig, no amount of brute force will save you. Backing up the descriptor becomes absolutely mandatory, and it’s important to understand exactly why.

To spend a UTXO locked by a multisig script, you have to rebuild the exact script that locks it, and that script contains every public key of the multisig, including the ones that aren’t signing. The first reason is that, without the script, you can’t even find your coins. For P2SH, P2WSH, and P2TR, the address only commits to the script without revealing it, so you need to reconstruct it just to recompute your addresses and locate your UTXOs on the blockchain. The second reason is that you need it to spend. With P2SH and P2WSH, the spending transaction must reveal the full script, so that the network can check it against the commitment contained in the address and then execute it. Taproot works a bit differently and doesn’t always reveal a script, but you still can’t produce a valid spend without being able to rebuild what the address commits to: the keys and scripts behind it. In short, a signature, however valid, is useless on its own. You can’t spend a UTXO whose spending conditions you can’t reconstruct.

Let’s take an example. You have a 2-of-3 multisig, and you lose the third private key along with its mnemonic phrase. In theory, you’re fine, because you still have 2 keys out of 3, which is exactly the threshold needed to unlock your bitcoins. Except that you didn’t back up the xpubs of your 3 signing devices. Without the public key derived from the xpub, there’s no way to rebuild the locking script. The threshold of 2 signatures is reachable, and yet your funds are still locked, simply because one piece of public information is missing.

So if we stick with the 2-of-3 multisig example, there are 2 situations that let you recover your funds, keeping in mind that to sign you must have access to the public keys of all 3 signers:

  • If you have all 3 mnemonic phrases, you’re fine, because you can always derive the xpubs from those phrases;
  • If you only have 2 of the 3 mnemonic phrases, you absolutely must also have a backup of the missing signer’s xpub.

Three recovery scenarios for a 2-of-3 multisig, one with the funds locked

The descriptor removes this risk. It acts as the standardized blueprint of the locking script, carrying within it all the information needed to recreate your wallet’s address space and its public keys.

Before descriptors

Before descriptors became widespread, setting up a clean multisig was an exercise in discipline. If you’ve been using Bitcoin for a few years, you’ve probably been through it. To be able to recover a 2-of-3, you had to keep, on top of the recovery phrases:

  • the 3 extended public keys (xpub), one per signer;
  • the exact order of the keys;
  • the threshold;
  • the script type;
  • the derivation path.

Some of this information could be recomputed. With all 3 mnemonic phrases and the derivation path, for example, you can re-derive the xpubs. But losing a signer’s mnemonic phrase without having backed up its xpub was enough to make the funds unrecoverable. That’s why the old wallet management software that let you create multisigs often provided a document to save and print, containing all of this information in plain text. There was, however, no standard for backing up this data.

Descriptors fix this problem by aggregating everything into a single string, standardized by BIP-0380.8 It’s just one line, which you can copy and import into any compatible software to recover your wallet.

Multisig backup before and after descriptors: five notes versus one line

Anatomy of a descriptor

A descriptor is made up of 4 parts. Let’s go through them in order, using a concrete example of a SegWit v0 (P2WPKH) wallet, the test wallet from BIP-0084, whose mnemonic phrase is public:

wpkh([73c5da0a/84h/0h/0h]xpub6CatWdiZiodmUeTDp8LT5or8nmbKNcuyvz7WyksVFkKB4RHwCD3XyuvPEbvqAQY3rAPshWcMLoP2fMFMKHPJ4ZeZXYVUhLv1VMrjPC7PW6V/<0;1>/*)#qf45pmyh

Here’s how to read this line, piece by piece.

The first part is the script function, here wpkh(...), which indicates a Pay-to-Witness-Public-Key-Hash output type, that is, SegWit v0 (which arrived in 2017 with bc1q... addresses). The main existing script functions are:

  • pk and pkh: the historical Legacy formats;
  • wpkh: SegWit v0, bc1q... addresses;
  • sh and wsh: for P2SH and P2WSH;
  • tr: Taproot, or SegWit v1, bc1p... addresses;
  • multi and sortedmulti: multisignature, without or with lexicographic sorting of the keys.

The second part is the origin, here [73c5da0a/84h/0h/0h]. It contains 2 pieces of information:

  • 73c5da0a: the master key fingerprint, which identifies the seed this key was derived from, and so the signing device that holds that seed;
  • 84h/0h/0h: the derivation path from that master key down to the key that follows, here the standard BIP-0084 path for single-sig native SegWit wallets, which we saw in the table earlier.

The third part is the key itself, here the extended public key xpub...C7PW6V. This is what lets you derive all the account’s addresses. The notation that follows it, /<0;1>/*, means the descriptor covers both the external chain (index 0, your receiving addresses) and the internal chain (index 1, your change addresses) at once. The wildcard * at the end of the path indicates that you can sequentially derive all the child addresses from that position onward.

The fourth part is the descriptor’s checksum, preceded by a hash sign, here #qf45pmyh. It protects against manual transcription errors. If you copy a character wrong, the software detects it and rejects the descriptor instead of sending you to an empty wallet.

Anatomy of a descriptor: script function, origin, key and checksum

Multisig descriptors

For a 2-of-3 multisig in SegWit v0, the descriptor uses exactly the same grammar, nesting a multi function inside a wsh:

wsh(multi(2,
  [d34db33f/48h/0h/0h/2h]xpub.../<0;1>/*,
  [4f5a6b7c/48h/0h/0h/2h]xpub.../<0;1>/*,
  [9e8d7c6b/48h/0h/0h/2h]xpub.../<0;1>/*
))#checksum

The 2 is the threshold, followed by the 3 keys, each with its fingerprint and path. All the information you once had to document by hand now fits into this single expression. That’s why the descriptor has become the recommended backup format.

The backup dilemma

The descriptor solves the recovery problem, but it creates another one. To really grasp it, we first need to clarify two words that often get confused: secrecy and privacy. They aren’t synonyms, and the entire backup strategy for a Bitcoin wallet rests on this distinction.

The most accurate formulation, in my view, is the one from Eric Hughes, in the Cypherpunk’s Manifesto of 1993:

Privacy is not secrecy. A private matter is something one doesn’t want the whole world to know, but a secret matter is something one doesn’t want anybody to know. Privacy is the power to selectively reveal oneself to the world.9

In other words, a secret is something no one should know. Private data is something you don’t want to expose to the whole world, but that you remain free to reveal to whomever you choose. Privacy is exactly that power to choose. This nuance changes everything, because in a Bitcoin wallet you handle both kinds of data, and they call for completely different protection.

Your mnemonic phrase is a secret in the strict sense. It gives access to the keys that let you spend your funds. If an attacker learns your seed, they effectively become the owner of your bitcoins. That’s why, to protect the secrecy of that seed, we take very specific and advanced measures that we wouldn’t use for other kinds of data.

The descriptor, by contrast, isn’t a secret, but only a collection of private data. A leak doesn’t let anyone steal from you, but it does let them spy on you. Whoever reads your descriptor can rebuild all your addresses, and so see your balance and your whole transaction history. That’s annoying, of course, but it’s nowhere near as serious as losing your funds. An attacker can use it to profile you, learn about you, and prepare a later attack. Unlike the seed, though, they’ll quickly lose interest once acting on it becomes too costly or too complex. The ratio between the effort required and the expected payoff is simply nothing like that of an attack on the seed.

Still, this private data also has to be backed up, as we saw earlier, and so you find yourself stuck between two bad options. On the one hand, if you back up your descriptor all over the place so you never lose it, you risk compromising your privacy. On the other, if you keep it strictly secret in a single location, you recreate a single point of failure, because if that one medium burns or disappears, you lose the ability to rebuild your wallet.

Descriptor backup dilemma between leak risk and loss risk

This is exactly the kind of trade-off between risk of loss and risk of theft that we’re trying to break with Liana. That’s why we implemented the encrypted descriptor backup, which solves all of these problems.

Encrypting the descriptor

The starting idea is simple: encrypt the descriptor. The problem in the previous section came from its nature as private data, exposed the moment you duplicate it. An encrypted descriptor, on the other hand, keeps that data hidden. So you can store as many copies as you want, in as many private places as you want. Anyone who stumbles on the file can’t read the descriptor inside. They can’t learn your balance or rebuild your addresses.

In other words, encryption breaks the dilemma. Redundancy no longer costs you your wallet’s privacy, and you can multiply your backups without exposing your addresses a little more each time.

Except that, on closer inspection, all we’ve done is move the problem. Any symmetric encryption relies on an encryption key, and that key has to be kept somewhere so you can decrypt when the time comes. So now you have a new secret to back up, exactly what you were trying to avoid.

This is exactly where the trick comes in, proposed by Salvatore Ingala in a discussion on Delving Bitcoin.10 Rather than inventing a separate encryption key, you encrypt the descriptor with the public keys it already contains, its xpubs. And any one of these xpubs is then enough to decrypt it. You already have these keys, since they’re easily re-derived from your mnemonic phrases. So there’s no extra key to create, and no new secret to back up.

The result is that the only secret you need to keep secret remains your mnemonic phrase or phrases. Everything else, including the descriptor, can be encrypted. To see where each piece then goes, I find it helps to sort the places where you can keep a backup into three levels:

  • Places safe enough for a secret, which only you can reach, such as a sheet of paper or a metal plate kept offline. That’s where your mnemonic phrase goes.
  • Private places, which only you or the people you choose can open, but which aren’t safe enough for a secret, such as your Google Drive, an email to yourself, a password manager, or a USB stick kept at home or left with a relative you trust. A hacked account or a lost stick can expose what they hold, so your mnemonic phrase never goes there. That’s where your encrypted descriptor goes.
  • Public places, which anyone can read, such as a post on your social media, a Nostr note, a public GitHub repository or a Bitcoin transaction. Your mnemonic phrase never goes there. I don’t recommend putting your encrypted descriptor there on purpose either, for reasons I explain below.

The more copies of the encrypted descriptor you make, the better, because losing it is the main risk. As we saw with the 2-of-3 multisig, your funds can stay locked without it, even when you still hold enough keys to sign. So redundancy comes first.

You still want to choose these places knowing what the file reveals. The encrypted part holds the whole descriptor, with its keys, its script and its timelocks. Only someone who holds one of its xpubs, such as a cosigner, your heir or a service you once gave an xpub to, can open it and rebuild your addresses or see your balance. A few clues stay in the clear, though. The file starts with the bytes BIP138, so anyone can tell it’s a Bitcoin wallet backup. If you left the derivation paths in, which is Liana’s default, they hint at the type of wallet you use. The file also shows roughly how many keys the wallet has, rounded up to 5, 10, 20 and so on, and since Liana doesn’t pad the encrypted part, the file’s size gives an idea of how long the descriptor is. I come back to the paths and the key count further down.

That’s why a leak isn’t an emergency. If a copy ends up in the wrong hands, because your mailbox gets hacked or even because the file gets published, a stranger who finds it only gets these few clues. They can’t see your addresses or your balance, so you don’t necessarily need to move to a new wallet. That’s exactly the job of the encryption. Your funds were never at stake anyway. They don’t depend on the descriptor staying hidden, but on your keys and your timelocks.

But it’s not an invitation to broadcast it. I don’t recommend publishing it on purpose, especially where it can be tied to your identity, such as your social media accounts. Even without decrypting it, a published file gives away the clues we just listed. Anyone who comes across it learns that you probably hold bitcoins, and that you may well use a carefully secured wallet, which can be enough to catch an attacker’s interest. Next to your name, it also tells them who to target. And a public copy can’t be taken back. A Bitcoin transaction stays in the blockchain for good, and anyone can copy a post before you delete it. Private is not public.

Encrypting the descriptor with its own xpubs instead of a dedicated key

If you have at least one signer or one mnemonic backup, you can decrypt, because from it you can re-derive the corresponding xpub, which is one of the very keys that encrypt the descriptor. The only situation in which you couldn’t decrypt your descriptor is one where you’ve lost all your signers and all your mnemonic backups, in which case your funds are already lost anyway.

How does descriptor encryption work?

Building on Salvatore Ingala’s idea, Pythcoiner, one of the Liana developers, proposed BIP-0138 to establish a standard and encourage its implementation across as many wallet applications as possible, starting with Bitcoin Core. The BIP was merged into the official BIPs repository in September 2026, with Draft status.11 Starting with version 16.0, released in November 2026, Liana writes its encrypted backups in this standard format.12 Liana had already shipped a similar scheme more than a year earlier, based on an early draft of the proposal.13 I explain how this first version worked, and what it means for your old backups, at the end of this article.

Here’s how it works in more detail in BIP-0138:

1. Computing the secrets

The central point of the scheme is that it introduces no new secret. The encryption key is derived directly from the public keys in the descriptor.

We start by taking the public key at the root of each xpub in the descriptor, normalizing them to the x-only format (32 bytes, the same format Taproot uses), and sorting them in lexicographic order. Let’s call them p1, p2, ..., pn. The scheme works for any number of keys, including a single key for a single-sig wallet descriptor.

Only two kinds of keys are left out: those that will show up as is on-chain, where anyone can read them, and the NUMS key that some Taproot descriptors use, which nobody holds.

BIP-0138 key preparation: descriptor xpubs reduced to 32-byte x-only root keys and sorted from p1 to p4

From there, we compute 2 types of value with a tagged hash, the construction introduced by BIP-034014 for Taproot:

tagged_hash(tag, m) = sha256(sha256(tag) | sha256(tag) | m)

The tag is a fixed text string, different for each use, so that the two computations below can never produce the same value from the same keys.

  • a common secret s, derived from all the public keys concatenated together
s = tagged_hash("BIP138_DECRYPTION_SECRET", p1 | p2 | ... | pn)
  • an individual secret si for each key, derived from that key pi alone
si = tagged_hash("BIP138_INDIVIDUAL_SECRET", pi)

The common secret s is the one actually used to encrypt the descriptor. But we never store it in the clear. Instead, for each key, we compute a value ci by combining the common secret and the individual secret with the XOR operation: ci = s ⊕ si. So in the end we have one ci value for each key.

For example, let’s imagine a 2-of-3 multisig wallet. We’ll have:

  • 1 common secret s;
  • 3 individual secrets si, one for each key, derived directly from their xpub;
  • 3 public values ci, one for each key.

These ci values are all stored in the clear alongside the encrypted descriptor, in the same file.

BIP-0138 computation of the common secret s, individual secrets si and values ci

2. Encryption

Once the common secret s is obtained, the descriptor is encrypted with the ChaCha20-Poly1305 symmetric encryption algorithm, using s as the key, together with a random 96-bit nonce.3 This algorithm also adds an authentication tag to the encrypted data. If you try to decrypt with the wrong key, or if a single byte of the encrypted data has been altered, decryption fails instead of returning garbage.

The backup file then holds, in this order:

  • the magic bytes BIP138;
  • a version number;
  • the derivation paths if you choose to include them;
  • the list of ci values;
  • the identifier of the encryption algorithm;
  • finally, the nonce followed by the encrypted data.

Inside the encrypted part, the descriptor is labeled with its type, here a BIP-0380 descriptor, so that the same container can carry other kinds of data. BIP-0138 recommends the .bip138 extension for this file, or .txt when it is encoded as Base64 text. Liana saves it in binary form, under the default name liana.bip138.

Byte layout of a liana.bip138 encrypted backup file

3. Decryption by a cosigner

Let’s imagine you’re recovering your wallet and you have one of the keys, that is, a public key p that was in the descriptor.

First you recompute the individual secret si of this key, exactly as in step 1:

si = tagged_hash("BIP138_INDIVIDUAL_SECRET", p)

Next, you take each ci value stored in the clear in the file and apply XOR to it again with your si. For the ci that was computed from your key, you get back the common secret, since XOR is reversible: s = ci ⊕ si. For all the others, you get a meaningless value. The file doesn’t say which entry is yours, so you simply try each result as the decryption key. Thanks to the authentication tag, the right one is recognized immediately.

All that’s left is to decrypt the descriptor with the common secret s.

Decryption succeeds if and only if your key was indeed one of the keys p1, ..., pn used for the encryption. Someone who has none of these keys can’t recompute anything, and the file stays unreadable to them. The ci values alone don’t make it possible to determine the common secret s without knowing at least one individual secret si.

BIP-0138 decryption of the descriptor by a single cosigner

In other words, what’s happening here is that the symmetric encryption key (s) used to encrypt the descriptor is itself encrypted using each xpub as an encryption key (the si), and the different versions of the encrypted encryption key (the ci) are stored in the clear alongside the encrypted descriptor. Since the encryption algorithm used here is simply the XOR function, this is in a sense a Vernam cipher, or one-time pad, in which the message is itself an encryption key used in another process.

A format that isn’t limited to descriptors

Even though the original use is the descriptor, the format was designed for other wallet data that is in no way secret in the sense of a private key: wallet policies (BIP-038815), transaction labels (BIP-032916), wallet backup (BIP-013917), or other metadata. A single file can even carry several items, each labeled with its own type. The principle stays the same. The only secret to protect is your mnemonic phrase or phrases; everything else is encrypted and can be replicated across all your private places.

The trade-offs of the format

This format necessarily involves trade-offs. The first one is that there is one ci per cosigner (one ci per key, to be precise). By counting these values in the file, an observer could know how many keys make up the wallet, even if they cannot know the threshold. This is a necessary trade-off if we want all cosigners to be able to decrypt the descriptor. BIP-0138 softens this leak with decoys: random values, indistinguishable from real ci values, pad the list up to the first step of a fixed scale (5, 10, 20, 40, and so on) that can hold all the real ones.3 Liana does this automatically. A wallet with 3 keys produces a file with 5 entries, and a wallet with 7 keys a file with 10. An observer only sees the rounded-up count.

BIP-0138 decoys rounding the number of ci values up to 5, 10 or 20

The other piece of data that could leak from the file is the xpub derivation path. The format lets you write the derivation path of each cosigner’s xpub in the cleartext part of the file, so that it doesn’t need to be known or tested during wallet recovery. This information does not pose a direct risk to your privacy, but it can give hints, admittedly weak ones, about your wallet. For example, a path m/48'/0'/0'/2' indicates it’s a multisig, while m/84'/0'/0' indicates it’s a single-sig native SegWit.

That’s why BIP-0138 makes these paths optional. To compensate, software that can fetch xpubs from a signing device should automatically try a list of common paths at recovery time3: accounts 0 to 9 of the BIP-0044, BIP-0049, BIP-0084, BIP-0086, and BIP-008718 paths, and of the two BIP-004819 multisig paths. Standard paths therefore no longer need to be stored in the file, or remembered by the user. In Liana, you make this choice with the “Include derivation paths” checkbox next to the backup button, which is checked by default. If you uncheck it, Liana leaves the standard paths out of the file. A non-standard path is still written, since no software would think of trying it.

The last trade-off concerns the encryption key itself. Encrypting the descriptor with its own xpubs makes that key less secret than a dedicated one. An xpub is private data, not a true secret, so anyone who already knows one of your xpubs can decrypt your backup. This is a deliberate design choice, because the scheme is meant to work first and foremost with the signing devices that already exist. It requires no new implementation in any device firmware, and since encryption only involves public keys, the backup can even be created without having a signing device in hand.

Take a former cosigner, for example. Say you once shared a multisig with someone, then set up a new wallet without them, but kept the same xpub. That person still knows your xpub, so if they ever get hold of a backup of your new wallet, they can decrypt it and see its addresses and balance, even though they still can’t spend from it. This can only happen if you reuse the same xpub in two different wallets, which is bad practice and something I advise against. Each new wallet should get its own xpub, for example by using a new account number in its derivation path.

In most cases, these trade-offs are not a problem, but I wanted to point them out in the interest of transparency about the compromises made.

Using the encrypted descriptor in Liana

Since version 13.0, the encrypted descriptor backup has been the default option in Liana. When you create a wallet, the “Back up descriptor” button generates an encrypted file that you can download and copy to your private places. As of version 16.0, this file follows BIP-0138 and is named liana.bip138 by default. You can still copy the descriptor in plain text, but I don’t recommend keeping that copy as a backup, for privacy. You can also create a new encrypted backup at any time from the wallet settings, with the “Back up encrypted descriptor” button.

The benefit shows up most at recovery time. When you load an encrypted backup with “Import a backup”, Liana detects it automatically and asks you to plug in and unlock a signing device belonging to the setup. It fetches the xpubs for the derivation paths listed in the file, plus the first 10 accounts of the path Liana uses (m/48'/0'/0'/2' to m/48'/0'/9'/2' on mainnet), and decrypts the descriptor on its own. If that fails, Liana offers to try the other common paths of BIP-0138 with the same device.

Recovering a liana.bip138 encrypted backup in Liana 16

Before BIP-0138: the .bed format

Liana didn’t wait for the standard. Version 13.0, released in September 2025, already offered the encrypted backup, based on an early draft of what would become BIP-0138.13 From version 13.0 to 15.0, Liana saved it as a .bed file, for Bitcoin Encrypted Descriptor.

The principle is the same: a common secret s derived from all the public keys, one individual secret si per key, and ci = s ⊕ si values stored in the clear next to the encrypted descriptor. Only the building blocks differ:

  • the file starts with the magic bytes BEB instead of BIP138;
  • the descriptor is encrypted with AES-256-GCM instead of ChaCha20-Poly1305;
  • the keys are serialized as standard 33-byte compressed public keys, instead of 32-byte x-only keys;
  • the secrets come from a plain SHA-256 of a text tag (BEB_BACKUP_DECRYPTION_SECRET or BEB_BACKUP_INDIVIDUAL_SECRET) followed by the keys, instead of the BIP-0340 tagged hash;
  • there are no decoys, so the number of ci values is exactly the number of keys in the wallet;
  • the derivation paths of all the keys are always written in the clear.

These differences are enough to make the two formats incompatible. From the same keys, each one computes a different encryption key. Software that wants to read both has to implement both, which is what Liana 16.0 does.

Compatibility between Liana versions

Liana 16.0 reads both formats. When you import a backup, it recognizes the format from the first bytes of the file, not from its extension, then decrypts either an old .bed or a .bip138, in binary or Base64 form. The .bed backups made with Liana 13.0 to 15.0 therefore remain perfectly valid, and you don’t need to redo them to recover your wallet.

The reverse isn’t true. Liana 16.0 only writes .bip138 files, and Liana 15.0 and earlier can’t read them. To open a .bip138 file, you need Liana 16.0 or later, or any other software that implements BIP-0138. If you keep a copy of the Liana installer next to your backups, make sure it’s version 16.0 or later. The same goes for the database. Liana 16.0 migrates the database of every wallet it opens, and that wallet can then no longer be opened with Liana 15.0 or earlier.

Liana versions reading and writing the .bed and .bip138 formats

One last point, about privacy. An old .bed file still reveals the exact number of keys in your wallet and their derivation paths. If this bothers you, you can create a new BIP-0138 backup from the wallet settings, with or without the derivation paths. The copies of the old file you’ve already scattered around, however, will keep revealing the same information.

Going further

References


  1. Pieter Wuille, “Hierarchical Deterministic Wallets,” BIP-0032, GitHub, bitcoin/bips, February 11, 2012. ↩︎

  2. Marek Palatinus, Pavol Rusnak, Aaron Voisine and Sean Bowe, “Mnemonic code for generating deterministic keys,” BIP-0039, GitHub, bitcoin/bips, September 10, 2013. ↩︎ ↩︎

  3. Pyth, “Compact Encryption Scheme for Non-seed Wallet Data,” BIP-0138, version 0.1.3, GitHub, bitcoin/bips, May 11, 2026. ↩︎ ↩︎ ↩︎ ↩︎

  4. Marek Palatinus and Pavol Rusnak, “Multi-Account Hierarchy for Deterministic Wallets,” BIP-0044, GitHub, bitcoin/bips, April 24, 2014. ↩︎

  5. Daniel Weigl, “Derivation scheme for P2WPKH-nested-in-P2SH based accounts,” BIP-0049, GitHub, bitcoin/bips, May 19, 2016. ↩︎

  6. Pavol Rusnak, “Derivation scheme for P2WPKH based accounts,” BIP-0084, GitHub, bitcoin/bips, December 28, 2017. ↩︎

  7. Ava Chow, “Key Derivation for Single Key P2TR Outputs,” BIP-0086, GitHub, bitcoin/bips, June 22, 2021. ↩︎

  8. Pieter Wuille and Ava Chow, “Output Script Descriptors General Operation,” BIP-0380, GitHub, bitcoin/bips, June 27, 2021. ↩︎

  9. Eric Hughes, “A Cypherpunk’s Manifesto,” activism.net, March 9, 1993. ↩︎

  10. Salvatore Ingala, “A simple backup scheme for wallet accounts,” Delving Bitcoin, April 16, 2025. ↩︎

  11. Pyth, “BIP138: Compact Encryption Scheme for Non-seed Wallet Data,” GitHub, bitcoin/bips, pull request #1951, merged September 21, 2026. ↩︎

  12. Manuel Gatti, “Liana 16.0: Multilingual, reworked UI and smarter labels,” Wizardsardine Blog, November 3, 2026. ↩︎

  13. Manuel Gatti, “Liana 13.0: Encrypted Descriptor Backups, Fiat Conversion, and Improved Usability,” Wizardsardine Blog, September 29, 2025. ↩︎ ↩︎

  14. Pieter Wuille, Jonas Nick and Tim Ruffing, “Schnorr Signatures for secp256k1,” BIP-0340, GitHub, bitcoin/bips, January 19, 2020. ↩︎

  15. Salvatore Ingala, “Wallet Policies for Descriptor Wallets,” BIP-0388, GitHub, bitcoin/bips, December 26, 2023. ↩︎

  16. Craig Raw, “Wallet Labels Export Format,” BIP-0329, GitHub, bitcoin/bips, August 23, 2022. ↩︎

  17. Pyth, “Wallet Metadata Export Format,” BIP-0139, GitHub, bitcoin/bips, May 11, 2026. ↩︎

  18. Robert Spigler, “Hierarchy for Deterministic Multisig Wallets,” BIP-0087, GitHub, bitcoin/bips, March 11, 2020. ↩︎

  19. Fontaine, “Multi-Script Hierarchy for Multi-Sig Wallets,” BIP-0048, GitHub, bitcoin/bips, December 16, 2020. ↩︎