EIP-8476: Permanent EOA Delegation Opt-Out

Discussion thread for the draft Core EIP Permanent EOA Delegation Opt-Out.

PR: Add EIP: Permanent EOA Delegation Opt-Out by nicolashw · Pull Request #12600 · ethereum/EIPs · GitHub

Abstract

Allow an externally owned account (EOA) to permanently disable EIP-7702 delegation by installing a non-executable account-code marker. A narrowly defined, previously invalid form of a set-code transaction performs the opt-out. The account keeps its address and ordinary transaction capabilities, but no subsequent delegation authorization can replace or clear the marker.

Motivation

Some accounts (institutional wallets, exchange hot wallets, treasuries) do not need delegated execution, and their operational controls may assume it is unavailable. This proposal lets an owner remove that capability explicitly. It does not protect against ordinary private-key compromise: a key holder can still sign ordinary transactions and transfer funds.

Summary of the mechanism

  • Opt-out is a type-4 (set-code) transaction with an empty authorization list, destination == sender, value == 0, empty data and empty access list. This form is invalid today; every other empty-list form stays invalid.
  • It sets the sender’s code to the candidate marker 0xef0200 (exact 3-byte match), charges a fixed 33500 gas, and executes no EVM code.
  • The EIP-3607 exception is extended so a sender with exactly this code can still originate transactions.
  • EIP-7702 authorizations whose authority has the marker fail the code-eligibility check and are skipped (including clearing to the zero address).
  • Calls to a marked account execute as empty code; EXTCODESIZE/EXTCODECOPY/EXTCODEHASH see the raw marker.

Open questions

  1. 0xef0200 is provisional. EIP-8141’s rationale discusses a 0xef02 prefix for future key aliases, and EIP-7851 / EIP-8164 use adjacent 0xef0101 formats. Which prefix should this use?
  2. Is reusing the constrained empty-list type-4 form preferable to a dedicated transaction type?
  3. Is 33500 gas (21000 + 12500) a reasonable charge, pending benchmarks?
  4. Interaction with EIP-8151 and with contracts or wallets that classify accounts by empty code.

Feedback on the specification and the security framing is welcome.

Reusing the 7702 envelope keeps this small, and the test cases already cover the ordering races I’d have asked about.

The marker only exists on the chain where the opt-out ran, while a 7702 authorization signed with chain_id 0 is valid anywhere its nonce matches. For a hot wallet that has only ever transacted on mainnet, an authorization at chain_id 0 and nonce 0 still works on every 7702 chain where that address never sent a transaction, whatever mainnet says. Security Considerations could say the guarantee is per chain, and that an owner who wants it has to opt out on every chain the key could be used on, including ones it never touched, which means funding gas there first.

On open question 4, a concrete case for Backwards Compatibility: OpenZeppelin’s ERC1155 calls onERC1155Received on any recipient with code, on every transfer and mint, and its ERC721 does the same in safeTransferFrom and _safeMint. A call to the marker succeeds with empty return data, that can’t be decoded as the expected selector, and the transfer reverts. So a marked account can’t receive ERC1155 tokens or safe ERC721 transfers from those contracts any more, and unlike a delegated account it can never add the hooks later. A treasury holding NFTs or 1155 positions would want to know that before taking an irreversible step.

1 Like

Thanks for the detailed review. The ERC-721/ERC-1155 compatibility issue is particularly important, and I agree that an irreversible opt-out should not permanently break functionality that a normal EOA already has.

After reconsidering the design and evaluating several alternative approaches, I believe the most appropriate direction is to preserve the existing account-code marker mechanism while refining how the EVM interprets that marker.

The core principle is simple: permanent opt-out should remove EIP-7702 delegation capability, not change the fundamental behavior of an EOA.

An opted-out account should retain its original address and ordinary EOA functionality, including sending transactions, transferring ETH and tokens, receiving NFTs, and interacting with contracts. The only intended difference is that it can never enable EIP-7702 delegation again.

Proposed refinement

The permanent opt-out marker would remain in the account’s underlying code state, allowing protocol-level authorization processing to recognize it and enforce irreversibility.

However, for EVM execution and code inspection, the marker would be treated as empty code:

  • CALL, STATICCALL, DELEGATECALL, and CALLCODE would encounter empty code rather than execute the marker.
  • EXTCODESIZE would return 0.
  • EXTCODECOPY would behave as if the account had empty code.
  • EXTCODEHASH would return the empty-code hash for an existing account.
  • The account would remain eligible to originate ordinary transactions.
  • EIP-7702 authorization processing would recognize the underlying marker and permanently reject attempts to replace or remove it.

This would allow existing ERC-721/ERC-1155 contracts to treat the opted-out account as a normal EOA, without requiring application-level contract upgrades.

Why this direction

After evaluating multiple approaches, I believe this offers the smallest practical impact on Ethereum Core and existing protocol semantics.

It builds on EIP-7702’s existing account-code mechanism rather than introducing new account fields, changing nonce semantics, or adding new persistent storage structures.

The additional protocol behavior is narrowly scoped to recognizing the permanent opt-out marker and treating it as empty code during EVM execution and code inspection. Ordinary EOAs, existing contracts, and standard EIP-7702 delegation behavior would remain unchanged.

There is one important distinction: the underlying account state would still contain the marker, while EVM-visible code behavior would reflect empty code. In particular, the state-trie codeHash and the value returned by EXTCODEHASH would differ for opted-out accounts.

This distinction needs explicit specification and review, including state proofs, RPC behavior, gas accounting, and security implications. The goal is to minimize protocol impact, not to introduce a broader account-model change.

Cross-chain scope

I also agree with your first point. The opt-out guarantee is strictly per chain.

An opt-out on Ethereum mainnet does not prevent a chain_id = 0 authorization from being used on another EIP-7702-enabled chain where the account has not opted out and the nonce matches.

I will clarify this in Security Considerations, including the requirement to opt out separately on each relevant chain and the associated gas-funding implications.

Next step

I plan to revise the draft around one clear invariant:

An EOA that permanently opts out of EIP-7702 should continue to behave like an ordinary EOA at the EVM execution level. The only permanently disabled capability is EIP-7702 delegation.

I will also verify the relevant execution paths, code-inspection behavior, and consensus implications before treating the refinement as final.

Thanks again for pointing out the compatibility issue. It helped clarify an important design requirement.

Update: a first revision along these lines is now in the PR (Add EIP: Permanent EOA Delegation Opt-Out by nicolashw · Pull Request #12600 · ethereum/EIPs · GitHub, commit d601317): empty-code inspection semantics, raw marker exposed via eth_getCode / eth_getProof, and the per-chain scope in Security Considerations.

Thanks, the revision reads well. Keeping the raw marker in eth_getCode and eth_getProof while the EVM sees empty code is a clean split.

One more place that reads raw code is the transaction pool. Geth’s legacypool limits any sender whose code hash isn’t the empty-code hash to one in-flight transaction with no nonce gaps (checkDelegationLimit in go-ethereum/core/txpool/legacypool/legacypool.go at master · ethereum/go-ethereum · GitHub), because a delegate can move the balance out from another transaction and leave queued ones unpayable. A marked account runs no code, so that reason doesn’t hold for it, but its code hash is keccak256(OPT_OUT_CODE), so it still hits the limit, and exchange hot wallets, the accounts this is for, usually keep many transactions pending. Backwards Compatibility could say pools SHOULD treat a sender whose code hash equals keccak256(OPT_OUT_CODE) like an empty-code EOA for pending-transaction limits.

Thanks again, @Zealynx. That’s another important catch, especially for exchange hot wallets where multiple pending transactions are normal.

I agree that a permanently opted-out account should not be subject to delegation-specific transaction pool restrictions, since it cannot execute delegated code or regain delegation capability.

I’ll clarify this in Backwards Compatibility: transaction pools SHOULD treat an account with codeHash == keccak256(OPT_OUT_CODE) like an ordinary empty-code EOA for pending-transaction limits, while preserving existing safeguards for pending authorization transactions.

This also reinforces the intended boundary of the proposal: the underlying marker remains visible to consensus and state inspection, but should not impose smart-account execution or transaction-pool restrictions on an EOA that has permanently opted out.

Thanks for pointing to the concrete Geth implementation.

Update: this is now in the PR (Update EIP-8476: Permanent EOA Delegation Opt-Out by nicolashw · Pull Request #12600 · ethereum/EIPs · GitHub, commit af6be4b). The text also notes that pools need to accept the empty-authorization-list opt-out form, which current EIP-7702 validation rejects.

A data point for Motivation and Security Considerations, from public chain data on the 29 Oct Binance hot-wallet incident (Binance has not published a root cause, so I only describe what the chain shows). On Ethereum, one type-4 transaction (0xad99264d5532ae0dd04b2004eebda05f25657e70dacb764f7ac8d4ccd051298b) carried 50 authorizations, all pointing at one small sweeper contract, with consecutive nonces 18914775 to 18914824. The wallet was sending its own transactions at the time, and the one authorization that applied was nonce 18914809: its own transactions around that block carry 18914808 before and 18914810 after, which fits a window being used to hit the then-current nonce. I recovered the signer of all 50, and every one is 0x28c6c062…1d60, the address Etherscan labels Binance 14, so the delegation was signed with that wallet’s own key or through its signing path. The delegate’s code contains the address of the EOA that deployed it as a hardcoded caller. According to TRM Labs’ write-up, the other chains were drained with ordinary signed transfers, without delegation.

So an opt-out applied beforehand on that chain would not have stopped the theft, but it would have removed the shortcut: the attacker would have needed a signature per transfer, as on the other chains, instead of one pre-signed batch. That looks like a fair statement of what the opt-out buys an exchange hot wallet, and it matches the Motivation line that the marker does not protect against ordinary key compromise. It might be worth saying so in Security Considerations.

Thank you, @it44, for the careful chain-level analysis, and for being explicit that it describes only what the chain shows and not a root cause.

This is exactly the risk the proposal is meant to address. Based on your analysis, the Ethereum-side pattern is a batch of pre-signed authorizations across a range of consecutive nonces, all to one delegate, submitted while the wallet was still active so that one of them would match the nonce at inclusion. Once that one applied, the delegation persisted, and the delegate could be called again without any further signature from the wallet. An opt-out applied beforehand on that chain would have caused every one of those tuples to be skipped.

I agree with your framing of what that buys, and with its limits:

  • It would not have stopped the theft. As on the other chains, ordinary signed transfers remain possible to anyone who can produce valid signatures.
  • It removes the shortcut: one batch of authorizations no longer converts into a standing delegated path, and each transfer needs its own signature in the account’s nonce sequence, which is also more visible to monitoring.
  • Where an attacker controls the signing path rather than a single key, they may still automate ordinary signatures, so the reduction is in capability and persistence, not a guarantee of more time.

I have added this to Security Considerations in neutral terms, describing the pattern (nonce-range authorization batches, persistent delegation, repeated calls without new signatures) without referring to a specific incident or address. Keeping the EIP text generic seems more appropriate for a specification. Discussion of the specific incident is welcome here.

PR: Update EIP-8476: Permanent EOA Delegation Opt-Out by nicolashw · Pull Request #12600 · ethereum/EIPs · GitHub (commit f1a4071).