CDP API Keys
Use API keys to authenticate requests to the suite of APIs offered on CDP.
Key Types
Type | Usage | Configuration |
---|---|---|
Secret API Key | Server-side: Used to securely authenticate server-to-server communication and must be kept private for maximum security. | - Custom scopes - IP allowlist |
Client API Key | Client-side: Used to identify applications from client-side code (ie, OnchainKit) and used in the RPC endpoint. | - Key rotation with expiration - Domain allowlist |
OAuth Client User Authentication | Client-side: Used to authenticate end users and access their Coinbase accounts with their permission. | - Configurable scopes - Redirect URIs - Access & refresh tokens |
Secret API Keys
Creating Secret API Keys
- Navigate to the Coinbase Developer Platform and select Secret API Keys under the API Keys tab
- Click the Create API key button.
- Enter an API key nickname and click Create & Download.
- Secure your private/public key pair in a safe location. See our Security Best Practices for secure storage recommendations.
To regenerate an API key, click Manage to delete and recreate the key.
IP Allowlist (Optional)
For IP allowlist configuration and examples, see our Security Best Practices guide.
Client API Key
Rotating the Client API Key
- Navigate to the Coinbase Developer Platform and select Client API Key under the API Keys tab
- Click the Rotate button.
- Select an expiration time for your previous key. This is to ensure you can replace your previous key without any downtime.
- Click confirm and replace all references to your previous key, including in your RPC endpoint.
Domain Allowlist
For domain allowlist configuration and important considerations, see our Security Best Practices guide.
OAuth Clients
Creating OAuth Clients
- Navigate to the Coinbase Developer Platform and select OAuth under the API Keys tab
- Click the Create client button
- Enter your application details:
- Application name (shown during OAuth)
- Application type
- Service offerings
- Redirect URIs
- Configure any advanced options if needed
- Store your client ID and client secret securely. See our Security Best Practices guide.
Authorization Flow
Exchange Code for Tokens:
Token Management
- Access tokens expire after 1 hour
- Refresh tokens can only be used once
- Use refresh tokens to obtain new access tokens when needed
Available Scopes
The following scopes control what your application can access:
wallet:accounts:read
: View account balanceswallet:user:read
: Access user informationwallet:transactions:read
: View transaction historywallet:transactions:send
: Send cryptocurrency (requires 2FA)offline_access
: Get refresh tokens
Deleting Keys
To delete any type of API key:
- Click API keys on the left side navigation bar.
- Navigate to the API key you’d like to edit and click Manage.
- Click Delete Key.
- Copy and paste the ID associated with the key and click Delete Key to confirm.
Deleting unused keys is an important security practice. Remove API keys you no longer need to minimize your attack surface.
Ed25519 Signature Algorithm
From February 2025 onwards, new CDP API keys will default to using the Ed25519 signature algorithm for enhanced security and performance. Existing API keys signed with ECDSA will continue to function without interruption, but you will need to update your SDK library to support the new key type.
Secret Format Comparison
🔑 [Previously] ECDSA - PEM Format
🔐 [Now] Ed25519 - Base64 Format
Benefits
- Faster Verification: Ed25519 offers better performance, especially in high-load environments.
- Stronger Security: Provides resistance against common cryptographic attacks.
- Simpler Key Management: Smaller keys and deterministic signatures improve usability.
ECSDA vs. Ed25519
What is ECDSA?
ECDSA (Elliptic Curve Digital Signature Algorithm) is a widely used asymmetric cryptographic algorithm based on elliptic curve cryptography (ECC). It’s commonly used in secure communications, blockchain, and digital signatures.
What is Ed25519?
Ed25519 is a modern public-key signature algorithm based on the Edwards-curve Digital Signature Algorithm (EdDSA), specifically using the Curve25519 elliptic curve. It is designed to be fast, simple, and resistant to common cryptographic vulnerabilities.
ECDSA vs. Ed25519 Key Differences
Feature | ECDSA | Ed25519 |
---|---|---|
Algorithm Type | Elliptic Curve DSA | Edwards-curve DSA |
Curve | secp256r1, secp256k1, etc. | Curve25519 |
Key Size | 256-bit (secp256r1) | 256-bit |
Signature Size | Variable (~64-72 bytes) | 64 bytes |
Deterministic Signatures | ❌ Requires random nonce | ✅ Always deterministic |
Performance | Slower verification | Faster signing & verification |
Security | Strong but depends on nonce randomness | More resistant to implementation flaws |
Private Key Shape | 32-byte scalar (can be DER-encoded in PEM format) | 32-byte seed (often stored with a 64-byte expanded form) |