There are several reasons why a user might need to restore their bitcoin wallet. They may have lost their device, be migrating from a different application or have deleted their wallet application. Regardless of why, it’s important that your wallet application has an easy way for users to recover their funds.
However, not all wallets from one application can be recovered in another, depending on what standards they support, as covered in the wallet interoperability section. Lack of interoperability and vendor dependance is an issue for wallets holding bitcoin on the Lightning network. Lightning network wallets can currently only be restored in the application originally used. It’s also worth noting that restoring from a recovery phrase only restores the private keys, but no user data like transaction notes, contacts etc.
As outlined earlier in the chapter, we consider an automatic cloud backup a good option, especially for beginners. One of the major UX benefits of this is a seamless recovery process. Assuming they are restoring in the same wallet application originally used, all the user needs to do to gain access to their funds again is to log in to their cloud storage account (typically iCloud or Google Drive).
Users may have created a wallet with another wallet application. In this case, they should be able to import that wallet into yours by entering their 12 or 24-word recovery phrase. There are several options for the UI when entering a recovery phase, as outlined earlier in the manual backup section of this chapter. Consider supporting recovery phrases in multiple languages for better global accessibility.
Some applications also provide an option for users to scan an encrypted proprietary QR code version of their recovery phrase. For a more detailed explanation of this recovery technique, check out this blog post by Casa.
Restore a wallet with funds on the Lightning network #
To fully restore a wallet with funds on the Lightning network, the state and history of the payment channels are needed in addition to the recovery phrase. As there are no standards for this yet, wallet applications need to have their own format for backing this up, and subsequently restoring. Due to the amount of information, a QR code of the encrypted data, like in the previous example, can be appropriate.
Recommendation
Be clear to users what you support and what wallet specifications they can expect to restore in your application. Most bitcoin products should support restoring from a recovery phrase at a minimum. Capability to restore an HD wallet implemented according to BIP32, 39, 43, 44, 49, 84 and 380 would be a good starting point.
Some less popular methods for restoring a wallet include importing a file with all the information required to recover funds such as public keys and key metadata. A wallet.dat file from Bitcoin Core is one example of such a file scheme. If you are developing a watch-only wallet, you would import an extended public key instead of the recovery phrase, this tends to be for technically minded users however.
Next, let’s take a deep dive into requesting bitcoin.