Overview

Accounts refer to an address on a blockchain that has the ability to sign transactions on behalf of the address, allowing you to not only send and receive funds, but also interact with smart contracts. Cryptographically, an account corresponds to a private/public key pair.

Accounts are a term consistent across the crypto ecosystem: Ethereum, Solana, and viem use this term to refer to the same concept.

The v2 Wallet APIs support the following account types:

  • EVM Compatible Accounts:
    • EOAs: Externally Owned Accounts on any EVM-compatible blockchain that have the ability to sign transactions on behalf of an account’s address (i.e., when using a Smart Account).
    • Smart Account: A smart contract-based account that can provide advanced functionality such as gas sponsorships and spend permissions.
  • Solana Accounts: An account on the Solana blockchain.

More code samples are available in our Typescript and Python SDK repositories.

EVM accounts

When using the v2 Wallet API, ensure you understand the differences between our two offered account types, Externally Owned Accounts (EOAs) and Smart Accounts so that you select the proper type for your application.

The v2 Wallet API supports EOAs on all EVM-compatible networks and Smart Accounts on Base Sepolia and Base Mainnet.

EOA vs Smart Accounts

While both account types enable blockchain interactions, they differ significantly in their architecture, capabilities, and constraints:

FeatureEOASmart Account
ControlPrivate key generated and secured in CDP’s TEEControlled by smart contract code with an owner account (can be a CDP-managed EOA or bring your own)
CreationGenerated new or imported from existing private keyCreated with CREATE2 opcode, deployed on first operation
Transaction typeDirect, signed blockchain transactionsBundled transactions (user operations)
Gas payment Must pay gas fees directly Gas sponsorship available via paymaster (subsidized on Base Sepolia)
Batch operations Single operation at a time Multiple calls in a single user operation
Owner requirements None required Requires an owner account (CDP EOA or external)
CDP limitationsNoneOne smart account per owner, one owner per smart account
Network support All EVM networks supported by CDP Base Sepolia and Base Mainnet only
Concurrent operations Can have multiple pending transactions Support for concurrent userOperations
viem compatibility Works seamlessly with viem for all onchain actions Smart account owners work seamlessly with viem for all onchain actions
web3/eth-account compatibility Works seamlessly with web3.py and eth-account libraries for all onchain actions Smart account owners work seamlessly with web3.py and eth-account libraries for all onchain actions
Faucet support Base, Ethereum, Solana Base, Ethereum, Solana

Need support for additional networks? Reach out to us on the Coinbase Developer Platform Discord in the #cdp-sdk channel.

Use cases

Use EOAs when:

  • You need support across all EVM networks
  • You require simple wallet functionality
  • You don’t need gas sponsorship features

Use Smart Accounts when:

  • You’re building on Base Sepolia or Base Mainnet
  • You need to batch multiple operations in one transaction
  • You want to sponsor gas fees for users
  • You need EIP-4337 account abstraction features

Implementation

EOAs are controlled directly by a private key.

EOAs

EOAs can be created new or imported from existing private keys. The following example shows both methods:

// Create a new EOA
const newAccount = await cdp.evm.createAccount();

// Import an existing EOA from private key
const importedAccount = await cdp.evm.importAccount({
  privateKey: "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  name: "imported-account"
});

Here’s how to create an EOA and send a simple transaction:

// Create a new EOA
const account = await cdp.evm.createAccount();

// Send a transaction
const { transactionHash } = await cdp.evm.sendTransaction({
  address: account.address,
  transaction: {
    to: "0x...",
    value: parseEther("0.1"),
  },
  network: "base-sepolia",
});

For a complete example of creating and using EOAs, see the quickstart guide.

Unlike Solana, EVM signing is handled automatically by the CDP SDK. When you call sendTransaction() for EOAs or sendUserOperation() for Smart Accounts, CDP manages the entire signing and submission process - you don’t need to manually serialize, sign, or submit transactions.

Smart Accounts

Smart Accounts are currently only available on Base Sepolia and Base Mainnet.

Smart Accounts operate through deployed smart contracts, enabling advanced features through EIP-4337 Account Abstraction.

When creating a Smart Account, an EOA must be provided as the owner (either a CDP-managed EOA or an external EOA).

A Smart Account is not deployed until its first user operation:

const smartAccount = await cdp.evm.createSmartAccount({
  owner: evmAccount,
});
// Contract address is deterministic but not yet deployed

// Contract is deployed with the first user operation
const sendResult = await cdp.evm.sendUserOperation({
  smartAccount,
  network: "base-sepolia",
  calls: [/* ... */],
});

Smart Accounts use the CREATE2 opcode for deterministic addresses, allowing the contract address to be known before deployment.

For detailed implementation examples including batch operations and gas sponsorship, see the Smart Accounts guide.

Solana accounts

Solana accounts represent addresses on the Solana blockchain that can hold SOL and other tokens.

Implementation

Creating and using Solana accounts with the CDP Wallet API is straightforward. This example demonstrates creating an account, funding it via faucet, and signing a message:

const account = await cdp.solana.createAccount();

await cdp.solana.signMessage({
  address: account.address,
  message: "Hello Solana!"
});

Transaction signing

Beyond basic account operations, you’ll often need to sign and send transactions. While message signing, demonstrated above, is used to verify account ownership (e.g., for authentication or off-chain verification), transaction signing is used to authorize actual on-chain actions, such as transferring SOL or interacting with a program.

The CDP Wallet API integrates seamlessly with the Solana Web3.js library for transaction handling. For complete examples of creating Solana accounts and sending transactions, see:

  • v2 Security: Learn about the security features of v2 Wallet API.
  • API Reference: Explore the complete API reference for v2 Wallet API.