How does it work?
Offline recovery creates two additional encrypted key shares (a 2-of-2 pair), separate from the wallet’s primary key shares:- Share 1. Encrypted and stored in the user’s Google Drive.
- Share 2. Encrypted and delivered to your configured webhook when you run an offline recovery reshare.
Configure offline recovery
To enable the feature follow the following steps:- Configure Google Drive backup for your environment.
- In the Dynamic Console, go to Wallets > Embedded Wallets > Backup & Recovery.
- Turn on Developer Recovery Share.
- Configure the Share Delivery webhook URL and the RSA public key used to encrypt shares.
If delegated access is enabled, offline recovery uses the same share-delivery webhook URL and encryption key.
Request a recovery share
Run an offline recovery reshare from the SDK for the user:mfaToken:
Encrypt to an end user’s key
By default, Share 2 is encrypted to the RSA public key configured on your environment, which means your backend can decrypt it. If you want the share to be decryptable only by the end user, pass a base64-encoded RSA public key (2048 bits or larger, PEM or raw key data) asrecoveryEncryptionPublicKey, for example a key whose private key lives on the user’s device:
crypto module:
kid of the key it was encrypted to (for caller-supplied keys, a SHA-256 fingerprint of the key bytes).
Your webhook receives a wallet.offlineRecovery.created event containing the encrypted Share 2. Store Share 2 securely.
Recovery
To recover, the user needs both recovery shares:- Share 2 from your webhook.
- Share 1 from their Google Drive.
offlineExportKey with the two decrypted shares: