# A simple backup scheme for wallet accounts

**URL:** <https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607>\
**Category:** Implementation\
**Tags:** wallet, descriptors, backup\
**Created:** [April 16, 2025, 12:38pm UTC](https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607 "2025-04-16T12:38:37Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![salvatoshi](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/salvatoshi/32/72_2.png) [@salvatoshi](https://delvingbitcoin.org/u/salvatoshi)\
**Post date:** [April 16, 2025, 5:47pm UTC](https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607/6 "2025-04-16T17:47:43Z")

</div>

Hi @josh, thanks for the comments! Somehow I missed your previous post, my bad.

> [@josh](#):
>
> If the encrypted descriptor is stored publicly or on a compromised server, an attacker who gains access to one secret gains knowledge of the existence of the multisig. This is not ideal if a user wants to protect themselves with a decoy single-sig wallet.

I would say in my scheme there is no distinction between an attacker and ‘someone who knows a secret’, as it’s designed to give knowledge of the descriptor precisely to the people who know at least one of the xpubs (or a subset of them, if desired). So if someone has the backup _and_ knows an xpub, they are expected to be able to decrypt.

> [@josh](#):
>
> The scheme I’m using makes one significant change. In a k-of-n multisig descriptor, the secret s is split into n shares using shamir secret sharing, where k shares are needed to recover. Each share is then encrypted with one xpub, so that k xpubs are needed to decrypt.

Shamir secret sharing, apart from adding at least _some_ (arguably manageable) complexity, does not generalize well to wallet setups more complex than multisig. For example, in a setup where there is a time-locked recovery partner that can help retrieve the funds if the primary spending path became inaccessible, you want them to be able to decrypt the backup even with the single xpub.

If you don’t want to enable some party to decode the backup, I think what will work better in practice is to have redundant copies of the backup, but do not give access to the backup to this third party (therefore, not posting it in a public place). Only if the primary spending path becomes lost, then they will be sent the encrypted backup.

> [@josh](#):
>
> The other minor difference is that I leave the derivation paths in plaintext, so that a user knows how to derive their xpubs. Only the sensitive data is encrypted (the xpubs and master fingerprints).

This is a great idea; even just a list of all the derivation paths that appear in the key-origin information (without attribution to specific keys) would reduce the search space to at most n xpubs when attempting decryption.

---

_[View the full topic](https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607)._
