Prerequisites
- Wallet: An existing Solana or Stellar wallet with at least one recovery method.
- API key: An API key with
wallets.createandwallets:transactions.createscopes. In staging, all scopes are included by default.
How It Works
Adding or removing a recovery method creates a transaction that one of the wallet’s existing recovery methods must approve. With the SDK,addRecoveryMethod() and removeRecoveryMethod() handle the approval for you: an email or phone method prompts the user for a one-time code, a server method signs with its secret, and an external wallet signs through its onSign callback. Once the transaction confirms, wallet.recoveryMethods reflects the change. With the REST API, you submit the change and then approve the returned transaction yourself.
Rules enforced by the API
Rules enforced by the API
- A wallet always keeps at least one recovery method: removing the last one is rejected.
- A recovery method whose add transaction has not confirmed yet cannot be removed. Adding the same method again returns the in-flight transaction, or starts a new one once it has expired.
- Only a recovery method can authorize these changes. Operational signers added with
addSigner()cannot. - On Solana, only Crossmint smart wallets support these operations. On Stellar, removing a recovery method requires the wallet to run the latest contract version.
Select the Authorizing Recovery Method
When a wallet has a single recovery method, the SDK uses it to authorizeaddSigner(), removeSigner(), addRecoveryMethod(), and removeRecoveryMethod(). When a wallet has several, select the one to authorize with first by calling useRecoveryMethod() with one of the entries in wallet.recoveryMethods; otherwise the operation throws SignerRequiredError. Here, the phone recovery method authorizes adding an email signer:
secret for a server method, or the onSign callback for an external wallet.
wallet.recoveryMethods throws InvalidRecoveryConfigError.
useRecoveryMethod() is experimental and may change in a future release.Add a Recovery Method
The new method accepts the same configuration objects asrecoveryMethods at wallet creation — email, phone, external-wallet, or server. Phone numbers use E.164 format.
- React
- Node.js
- React Native
- REST
["email", "phone"]. With several recovery methods, call useRecoveryMethod() first.Remove a Recovery Method
Identify the method to remove with the same configuration object you would pass touseRecoveryMethod(). Any of the wallet’s recovery methods can authorize the removal, as long as at least one method remains afterwards. In the React and React Native examples below, the email method authorizes removing the phone method.
- React
- Node.js
- React Native
- REST
Next Steps
Configure Recovery
Set recovery methods when creating a wallet
List Signers
Inspect the wallet’s signers and recovery methods
Recover a Wallet
Regain access from a new device with a recovery method

