0x04f8770280843b9aca008506fc23ac0083030d4094 EOA Code Designator Prefix: 0xef0100 || sweeper_contract_address
Executive Summary: When Externally Owned Accounts Acquire Persistent Bytecode
On May 7, 2025, Ethereum activated the Pectra (Prague-Electra) network upgrade, introducing EIP-7702 (Set EOA Account Code) via EIP-2718 Transaction Type 0x04. Engineered to bridge traditional Externally Owned Accounts (EOAs) into ERC-4337 account abstraction (enabling legitimate transaction batching, passkey verification, and gas sponsorship without migrating addresses), EIP-7702 altered a ten-year invariant of the Ethereum Virtual Machine: EXTCODESIZE on an EOA is no longer guaranteed to be zero, and an EOA can delegate complete execution authority over its own msg.sender identity via a single off-chain secp256k1 signature.
Within seventy-two hours of mainnet activation, Crime-as-a-Service (CaaS) drainer syndicates led by Inferno Drainer, Pink successors, and automated mempool sweeper operators deployed standardized malicious delegation targets across Ethereum, BNB Smart Chain, Base, and Arbitrum. Empirical chain telemetry collected across the first six months post-Pectra revealed that over 85% of all mainnet EIP-7702 authorizations pointed to automated sweeper or drainer contracts, accounting for more than $85 million in cumulative retail and whale portfolio losses (DT-INC-2025-002).
Byte-Level Mechanics of Type 0x04 & MAGIC (0x05) Authorization Tuples
Unlike a standard transaction (which must be funded with ETH gas and broadcast by the signer), EIP-7702 separates authorization signing (performed off-chain by the victim authority key) from transaction execution and gas payment (performed on-chain by any third-party relayer or drainer bot!).
An EIP-7702 authorization tuple contains four fields: [chain_id, address, nonce, y_parity, r, s]. The victim signs the keccak256 digest of a single-byte domain-separation prefix (MAGIC = 0x05) concatenated with the RLP-encoded target tuple:
authorization_digest = keccak256(0x05 || rlp([chain_id, delegation_contract_address, account_nonce]))
When the drainer's relayer bot bundles this signed tuple inside authorization_list of a Type 0x04 transaction and pays the L1/L2 gas fee:
- The EVM recovers the
authorityEOA address viaecrecover(authorization_digest, y_parity, r, s). - The EVM verifies
chain_id == 0 || chain_id == block.chainidand checks thatnoncematches the victim EOA's current transaction nonce, incrementing the victim's nonce by1. - The EVM writes a
23-byteDelegation Designator directly into the victim EOA'scodefield (using the0xefprefix reserved underEIP-3541so normalCREATEdeployments can never forge it):EOA.code = 0xef0100 || <20-byte delegation_contract_address> - From that microsecond forward, every call directed at the victim's EOA executes the bytecode of
delegation_contract_addressviaDELEGATECALL-equivalent semantics whereaddress(this)andmsg.senderon outbound sub-calls equal the victim's own EOA!
Four Adversarial Attack Vectors Observed in DT-INC-2025-002
- Atomic Multi-Asset Portfolio Drain (
Inferno Batch Sweeper): Before Pectra, anERC-20phishing page had to prompt the victim for separatePermitsignatures per token (or rely on priorPermit2infinite allowances) and still could not touch nativeETHwithout persuading the user to broadcast a value-bearing transaction. WithEIP-7702, the relayer attachesInferno's batch sweeper contract to the victim's EOA and invokesexecute(Call[])in the exact same transaction, transferring nativeETH,USDC,USDT,WBTC,stETH, and staked LP receipts simultaneously becausemsg.senderinside every token contracttransfercall is the victim's own EOA! - Omnichain
chain_id = 0Replay: Whenever a victim signs an authorization tuple containingchain_id = 0(most devastating on fresh or low-nonce vaults wherenonce = 0across multiple L2s), drainer bots immediately replay the identical(y_parity, r, s)signature on everyEIP-7702-enabled EVM chain (Ethereum,Base,Arbitrum,Optimism,BNB Smart Chain,Unichain) where the account's nonce matches. - Storage Collision & Uninitialized Smart-Account Upgrade Traps: Several early post-Pectra wallet implementations deployed
EIP-7702smart-account templates whoseinitialize(address owner)function lacked binding cryptographic commitment to the EOA's own signature, allowing MEV front-runners watching the mempool to sandwich the0x04setup transaction and register themselves as the delegated account's passkey guardian. - Post-Compromise Persistent Sweeper Lockout (
receive()Hook + Nonce Pre-Signing): When an attacker compromises a hot-wallet seed or.envprivate key, they immediately delegate the EOA to a sweeper contract whosereceive() external payablefunction forwards100%of incomingmsg.valueto the attacker, and pre-sign50consecutive future authorization tuples (nonce + 1throughnonce + 50) in private Flashbots/builder bundles so manual user revocations are instantaneously overwritten when vesting or staking rewards unlock!
Smart-Contract Broken Invariants & Wallet Firmware Blind Spots
DT-INC-2025-002 exposed critical engineering blind spots across both DeFi Solidity contracts and retail wallet signing interfaces:
1. Collapse of Legacy require(msg.sender == tx.origin) & extcodesize == 0 Guards
For nearly a decade, hundreds of Solidity developers wrote require(msg.sender == tx.origin, "No contracts") or inline assembly if gt(extcodesize(caller()), 0) { revert(0, 0) } under the mistaken belief that enforcing EOA-only callers prevented atomic flash-loan or multi-call manipulation. Under EIP-7702:
- When a delegated EOA initiates a Type
0x04or Type0x02transaction calling its own delegated batch-execution logic,msg.sender == tx.originevaluates totrueon the top-level sub-calls while executing arbitrary loop/reentrancy contract logic! - Conversely, naive contracts rejecting callers with
extcodesize(msg.sender) > 0broke legitimate smart-wallet users whose EOAs held the23-byte0xef0100...delegation designator. Protocol engineers must replace alltx.originandextcodesizeheuristics with explicitEIP-1153transient-storage reentrancy locks (TSTORE/TLOAD).
2. Why JSON-RPC eth_sign & Outdated Firmware Facilitated 0x05 Phishing
Because an EIP-7702 authorization digest (keccak256(0x05 || rlp([chain_id, address, nonce]))) is a raw 32-byte elliptic-curve hash lacking the EIP-191 \x19Ethereum Signed Message:\n prefix, well-engineered wallets (Rabby, MetaMask latest builds, Trezor Safe 7, and Ledger updated Ethereum apps) strictly prohibit external dApps from requesting wallet_signAuthorization via standard window.ethereum provider APIs, restricting account-delegation upgrades exclusively to internal wallet settings menus against a hardcoded allowlist of audited smart-account implementations (Safe, Kernel, Ambire, MetaMask Delegator).
How, then, did Inferno Drainer capture $85M+ in post-Pectra delegations?
- Unpatched Wallet Forks & Mobile In-App Browsers: Regional mobile wallets and older desktop extension builds still exposed permissive raw-hash signing (
eth_sign) or custom RPC methods without filtering prefix byte0x05, allowing phishing pages to request anEIP-7702tuple disguised as a "Gasless Security Verification." - Malicious Browser Extensions & Clipboard/Seed Infostealers: Attackers harvesting hot-wallet vaults (
Lumma,BeaverTail) immediately converted stolen keys into persistent0xef0100sweepers across 10+ chains viachain_id = 0to automate extraction of illiquid staked positions (PendlePTs,EigenLayerrestaked withdrawals, and vested token airdrops) the exact block cooldowns expired. - Developer
.env& Foundry Script Mishaps: Engineers testingvm.signDelegationon mainnet forks with real funded deployment keys inadvertently committed or broadcast wildcardchain_id = 0tuples against unverified test contracts lackingmsg.sender == address(this)access modifiers!
3. Storage Dirtying Risks Across Delegation Upgrades (ERC-7201 Namespaced Storage)
Even when delegating an EOA to a legitimate smart-account contract and later switching to a different wallet vendor's EIP-7702 contract, the EOA's underlying persistent storage trie is never wiped when EOA.code changes! If Wallet Vendor A stores uint256 guardianThreshold at storage slot 0 and Wallet Vendor B stores address sessionKeyOwner at storage slot 0, re-delegating without ERC-7201 (Namespaced Storage Layout) causes catastrophic cross-implementation storage-slot collisions analogous to Bybit's proxy slot 0 overwrite. Never delegate an EOA to any contract that fails to enforce ERC-7201 hashed storage namespaces and explicit cryptographic re-initialization nonces.
Evolution of EVM Wallet Drainer Primitives (2020 - 2026)
| Drainer Vector | On-Chain / Off-Chain Artifact | Victim Pays Gas? | Blast Radius per Signature | Persistence After Drain |
|---|---|---|---|---|
Legacy ERC-20 approve | On-chain tx 0x095ea7b3 | Yes (Visible tx fee) | Single ERC-20 token contract only | Until approve(spender, 0) tx |
EIP-2612 Permit | Off-chain EIP-712 signature | No (Drainer relays) | Single ERC-2612-compliant token | Single nonce consumed on permit() |
Uniswap Permit2 Batch | Off-chain PermitBatch struct | No (Drainer relays) | All tokens previously approved to Permit2 | Until lockdown() or expiration |
EIP-7702 Type 0x04 (SET_CODE) | Off-chain 0x05 || rlp([id, addr, n]) | No (Drainer relays) | 100% of Native ETH + ALL Tokens/NFTs + Omnichain (id=0) | Permanent EOA code (0xef0100...); steals future deposits! |
Forensic Inspection & Safe Emergency Revocation Procedure
If you suspect an EOA has signed a suspicious post-Pectra message or exhibits unauthorized sweeps, do NOT send ETH to that EOA to pay gas! Follow this deterministic four-step containment protocol:
- Inspect EOA Code Designator via Local/Trusted RPC:
Repeat this check acrosscast code 0xYOUR_EOA_ADDRESS --rpc-url https://ethereum-rpc.publicnode.com # Healthy standard EOA returns: 0x # Compromised EIP-7702 EOA returns 23 bytes: 0xef0100<20-byte-sweeper-address>Ethereum,Base,Arbitrum,Optimism, andBNB Smart Chain. - Determine Whether the Private Key Itself Is Compromised: If you never leaked your seed phrase or private key (meaning you only signed a phishing prompt on a hardware wallet or
Rabby), revoking the delegation restores clean EOA custody. If your.envor hot-wallet seed leaked, the attacker can re-sign new0x05tuples indefinitely; treat the address as permanently burned and request protocol teams migrate unvested claims if supported. - Execute Sponsored Zero-Address Delegation Revocation (
address(0)): Per theEIP-7702specification, signing a new authorization tuple whose targetaddressequals0x0000000000000000000000000000000000000000clears the EOA's0xef0100...code pointer back to empty0x! Construct theaddress(0)revocation tuple offline using Foundry (cast wallet sign-auth 0x0000000000000000000000000000000000000000) at the infected EOA's currentnonce, then submit and pay gas for the Type0x04transaction (cast send --auth <signed_hex>) from a completely separate, clean gas-payer EOA via a private builder RPC (https://rpc.flashbots.net) so mempool sweeper bots cannot front-run your nonce! - Bundle Claim + Sweep + Revocation Atomically for Compromised Vesting Keys: In the worst-case scenario where your raw private key was stolen and awaits an upcoming token unlock, submit an atomic multi-transaction private Flashbots / Titan Builder bundle where Transaction 1 (paid by Sponsor EOA) overwrites
EOA.codeto0x0000...0000(or your own rescue contract) and claims/transfers the unlocked tokens to a fresh hardware cold wallet within the exact same block index (block.number), denying public mempool visibility to the attacker's sweeper daemon.
Wallet Architecture & dApp Integration Hardening Checklist
Both wallet developers and smart-contract engineers building on post-Pectra EVM networks must enforce explicit protocol boundaries to neutralize DT-INC-2025-002 attack classes:
- Block External
0x05Signing Overwindow.ethereum(EIP-1193): Browser and mobile wallets must never expose arbitraryMAGIC (0x05)digest signing or unrestrictedeth_signraw-hash primitives to untrusted web origins. Account-code delegation (SET_CODE) should only be initiated inside privileged wallet chrome UI against audited, reproducibly compiled smart-account contracts (ERC-7579/Safe/Kernel) verified by bytecode hash. - Reject
chain_id = 0Wildcard Authorizations by Default: Hardware wallet Secure Element parsers (Trezor,Keystone,BitBox02,Ledger) must explicitly decode0x04authorization lists on-device, render a high-severity warning screen wheneverchain_id == 0appears, and require explicit per-chain (chain_id == 1,8453,42161) confirmation unless the user manually unlocks advanced developer settings. - Mandate
ERC-7201Namespaced Storage & Cryptographic Initializers: Any smart-account implementation designed as anEIP-7702delegation target must store state exclusively atERC-7201collision-resistant slots (keccak256(abi.encode(uint256(keccak256("namespace")) - 1)) & ~bytes32(uint256(0xff))) and require anEIP-712domain-bound owner signature insideinitialize()so mempool front-runners cannot hijack uninitialized delegations. - Audit Existing EOAs Quarterly Across All L2s: Operators migrating legacy hot wallets or developer deployment keys should run automated
eth_getCodesweeps across every active EVM chain via private or Tor-routed RPC endpoints to verify zero unexpected0xef0100designators remain attached. If an historical developer key ever signed experimental Pectra testnet or mainnet authorization tuples withchain_id = 0, rotate operational treasury balances immediately into a fresh hardware-backedSafeor air-gapped vault rather than relying solely on nonce exhaustion, because future EVM-compatible Layer-2 rollups launching with account nonce zero can still replay archived wildcard signatures years after initial signing.
Frequently Verified Technical Questions
How does an EIP-7702 drainer attack differ from a traditional ERC-20 approve or Permit2 phishing signature?
Primary Reference: EIP-7702 Security Considerations
Why does setting chain_id to 0 in an EIP-7702 authorization create an omnichain catastrophe?
Primary Reference: EIP-7702 Chain ID Replay Rules
Does transferring ETH to a compromised EIP-7702 wallet to pay revocation gas get stolen immediately?
Primary Reference: EIP-7702 Delegation Revocation Mechanics
How do attackers weaponize EIP-7702 immediately after stealing a hot-wallet private key?
Primary Reference: DT.gl Incident Forensics Ledger
Published: | Last Verified:
-
2026-11-11: Updated Q3-Q4 2026 multi-chain EIP-7702 delegation statistics across Ethereum, Base, Arbitrum, and BNB Smart Chain and added consecutive-nonce hot-wallet compromise forensics. -
2026-07-14: Initial DT.gl publication of forensic post-mortem DT-INC-2025-002 analyzing post-Pectra Inferno Drainer Crime-as-a-Service sweeper contracts.