Overview
Wallet Standard is a universal interface that allows Solana wallets to work seamlessly across different dapps without vendor lock-in. It’s the ecosystem standard for wallet integration, supported by major wallets like Phantom, Solflare, and Backpack. The @coinbase/cdp-solana-standard-wallet package integrates CDP’s embedded Solana wallets into the Wallet Standard ecosystem, allowing you to use the Wallet Standard interface to interact with your user’s wallets. You’ll learn how to install the package, set up the integration, and use CDP wallets through the standard interface.Check out the CDP Web SDK reference for comprehensive method signatures, types, and examples.
Supported features
CDP Solana wallets support all standard Solana wallet features:Feature | Method | Description |
---|---|---|
Connect | standard:connect | Connect to the wallet |
Disconnect | standard:disconnect | Disconnect from the wallet |
Event listener | standard:events | Listen for wallet events |
Sign message | solana:signMessage | Sign arbitrary messages |
Sign transaction | solana:signTransaction | Sign transactions for later submission |
Sign and send | solana:signAndSendTransaction | Sign and broadcast transactions |
CDP identifier | cdp: | Custom feature flag to identify CDP wallets |
Prerequisites
- Node.js 22+ installed
- A node package manager installed (i.e.,
npm
,pnpm
, oryarn
) - A free CDP Portal account
- Basic familiarity with React and Solana
1. Install packages
Add the required packages to your project using your preferred package manager.If you want to use your own UI instead of the prebuilt UI components, install
@coinbase/cdp-hooks
instead of @coinbase/cdp-react
.2. Get your CDP Project ID
- Sign in to your CDP Portal account
- Select a project from the dropdown menu in the top-left
- Click the gear icon to view project settings
- Copy the Project ID for use in the next step
3. Set up the CDP Provider
UseCDPReactProvider
or CDPHooksProvider
to manage CDP initialization and authentication context.
main.tsx
Use
CDPHooksProvider
from @coinbase/cdp-hooks
if you don’t need pre-built UI components like <AuthButton />
.4. Use the CDP Solana wallet hook
Import and use theuseCdpSolanaStandardWallet
hook to access your CDP wallet. The hook uses the config from your CDPReactProvider
or CDPHooksProvider
.
App.tsx
5. Sign in the user
Before using the wallet, users need to authenticate with CDP. Option 1: Using React ComponentsWhen a user signs out or their session expires, the CDP wallet automatically unregisters from the Wallet Standard registry. This means it will no longer appear in wallet lists for dapps, and any active connections will be disconnected. Users will need to sign in again to restore wallet functionality.
6. Perform wallet operations
Sign a message
SignMessage.tsx
Sign and send a transaction
SendTransaction.tsx
7. Discover all wallets
UseuseSolanaStandardWallets
to see all available wallets in the ecosystem, including CDP, Phantom, Solflare, and others.
WalletList.tsx
What's different from direct CDP integration?
What's different from direct CDP integration?
The Wallet Standard integration provides:
- Universal compatibility - Works with any dapp supporting the Wallet Standard
- Automatic discovery - Your user’s CDP wallet appears alongside other installed wallets
- Standard interface - Uses the same methods as Phantom, Solflare, etc.
- No vendor lock-in - Dapps don’t need CDP-specific code
- Ecosystem benefits - Wallet adapters, aggregators, and tooling work automatically
wallet.features['solana:signMessage']
instead of CDP-specific APIs.Example applications
Explore complete working examples:Demo with CDP Hooks
A complete example using CDP providers and hooks for enhanced functionality.
Standalone Demo
A complete example using the standalone integration pattern without providers.
Supported networks
CDP Solana wallets support both mainnet and devnet. Use these chain identifiers in your transactions:Mainnet
Chain identifier:
solana:mainnet
Devnet
Chain identifier:
solana:devnet
What to read next
- CDP Web SDK Documentation: Comprehensive API reference for the CDP Web SDK
- React Hooks: Learn about available CDP hooks
- Solana Signing: CDP methods for signing operations
- Sending Solana Transactions: CDP methods for sending transactions
- Wallet Standard Documentation: Explore the Wallet Standard specification