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.

Background

ACP-209 proposes bringing EIP-7702 to Avalanche so externally owned accounts (EOAs) can delegate code execution. It combines reserved balances and separate nonce rules to preserve the guarantees required by Streaming Asynchronous Execution (SAE).

This article explains the proposal and provides context for its design.

I also cover other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

Proposal summary

ACP-209 brings the set code transaction format introduced by Ethereum's EIP-7702 to the Avalanche EVM. It lets an externally owned account designate code so the account can act like a smart contract. This supports features such as batching operations, sponsored payments, and permission controls.

ACP-209 adapts those semantics to Streaming Asynchronous Execution (SAE). Adopting Ethereum's execution rules directly would violate two invariants on which SAE depends.

The problem

EIP-7702 assumes Ethereum's synchronous execution model. Under SAE, the following state changes could invalidate transactions accepted before execution.

  • Balances can decrease. Calls initiated by another account can execute delegated code and change an EOA's balance. A transaction that can cover its fees and transfer value at validation may be unable to pay at execution.
  • Nonces can increase during execution. A delegated EOA can use CREATE, increasing its nonce while another transaction executes. Other transactions from the same account may then become invalid depending on execution order.

SAE relies on static validation to guarantee that accepted transactions can execute. Losing that guarantee creates a denial-of-service risk.

The solution

Reserved balances

Delegated EOAs maintain a reserved balance. The ReservedBalanceManager precompile manages deposits. At block validation, the reserve must cover the sum of the maximum fees and transfer values of all pending transactions. This protects their ability to pay even when calls or other transactions change the regular balance.

Separate nonce rules for validation and execution
  • Validation checks the nonce at the settled state root plus the number of pending transactions.
  • Execution uses the most recently used nonce plus one.

An intervening CREATE can therefore change the execution nonce without invalidating a transaction already included in a block.

ACP-209 proposes adopting EIP-7702's set code transaction in the Avalanche EVM.

See the following article for background on EIP-7702.

[EIP-7702] How EOAs gain smart contract behavior

Ethereum activated EIP-7702 on mainnet in the May 2025 Pectra upgrade. An EOA, ordinarily controlled directly by a private key, can set a delegation designation and behave like a smart contract.

Improvement Effect
Batch execution Combine several operations in one transaction and execute them atomically.
Sponsored payments Pay transaction fees on behalf of another account.
Privilege de-escalation Temporarily restrict permissions when performing an operation.

Avalanche proposes the same capabilities while adapting set code transactions to SAE, the mechanism proposed in ACP-194.

See the following article for background on ACP-194.

[ACP-194] How SAE separates transaction ordering from execution

The adaptation changes how the account nonce and balance are handled so EIP-7702 can coexist with SAE.

Motivation

ACP-209 aims to bring EIP-7702's usability improvements to Avalanche. Adopting it unchanged would break the invariants that ACP-194 relies on, so ACP-209 adapts its behavior.

Expected benefits of SAE

The Avalanche community has expressed support for the SAE proposal for several reasons.

Benefit Explanation
Higher gas rate Avalanche EVM chains, including the C-Chain, can raise their target gas rates.
Front-running prevention An encrypted mempool can prevent participants from front-running transactions.
Real-time VRFs Transaction execution can use verifiable random functions in real time.

To retain these benefits, Avalanche needs to preserve SAE's invariants while adding EIP-7702 functionality.

Invariants required by ACP-194

Ethereum's EIP-7702 semantics break two invariants that SAE requires.

Invariant Explanation
When an account balance can decrease Only a transaction sent by that account can reduce its balance.
When an EOA nonce can increase An EOA nonce cannot increase after transaction execution begins.

These invariants let SAE use static analysis to check a transaction before it executes. The analysis verifies that the nonce is correct and that the sender can cover the fees and transfer value.

At block acceptance, SAE uses these checks to agree on a block containing transactions that can execute. Accepted transactions then enter an asynchronous queue and execute in order.

If an EOA's balance or nonce can change during execution, a transaction that passed static validation may be invalid by the time it reaches the front of the queue. Invalid transactions can occupy queue capacity, creating a denial-of-service risk. Including transactions whose fees cannot be paid can also undermine chain stability.

EIP-7702 challenges and their impact on Avalanche

EIP-7702 lets a transaction set another account's delegation or change its nonce. The EIP's security considerations discuss how this complicates static validation in Ethereum's mempool.

Activity by another account can make a transaction stale, preventing nodes from deciding its validity through static checks alone.

Suppose account A submits a transaction, Tx1, that is valid against the current state. Another transaction, Tx2, can change the nonce, delegation, or balance of A or a related account. If Tx2 executes first, Tx1 may become stale and no longer be valid.

Under synchronous execution, as in Ethereum, nodes can assess order and arrange transactions into a valid sequence. Under SAE, a block may already have been accepted through static validation by the time its transactions execute. A transaction accepted on that basis must remain valid even after earlier transactions change state.

Under synchronous execution, the issue affects mempool propagation and ordering. Under asynchronous execution, a transaction accepted into a block can turn out to be invalid at execution. That can enable denial of service. Avalanche therefore adapts EIP-7702 to preserve SAE's invariants.

Specification

ACP-209 adds EIP-7702 set code transactions to the Avalanche EVM. Core behavior follows EIP-7702, with two changes to validation and execution for compatibility with ACP-194. Together they preserve the validity of transactions included in a block.

Main changes

Change Description
Reserved balance A delegated EOA maintains a reserve to cover transaction fees and transfer value. The new ReservedBalanceManager precompile manages it.
Separate nonce rules Block validation checks one nonce, while execution updates the account nonce separately. Intervening changes to the execution nonce do not invalidate transactions already in the block.

Reserved balances

With SAE, the block acceptance rules must ensure statically that each transaction can execute. A reserved balance guarantees that the sender can cover the maximum transaction fee and transfer value.

This applies to delegated accounts, which are EOAs that have set an EIP-7702 delegation. Their code can run when another account calls them, potentially changing the balance and making later transactions unaffordable. By reserving funds first, the protocol can ensure that already accepted transactions remain payable despite those changes.

ReservedBalanceManager precompile

The proposal adds a stateful precompile for reserved balances.

Property Value
Contract name ReservedBalanceManager
Address 0x0200000000000000000000000000000000000006
Managed state The reserved balance of each account

The precompile exposes the following interface. The comments retain their original Japanese.

solidity
interface IReservedBalanceManager {
    /// @dev アカウントの予約残高が変更されたときに発行されるイベント
    event ReservedBalanceUpdated(address indexed account, uint256 newBalance);

    /// @dev 指定したアカウントに対して、送信されたネイティブトークンを予約残高として預け入れる
    function depositReservedBalance(address account) external payable;

    /// @dev 指定したアカウントの現在の予約残高を取得
    function getReservedBalance(address account) external view returns (uint256 balance);
}

ReservedBalanceManager maintains a mapping of accounts to reserved balances. The precompile can increase these balances. Only the EVM can reduce them at transaction execution, so account code cannot withdraw reserved funds directly.

Transaction validation rules

Block validation checks the following conditions before the transaction is included.

Condition Validation rule
The account does not use EIP-7702 It is an ordinary EOA and needs no reserve. Check that the regular balance covers fees and value after accounting for the pending execution queue described in ACP-194.
The account uses or is setting an EIP-7702 delegation Treat it as a delegated account. The reserve in the current SettledStateRoot must cover all pending transactions' maximum fees plus their transfer values.

The SettledStateRoot, defined in ACP-194, represents the latest settled state used for static analysis.

Transaction execution rules

Execution handles the balances as follows.

Operation Rule
Deducting fees and transfer value Debit the regular balance first. Cover any shortfall from the reserved balance.
Accessing balances during code execution Code can spend only the regular balance. It cannot spend the reserve directly and can increase it through depositReservedBalance.
Refunding gas Credit the reserve first, up to its pre-execution amount. Credit any remaining refund to the regular balance.

Nonces

When an EOA delegates code under EIP-7702, its nonce can change during execution. This can cause the nonce on another transaction already included in a block to differ from the account nonce at execution. Avalanche separates the validation check from the execution update to avoid invalidating the accepted transaction.

Block validation rules

  • Start with the account nonce at the SettledStateRoot defined in ACP-194.
  • Add the number of transactions from the same account already in the PendingExecutionQueue or earlier in the current block.

Expected nonce = nonce at the settled state root + the account's transaction count in the pending queue and earlier in the current block.

This counts transactions that have been included in a block and are still waiting to execute.

Execution rules

  • Use the most recently used account nonce plus one.
  • The execution nonce accounts for both transactions issued and contracts created by the account.

The nonce used in execution can therefore differ from the nonce the sender signed.

Effects of the nonce design

Separating validation and execution keeps an accepted transaction from becoming invalid because of intervening execution. Nonce uniqueness still prevents reuse of a nonce for replay.

A contract address previously derived from a sender and its transaction nonce may no longer be predictable from the signed nonce alone. The execution nonce may differ, changing the resulting address.

Compatibility

Invariants affected by EIP-7702

EIP-7702 changes some properties that EVM applications could previously assume. The same effects apply on Avalanche.

Property Change
tx.origin == msg.sender Equality previously indicated the top-level frame. A delegated account can issue multiple calls within one transaction, so equality can also occur outside that frame.
EOA nonce increments EOA nonces previously did not increase once execution began. If a delegated account performs CREATE, its nonce can increase during execution.
Contract address derivation For an EOA's contract creation transaction with no to, the address was derived from the sender and signed nonce. Changes before execution can cause the actual nonce and resulting address to differ. The article limits this case to delegated accounts that execute CREATE in code.

These changes can affect assumptions made by existing contracts and wallets.

Reserved balance requirements

Delegated accounts must retain enough reserved balance to preserve SAE guarantees.

Condition Requirement
A set code transaction has been accepted Reserve enough to cover the maximum fees and transfer values of all queued transactions.
The reserved balance is zero The delegated account cannot submit a new transaction. Another account must fund its reserve through ReservedBalanceManager.
Self-funding the initial reserve Call depositReservedBalance before sending the set code transaction.
Transferring the entire regular and reserved balance First convert the regular balance into reserve, then transfer the full balance.

The reserve protects the funds needed for fees and transfers against changes made by other accounts or the execution order.

RPC changes

The proposal recommends the following changes so clients and wallets can display reserved balances.

RPC method Behavior
eth_getBalance Return the sum of regular and reserved balances so existing interfaces display the total.
eth_getReservedBalance Add a method to query an account's reserved balance separately.

Wallets can adopt explicit reserve support incrementally.

Security considerations

The EIP-7702 security considerations generally also apply to Avalanche. The article identifies two exceptions.

Exception Reason
Sponsored transaction relayers Reserved balances guarantee fee payment, so this mechanism does not rely on an external relayer model.
Transaction propagation Separate validation and execution rules address the static validity problem described in EIP-7702.

Additional considerations

Updating reserved balances could increase state update costs for transfers. The proposal must therefore consider whether the customary 21,000 gas for a simple transfer still suffices. Raising the cost could affect contracts with hard-coded gas limits and gas estimates from off-chain wallets and APIs.

Open questions

Question Considerations
Does ReservedBalanceManager justify its cost? The design, implementation, and user experience costs of the precompile must be weighed against the benefits of set code transactions. Some of those benefits are possible with contract-layer techniques such as ERC-2771, though not every contract supports them.
Is ReservedBalanceManager worth introducing to allow delegated code to transfer native tokens? An alternative would prevent delegated code from spending native tokens and use wrapped ERC-20 assets such as WAVAX for similar operations. That also affects implementation complexity and compatibility with Ethereum.

See the following article for background on ERC-2771.

[ERC-2771] Meta-transactions that let another address pay gas

Conclusion

ACP-209 proposes bringing EIP-7702 to Avalanche while preserving SAE safety through reserved balances and distinct nonce rules for validation and execution.

Questions are welcome by direct message.

Twitter @cardene777

Find more of my writing and resources here.

https://chaldene.net/