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
- A single task, such as calling after an approve, often requires signing multiple transactions
- Bundling multiple calls requires a contract wallet, but gas funding and wallet compatibility issues make adoption hard
- EOAs cannot have their own storage and can only do simple transfers and calls
After EIP-2803
- Directly execute the data of a transaction sent to a new precompile address as EVM bytecode
- Multiple CALLs can be executed within the bytecode, bundling several actions into one transaction
- EOAs can also have storage via SLOAD/SSTORE, allowing data to persist across transactions
Who is affected
- Users: Several actions can be completed with a single signature, without the repeated signing required for flows like approve followed by a call.
- Wallet and dApp developers: Flows that used to require multiple transactions can be simplified into a single transaction.
- Client teams: The rules for executing bytecode using the new reserved precompile address and the EOA context need to be implemented.
- Contract developer: Logic that assumes an EOA cannot perform multiple actions atomically may be 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.