Warning: Providing the custodian backup share to the client device puts both MPC shares on a single device, removing the multi-party security benefits of MPC. This operation should only be done for users who want to move off of MPC and into a single private key. Use
portal.ejectPrivateKeys() at your own risk!Ejecting Methods
You can eject wallets using either Portal-Managed Backups or Self-Managed Backups depending on your implementation.Portal-managed backups
To eject the private keys for your users’ wallets, their two matching backup shares need to be combined. Since both of these shares are stored on the Portal backend encrypted at rest, we first need to verify that the upcoming request to eject the wallet is not an attack. In order to do this, we make this a two-step process: Implementation Requirements- Make a Custodian-authed
PATCHrequest using your Custodian API Key (the same API key you use to create new users) to the/custodians/me/clients/{clientId}/enable-ejectendpoint to allow for this client to perform anejectoperation - Call the
portal.ejectPrivateKeys()function from your client application with the appropriate backup method
Step 1: Enable the Eject Operation
Make a custodian-authenticatedPATCH request using your Custodian API Key to authorize the ejection. Send a JSON body with the walletId and an ejectableUntil timestamp at least one minute in the future:
- ETH & Solana
- ETH
The
walletId can be found in the wallets property of portal.getClient() (clientInfo.wallets[*].id).If you are planning on ejecting multiple wallets for a user, you’ll need to make multiple separate requests to “unlock” all required wallets.
Step 2: Eject the Wallet
After preparation, call theejectPrivateKeys() method with the appropriate backup method that was originally used to secure the wallet:
- ETH & Solana
- ETH
- Retrieve and combine shares from Portal’s server
- Perform the cryptographic operations to construct the private keys
- Return the private keys as a string that can be imported into other wallet managers
Self-Managed Backup (from your server)
When using Self-Managed Backups, you store the backup shares in your own infrastructure. To eject a wallet, you’ll need to provide both backup shares to theportal.ejectPrivateKeys() function.
- Client Backup Share - Encrypted backup share received from
portal.backupWallet()(thecipherText). - Custodian Backup Share - Raw backup share received from the
POST /backupwebhook.
- Retrieve the encrypted client backup share from your storage
- Retrieve the raw custodian backup share(s) from your storage
- Call the eject function with both shares
- ETH & Solana
- ETH
Cryptographic Curves
Portal supports multiple blockchain networks that use different cryptographic curves:
- SECP256K1: Used by Ethereum and most EVM-compatible blockchains
- ED25519: Used by Solana and several other blockchains
Security Considerations
Use Cases
Private key ejection should only be used in specific scenarios:- Migration - Moving to a different wallet provider
- Advanced users - Who need direct access for specific operations
- Compliance - Regulatory requirements that mandate key access