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 EIP-3074, a proposal to introduce two EVM instructions, AUTH and AUTHCALL, so externally owned accounts (EOAs) can delegate control to smart contracts.

The following explanation translates, summarizes, and expands on the original proposal.

I have also written about other EIPs.

Overview

This Ethereum Improvement Proposal (EIP) introduces two new instructions to the Ethereum Virtual Machine (EVM): AUTH and AUTHCALL. The goal is to allow externally owned accounts (EOAs) to delegate control to smart contracts.

  • AUTH
    • This instruction sets a context variable called authorized based on an ECDSA (Elliptic Curve Digital Signature Algorithm) signature.
    • After verifying the signature, it sets the authorized variable according to the result.
    • This informs the EVM that the signer has been authenticated.

The Elliptic Curve Digital Signature Algorithm (ECDSA) is a common method for generating digital signatures, particularly in cryptocurrencies and communications requiring security. ECDSA is a public-key cryptographic algorithm based on elliptic curve cryptography.

What is an elliptic curve?

An elliptic curve is a curve defined by a particular algebraic equation. The elliptic curves used in ECDSA are described by equations of the following form.

y2=x3+ax+by^2 = x^3 + ax + b

Here, aa and bb are constants, and points on the curve form the basis of the calculations.

Main steps of ECDSA

  1. Key generation

    • Private key
      • A randomly selected number.
    • Public key
      • A point on the elliptic curve derived from the private key.
  2. Signature generation

    • Compute the hash of the message.
    • Generate a signature, typically a pair of numbers, using the private key and hash.
    • This signing process uses point addition and multiplication on the elliptic curve.
  3. Signature verification

    • Verify the signature using the sender's public key, the message hash, and the received signature.
    • Given the correct public key and signature, the verification calculation establishes the authenticity of the message against its original hash.

Benefits of ECDSA

  • Security
    • Provides strong security with relatively small keys.
  • Efficiency
    • Can be computationally efficient compared with other cryptographic schemes.

Examples of use

Many cryptocurrencies, including Bitcoin and Ethereum, use ECDSA for transaction authentication and security.

Its security and efficiency make ECDSA an important part of modern digital security.

  • AUTHCALL
    • This instruction can call another address (for example, invoke a function or execute a transaction) as the authorized account.
    • Essentially, AUTHCALL uses the authorization established by AUTH to act on behalf of the authorized account.

This allows a smart contract to execute particular actions using a user's account with that user's permission. Rather than requiring users to sign transactions directly, it introduces a model in which trusted smart contracts can act on their behalf.

Although such functionality could improve usability and security in DeFi and financial services, authorization mechanisms and smart contract security must be designed with great care.

Motivation

This EIP proposes a new approach to the longstanding demand for expanding the capabilities of externally owned accounts (EOAs). Previous requests have included transaction batching, gas sponsorship, expiration dates, and scripting. Adding these directly increases protocol complexity and makes adapting to new requirements or changes more difficult. It may also increase the attack surface.

Rather than hardcoding these capabilities into the protocol as transaction validity requirements, the proposal allows users to delegate control of their EOAs to smart contracts, giving developers a flexible framework for creating new transaction schemes for EOAs. One compelling use case is allowing an EOA to behave like a smart contract wallet without deploying a new contract.

Another primary motivation for the EIP is sponsored transactions. This refers to situations in which an account other than the one performing the transaction pays the gas fees.

For more on sponsored transactions, see the following article.

https://chaldene.net/erc20permit#st-toc-h-7

Using tokens on Ethereum normally requires gas fees to perform transactions, such as transfers or smart contract execution. These gas fees are paid in ETH. However, many users may hold valuable tokens other than ETH, such as ERC-20 tokens, without holding any ETH.

For more on ERC-20, see the following article.

https://chaldene.net/erc20

The problem

Users without ETH must convert other tokens they hold into ETH to pay gas fees. However, the conversion itself requires a transaction, so users cannot convert their tokens to ETH without already having ETH. This creates a circular dependency.

Sponsored transactions as a solution

Sponsored transactions were proposed to resolve this problem. When a user performs a transaction, another account (the sponsor) pays the gas fee instead of the user. By having a sponsor pay the gas fee, users can transact without converting their existing tokens into ETH.

Benefits

  • Greater accessibility
    • Users without ETH can still perform transactions.
  • Flexibility
    • Users holding different types of tokens can use Ethereum without holding ETH.

Sponsored transactions therefore give users more freedom to operate on Ethereum and help expand the ecosystem's user base.

Under this EIP, another account can sponsor a user's transaction and cover its gas fees. This makes Ethereum easier to use for new users and users with limited funds.

Specification

Conventions

  • top - N
    • Refers to the Nth value from the most recently pushed value on the EVM stack.
    • Here, top - 0 refers to the most recent value.
  • ||
    • Byte concatenation operator.
  • invalid execution
    • Execution is invalid, immediately terminating the current execution frame and consuming all remaining gas, as with stack underflow or an invalid jump.

Constants

Constant Value
MAGIC 0x04
  • MAGIC
    • A constant used in EIP-3074 signatures to prevent collisions with other signature formats.

Context variables

Variable Type Initial Value
authorized address unset
  • authorized
    • Identifies the active account for the AUTHCALL instruction in the current execution frame.
    • If set, authorized contains only an account that has authorized the contract to act on its behalf.
    • If unset, no active account has been established and it cannot be used with AUTHCALL.

Scope of the context variable

  • authorized has the same scope as the program counter: it persists within an execution frame but is not passed through any call, including DELEGATECALL.
  • If the same contract executes in different frames (for example, through a CALL to itself), each frame has an independent authorized value.
  • At the beginning of an execution frame, authorized is always unset.
    • This is true even if it was set in a previous execution frame.

This EIP allows smart contracts to act more flexibly on behalf of EOAs and introduces a new way to authorize particular operations on a user's behalf.

AUTH (0xf6)

The following describes the new AUTH opcode (0xf6). This instruction takes three elements from the EVM stack as input and returns one element as output. Its purpose is to verify a particular signature and, if verification succeeds, set the context variable authorized.

Input

The AUTH instruction takes the following stack elements as input.

Stack Value
top - 0 authority
top - 1 offset
top - 2 length

It also specifies a particular range of memory. That range contains data in the following format.

  • yParity
    • memory[offset : offset+1]
  • r
    • memory[offset+1 : offset+33]
  • s
    • memory[offset+33 : offset+65]
  • commit
    • memory[offset+65 : offset+97]

The instruction reads particular data from memory to verify an ECDSA (Elliptic Curve Digital Signature Algorithm) signature.

Memory layout

yParity
  • Address
    • memory[offset : offset+1]

Contains the signature's yParity value. This value (0 or 1) indicates the parity of the relevant elliptic curve point's Y coordinate in the recoverable ECDSA signature. It is used to recover the public key.

r
  • Address
    • memory[offset+1 : offset+33]

Contains the signature's r component. This value is obtained during signature generation and is used to verify the signature's validity.

s
  • Address
    • memory[offset+33 : offset+65]

Contains the signature's s component. This is another part of the signature and is needed together with r to verify it.

commit
  • Address
    • memory[offset+65 : offset+97]

A 32-byte value containing additional data, used to verify signature validity under particular conditions or in a particular context. This value helps prove that the contract is performing operations according to predefined conditions.

Purpose

The instruction verifies that a particular account has authorized an action in a transaction or interaction between contracts. For example, a user who wants a smart contract to perform a particular operation on their behalf can use the signature to prove that authorization is valid. If the signature is valid and the specified parameters have the expected values, authorized is set and the smart contract is permitted to act on the account's behalf.

Output

The following output is returned to the stack.

Stack Value
top - 0 success

The instruction does not modify memory.

Behavior

Signed data and verification

The AUTH instruction verifies an ECDSA signature using the following information.

  • yParity, r, s
    • Components of an ECDSA signature on the secp256k1 curve.

The signed message is keccak256(MAGIC || chainId || nonce || invokerAddress || commit).

  • MAGIC
    • A constant (0x04) used to distinguish this signature format.
  • chainId
    • A unique identifier for the current chain, padded to 32 bytes.
  • nonce
    • The signer's current nonce, left-padded to 32 bytes.
  • invokerAddress
    • The address of the contract executing AUTH, padded with zeroes to 32 bytes.
  • commit
    • A 32-byte value committing to specific additional validity conditions in the invoker's logic.
Behavior based on the signature verification result

If the signature is valid and the signer's address matches the authority address, authorized is set to authority. If the signature is invalid or the signer's address does not match authority, authorized is unset (reset). AUTH returns 1 if authorized is set, and 0 otherwise.

Gas cost

The gas cost of AUTH consists of the following components.

  • Fixed cost
    • 3100 (approximately the cost of the ecrecover precompile, plus the cost of keccak256 hashing and additional logic).
  • Memory expansion gas cost (auth_memory_expansion_fee)
    • The cost of expanding memory when the specified memory range exceeds the current allocation.
  • 100 if authority has already been accessed (warm), or 2600 otherwise (cold), as defined by EIP-2929.

For more on EIP-2929, see the following article.

[EIP-2929] Increasing Gas Costs for Certain Opcodes

This opcode is important for verifying that a smart contract is authorized to act on a particular account's behalf and aims to improve Ethereum's security and flexibility.

AUTHCALL (0xf7)

The new AUTHCALL opcode (0xf7) behaves similarly to the existing CALL (0xF1) instruction in the Ethereum Virtual Machine (EVM), with several differences. It takes seven stack elements as input and returns one element as output. AUTHCALL acts as the authorized account previously set by AUTH.

Input

The AUTHCALL instruction takes the following stack elements as input.

Stack Value
top - 0 gas
top - 1 addr
top - 2 value
top - 3 argsOffset
top - 4 argsLength
top - 5 retOffset
top - 6 retLength

Description

  • gas
    • Amount of gas allocated to the call.
  • addr
    • Address of the contract to call.
  • value
    • Amount of ETH to transfer.
  • argsOffset
    • Starting memory position of the arguments.
  • argsLength
    • Length of the arguments.
  • retOffset
    • Starting memory position for the return data.
  • retLength
    • Length of the return data.

Output

The following output is returned to the stack.

Stack Value
top - 0 success

Behavior

AUTHCALL resembles the existing CALL instruction, but with several differences. When a particular account has been set as authorized, the instruction can call another contract with that account's authority.

Main differences and behavior
  1. Checking authorized

    • If authorized is unset, execution is invalid.
    • For AUTHCALL to operate correctly, authorized must first be set through an instruction such as AUTH.
  2. Setting the caller address

    • The caller address becomes the address set in authorized.
    • The operation therefore behaves as if the authorized account were acting directly on the other contract.
  3. Gas cost and allocation

    • Gas is calculated similarly to CALL, but if the gas operand is 0, all available gas is forwarded subject to EIP-150.
    • If available gas is less than the gas specified by the operand, execution is invalid.

For more on EIP-155, see the following article.

[EIP-150] Increasing Opcode Gas Costs

  1. Value transfer and balance checks

    • value is deducted from the balance of the authorized account. If value exceeds the authorized balance, execution is invalid.
    • No gas stipend is provided.
    • This also applies when transferring a nonzero value.
  2. Increasing call depth

    • AUTHCALL increases call depth by one.
    • Because it calls the target directly rather than routing through the authorized account, call depth does not increase by two.

Call depth refers to the depth of the context stack during transaction execution in the Ethereum Virtual Machine (EVM). It is an important concept when smart contracts call other contracts.

What is call depth?

When a transaction executes a smart contract in the EVM, the initial execution level begins. The call depth at this point is 0. Every time a smart contract calls another contract, a new execution frame is pushed onto the stack and call depth increases by 1. For example, when one contract calls another, the depth becomes 1; if the called contract then calls another contract, it becomes 2, and so on.

Call depth limit

The EVM sets a maximum call depth of 1024. Beyond this limit, the call fails and is not executed. This rule helps prevent security risks such as stack overflow attacks.

Effects of call depth

Call depth particularly affects gas consumption and transaction complexity. Deep call chains consume gas at each level, increasing transaction costs. Transactions with deep call chains can also be more prone to errors and harder to debug.

Managing call depth

When designing smart contracts, it is important to manage call depth appropriately. Designs in which several contracts call one another may reach unexpected depths and increase the risk of transaction failure. It is therefore desirable to keep call structures as flat as possible and avoid unnecessary external calls.

  1. Handling return data

    • The return data area accessed by RETURNDATASIZE and RETURNDATACOPY is set in the same way as for CALL.
  2. Resetting authorized

    • Importantly, authorized is not reset after AUTHCALL executes; it remains unchanged.

These characteristics allow AUTHCALL to operate under another account's authority, giving smart contracts the flexibility to execute complex interactions and conditional transactions.

Gas cost

The gas cost of AUTHCALL consists of several components. These include the static gas cost, memory expansion cost, dynamic gas cost, and gas available to execute the subcall.

Calculating gas costs
  • Static gas cost (warm_storage_read)

    • The basic gas cost of reading previously accessed addresses or data.
  • Memory expansion gas cost (memory_expansion_fee)

    • Calculated as for CALL, with additional gas costs when memory usage increases.
  • Dynamic gas cost (dynamic_gas)

    • Starts at 0 and increases under the following conditions.
      • If the target address addr has not been accessed previously (cold_account_access), 2500 is added to the dynamic gas cost.
      • If the transferred value is greater than 0, 6700 is added.
      • If the target address is also empty (no contract deployed), 25000 is added.
  • Gas available to execute the subcall (subcall_gas)

    • Calculate the remaining gas (remaining_gas) after deducting the dynamic gas cost from available gas, then subtract one sixty-fourth to obtain all_but_one_64th.
    • If the gas operand is 0, subcall_gas is set to the full all_but_one_64th amount.
    • This follows EIP-150, allowing as much gas as possible to be allocated to the subcall.
    • If the gas operand is nonzero and all_but_one_64th is less than gas, execution is invalid and an error occurs (an exception is raised).
    • Otherwise, subcall_gas is set to gas.

The gas operand in the Ethereum Virtual Machine (EVM) plays an important role in smart contract execution. Gas controls the consumption of computational resources on Ethereum and provides a way for users to pay for the computation and storage operations required to execute smart contracts. Specifying the amount of gas required for each transaction or function call controls how many computational resources the operation can consume.

Overview of the gas operand

The gas operand specifies the amount of gas associated with executing a smart contract instruction. It helps manage transaction execution costs and time and prevents network overload. Gas fees are calculated from the price per unit of gas (gas price) and the amount of gas consumed. When submitting a transaction, users can specify the gas price, which influences transaction priority.

Using the gas operand

Transaction gas

When submitting a transaction, set the gas limit (the maximum amount of gas the transaction may consume) and gas price (the price per unit of gas). The gas limit sets the upper bound on gas consumption. Exceeding it results in an Out of Gas error.

Gas for function calls

When calling a function, it is also possible to specify how much gas to allocate. This is particularly important when calling other contracts or performing complex calculations.

Importance of the gas operand

  • Security
    • The gas system prevents unlimited loops and excessive computation caused by malicious users or buggy contracts from disrupting the network.
  • Efficiency
    • Gas makes it possible to estimate how much computation each blockchain node must perform, improving overall system efficiency.
  • Economics
    • Gas is part of Ethereum's economic system, providing rewards for block producers and incentives to maintain and operate the network.

Understanding and managing the gas operand is essential to operating smart contracts effectively and economically on Ethereum.

Charging gas costs

As with CALL, AUTHCALL immediately charges the full gas cost regardless of whether the call actually executes. This ensures the EVM has the gas required before making the subcall.

These rules allow AUTHCALL to call other contracts under the authority of the authorized account while strictly managing gas usage and calls. This enhances the ability of smart contracts to use another account's resources effectively and carry out complex interactions.

Additional notes

Signature format and memory usage

Signature format flexibility

The AUTH instruction accepts a dynamic memory range so it can potentially support contract accounts that use non-ECDSA signatures in the future. Although only externally owned accounts (EOAs) are currently supported in the proposal, this allows support for different signature schemes in the future.

Handling the signer address

Implications of the authority argument

Including authority (the signer address) as an argument to AUTH is intended to support both contract accounts and EOAs in a future upgrade. If multiple signature schemes are allowed, deriving the authorized account's address from the signature alone will be impossible. The authority argument is therefore needed to specify the signer's address.

Allocating available gas

Reserving available gas

Following EIP-150, AUTHCALL does not forward more than 63/64 of the available gas to a subcall. This controls gas consumption and avoids problems caused by call depth.

Handling an unset authorized variable

Error handling when authorized is unset

Contracts should set authorized correctly before executing AUTHCALL. If AUTHCALL is attempted while authorized is unset, immediately terminating the current execution frame is the safest behavior. This behavior is particularly important for transaction sponsorship and relaying, where responsibility must be clearly separated between the sponsor and the sponsee. It prevents problems caused by the sponsor, such as an erroneous subcall or a failed AUTH, from unfairly charging the sponsee.

Introducing a new transaction type

This alternative introduces a new transaction type to separate the account paying fees from the account actually performing the action. It requires extensive client changes and is more difficult to upgrade than other solutions. It also has the drawback of not being immediately compatible with account abstraction (AA). AA contracts do not have private keys and therefore cannot issue signed transactions from a sponsor's account. The main advantage of a new transaction type is that the protocol enforces validity requirements, preventing invalid transactions from occupying block space.

For more on ERC-4337, see the following article.

[ERC-4337] Understanding Account Abstraction without Protocol Changes

Introducing a new mechanism within the EVM

This approach introduces a mechanism in the EVM for acting as another account (masquerading). AUTH and AUTHCALL enable calls to be made as an externally owned account (EOA). This provides immediate benefits for future development, such as allowing contract accounts to send and receive ETH more directly. The approach is less invasive than introducing a new transaction type and requires fewer changes to existing wallets and tools. The sole departure from CALL emphasized in this rationale is setting CALLER, implementing the minimal sender abstraction needed for sponsored transactions.

Signatures and trust

The initial proposal and its problems

The original proposal considered using a precompiled smart contract (one built into the blockchain) with storage to track nonces, incrementing values used to distinguish transactions. However, this was unprecedented for Ethereum and raised concerns about technical complexity and security risks.

Revised approach

To address these problems, replay protection was delegated to individual invokers. Each invoker contract manages its own nonces, reducing the complexity of the overall system.

Trust between users and invokers

Binding a signature to an invoker

When a user signs a transaction, the signature is bound to a particular invoker. This means it is valid only in the context of that contract, preventing other invokers from misusing it.

User confidence

Users can choose an invoker they trust to manage their transactions appropriately and execute them as intended. This gives users confidence that their transactions will be processed correctly.

Replay protection for sponsored transactions (preventing malicious reexecution of actions that have already been executed) can thus be managed in a simpler and more secure way. Users can protect their transactions through their relationship with a particular invoker.

Understanding the commit field

The role of the commitment

Users commit to the properties of a particular transaction or call, such as the amount transferred or gas allocated. This is done by computing a hash of particular transaction details. This hash (the commitment) is used to ensure the committed details are verified and authorized before execution. It allows protections against risks such as replay attacks.

auth-msg.png Source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3074.md

Extensibility

The commit field allows an invoker (a contract managing calls) to implement arbitrary constraints. For example, it can manage multiple nonces in parallel or commit to several calls using a single signature. This makes it possible to combine transaction flows into a single transaction, for example, executing ERC-20 approve and transfer using one signature.

auth-msg-multi-call.png Source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3074.md

Invoker Contracts

The role of the invoker contract

The invoker contract acts as a trusted intermediary between the sponsor and the sponsee (the party whose fees are paid). The sponsee signs for an invoker to ensure that only a particular trusted contract can process the authorized transaction. This enables the sponsee to execute transactions safely without trusting the sponsor.

Security considerations

Invoker contracts must not be upgradeable, and their deployed code should not be changed. An upgradeable invoker risks being replaced by malicious code, creating a potential security vulnerability.

Managing call depth and gas

The EVM limits the maximum number of nested calls. A sponsor deliberately increasing call depth before reaching an invoker could interfere with the sponsee's transaction. However, considering the 63/64 gas rule and the cost of AUTHCALL, the practical depth of the call stack is substantially constrained by gas parameters. An invoker therefore only needs to guarantee a minimum amount of gas; reasonable gas amounts cannot reach the hard maximum call depth.

Deducting value from an EOA during execution

Transaction pool invariant

Deducting value from an externally owned account (EOA) during transaction execution was previously considered problematic. This was based on the invariant that transaction pools could determine transaction validity statically.

Breaking the invariant

Further investigation concluded that breaking the invariant could be safe. Although an attacker could theoretically queue many transactions and invalidate them together, this was not considered a significant concern because of the limited practical impact on the network as a whole.

Allowing the signer as tx.origin

Benefits of allowing the signer as tx.origin

Simplifying transaction batching

When tx.origin equals authorized, the sender of the outer transaction is the signing account. For example, instead of performing ERC-20 token approval (approve) and a subsequent transfer (transfer) in separate transactions, both can be completed in one transaction.

Security concerns involving tx.origin

Effects on smart contracts

With EIP-3074, msg.sender == tx.origin may hold at multiple execution levels through AUTH and AUTHCALL. This normally occurs only at the outermost transaction level and affects smart contracts containing checks such as require(msg.sender == tx.origin).

Examples of security checks
  • EOA checks
    • Used to verify that msg.sender is an EOA.
    • The check does not depend on execution depth, so the proposal does not affect it.
  • Preventing atomic sandwich attacks
    • Such attacks depend on changing state before and after the target contract executes.
    • The EIP may break this protection, although relying on tx.origin in this way is generally considered poor practice.
    • Reentrancy protection
      • The proposal may affect this particular form of reentrancy protection, although no examples using it were found.

Solutions and mitigations

Alternative approaches

Set tx.origin to a constant ENTRY_POINT address or the invoker address. Set tx.origin to a special address derived from the sender, invoker, or signer address. Prohibit authorized == tx.origin (with the possibility of relaxing the restriction in the future).

These points are important when assessing the potential benefits and risks of using tx.origin.

Security risks and mitigations

Atomic sandwich attacks

The use of tx.origin may weaken protection against atomic sandwich attacks (attacks involving state changes before and after a particular contract executes), although such use is generally considered poor practice.

An atomic sandwich attack is a particular type of attack discussed in blockchain and smart contract security. The problem is particularly relevant to platforms such as Ethereum, where an attacker can manipulate a target transaction's outcome by inserting transactions before and after it.

How atomic sandwich attacks work

  1. Observing transactions

    • An attacker observes a particular transaction on the blockchain network.
    • These are typically transactions involving significant asset movements or execution of important contract functions.
  2. Atomic insertion

    • The attacker places transactions immediately before and after the target transaction.
    • This lets the attacker alter the target transaction's execution environment in advance and take advantage of the resulting state.
  3. State manipulation

    • The initial transaction may change state on which the target transaction depends, such as market prices or liquidity pool balances.
    • After the target transaction executes, the attacker manipulates state again to profit from the original transaction.

Examples of atomic sandwich attacks

Price manipulation

On decentralized finance (DeFi) platforms, attackers may exploit slippage to deliberately increase or decrease an asset's price. They can then exploit those price movements for illicit gains.

Flash loan attacks

Attackers may use flash loans (a mechanism for borrowing substantial amounts of funds for a short period) to borrow assets and insert transactions affecting the market. They may then profit from market manipulation before returning the assets.

Defenses

Randomizing transaction ordering

Randomizing the order of transactions determined by miners or block producers can reduce the effectiveness of such attacks.

Slippage protection

Users can set the amount of slippage they are willing to accept when submitting a transaction to reduce their exposure to price manipulation.

Atomic sandwich attacks are a particular concern in DeFi, and users and platforms should understand the risks and implement appropriate defenses.

Preventing recursive calls

The msg.sender == tx.origin check is sometimes used to prevent recursive calls, but the proposal may reduce its effectiveness. Other methods of preventing recursion exist, however, such as using storage variables.

Other proposed solutions

Changing how tx.origin is set

Setting tx.origin to a fixed entry point or invoker address has been proposed as a way to relax restrictions while preserving the invariant.

Comparing AUTHCALL and CALL

Cost differences

When transferring a nonzero value with CALL, the cost increases by an additional 9,000 gas. Of this amount, 6,700 covers balance-transfer overhead and the remaining 2,300 is used as a stipend to initialize the subcall's gas counter. Because AUTHCALL does not provide a stipend to the subcall, only the base 6,700 is used.

In-protocol revocation

The need for revocation

Without revocation of AUTH messages, the EIP provides developers with a powerful and flexible primitive but exposes users who rely on insecure or malicious invokers to risks. Users' new ability to batch many operations in a single transaction increases the risk of funds being drained from their accounts. This risk is likely to continue increasing regardless of this EIP's adoption, as protocol-level and application-level support for such functionality is explored.

Replay protection and security risks

If invokers implement replay protection, the impact of these risks should be substantially limited. However, a bug that allows an adversary to bypass replay protection could grant the adversary full access to any EOA that interacted with a vulnerable invoker.

Nonces and revocation

Without in-protocol revocation, users have no way to remove their accounts from vulnerable invokers. For this reason, AUTH requires the nonce in the message to match the signer's current nonce. A single transaction from the EOA can therefore increment its nonce and invalidate all outstanding authorizations.

Compatibility

Background

Ethereum's account model currently has two types of accounts: externally owned accounts (EOAs) and smart contract accounts. EOAs are identified using ECDSA signatures created with private keys, which authenticate transactions.

Concerns

Future changes to the account model

Although this EIP relies on ECDSA signatures, it may eventually be desirable to remove the concept of EOAs entirely and replace them with smart contract wallets that emulate their behavior. If this change is implemented, users could go further and upgrade to alternative authentication methods such as multisignature authentication.

Continued use of legacy authentication methods

Under the current EIP design, even if a smart contract wallet upgrades to another authentication method, AUTH may continue allowing actions authorized by the old private key. This may introduce security issues because AUTH does not respect the new authentication logic.

Proposed solution

Modifying AUTH logic

One proposal is to modify AUTH when EOAs are removed so it makes a standardized call to the account, allowing the account to decide whether the signature or witness is valid. This would let AUTH respect the account's new authentication logic and operate more flexibly in a future-compatible way.

Need for further research

Further research is needed into how such changes would affect invokers and how best to design invokers for the future. This is important for adapting to future developments in Ethereum's account and authentication systems.

Security

Secure invokers

Invokers execute user instructions through smart contracts, and insecure invokers may introduce significant risks.

Replay protection

Invokers must implement a nonce and include it in the commitment to prevent replay attacks. This prevents malicious actors from reusing the same signature to repeat an action.

Committing to value

The value transferred in the transaction (value) should be included in the commitment. This prevents the sponsor from causing unintended effects.

Committing to gas

It is also important to include the amount of gas in the commitment. This prevents a sponsor from deliberately causing the transaction to run out of gas and fail.

Address and call data

The transaction's destination address (addr) and call data (calldata) should also be included in the commitment. This prevents malicious actors from calling arbitrary functions on arbitrary contracts.

Allowing the signer as tx.origin

Setting tx.origin equal to authorized introduces the following risks.

Breaking protection against atomic sandwich attacks

When tx.origin is also the signer, protection against atomic sandwich attacks may be broken. This weakens defenses against attacks involving state changes before and after the transaction.

Breaking reentrancy protection

Reentrancy protection based on require(tx.origin == msg.sender) may be broken. Contracts relying on this form of reentrancy protection may be affected by the proposal.

Sponsored transaction relayers

Sponsored transaction relayers pay transaction fees on behalf of users, but face the following risks.

Invalidating authorizations

An authorized account may increment its own nonce to invalidate authorization and cause the relayer to waste gas.

Withdrawing assets

An authorized account may withdraw relevant assets, causing the relayer to waste gas.

To mitigate these risks, relayers should consider designs that account for potential losses, such as collateral deposits or reputation systems.

Conclusion

This article covered EIP-3074, a proposal introducing the EVM instructions AUTH and AUTHCALL to allow EOAs to delegate control to smart contracts. I hope the explanation was helpful.

If you have questions, feel free to contact me via Twitter DM.

Twitter @cardene777

I also publish content on the following platforms.

https://chaldene.net/