Documentation Index
Fetch the complete documentation index at: https://docs.gelato.cloud/llms.txt
Use this file to discover all available pages before exploring further.
EIP-7702 enables EOAs (Externally Owned Accounts) to temporarily act as smart accounts. This means your existing wallet is your smart account - no need to transfer assets to a separate contract address.
Why EIP-7702?
With traditional ERC-4337 smart accounts, users must:
- Deploy a new smart account contract
- Transfer assets from their EOA to the smart account
- Manage two separate addresses
With EIP-7702:
- Your EOA address becomes your smart account
- No asset transfers required - use your existing balances
- Same address across all chains
- Seamless upgrade path for existing wallets
Network & Account Support
EIP-7702 is supported on most chains and smart account implementations. However, support varies by network and account type.
Usage
To use EIP-7702, you need to signal it in your request and provide an authorization signature. In following code snippets you can see the difference implementaitons
Gelato Gasless SDK
Viem
Permissionless
API
Set eip7702: true when creating the bundler client:
const bundler = await createGelatoBundlerClient({
account,
apiKey: process.env.GELATO_API_KEY,
client,
eip7702: true,
});
Include the authorization object in the UserOperation using viem’s bundler client:import { createPublicClient, createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
const owner = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const walletClient = createWalletClient({
account: owner,
chain: baseSepolia,
transport: http(),
});
const publicClient = createPublicClient({
chain: baseSepolia,
transport: http(),
});
const authorization = await walletClient.signAuthorization({
contractAddress: smartAccountImplementation,
delegate: true,
});
const hash = await walletClient.sendTransaction({
authorizationList: [authorization],
to: targetAddress,
data: callData,
});
Use permissionless with the 7702 smart account variant:import { createSmartAccountClient } from "permissionless";
import { to7702SimpleSmartAccount } from "permissionless/accounts";
import { createPublicClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
const owner = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const publicClient = createPublicClient({
chain: baseSepolia,
transport: http(),
});
const account = await to7702SimpleSmartAccount({
client: publicClient,
owner,
});
const bundlerClient = createSmartAccountClient({
account,
chain: baseSepolia,
bundlerTransport: http("https://api.gelato.cloud/bundler/84532?apiKey=YOUR_API_KEY"),
});
// First transaction requires authorization
const hash = await bundlerClient.sendTransaction({
to: targetAddress,
data: callData,
value: 0n,
authorization: await owner.signAuthorization({
contractAddress: account.implementation,
}),
});
When using the API directly, use viem’s signAuthorization to create the authorization and include it in the UserOperation.Step 1: Sign the authorizationimport { createWalletClient, http } from "viem";
const authorization = await walletClient.signAuthorization({
contractAddress: smartAccountImplementation,
chainId: 84532, // Base Sepolia
nonce: await publicClient.getTransactionCount({ address: eoaAddress }),
});
// authorization contains: { address, chainId, nonce, r, s, yParity }
Step 2: Include in the API request{
"jsonrpc": "2.0",
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0x...",
"nonce": "0x0",
"callData": "0x...",
"signature": {
"signature": "0x...",
"authorization": {
"address": "0x...",
"chainId": 84532,
"nonce": 0,
"r": "0x...",
"s": "0x...",
"yParity": 0
}
}
},
"0x0000000071727De22E5E9d8BAf0edAc6f37da032"
],
"id": 1
}
Authorization Signature
The authorization signature delegates your EOA to act as a smart account. It includes:
- address: The smart account implementation contract
- nonce: Your EOA’s current nonce
- chainId: The target chain (included automatically)
This signature is attached to the UserOperation and verified on-chain during execution.