EIP-6810 · Stagnant · Core · 2023-04-01
EIP-6810: Ex Post Facto Cascading Revert
A tongue-in-cheek April 1 proposal for a transaction type that undoes one of your past transactions plus everything that depended on it, illustrating why settlement finality matters.
What problem does it solve?
On Ethereum, once a transaction is confirmed it is settled. If you send funds to the wrong address, approve the wrong contract or get scammed, the protocol will not reverse it. Reversibility can be built into smart contracts (escrows, timelocks), but it is not the default.
EIP-6810 "solves" this by letting a sender reverse any of their past transactions after the fact, promising to end "all regret". It is dated 1 April 2023, and its text (for example, the Security Considerations section claims an audit by a US state senator, and the Reference Implementation says "TODO this later") makes clear it is a joke. It is still a useful thought experiment about why finality is a core property.
How it works
As written:
- A new EIP-2718 transaction type
0x5awith payloadrlp([chainId, nonce, revertNonce, budget, yParity, r, s]).revertNoncepicks which of your earlier transactions to undo. - The state is rolled back to the start of that transaction. Every piece of state it touched (balances, code, nonces, storage) goes into an access list, in the spirit of EIP-2929.
- Any later transaction that read or used that state is also reverted, and the process cascades forward to the current block.
- The sender supplies a
budgetin ether. Fees of all reverted transactions are refunded from it, and the remainder goes to the block producer. If the budget runs out, the revert fails and the whole budget is still paid. - The transaction must be the only one in its block. Clients are told to snap sync to catch up with the new state.
The test cases show the problem: reverting the deployment of a contract reverts every transaction that ever interacted with it; reverting a funding transaction reverts all later activity of the funded account.
Sample code
The transaction envelope as described (pseudocode):
TX_TYPE = 0x5a
payload = rlp.encode([chain_id, nonce, revert_nonce, budget])
sig = secp256k1_sign(keccak256(bytes([TX_TYPE]) + payload), sender_key)
tx = bytes([TX_TYPE]) + rlp.encode([
chain_id, nonce, revert_nonce, budget,
sig.y_parity, sig.r, sig.s,
])
# Receipt: rlp([status, budgetUsed, removedLogsBloom, [newReceiptPayloads]])
The cascade rule, informally:
tainted = state_touched_by(tx_to_revert)
for tx in transactions_after(tx_to_revert):
if tx.reads_or_writes(tainted):
revert(tx)
tainted |= state_touched_by(tx)
Things to know
- Status: Stagnant, and it was never a serious candidate for inclusion. Do not build anything expecting it.
- The design shows why reversible settlement does not work at the base layer: a single revert can invalidate an unbounded set of other users' transactions, exchanges' deposits and DeFi positions, and no one could rely on any confirmation.
- If you need recoverability, build it at the application or account level: escrow contracts, delayed withdrawals, guardians or social recovery in smart accounts.