EIP-2803 Rich transactions for EOAs (Rich Transactions)

No call decision · Account abstraction · EIP status Stagnant · created 2020-07-18

Allows an externally owned account (EOA) to send a transaction to a newly designated precompile address, where the data is executed directly as EVM bytecode, letting multiple contract calls be bundled into a single transaction.

Why it is needed

Right now, a single goal often requires signing multiple transactions, like approving a token and then calling an action with it. This makes for a poor dApp user experience. Contract wallets could in theory bundle multiple calls into one, but in practice they have seen almost no adoption, due to the need to separately fund the contract wallet account with gas, poor contract wallet support in browser wallets, and inconsistent APIs across wallets. This EIP tries to solve this problem by extending the capabilities of existing EOAs.

What changes

Today

After EIP-2803

Who is affected

In depth

New precompile address x

A single new reserved address x is designated within the precompile address range. When an EOA sends a transaction to this address, the transaction's payload (data) is treated as EVM bytecode and executed. Address x itself has no code stored. Conversely, when a contract calls x, there is no special effect; it is treated the same as calling a nonexistent precompile or an empty address.

Execution context: treating the EOA as the current account

The ADDRESS opcode returns the address of the EOA that signed the transaction, and BALANCE also returns that EOA's balance. A value-sending CALL takes the value from the EOA's balance, and CALL sets CALLER to the EOA rather than x. DELEGATECALL keeps the owning account as the EOA, and both the CALLER and ORIGIN opcodes return the signing EOA's address. The author states that this entire behavior was designed to resemble a DELEGATECALL from the EOA.

Handling of code, storage, and CALLDATA

Since x has no code, the CODE* and EXTCODE* family of opcodes behave the same as when targeting an empty address. The CALLDATA* opcodes operate directly on the transaction's payload. SLOAD and SSTORE operate on the signing EOA's storage, which means the EOA can now have storage data that persists across transactions. All other opcodes behave the same as in a normal contract call.

Disabling SELFDESTRUCT and limiting value

The SELFDESTRUCT opcode has no effect in this context. This reflects the fact that no code is stored on chain, and also prevents new edge cases such as resetting the EOA's nonce to zero. In addition, if the transaction carries a value, the transaction itself is treated as invalid.

Design rationale: precompile vs. new transaction type

Rather than creating a new transaction type as defined by EIP-2718, the author chose the precompile address approach. The reason is that the precompile approach allows this 'rich transaction' feature to be used together with any EIP-2718 transaction type, meaning it is not tied to a specific transaction format.

Backward compatibility and impact

This is a new feature that must be implemented in a hard fork, and no backward compatibility issues with existing code are expected. However, any contracts or dApps that assume an EOA cannot perform multiple actions atomically at once may have that assumption broken. The authors note that this kind of 'protection' is already easily defeated by miners, so they do not consider it a significant use case.

Current status

This EIP's status is Stagnant. In other words, active discussion has stopped, and whether it will be adopted as a standard in the future has not been decided.

Original EIP · ← EIPs