Coinbase

SKILL.md

Coinbase Developer Platform (CDP) Skill

Product Summary

Coinbase Developer Platform (CDP) is a comprehensive suite of onchain crypto services that enables developers to build blockchain applications without managing complex infrastructure. CDP provides secure wallet management (Server Wallet v2 and Embedded Wallets), REST APIs, SDKs (Python, TypeScript), and CLI tools for EVM and Solana networks. Key entry points: CDP Portal (portal.cdp.coinbase.com) for API key creation, CDP SDK (GitHub: coinbase/cdp-sdk) for programmatic access, CDP CLI (npm: @coinbase/cdp-cli) for terminal-based operations, and REST API v2 (api-reference/v2) for direct HTTP integration. Authentication uses JWT tokens with Ed25519 or ECDSA keys. Primary documentation: https://docs.cdp.coinbase.com

When to Use

Reach for this skill when:

  • Wallet operations: Creating accounts, managing keys, importing/exporting wallets, rotating secrets
  • Transactions: Sending funds, token transfers, batch operations, gas sponsorship
  • Smart contracts: Deploying contracts, calling functions, managing smart accounts (EIP-4337)
  • Trading: Executing swaps, getting price quotes, discovering best execution prices
  • Data queries: Checking balances, transaction history, token information
  • Agentic workflows: Building AI agents that interact with blockchain (AgentKit)
  • Onramp/Offramp: Converting fiat to crypto or vice versa
  • Staking: Delegating assets to validators
  • Webhooks: Setting up real-time notifications for wallet activity

Do NOT use for: Coinbase consumer account access (use Coinbase App API instead), institutional trading (use Exchange/Prime APIs), or operations requiring user OAuth login (use Coinbase OAuth2).

Quick Reference

Authentication Methods

Method Use Case Key Type
JWT (Ed25519) Server-side, recommended default Secret API Key
JWT (ECDSA) Legacy SDKs, Advanced Trade SDK Secret API Key
Client API Key Client-side, public-facing apps Client Key
OAuth2 User login with Coinbase account OAuth Client

Essential Commands (CDP CLI)

# Install
npm install -g @coinbase/cdp-cli

# Configure credentials
cdp env live --key-file ./cdp_api_key.json
cdp env live --wallet-secret-file ./cdp_wallet_secret.txt

# Create and manage accounts
cdp evm accounts create name=my-wallet
cdp evm accounts list
cdp evm accounts by-name my-wallet

# Fund testnet account
cdp evm faucet address=$address network=base-sepolia token=eth

# Send transaction
cdp evm transactions send from-account=my-wallet to=$recipient amount=0.1 token=eth

# Solana operations
cdp solana accounts create name=sol-wallet
cdp solana transactions send from-account=sol-wallet to=$recipient amount=1 token=sol

SDK Quick Start (TypeScript)

import { Coinbase, CoinbaseError } from "@coinbase/cdp-sdk";

const client = Coinbase.configureFromJSON("cdp_api_key.json");
const wallet = await client.createWallet();
const account = wallet.getDefaultAccount();
const transfer = await account.transfer(0.01, "eth").wait();

Supported Networks

Network Type Use
Base Sepolia EVM Testnet Development/testing
Ethereum Sepolia EVM Testnet Development/testing
Solana Devnet Solana Testnet Development/testing
Base EVM Mainnet Production
Ethereum EVM Mainnet Production
Solana Solana Mainnet Production

Key File Paths & Configuration

  • API Key: Download from portal.cdp.coinbase.com/projects/api-keys (JSON format)
  • Wallet Secret: Download from portal.cdp.coinbase.com/products/server-wallet/accounts (text file)
  • Environment variables: CDP_API_KEY_NAME, CDP_API_KEY_PRIVATE_KEY, CDP_WALLET_SECRET
  • CLI config: ~/.cdp/config.json (auto-created after cdp env setup)

Decision Guidance

When to Use Server Wallet v2 vs Embedded Wallet

Scenario Server Wallet v2 Embedded Wallet
Backend automation, trading bots
User-facing web/mobile app
Secure key management required
Multi-network support needed
Gas sponsorship
Social login (Google, Apple, X)

When to Use REST API vs SDK

Consideration REST API SDK
Language flexibility ✅ (any language) Limited (Python, TS)
Type safety
Development speed Slower Faster
Direct HTTP control
Error handling Manual Built-in

Key Algorithm Selection

Scenario Algorithm
New projects, CDP SDK, direct API Ed25519 (default)
Advanced Trade SDK, Coinbase App SDK ECDSA (required)
Eliza framework, legacy systems ECDSA

Workflow

1. Set Up Credentials

  • Create API key at portal.cdp.coinbase.com/projects/api-keys
  • Create wallet secret at portal.cdp.coinbase.com/products/server-wallet/accounts
  • Store securely (environment variables, not version control)
  • Choose Ed25519 unless using legacy SDKs

2. Initialize Client

  • CLI: cdp env live --key-file ./cdp_api_key.json && cdp env live --wallet-secret-file ./cdp_wallet_secret.txt
  • SDK: Load from JSON file or environment variables
  • REST: Set Authorization header with JWT token

3. Create Wallet/Account

  • CLI: cdp evm accounts create name=my-wallet
  • SDK: const wallet = await client.createWallet()
  • REST: POST /api/v1/wallets

4. Fund Account (Testnet)

  • CLI: cdp evm faucet address=$address network=base-sepolia token=eth
  • SDK: await account.faucet()
  • REST: POST /api/v1/faucets/evm

5. Execute Transaction

  • CLI: cdp evm transactions send from-account=my-wallet to=$recipient amount=0.1 token=eth
  • SDK: await account.transfer(0.01, "eth").wait()
  • REST: POST /api/v1/evm-accounts/{address}/transactions

6. Verify & Monitor

  • Check transaction hash on block explorer (Basescan, Etherscan, Solscan)
  • Use webhooks for real-time notifications
  • Query transaction status via API

Common Gotchas

  • API key exposure: Never commit keys to git. Use environment variables or secure vaults. Rotate immediately if exposed.
  • Wallet secret loss: Download and store safely—cannot be recovered. Implement rotation strategy.
  • Network mismatch: Testnet and mainnet are separate. Verify network before sending real funds.
  • Gas estimation: Always estimate gas before sending. Insufficient gas causes transaction failure.
  • Rate limits: CDP enforces rate limits. Implement exponential backoff for retries.
  • ECDSA vs Ed25519: Advanced Trade SDK requires ECDSA keys; most others support Ed25519. Check SDK docs.
  • Wallet secret required for signing: All transaction signing requires wallet secret. Cannot be bypassed.
  • Account creation is async: Wait for account creation to complete before using. Check status via API.
  • Testnet funds are free but limited: Faucet has daily limits. Plan testing accordingly.
  • Smart accounts need initialization: EIP-4337 smart accounts require initial setup transaction.
  • Solana vs EVM differences: Different transaction models, fee structures, and signing schemes. Read protocol docs.
  • Deprecated v1 Server Wallet: Do not use v1. Migrate to v2 for better security and features.

Verification Checklist

Before submitting work:

  • API credentials loaded from environment variables (not hardcoded)
  • Wallet secret stored securely and never logged
  • Correct network selected (testnet for dev, mainnet for production)
  • Transaction gas estimated and sufficient
  • Account created and funded before sending transactions
  • Error handling implemented for API failures and timeouts
  • Webhook subscriptions configured if monitoring required
  • Rate limiting handled with exponential backoff
  • Transaction hash verified on block explorer
  • Wallet secret rotation tested (if applicable)
  • Code tested on testnet before mainnet deployment
  • Sensitive data not logged or exposed in error messages

Resources

Comprehensive navigation: https://docs.cdp.coinbase.com/llms.txt

Critical documentation:

  1. CDP API v2 Authentication — JWT token generation and signing
  2. Server Wallet v2 Quickstart — Create accounts and send funds
  3. CDP CLI Quickstart — Terminal-based operations and MCP integration

Additional resources:


For additional documentation and navigation, see: https://docs.cdp.coinbase.com/llms.txt

Installs
11
First Seen
Apr 8, 2026