Use this file to discover all available pages before exploring further.
The first iteration of account abstraction from Dynamic uses ZeroDev and embedded wallets.This guide will walk you through setting up ZeroDev and Dynamic so that you can sponsor transactions. While we’re using Base Sepolia for this guide, you can use any network that has implemented the Ethereum Petra upgrade.
Sign up for a free account at https://dashboard.zerodev.app/ and create a project, configure your project name and network (we’ll use Base Sepolia for this example, but you can choose any supported network) and copy your new ZeroDev project ID.
Note that the network you select in your ZeroDev project will be the network
that the smart contract wallet is deployed on and cannot be changed without
creating a new project. Choose a network that aligns with your application’s needs.
You must be using at least SDK version 3.3.0 or 4.0.0-alpha.8 to have access to this feature
Click on “Add another chain”. You can input 1 ZeroDev project ID per chain you would like enabled.
If you would like to remove a multichain ZeroDev provider, hover your mouse over the network icon and you should be able to click the “Trash icon” to remove.
Click “Yes” to save and add another provider if desired.
4
Choose who gets a Smart Contract Wallet (SCW)
On the same configuration page as the step above, you’ll see there are two different types of configuration for issuing Smart Contract Wallets (SCWs) in Dynamic - the wallet level and the user level.
Wallet level
Choose whether to issue SCWs to all wallets, or only to embedded wallets. Note that for the former, you will need to handle the UI and frontend yourself.
User level
Choose whether to issue SCWs to all your users (existing included next time they log in), or just new users.
5
Choose if your users see both the signer and smart wallet
On the same configuration page as the 2 steps above, you’ll see there is a setting for how the Dynamic SDK treats the signer and the smart wallet - only the smart wallet or both the smart wallet and signer.
Show Smart Wallet Only
Only allows you to interact with the smart wallet directly.
Show Smart Wallet & Signer
Treats the smart wallet and signer as separate wallets which you can switch between.
Note that we currently only create smart wallets for embedded wallets. You
will see native web3 wallets in your Dynamic widget, and can still use one to
sign in, but only new embedded wallets will have a smart wallet.
7
Render Dynamic
For this guide, we’ll be using React and TypeScript, but this can easily be adapted to other frameworks.
If you don’t already have an app created, check out our Quickstart guide or Create dynamic app.In your existing project, make sure to install the account abstraction package:
npm
yarn
pnpm
bun
Shell
npm install @dynamic-labs/ethereum-aa
Shell
yarn add @dynamic-labs/ethereum-aa
Shell
pnpm add @dynamic-labs/ethereum-aa
Shell
bun add @dynamic-labs/ethereum-aa
Then add the ZeroDevSmartWalletConnectors to your existing walletConnectors array in the DynamicContextProvider:
To use ZeroDev v5.2, use Dynamic SDK version ^2.0.5. For newer versions, use the latest compatible Dynamic SDK.
Make sure to grab your Dynamic environment id from the Dynamic Dashboard
under Developer > SDK & API Keys, and replace it in the environmentID
setting.
8
Set up a gas sponsorship rule
Now we will set up a basic gas sponsorship policy in the ZeroDev
dashboardIn the Gas Policies tab, click on the button labeled “New” in the Project Policies section
Select “Amount” as the Type, “0.1” as the value and “Day” as the interval. This is saying that we will sponsor up to 0.1 ETH total per day
Click Create Project Policy, and that’s it! Now start your app, log in and try sending some ETH out. The Dynamic SDK will check if a transaction meets your gas policies and will automatically hide the gas in the transaction confirmation step if the gas is sponsored, if not the gas will be displayed.
Since you will be creating a brand new wallet when you log in, you will need to fund it with the native token of your chosen network. If you’re using Base Sepolia as in this guide, you can access a free ETH faucet here: https://www.alchemy.com/faucets/base-sepolia
9
Using the Kernel
To interact with the wallet, you will need to interact with the kernel client. This allows you to send user operations and transactions through your smart wallet.
Note that there is a delay between loading the page and the ZeroDev kernel client
being available. To ensure that the kernel client is available,
please await one of the following methods: getAddress(), getConnectedAccounts() or getNetwork()
before calling getAccountAbstractionProvider().
The only bundler that supports EIP-7702 is Pimlico. So you will need to use the ZeroDevSmartWalletConnectorsWithConfig connector and pass in the bundlerProvider prop with the value PIMLICO.
If you’re planning to use EIP-7702 (which allows EOAs to upgrade to smart accounts), the same kernel interaction principles apply. To learn more about EIP-7702, see our EIP-7702 guide.
Enable a 7702 compatible network (like Odyssey Testnet) on Dynamic’s Chains
Select 7702 for wallet options during ZeroDev configuration in the dashboard
10
Send a transaction
Run your app, and if you copied our snippet from earlier, you should see this
basic pageClick Connect your wallet, enter your email and hit Continue. After pasting in your OTP you’ll be fully logged in!Next, we’re going to send a transaction. To do that, we will need some of the network’s native token. Grab your wallet address by clicking on the Dynamic Widget, then click on the three dots next to your address and hit “Copy wallet address”. If you’re using Base Sepolia as in this guide, you can paste your address into the Base Sepolia Faucet which will deposit some free ETH into your account. After doing so, if you refresh your app, you should see your balance update
Now, send yourself some tokens by clicking on the Send button in the Dynamic Widget. Enter 0.01 as the amount, and an address of your choosing as the recipient, then hit Send now. You will see a screen like the following. Notice that there is no gas estimate field, because this transaction will be sponsored!Hit confirm, sign for the transaction with your passkey. Congratulations, you just sent a gas-sponsored transaction! If you take your smart wallet address and paste it into the block explorer for your network (for Base Sepolia, that’s the Base Sepolia Scan), you will see your smart wallet and the transaction you just sent.
Now that you’ve completed the initial setup and sent your first transaction, you can utilize the full functionality of ZeroDev inside Dynamic - everything from session keys to gas policies. Learn more in the ZeroDev Docs.
You can use viem or ethers with account abstraction to sign messages or send sponsored transaction with no extra configuration, it also works with our wagmi integration.
Once you’ve tested things out and want to deploy to a live network, you will need to do the following:
Add your credit card to ZeroDev under Account Settings > Billing
Create a new ZeroDev project and select a live network
Copy your new ZeroDev project id and paste it into your Dynamic Dashboard
a. We recommend using your Dynamic Sandbox environment for testing your testnet setup, and using your Dynamic Live environment for production.
In order to restrict access to your ZeroDev project id to allow only dynamic to use it you can add dynamic’s static IP address’s to your projects IP allowlist.Dynamic’s IP addresses:
The wallet connector will return your smart wallet address, that address will be used in the Dynamic UI and is the main address you will interact with. But you can fetch the signer address by using the wallet connector’s eoaConnector property and then fetching the address there.
Can I use an existing wallet as a smart contract wallet with account abstraction?
Yes, but not today with Dynamic. We are working on developing new flows to make managing existing EOA wallets with SCWs a smooth transition.
What networks are supported for deploying smart contract wallets?
It depends which provider you choose. For example, with ZeroDev you have the following options:
Arbitrum One
Avalanche
Base
Binance Smart Chain
Ethereum
Optimism
Polygon
Can I change the network for a smart contract wallet after it's deployed?
Each provider will handle things differently, so it’s always better to check
directly with them. For example, with ZeroDev you can’t change the network
after deployment. With Alchemy, it might be possible in a roundabout way.
What happens if I don't want to use a provider i.e. ZeroDev any more?
With Dynamic, you will need to use either ZeroDev or Alchemy. If you have
alternative AA providers, please reach out via our
slack.
What pricing package includes this feature?
This is an advanced feature, but there is
no additional cost from Dynamic beyond the advanced tier itself. The providers
do take a transaction fee, which you can see on their respective pricing
pages.
What does private beta mean in this context, what should I expect?
We are adding customers one at a time for a few weeks, after which we’ll open
it up to the general public as GA.
How are private keys securely managed and stored for smart contract wallets with account abstraction?
Private keys are managed by the EOA, not the SCW. Every SCW has a Signer, or
Owner, which is the EOA.
What is the process for recovering a smart contract wallet in case of key loss or compromise?
The only way the SCW can be recovered is if the EOA is recovered. The SCW is a
smart contract, and the EOA is the owner of the SCW. If the EOA is lost, the
SCW is lost.
Are your smart contract wallets non-custodial?
It’s a common misconception that AA wallets are inherently non-custodial. In fact, whether a wallet is AA or not has nothing to do with whether it’s custodial. It’s the signers that determine whether a wallet is custodial.That is, if you use a non-custodial signer such as local private keys to manage your AA wallet, then it’s non-custodial. At the same time, if you use a custodial key provider such as Fireblocks to manage your AA wallet, then it’s custodial.In any case, whoever has custody over the signers has custody over the wallet.
Why is it better to do this through Dynamic than integrating ZeroDev directly?
We have wrapped our providers so you get all the benefit, and more. For
example, we handle the transaction hashing so it’s user friendly and are able
to show the SCW in our widgets and connectors.