---
eip: 2997
label: EIP-2997
title: IMPERSONATECALL Opcode
status: Stagnant
type: Standards Track
category: Core
created: 2020-09-24
official: https://eips.ethereum.org/EIPS/eip-2997
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2997.md
canonical: https://eips.huatuo.xyz/eip-2997/
lang: en
tldr: Proposed an IMPERSONATECALL opcode that lets a contract make calls as derived sub-addresses (from its own address plus a salt), enabling multi-user wallets without deploying a contract per user.
tags: [opcode, wallet, meta-transactions, account-abstraction, core]
---

# EIP-2997: IMPERSONATECALL Opcode

> Add a new opcode, IMPERSONATECALL at 0xf6, which is similar in idea to CALL (0xF1), except that it impersonates a sender, i.e. the callee sees a sender different from the real caller. The impersonated sender address is derived from the real caller address and a salt.

**TL;DR:** Proposed an IMPERSONATECALL opcode that lets a contract make calls as derived sub-addresses (from its own address plus a salt), enabling multi-user wallets without deploying a contract per user.

## What problem does it solve?

Services that give every user a non-custodial smart wallet usually rely on counterfactual deployment: each user has a predictable [CREATE2](/eip-1014/) address, and the wallet contract is deployed only when needed. But as soon as the user wants to move ETH or tokens out, the sponsor must pay to deploy that user's contract (or a proxy), which the author estimates at least 42,000 gas per user.

EIP-2997 proposes a **multi-user wallet**: one contract that controls many user addresses directly, authorizing actions with [EIP-712](/eip-712/) signed messages, with no per-user deployment. It also enables batching many users' transfers while keeping normal Ethereum addresses.

## How it works

A new opcode `IMPERSONATECALL` (`0xf6`) behaves like `CALL` but the callee sees a **different sender**: an address derived from the real caller and a salt.

Operands (7): `gas`, `to`, `in_offset`, `in_size`, `ret_offset`, `ret_size`, `salt`.

The impersonated sender is:

```
sender = keccak256(0xff ++ caller ++ salt ++ zeros32)[12:]
```

- `caller` is the 20-byte address of the contract executing the opcode; `salt` is 32 bytes; `zeros32` is 32 zero bytes.
- This mirrors CREATE2 derivation but the trailing zero bytes keep it in a separate address space from real contracts.

In the call:

- `CALLER` returns the impersonated address.
- If value is non-zero, ETH is taken **from the impersonated account's balance**, so the wallet can move funds that were sent to a user's derived address.
- Gas is charged exactly as for `CALL`.
- No code runs "inside" the impersonated account; if a contract happens to exist there, its code is not executed.

## Sample code

Off-chain derivation of a user's impersonated address (ethers v6), matching the spec's formula:

```ts
import { keccak256, concat, getAddress, ZeroHash } from "ethers";

function impersonatedAddress(wallet: string, salt: string): string {
  const hash = keccak256(concat(["0xff", wallet, salt, ZeroHash]));
  return getAddress("0x" + hash.slice(-40));
}

// Spec test vector: caller = 0x00..00, salt = 0x00..00
console.log(impersonatedAddress("0x0000000000000000000000000000000000000000", ZeroHash));
// expected per spec: 0xFFC4F52F884A02BCD5716744CD622127366F2EDF (checksummed)
```

A multi-user wallet would, after checking the user's EIP-712 signature, execute `IMPERSONATECALL(gas, token, ..., salt = userId)` so the token sees the user's own address as `msg.sender`.

## Things to know

- Status is **Stagnant**. The opcode was never added to Ethereum.
- The derived addresses are controlled solely by the wallet contract's code. Users must trust that code, since anything it does can move their funds.
- Related ideas for giving accounts programmable behavior include [EIP-2803](/eip-2803/) (rich transactions), [ERC-4337](/eip-4337/) smart accounts, and [EIP-7702](/eip-7702/), which is the path Ethereum actually shipped for EOAs.
- The spec notes address collisions with real contracts or EOAs are possible in theory but practically infeasible, as with CREATE2.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-2997
