Skip to content

Integrating Coinbase smart wallets ​

The Coinbase Smart Wallet is the next iteration of the Coinbase Wallet, taking a lot of the wallet logic onchain to unlock massive new capabilities for users. It is available in version 4.0.0 of the Coinbase Wallet SDK.

Privy enables you to support Smart Wallet out of the box. Just update your SDK version and give your users access to the Smart Wallets, meaning

  • you can set up the smart wallet with wagmi or your favorite library for free.
  • you can support the Smart Wallet alongside other popular login methods like MetaMask or email login.

What is the Coinbase Smart Wallet? ​

The Smart Wallet itself is an ERC-4337 compatible smart contract. It will prompt your user to sign up using passkeys generated on their device and can do everything a wallet can do from thereon in, and more. The Smart Wallet boasts a number of huge benefits:

  • No extensions or passphrases required: the user only needs a passkey to get up and running!
  • Accessible across sites: by tying the passkey to a Coinbase domain (keys.coinbase.com), the Smart Wallet will work across any site that integrates it. This means one account for your user wherever they go.
  • Simple account funding: The Smart Wallet integrates with your Coinbase balances out of the box, making it easy for your users to fund transactions from the wallet if they already have a Coinbase account and unlocking AA benefits around gas sponsorship with paymasters.
  • Flexibility of AA: Enabling more complex use cases, like multiple owners for a Smart Wallet, for instance.

Integrating AA at the wallet level is a powerful way to make it easily accessible to all users across apps, while giving developers an easily upgradeable experience thanks to the Smart Wallet's onchain system.

What networks does Coinbase Smart Wallets support? The Coinbase Smart Wallet is compatible with the following networks: - Arbitrum - Avalanche - Base - BNB - Ethereum L1 - Optimism - Polygon - Zora

For more, you can read about the Smart Wallet, and check out the source code

Integrating the Coinbase Smart Wallet with Privy ​

The Coinbase Smart Wallet is available to all Privy developers. To get set up, you will simply need to add Coinbase Wallet to your login flow and configure your smart wallet preference in the config.externalWallets.coinbaseWallet.connectionOptions property.

tsx
<PrivyProvider
  appId="your-privy-app-id"
  config={{
    appearance: { 
      walletList: ['coinbase_wallet'], 
      ...insertTheRestOfYourAppearanceConfig, 
    }, 
    externalWallets: { 
      coinbaseWallet: { 
        // Valid connection options include 'eoaOnly' (default), 'smartWalletOnly', or 'all'
        connectionOptions: 'smartWalletOnly', 
      }, 
    }, 
    ...insertTheRestOfYourPrivyProviderConfig,
  }}
>
  {children}
</PrivyProvider>

By default, Privy will set config.externalWallets.coinbaseWallet.connectionOptions to eoaOnly such that smart wallets are not enabled. This will surface the existing Coinbase Wallet extension for users who have it installed.

The following are valid connectionOptions property values:

  • eoaOnly: (default) The Privy SDK will only surface the Coinbase Wallet extension or Coinbase Wallet mobile app QR code. Users who do not have it installed will be prompted to install it.
  • smartWalletOnly: The Privy SDK will surface the Coinbase Smart Wallet for all users.
  • all: The Privy SDK will detect whether the user has the Coinbase wallet extension installed. It will popup the Coinbase wallet if they do and the Smart Wallet otherwise.

TIP

Smart Wallet supports a limited number of chains. If using all or smartWalletOnly connection options, be sure that your PrivyProvider default chain and supported chains list is a subset of Coinbase's supported list.

What's next ​

We believe the release of the Coinbase Smart Wallet is a big step forward for broad adoption of account abstraction and bringing crypto mainstream and we are excited to support this product at launch.

From there, we are looking at two paths moving ahead, both leveraging the forthcoming EIP-3074:

  • Making EOA migrations to smart wallets simple -- We want to ensure users can easily move assets over to a smart wallet system if they so choose.
  • Enabling multiple signers for the Smart Wallet system -- While powerful, we also recognize passkeys may not be right for all users. Using EIP-3074, we are looking to easily enable users to leverage the Coinbase Smart Wallet with an email or social based Privy embedded wallet.

For more on this, you can read our blog post on this integration path and check out @wilsoncusack's exploration of these systems leveraging the forthcoming EIP-3074.