EIP-7702 allows externally owned accounts (EOAs) to delegate their code execution to smart contracts for the duration of a transaction. EOAs temporarily “borrow” code from smart contracts through signed authorizations, enabling account abstraction, batched operations, and enhanced wallet functionality. Code delegation only lasts for the transaction duration, maintaining EOA security while adding programmable capabilities.

Comparison with Ethereum

Similarities

  • Same transaction structure: SetCodeTx format with authorization lists
  • Same authorization signature format: EIP-712 compatible signatures
  • Same nonce validation rules: Authorization nonce must match account nonce
  • Same delegation bytecode format: Standard delegation proxy pattern
  • Same gas cost parameters: Standard EVM gas costs apply

Cosmos SDK Enhancements

  • Instant Finality: Delegations are final after one block (~2s) vs 12+ confirmations on Ethereum
  • Lower Gas Costs: Typically much lower transaction costs than Ethereum mainnet
  • Enhanced Debugging: Better error messages and transaction tracing
  • IBC Integration: Delegated code can interact with IBC precompiles for cross-chain operations

Comparison with Account Abstraction

EIP-7702 vs EIP-4337

FeatureEIP-7702 (Code Delegation)EIP-4337 (Account Abstraction)
Account TypeEnhances existing EOAsRequires new contract accounts
CompatibilityWorks with all existing walletsRequires AA-compatible wallets
Gas CostsStandard transaction costsAdditional overhead for UserOps
ComplexitySimple authorization signaturesComplex bundler infrastructure
Adoption PathGradual EOA enhancementNew account creation required

Use Case Comparison

EIP-7702 Strengths:
  • Enhances existing accounts without migration
  • Lower complexity and gas costs
  • Works with current wallet infrastructure
  • Simpler developer experience
EIP-4337 Strengths:
  • More flexible validation logic
  • Advanced features like social recovery
  • Dedicated account abstraction infrastructure
  • Better separation of concerns

Implementation Details

Transaction Structure

SetCodeTx Format

Authorization Structure

Source: tests/integration/x/vm/state_transition_benchmark.go:47-55

Usage Examples

References