Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers EIP5003, which proposes a new opcode, AUTHUSURP, as a way for an externally owned account (EOA) to replace the authority of its original private key.
This article translates, summarizes, and expands on the proposal linked below.
I have also written about other EIPs.
Overview
An EIP (Ethereum Improvement Proposal) is a formal document proposing a change or addition to the Ethereum network protocol.
Individual EIPs propose ways to extend network functionality or address security problems.
This proposal centers on the new opcode AUTHUSURP and two related EIPs, EIP3074 and EIP3607.
EIP-3074
EIP3074 proposes two opcodes, AUTH and AUTHCALL.
They provide a new way for wallets and contracts to act on behalf of a user's account.
The main objective is to improve transaction authorization.
Users can delegate transaction execution to a trusted contract rather than using their private key to sign each transaction themselves.
For more on ERC3074, see the following article.
[EIP3074] Delegating Control of EOAs to Contracts with Two New Instructions
EIP-3607
EIP3607 proposes preventing an address containing code from being used as an EOA. Once a smart contract has been deployed to that address, it can no longer be used as an EOA, preventing unauthorized withdrawals that rely on using that address as a transaction sender.
For more on EIP3607, see the following article.
[EIP3607] Understanding the Proposal to Prevent Ethereum Address Collisions
New opcode: AUTHUSURP
The new opcode AUTHUSURP makes it possible to deploy code at a particular authorized address.
It is intended for use with an address authorized under EIP3074.
Combined with EIP3607, it can effectively revoke the authority of an EOA's original signing key.
In other words, the controller of an externally owned account can use AUTHUSURP to deploy new code and update or change how that account is controlled.
The proposal aims to improve both Ethereum's security and flexibility. Users could manage their accounts more securely and customize their behavior for new applications and use cases.
Implementing a change of this kind, however, requires careful consideration of network security and compatibility. New opcodes and features can have unexpected effects on existing systems and protocols. Extensive testing and community feedback are therefore important before an EIP is accepted and implemented.
Motivation
This section describes the security problems associated with externally owned accounts (EOAs) on Ethereum and how the new EIP proposes addressing them. EOAs hold substantial value managed by many users, but they have important limitations, including key rotation, transaction batching to reduce gas costs, and sponsored transactions that reduce the need to hold ether.
Key rotation is the security practice of periodically replacing private and public keys used for digital authentication or encryption. It helps mitigate the risk of long-term attacks and private key compromise. There are several main reasons for rotating keys:
Improved security
Using the same private key for a long period increases the exposure associated with that key. Periodic rotation can limit damage if a key is compromised and help maintain security.
Meeting compliance requirements
Many regulations and standards require periodic key rotation to protect data. This helps organizations meet regulatory requirements and keep their data secure.
Reducing risk exposure
If a key is compromised, access to systems or data protected by that key can be limited to the period before the key is replaced, where revocation is supported. This reduces the window in which an attacker can cause damage.
How key rotation works
The key rotation process consists of the following steps.
-
Generate new keys
- Generate a new private and public key pair.
- Follow strong security standards during generation.
-
Deploy the new keys
- Introduce the new keys into the system or application, replacing the old ones.
- Update the system to use the new keys.
-
Revoke and dispose of the old keys
- Once the new keys are working, revoke and securely dispose of the old keys.
- This helps prevent misuse of the old keys.
-
Maintain audit records and logs
- Record the key rotation process so that it can be audited properly.
- These records support tracing and root-cause analysis in the event of a security incident.
Key rotation is an essential process for security-conscious organizations and systems that handle sensitive data. Periodically replacing keys helps maintain security and minimize risk.
EOA limitations
One of the main limitations of EOAs is the lack of a mechanism for rotating their security keys. A leaked private key cannot be revoked, leaving a persistent security threat. Users can migrate to a new secret recovery phrase, but doing so requires transactions for all their assets and can be very expensive. Some permissions may also be impossible to migrate.
Smart contract wallets and account abstraction
New users can benefit from smart contract wallets by choosing their authentication algorithms, setting spending limits, and enabling social recovery, among other features. These wallets also support key rotation and delegation of authority. The then-recent EIP4337 standard provides application-layer account abstraction, but it does not address the existing accounts of many users.
For more on EIP4337, see the following article.
[ERC4337] Implementing Account Abstraction Without Protocol Changes
Why a new proposal is needed
The new EIP addresses the fundamental limitations of EOAs and aims to provide an eventual migration path away from them. It differs from EIP3074, which provides opcodes for EOAs to delegate signing authority to an arbitrary smart contract but cannot revoke the original signing key's authority. The new proposal provides a path away from an EOA's native signing key altogether, facilitating a transition to contract-based accounts.
The term native signing key is used primarily in connection with Ethereum's externally owned accounts (EOAs). Here, native refers to the original private key with the account's fundamental signing authority. It is the key associated with the account when it is first generated and is used to sign transactions from that account.
Why the native signing key matters
An EOA's native signing key is important for the following reasons.
-
Account access
- This key controls ownership of and access to the account.
- Anyone holding it can issue transactions and move funds through the account.
-
Security risks
- If the key is leaked, the account's assets may be stolen.
- Protecting this key is therefore critical.
Limitations of signing keys
- Lack of key rotation
- In a traditional EOA, the signing key is essentially fixed once assigned.
- This creates a security weakness: if the key is leaked, the risk persists.
- Limited functionality
- An EOA cannot implement complex logic or security features on its own.
- For example, it cannot itself enforce multiple conditions or authentication requirements for transactions.
Proposed migration
The new proposal encourages migration to more secure and flexible contract-based accounts by providing a path away from the native signing key. Contract-based accounts can support key rotation and multiple authentication methods, improving security and allowing more flexible account management. Through this migration, users can address risks associated with old signing keys and use new security features.
This approach is intended to enable more secure and flexible account management while accounting for the many existing EOA users. The proposal is designed as a way to move away from EOAs rather than preserve them, helping the community evolve toward a safer and more accessible platform.
Specification
The proposed new opcode AUTHUSURP (0xf8) introduces new functionality to the Ethereum Virtual Machine (EVM).
It resembles the CREATE (0xf0) opcode but differs in several respects.
It concerns smart contract code deployment and operates under specific conditions.
Stack values (top - N)
The EVM is a stack-based machine. Data used during computation is temporarily stored in a stack. Data on the stack is managed according to the last in, first out (LIFO) principle.
- top - N
- This notation refers to data within the stack.
top - 0refers to the topmost stack item, the most recently pushed item.top - 1refers to the item immediately below it, and so on.- The notation clarifies how EVM opcodes manipulate data.
Invalid execution
Under certain conditions, execution in the EVM is considered invalid. Examples include stack underflow, invalid jumps, and invalid data for an operation. Invalid execution results in the following behavior.
- Immediately terminate the current execution frame
- When invalid execution is detected, the EVM immediately stops execution in the current frame.
- Consume all remaining gas
- All remaining gas allocated to that execution is consumed.
- This acts as a penalty for the error.
Empty account
Ethereum has two types of accounts, smart contract accounts and externally owned accounts (EOAs). An account can be considered empty under the following conditions.
- Balance is 0
- The account's ether balance is 0.
- Nonce is 0
- The account's transaction count is 0.
- For an EOA, this counts sent transactions; for a contract account, it relates to contract creation.
- No code
- In the case of a contract account, no deployed code exists.
Understanding these criteria is important for smart contract development and transaction analysis. Knowing how the EVM handles each state helps with contract design and debugging.
Opcode behavior
Input
| Stack | Value |
|---|---|
| top - 0 | offset |
| top - 1 | length |
Output
| Stack | Value |
|---|---|
| top - 0 | address |
Detailed behavior
Authorization check
Execution is valid only if authorized, as defined by EIP3074, is set.
If authorized is unset, execution is invalid: all remaining gas is consumed, and the current execution frame exits immediately.
Gas calculation
If authorized points to an empty account (zero balance, nonce 0, and no code), the static gas cost is 32,000.
Otherwise, it is 7,000.
Ethereum transactions and smart contract execution involve two concepts: static gas cost and dynamic gas cost. Both are important when calculating the cost of executing a transaction or opcode.
Static gas cost
A static gas cost is a predetermined, fixed amount of gas. It represents a minimum cost that always applies to a particular operation or transaction. Examples include the base cost of sending a transaction and the fixed cost of executing certain opcodes.
Static gas costs are determined by the rules of the EVM (Ethereum Virtual Machine), independently of the execution environment or runtime state for the applicable case. This helps developers and users estimate transaction costs.
Dynamic gas cost
A dynamic gas cost varies according to the execution conditions of a transaction or the state it accesses. The gas required may depend on transaction complexity or data size; network congestion can also affect the gas price paid for that gas.
For example, complex calculations or storing large amounts of data in a smart contract can require more gas as resource usage increases. When the Ethereum network is congested, a higher gas price may also be needed for a transaction to be prioritized.
Example: AUTHUSURP gas cost
For the AUTHUSURP opcode, the static gas cost is 32,000 if authorized points to an empty account.
This reflects the base cost of deploying a new contract.
If authorized instead points to a nonempty account, the static gas cost is 7,000.
The cost is lower for an operation on an existing account than for a new deployment.
Understanding the difference between static and dynamic gas costs is important for managing and estimating Ethereum transaction costs efficiently.
Ignoring the nonce
AUTHUSURP does not check the nonce of the authorized account.
Executing initcode
initcode executes at the authorized address.
If initcode does not return bytes, its execution frame is reverted and AUTHUSURP returns zero.
Deploying code
After executing initcode, but before deploying the returned code, the account's code is checked. If it is not empty, the initcode execution frame is reverted, and AUTHUSURP returns zero.
The code is deployed at the authorized address.
Significance and use cases
Using the authorized mechanism from EIP3074, AUTHUSURP provides a way to deploy new contract code securely to a specific account.
This allows code to be installed or changed under specific conditions.
The opcode can be seen as a further step toward improving Ethereum's security and flexibility.
Additional details
The proposed AUTHUSURP opcode has specific behavior and constraints that distinguish it from other Ethereum contract deployment methods.
Why a nonce check is unnecessary
Ethereum accounts, particularly externally owned accounts (EOAs), normally have a counter called the nonce.
The nonce helps prevent a transaction from being executed twice and is incremented each time a transaction is sent.
The AUTHUSURP opcode, however, does not check this nonce.
This is because AUTHUSURP must also work with accounts that have previously sent transactions, whose nonce is not 0.
AUTHUSURP primarily operates on authorized addresses, regardless of their past transaction history, so it works independently of the nonce value.
Deploying a zero-length contract
If initialization code (initcode) deploys a zero-length contract using AUTHUSURP, no code is deployed to the address, so it can be used again with AUTHUSURP.
This differs from other deployment procedures, such as the CREATE opcode, which increment the account's nonce even if deployment fails in certain cases, preventing reuse.
Code checks and deployment timing
With AUTHUSURP, the account's code must be checked immediately before deployment to catch situations where initcode attempts to deploy something to the same address using AUTHUSURP.
If code already exists at that address, deployment through AUTHUSURP is canceled and the initcode execution frame undergoes a revert.
Other deployment instructions do not generally require this particular check, but because AUTHUSURP does not increment the nonce, checking account state before deployment is important.
These properties make AUTHUSURP useful in particular cases, but understanding and applying its behavior correctly matters for both security and efficiency.
Compatibility
Combining the AUTHUSURP opcode with EIP3607 would significantly change the security properties of Ethereum accounts.
The specific capability discussed here is revoking the authority of an existing ECDSA signing key to send transactions from the account.
This new behavior can completely change account control under certain conditions.
This section also explains the similarities to the CREATE2 opcode.
What is EIP3607?
EIP3607 is an Ethereum improvement proposal that prohibits transactions originating from smart contracts, particularly those already deployed. This prevents contracts from acting as fake EOAs. Contract accounts cannot ordinarily originate transactions to other contracts or users, and this proposal reinforces that restriction at the protocol level.
AUTHUSURP behavior
AUTHUSURP is an opcode that changes control of a specific account by deploying new code at its address.
It builds on EIP3074 to perform authorized operations.
When combined with EIP3607, AUTHUSURP can effectively revoke the original ECDSA signing key's authority, preventing that key from issuing transactions from the account.
Similarities to CREATE2
The CREATE2 opcode provides a way to deploy a contract based on a given salt (salt), initcode, and other parameters.
This allows the deployment address to be calculated in advance and, where permitted, the contract to be redeployed to the same address.
Like AUTHUSURP, it offers flexibility in controlling account or contract behavior, but AUTHUSURP adds the powerful security property of invalidating the original credentials.
Combining AUTHUSURP and EIP3607 could substantially change account security on Ethereum, replacing the previous access mechanism associated with a particular signing key.
This could strengthen account security and enable new applications.
Security considerations
Changing account control through the proposed AUTHUSURP opcode means transferring that control from a traditional private key to another mechanism.
Existing contracts that use ECDSA signatures, however, do not automatically recognize that this change has taken place.
This is particularly problematic when ECDSA signatures are used outside transactions.
ECDSA signatures used outside transactions
Many Ethereum smart contracts use ECDSA signatures outside transactions.
One example is the permit function in token contracts, which allows users to authorize another party to spend tokens without sending a transaction themselves.
Users sign with their private key and pass that signature to the contract to authorize a specific operation.
The underlying problem
When an account is taken over by AUTHUSURP (that is, control moves from the private key to another mechanism), signatures made with the original private key are still treated as valid, and contracts cannot recognize the change in account ownership.
This means that the old private key may still have authority over certain operations even though the account is under new control.
Proposed solution: changing ecrecover
ecrecover is a precompiled contract used in Ethereum to recover a signer's address from a signature.
One proposal is to modify this contract so that it can recognize changes in account control made through AUTHUSURP.
In other words, after ecrecover successfully verifies a signature, additional logic would check whether the account is governed by the currently valid control mechanism.
This change could reduce the risk of signatures from the old private key being misused after an account has been taken over through AUTHUSURP.
It could also improve smart contract security and make the contract environment more reliable.
Citation
Dan Finlay (@danfinlay), Sam Wilson (@SamWilsn), "EIP-5003: Insert Code into EOAs with AUTHUSURP [DRAFT]," Ethereum Improvement Proposals, no. 5003, March 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5003.
Conclusion
This article covered EIP5003, which proposes introducing the new opcode AUTHUSURP as a mechanism for replacing an EOA's private-key authority.
I hope the explanation was helpful.
If you have questions, feel free to contact me through Twitter DMs.
I also share information on other platforms. Feel free to explore them.



