Wallet Recovery
Last updated
Last updated
Although the wallet holder is not required to input their seed phrase with each use of their wallet, it is highly recommended that you display the seed phrase during the wallet creation process. This is because our system requires the wallet holder's seed phrase in order to later recover a wallet.
Both wallet recovery and wallet import require your seed phrase. However, wallet recovery retrieves the specific instance of that wallet which includes wallet data, wallet addresses, and user data.
Importing a wallet creates a new instance of that wallet even if another wallet with that seed phrase exists. Any wallet data would have to be recreated or fetched again from the blockchain. Wallet services that require approvals would need to be reverified.
If the current user already has an associated wallet within your system, then you would want to utilize wallet recovery. Examples:
if an existing wallet holder is setting up their account on a new device
if the existing wallet holder lost access to an encryption factor such as their wallet password
Although, you may also choose to customize the page depending on the scenario. We recommend catching missing or corrupted keys with a generic flow upon landing on any wallet related page.
Although the seed phrase is the ultimate backup for your wallet and we highly recommend exposing it to the user to maintain interoperability, we've created a seed phrase recovery service which allows you to create key shares that can be used to regenerate your seed phrase on demand. This makes the seed phrase optional, as long as the minimum threshold of key shares are accessible.
The key share scheme is customizable and these key shares can be distributed and stored as desired which allows you to innovate on backup mechanisms. Read more in Seed Phrase Recovery (Beta).
In order to recover a wallet, you must determine whether you would like to do so with the SDK or with the APIs. If you chose to create a wallet with the SDK, we recommend using the SDK for recovery. If you chose to create a wallet with the APIs, you will need to use take the same approach to recovery.
With our SDK, you will always use the recover function regardless of the scenario where recovery is needed. You will be responsible for detecting that the keys in storage are not found or are corrupted.
The recover function of the SDK handles
authentication,
initiating recovery from Wallaby,
seed phrase encryption and transportion to Wallaby
seed phrase decryption from Wallaby
client side seed phrase encryption and storage
Implementation is described in more detail in in the developer docs: Recovering a wallet with the SDK
You should expect the following behavior when using this function:
(Happy path) If we detect that a wallet with the given seed phrase/user id combo already exists, then we recover it.
If we detect that the wallet with a given seed phrase does not exist, then we throw an error.
If we detect that the given seed phrase does not match that user, then we ?
If we try to store the seed phrase, but find that it already exists, then we ?