
How native transaction assertions could enforce a transaction's final outcome
Ethereum Foundation research post distinguishing "intent mismatch" (Bybit, BadgerDAO) from "outcome mismatch" (the Aave/CoW $50.4M swap that settled for $36K) attacks on signed transactions, then proposing native transaction assertions as a fix. It details EIP-7906, which adds a read-only POST_TX frame (building on EIP-8141 frame transactions) with three new opcodes — TXTRACE, TXDIFF, EVENTDATACOPY — letting onchain logic inspect the full net state diff and events after execution and revert if a signed, independently-sourced rule is violated.
What it is
EIP-7906 ("Transaction Assertions via State Diff Opcode") specifies three new EVM opcodes — TXTRACE, TXDIFF, EVENTDATACOPY — that run inside a read-only POST_TX frame appended to EIP-8141 frame transactions. EIP-8141 is scheduled for the Hegotá upgrade; EIP-7906 has reached "Considered for Inclusion" but is not yet confirmed for that fork.
How it works
A frame transaction runs its normal validation/action steps, then executes a POST_TX frame as a static call after the transaction body completes. Inside that frame, TXTRACE enumerates the transaction's net state changes and events, TXDIFF retrieves starting/final values for specific addresses and storage slots, and EVENTDATACOPY copies an event's data into memory. State changes are reported as net diffs only: a slot written five times shows one entry with its original and final values, and a slot that ends unchanged doesn't appear at all. If the assertion logic in the POST_TX frame determines the rule was violated, the entire execution body reverts — but the transaction still lands in the block with a failed status, and the gas payer is charged for gas consumed (this charge is explicitly designed to stop builders from being spammed with free deliberately-failing transactions).
Preconditions / Affected
The mechanism only works within frame transactions (EIP-8141), so it requires that upgrade first. The assertion is not mandatory by protocol — EIP-7906 doesn't force any transaction to carry one. Enforcement responsibility shifts to two parties: wallets must ensure every frame transaction they build includes the required assertion (sourced from a prior simulation or a standing policy), and protocols must have their protected functions explicitly check that the call arrived via a frame transaction containing the exact required assertion, rejecting ordinary transactions or ones with a missing/incorrect assertion. An already-deployed immutable contract cannot retrofit this check.
What to do
For wallet/protocol teams: track EIP-8141's Hegotá scheduling and EIP-7906's inclusion status, since the mechanism is unusable until both land. The Ethereum Foundation is soliciting input from wallet and protocol teams now, before the design is finalized — contact trilliondollarsecurity@ethereum.org or join the EIP-7906 discussion thread.
Caveats
The guarantee is scoped to a single transaction on a single network — it does not cover routes or workflows spanning multiple chains. Because assertions are optional at the protocol level, any integration that doesn't explicitly verify the frame-transaction assertion gains no protection. The spec itself is still unconfirmed for inclusion.
Organisations named here
- BadgerDAO attack
- Bybit incident
- CoW Swap
- EVENTDATACOPY
- POST_TX frame
- Trillion Dollar Security
- TXDIFF
- TXTRACE
Technologies named here
- Clear Signing
- Ethereum
- Safe
- Transaction simulation
- Aave
- Safe checkAfterExecution hook
- Uniswap amountOutMinimum check
- CoW
- EIP-7906
- BadgerDAO
- Bybit
- EIP-8141
- Radiant Capital
- Uniswap
- Hegotá
Techniques named here
- Intent mismatch
- Outcome mismatch
- Sandwich attack
- Proxy implementation swap
- Signing-time payload substitution via malware
Threat actors named here
- Bybit incident attacker
- BadgerDAO attack / Badger exploit
- Radiant Capital incident
Related in Blockchain

THORChain Exploit Report #2 — GG20 root-cause disclosure

Black Thursday revisited: MakerDAO keeper exploited for $500K
.jpg)