import
method and using a seed phrase.
Wallets can create new addresses, list their addresses, list their balances and transfer assets to other addresses or wallets.
Wallets are created on a specific network. Certain features are only available on certain networks. For example, faucets are only available on Base Sepolia and Ethereum Sepolia. Trades are only available on Base Mainnet.
Creating a Wallet
SDK DocumentationRefer to the Wallet class SDK docs for a full list of supported methods.A wallet starts with a single
defaultAddress
. You can also create more addresses in the wallet, and list them:Securing a Wallet
There are two types of wallets that can be created using the CDP SDK, depending on how the private keys are managed: Coinbase-Managed (2-of-2) Wallets and Developer-Managed (1-of-1) Wallets. Developer-Managed wallets are best for rapid testing and prototyping, while Coinbase-Managed wallets are recommended for any production environments.Turn on IP Whitelisting in the CDP PortalIP whitelisting provides another layer of protection for your wallets and prevents an attacker from using your CDP API key outside of your infrastructure. See API Key Security Best Practices on how to enable IP whitelisting on your secret API keys.
Secure your CDP Secret API Key
- MPC does not safeguard your CDP API keys or account credentials. If your CDP login or API keys are compromised, funds held in API Wallets could potentially be at risk even when using 2-of-2 MPC.
- Coinbase recommends that you store your secret API keys in a dedicated solution such as AWS secret manager, Azure key vault, or some other secure storage option. Your CDP account can be used to mint new secret API keys and should be stored securely using a password manager. Always follow the principle of least privilege when deciding who within your organization can access your CDP account funds.
Coinbase-Managed Wallets
Server Wallet offers a state-of-the-art Multi-Party Computation (MPC) option that splits private keys into two shares between Coinbase and the developer, ensuring improved security. Even if a developer’s share of the private key is compromised, assets will not be at risk as long as the CDP API keys and account credentials remain secure. These Coinbase-Managed (2-of-2) wallets use the Server-Signer, a deployable component that simplifies key management and provides a secure way to sign transactions. For production applications requiring maximal security, we recommend using Coinbase-Managed Wallets.Developer-Managed Wallets
For Developer-Managed (1-of-1) Wallets, it is your responsibility as the developer to securely store the data required to re-instantiate your wallets. For example, you may choose to store this data in an encrypted database. As with any 1-of-1 wallet solution, losing access to the wallet could result in a loss of funds. The CDP SDK provides two key pieces of information to persist Developer-Managed (1-of-1) Wallets:- Seed: a 32-byte hexadecimal string. This seed is used to derive all of the private keys in the wallet and provides access to spend the assets in the wallet.
- Wallet ID: a string used to identify the wallet.
export
method:
Persisting Locally
For convenience, we provide a method that stores the wallet seed to a local file that you specify.This is an insecure method of storing wallet seeds and should only be used for development purposes.
Re-instantiating a Wallet
The seed and the ID of the wallet are required to re-instantiate a wallet when a new session is started. This data is encapsulated in the export data of a wallet, which should be securely persisted by the developer. The following code demonstrates how to import the data required to re-instantiate a wallet.Hydrating a Wallet
Another method of re-instantiating a wallet is to “hydrate” it. Hydration consists of two parts:- Fetching the wallet from the server
- Setting the correct seed on the wallet
Hydrating Locally
Importing a Wallet
The CDP SDK allows you to import your own wallet via a mnemonic seed phrase, so that you can bring your existing wallets into the CDP ecosystem.- Easily import wallets from other tools: Use your BIP-39 mnemonic seed phrase to import your existing wallet (ie, from MetaMask, Coinbase Wallet app, etc.) into the CDP ecosystem, allowing you to create complex, programmatic, or agentic interactions.
- 1-of-1 (Developer-Managed) security: Your wallet’s seed and seed phrase will not leave your device.
Remember to back up your seed phrase. Coinbase is not responsible for any loss of your seed phrase.
- Export your wallet data (includes your
seed
andwallet ID
) to your desired storage medium. - Re-instantiate your wallet at any time using your exported wallet data, without needing to use your mnemonic seed phrase.
Retrieving Balances
To view the amount of assets held in a wallet, call the following:list
method only returns balances for the top 20 assets supported by symbol. For other assets, use get
as follows.