Skip to content

feat(evm): EIP-7851 code-controlled EOA delegation (SETSELFDELEGATE) - #12239

Draft
MarekM25 wants to merge 1 commit into
NethermindEth:masterfrom
MarekM25:feature/eip-7851
Draft

feat(evm): EIP-7851 code-controlled EOA delegation (SETSELFDELEGATE)#12239
MarekM25 wants to merge 1 commit into
NethermindEth:masterfrom
MarekM25:feature/eip-7851

Conversation

@MarekM25

@MarekM25 MarekM25 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Changes

  • New SETSELFDELEGATE opcode (0xf6 placeholder — value is TBD in the spec; 9500 gas), gated by IsEip7851Enabled: pops a delegate address, rewrites the executing account's designator to 0xef0101 || delegate and pushes 1; pushes 0 without state change for a zero delegate or when the executing account's state code is not a 23-byte designator; exceptional halt in static context
  • Eip7851Constants with the 0xef0101 ECDSA-disabled designator helpers
  • Delegation following (ICodeInfoRepository.TryGetDelegatedAddress) now accepts both 0xef0100 and 0xef0101, so calls to an ECDSA-disabled EOA still execute its delegate
  • EIP-7702 authorization processing explicitly rejects tuples whose authority is ECDSA-disabled (the broader delegation parsing would otherwise have validated them)
  • Sender validation and txpool filters already use the strict 0xef0100 check, so ECDSA-authenticated transactions from 0xef0101 accounts are rejected as contract senders — covered by regression tests
  • IsEip7851Enabled flag + eip7851TransitionTimestamp chainspec plumbing

Spec: https://eips.ethereum.org/EIPS/eip-7851 (Hegotá / EIP-8081 candidate). Not yet activated in any fork file — activation lands with the Hegotá fork wiring (#12226).

Part of the Hegotá (EIP-8081) PR series.

Types of changes

What types of changes does your code introduce?

  • New feature (a non-breaking change that adds functionality)

Testing

Requires testing

  • Yes

If yes, did you write tests?

  • Yes

Notes on testing

Eip7851Tests (7): success from 0xef0100 and 0xef0101 contexts, zero-delegate failure, non-delegated-context failure, static-context halt, ECDSA-disabled sender rejection, ECDSA-disabled authorization skip. Existing 7702/delegation/transaction-processor suites pass unchanged (119 tests).

Documentation

Requires documentation update

  • No

Requires explanation in Release Notes

  • No

Remarks

The opcode value is marked TBD in the EIP; 0xf6 is a placeholder to revisit when the spec assigns one.

🤖 Generated with Claude Code

Adds the SETSELFDELEGATE opcode (0xf6 placeholder, 9500 gas): delegated
wallet code can rewrite its EOA's designator to the ECDSA-disabled form
0xef0101 || delegate, permanently disabling the ECDSA key. Delegation
following (calls) accepts both 0xef0100 and 0xef0101 designators, while
sender validation (EIP-3607 path) and EIP-7702 authorization processing
keep rejecting ECDSA-disabled accounts — authorizations from them are
now explicitly invalid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant