# Integrating with EIP-7702 - Privy Source: https://docs.privy.io/recipes/react/eip-7702 ## Summary This Privy documentation page explains how to integrate EIP-7702, an EVM upgrade that lets externally owned accounts set their code to a smart contract's, giving EOA wallets account abstraction features such as transaction bundling, gas sponsorship and custom permissions. Privy says it supports the low-level interfaces required by EIP-7702, including signing authorizations and sending type 4 transactions. The page includes guides for Alchemy, Biconomy, Pimlico, Porto and ZeroDev, each showing how to upgrade a Privy embedded wallet and send sponsored or gasless transactions. It also describes checking delegation status with a single eth_getCode call, where a 0xef0100 prefix followed by a 20-byte address indicates a delegated EOA. ## Article 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: Privy provides methods to sign EIP-7702 authorizations 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 signing EIP-7702 authorizations in our dedicated guide. Learn more about using the signed authorization in the integration guides below! Detect current 7702 authorization state and implementation address You can determine whether an EOA is currently delegated via EIP-7702 and read the authorized implementation address with a single eth_getCode call on the EOA address. Under EIP-7702, an authorized EOA temporarily exposes a small bytecode stub that begins with the magic prefix 0xef0100, followed immediately by the 20-byte implementation address. If eth_getCode returns empty code (0x or 0x0), the EOA is not currently delegated on that chain. The snippets below return the current implementation address or null. Viem Ethers Show Full helper function (robust & typed) Show Full helper function (robust) Using EIP-7702 capabilities Alchemy Biconomy Pimlico Porto ZeroDev In this guide, we will transform your Privy embedded wallet into a smart wallet with features like gas sponsorship, batch transactions, granular permissions, and more using EIP-7702 support from Alchemy. 0. Install dependencies In your app’s repository, install the required dependencies from Privy, Alchemy Account Kit, and viem: 1. Create an Alchemy account and get your API key Create an app: visit the Alchemy dashboard to create a new app, if you don’t already have one. Make sure to enable networks that support EIP-7702 such as Ethereum Mainnet or Sepolia. Save the app’s API Key that will be used later. Enable gas sponsorship: visit the Gas Manager dashboard and create a new sponsorship policy for the app you created in step 1. This policy will be used to set rules on how much of user’s gas you want to sponsor. Make sure to enable gas sponsorship on a chain that support EIP-7702 such as Ethereum Mainnet or Sepolia. Save the Policy ID that will be used later. Now that you have your API key and Policy ID, you can set up your smart wallets. 2. Configure Privy settings If you’re already using a Privy embedded wallet, update your configuration to support EIP-7702 with embedded wallets. If you don’t yet have authentication configured, you can follow this guide to get set up.Make sure your PrivyProvider has the following embeddedWallets settings and ensure you set the defaultChain and supportedChains to the 7702 supported chain you chose in step 1. 3. Adapt Privy signer to a smart account signer Now that you have authentication working, adapt the Privy signer to be able to sign 7702 authorizations to upgrade to smart accounts.1. Get the Privy embedded wallet 2. Create a SmartAccountSigner instance 4. Upgrade to smart accounts and send sponsored transactions Now that you have a SmartAccountSigner instance, follow this guide to create a smart account client (createModularAccountV2Client ) and start sending sponsored transactions. You’ll need: the SmartAccountSigner instance defined in step 3 the API key and the policy ID from step 1 Once you define the client, you can send sponsored transactions with your embedded EOA and access other advanced smart account features! This client will handle all of the logic of delegating to a new smart account, if not already, and signing transactions. If you don’t yet have a signer, follow this guide to get set up.Looking for a complete working example? See this working example integrating Privy embedded EOAs with EIP-7702 and Alchemy Smart Wallets. Next steps You just upgraded your EOA and sent your first sponsored transaction using EIP-7702!If you want to leverage other smart account capabilities such as batching and permissions, check out the Alchemy docs. In this guide we’ll see a quick example of using the Biconomy’s Modular Execution Environment (MEE) stack with Privy! Project Setup Create your project using Vite: Add the following to your package.json: Install dependencies: Set up your main.tsx: In wagmi.ts: ⬇Get the Embedded Wallet Instance After logging in the user with Privy, you can find the embedded wallet as follows: Authorizing with EIP-7702 To install the Biconomy Nexus 1.2.0 smart account on the address of your Privy embedded wallet EOA, you need to sign the following authorization. Note: This is using the signAuthorization method exposed by the useSignAuthorization Privy hook. Execute a Cross-Chain Gas Abstracted Transaction After signing, you can submit a transaction through Biconomy MEE Relayers. Notice few things for this transaction: Gas is paid with USDC Gas is paid on a different chain than the instruction being executed The amount arg in the ERC-20 transfer call is not fixed to a value, but uses runtimeERC20BalanceOf which will inject the full amount of USDC available. This demonstrates few key points of MEE: Gas abstraction / gas sponsorship Multi-chain execution/orchestration Runtime parameter injection enabling multi-transaction composability You can then link the user to MEE Scan to track: Storing the Authorization If you’ve used the chainId === 0 for your authorization you can store it (e.g. in localStorage or DB) and replay it for other chains in the future. This gives your users an even more seamless UX. In this guide, we’ll demonstrate how to use Pimlico, a bundler and paymaster service for ERC-4337 accounts, to enable your users to send gasless transactions using EIP-7702 authorization. 0. Install dependencies In your app’s repository, install the required dependencies from Privy, Permissionless, and Viem: 1. Sign up for a Pimlico account and get your API key Head to the Pimlico dashboard here and create an account. Generate an API key and create a sponsorship policy for the network you plan to use (optional). Make note of your API key and sponsorship policy ID. 2. Configure Privy settings Configure your app to create embedded wallets for all users. 3. Create a simple smart account with Permissionless SDK Permissionless provides a simple way to create a smart account client that can send user operations with EIP-7702 authorization. All you need is the user’s embedded wallet and the Pimlico API key. 4. Sign the EIP-7702 authorization Privy provides methods to sign EIP-7702 authorizations 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. With the smart account client configured and the authorization signed, you can now send gasless UserOperations: Conclusion That’s it! You’ve just executed a gasless transaction from a normal EOA upgraded with EIP-7702 using Pimlico as the bundler and paymaster service.Explore the rest of the Pimlico docs to learn about advanced features like batching transactions, gas estimation, and more. In this guide, we’ll demonstrate how to use Porto, a universal blockchain account infrastructure with native cross-chain interoperability, together with Privy to upgrade your EOA wallets with EIP-7702. 0. Install dependencies In your app’s repository, install the required dependencies from Privy, Porto, and viem: 1. Configure Privy settings Configure your app to create embedded wallets for all users. Update your PrivyProvider configuration: 2. Set up Porto client Create a Viem client configured for Porto: 3. Create Porto account with Privy’s embedded wallet Get the Privy embedded wallet and create a Porto account instance with custom signing: 4. Upgrade account to Porto Use Porto’s RelayActions to upgrade the account: 5. Send transactions with Porto With the account upgraded, you can now send transactions through Porto’s relay infrastructure with advanced features like gas sponsorship and cross-chain capabilities: 6. Track transaction status Monitor the status of your transactions: Next steps You’ve successfully upgraded your EOA with EIP-7702 and Porto! Your users can now: Send transactions with gas sponsorship Execute cross-chain transactions seamlessly Batch multiple operations in a single transaction Benefit from native interoperability across chains Explore the Porto documentation to learn about additional features. 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. 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.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.