EIP-7702

Enhancing Externally Owned Accounts (EOAs) by allowing them to temporarily delegate their execution to smart contracts.

Key Features

🔧Flexibility

  • Single-chain and cross-chain authorizations
  • User-chosen proxy contracts
  • Enables vendor experimentation
  • Revocable temporary delegation

⚙️Compatibility

  • Seamless integration with EIP-4337
  • Compatible with existing smart accounts
  • Maintains EOA simplicity
  • Supports bundling & gas sponsorship

Technical Specification

Transaction Type 0x04

EIP-7702 introduces a new transaction type with TransactionType 0x04.

{
  "type": "0x4",
  "chainId": number,
  "nonce": number,
  "gasLimit": string,
  "gasPrice": string,
  "to": string,
  "value": string,
  "data": string,
  "authorizationList": [
    {
      "chainId": number,
      "address": string,
      "nonce": number,
      "yParity": number,
      "r": string,
      "s": string
    }
  ]
}

Authorization List Fields

FieldTypeDescription
chainIdnumberThe chain ID where the authorization is valid (0 for all chains)
addressaddressThe address of the smart contract code to delegate to
noncenumberThe nonce of the signer's account
yParity, r, ssignatureThe EIP-712 signature components

Authorization Behavior

1

Verification

The protocol verifies the chain ID, nonce, and validates the authorization signature to ensure authenticity.

2

Delegation

The EOA's code is temporarily set to the code of the specified contract address for the duration of the transaction.

3

Execution

The transaction is executed using the logic defined in the delegated smart contract.

Common Use Cases

Gas Sponsorship

Enable gasless transactions by delegating to a paymaster-enabled smart account.

Transaction Batching

Execute multiple operations (e.g., Approve + Swap) in a single transaction.

Advanced Security

Implement custom permissioning, multisig requirements, or time-locked operations.

Security Considerations

Example: Creating an Authorization

TypeScript/Viem Example

// Create authorization for EIP-7702
const authorization = {
  chainId: 11155111, // Sepolia
  contractAddress: '0xe6Cae83BdE06E4c305530e199D7217f42808555B',
  nonce: 0
};

// Sign the authorization
const signature = await walletClient.signAuthorization({
  ...authorization,
  account: account
});

// Create EIP-7702 transaction
const transaction = {
  type: '0x4',
  chainId: 11155111,
  from: account.address,
  to: targetAddress,
  value: '0',
  data: '0x',
  nonce: await publicClient.getTransactionCount({
    address: account.address
  }),
  authorizationList: [signature]
};

Frequently Asked Questions

Resources