Integrating with EIP-7702
EIP-7702 is an upgrade to EVM blockchains that enables externally owned accounts (EOAs) to set their code to that of a smart contract. In practical terms, this means that EOA wallets will gain AA (account abstraction) capabilities such as transaction bundling, gas sponsorship, and custom permissions.
Privy supports all low level interfaces required by 7702 - signing authorizations and sending type 4 transactions, allowing you to use any implementation of EIP-7702. Use the following guides to get started with EIP-7702 in your application:
Signing EIP-7702 authorizations
Privy provides a useSignAuthorization
hook that allows you to sign an EIP-7702 authorization using the user’s embedded wallet. This authorization is a cryptographic signature that allows an EOA to set its code to that of a smart contract, enabling the EOA to behave like a smart account.
Learn more about using the signed authorization in the guides below!
Using EIP-7702 capabilities
In this guide, we demonstrate using ZeroDev, a toolkit for creating smart accounts, together with Privy to enable your users to send gasless (sponsored) transactions.
Want to see a full end to end example? Check out our starter repo here!
0. Install dependencies
In your app’s repository, install the required dependencies from Privy, ZeroDev and viem
:
1. Sign up for a ZeroDev account and create a project
Head to the ZeroDev dashboard and create a project on a chain that supports EIP-7702 (e.g. Sepolia, Holesky, Odyssey).
Set up a gas sponsorship policy to enable sending sponsored transactions. Copy the Bundler RPC and Paymaster RPC for the network you plan to use.
2. Configure Privy settings
Configure your app to create embedded wallets for all users. Also configure Privy to not show its default wallet UIs. Instead, we recommend you use your own custom UIs for showing users the user operations they sign.
Update your PrivyProvider
configuration to include the following properties:
3. Create a 7702 Kernel account with the ZeroDev SDK
ZeroDev exposes helper functions that take care of generating the 7702 authorization for you. All you need to provide is the signer for the user’s embedded wallet and the Kernel version you want to use.
Behind the scenes ZeroDev generates the EIP-7702 authorization and binds the Kernel implementation code to the EOA, giving it smart-account super-powers while keeping the same address.
4. Configure the ZeroDev client for sponsored transactions
5. Send a gas-sponsored transaction
With the client configured, you can now send gasless UserOperations. Below we send an empty call then wait for it to be mined:
Conclusion
That’s it! You’ve just executed a gasless transaction from a normal EOA upgraded with EIP-7702.
Explore the rest of the ZeroDev docs to learn about batching, session keys, cross-chain actions and more.
In this guide, we demonstrate using ZeroDev, a toolkit for creating smart accounts, together with Privy to enable your users to send gasless (sponsored) transactions.
Want to see a full end to end example? Check out our starter repo here!
0. Install dependencies
In your app’s repository, install the required dependencies from Privy, ZeroDev and viem
:
1. Sign up for a ZeroDev account and create a project
Head to the ZeroDev dashboard and create a project on a chain that supports EIP-7702 (e.g. Sepolia, Holesky, Odyssey).
Set up a gas sponsorship policy to enable sending sponsored transactions. Copy the Bundler RPC and Paymaster RPC for the network you plan to use.
2. Configure Privy settings
Configure your app to create embedded wallets for all users. Also configure Privy to not show its default wallet UIs. Instead, we recommend you use your own custom UIs for showing users the user operations they sign.
Update your PrivyProvider
configuration to include the following properties:
3. Create a 7702 Kernel account with the ZeroDev SDK
ZeroDev exposes helper functions that take care of generating the 7702 authorization for you. All you need to provide is the signer for the user’s embedded wallet and the Kernel version you want to use.
Behind the scenes ZeroDev generates the EIP-7702 authorization and binds the Kernel implementation code to the EOA, giving it smart-account super-powers while keeping the same address.
4. Configure the ZeroDev client for sponsored transactions
5. Send a gas-sponsored transaction
With the client configured, you can now send gasless UserOperations. Below we send an empty call then wait for it to be mined:
Conclusion
That’s it! You’ve just executed a gasless transaction from a normal EOA upgraded with EIP-7702.
Explore the rest of the ZeroDev docs to learn about batching, session keys, cross-chain actions and more.
In this guide, we demonstrate using Biconomy’s Modular Execution Environments, together with Privy to enable your users to send cross chain transactions.
0. Install dependencies
In your app’s repository, install the required dependencies:
1. Sign up for a Biconomy account and get your project ID
Visit the Biconomy dashboard and sign up for a new account if you do not have one already.
2. Follow Biconomy setup instructions
Follow the Biconomy integration guide to set up the rest of your project using Biconomy’s AbstractJS SDK!