Import Wallets
Only individual private key import is supported. To import an HD wallet, derive individual keys from the seed and import them one at a time.Import user wallets
UseimportEndUser to import a private key into an end user’s wallet. The end user controls the wallet through your app’s authentication flow. This is useful when migrating users from another wallet provider and you want to preserve their wallet addresses.
Set keyType to "evm" (hex-encoded) or "solana" (base58-encoded).
- Node (TypeScript)
- Python
Import API key wallets
EVM
UseimportAccount to bring an external private key into a wallet your application controls via API key. Provide a hex-encoded 32-byte private key.
- Node (TypeScript)
- Python
Solana
Provide a base58-encoded private key (e.g. from Phantom) or a raw 32-byte key array.- Node (TypeScript)
- Python
Export wallets
Export user wallets
User wallet exports always happen inside a secure, isolated iframe. Your application code never has access to the raw key material.UI component
The pre-builtExportWalletModal from @coinbase/cdp-react handles the full export flow with built-in UI:
React
React hook
UseuseEvmKeyExportIframe from @coinbase/cdp-hooks when you want to embed the export iframe directly in your own UI:
React
Export API key wallets
EVM
Export private keys from wallets your application controls via API key. You can export by address or by name. Note that you cannot export user wallets via the backend SDKs.- Node (TypeScript)
- Python
Solana
- Node (TypeScript)
- Python
API key configuration
To export private keys programmatically, your API key must have the Export (export private key) scope enabled. Configure this when creating the API key under API restrictions > API-specific restrictions.Security best practices
- Never log, display, or store private keys in plaintext
- Clear key variables from memory after use
- Require explicit user consent before any export operation
- Prefer clipboard copy over displaying keys on screen
- Educate users on secure storage (hardware wallets, encrypted vaults)