EIP-7727 · Stagnant · Core · 2024-06-24
EIP-7727: EVM Transaction Bundles
Proposes two new transaction types and a BUNDLE_SIGNER opcode so users and contracts can hand ordering rights to a chosen off-chain sequencer, creating EVM-native bundles that let apps rather than block builders capture sequencing value.
What problem does it solve?
Today one block builder decides the exact order of every transaction in a block. Order decides who touches a piece of state first, so it carries a lot of value (MEV), and that value flows to builders and searchers. Applications have no protocol-level way to say "transactions touching my contract should be ordered by this party".
EIP-7727 adds bundles to the EVM itself: a transaction can name a bundleSigner, and only a bundle signed by that address can include it. Contracts can then check who sequenced a call and redirect ordering value back to the application.
How it works
Two new EIP-2718 typed transactions and one opcode:
- Delegated transaction (
0x05): a normal call (nonce,gasPrice,gasLimit,to,value,data) plusbundleSignerand an optionalblockNumber. It is only valid inside a bundle signed bybundleSigner, and, ifblockNumberis non-zero, only in that block. - Bundle transaction (
0x06): a "meta" transaction that does not execute code. It carries atransactionListof type-0x05 or nested type-0x06 transactions that all name the bundle's signer, and it fixes their order. Bundles can themselves name abundleSignerand so be nested. BUNDLE_SIGNERopcode: inside a delegated transaction it pushes thebundleSigner; otherwise it pushes the zero address. Gas cost isGAS_VERY_LOW.
No revert protection. Unlike builder bundles, inner transactions are not all-or-nothing. An inner transaction that is invalid when its turn comes (bad nonce, insufficient funds) is skipped. The bundle signer pays for its bytes at the calldata rate plus a base cost; valid inner transactions cost the bundle signer nothing extra and pay their own gas.
Receipts: a bundle's receipt holds a statusArray, one entry per inner transaction, with status 0x3 for invalid ones. Invalid delegated transactions get no receipt of their own.
Sample code
Payload layouts from the spec (RLP):
0x05 || rlp([bundleSigner, blockNumber, chainId, nonce, gasPrice,
gasLimit, to, value, data, yParity, r, s])
0x06 || rlp([bundleSigner, blockNumber, chainId, nonce, gasPrice,
transactionList, yParity, r, s])
bundle gas = BUNDLE_BASE_GAS_COST
+ CALL_DATA_TOKEN_COST * invalid_inner_tx_bytes
A contract that only accepts calls sequenced by its own sequencer (illustrative; the opcode number is still TBD, so bundleSigner() stands in for it):
address public immutable sequencer;
modifier onlySequenced() {
require(bundleSigner() == sequencer, "not sequenced");
_;
}
Things to know
- Status is Stagnant: no recent progress, and it is not scheduled for any upgrade. Constants such as
BUNDLE_BASE_GAS_COSTand the opcode number are still TBD. - The draft uses a legacy-style single
gasPricerather than EIP-1559 fee fields. - Delegating ordering does not remove censorship risk; it moves it to the sequencer. The spec suggests running sequencing logic publicly and trust-minimised (for example in a TEE).
- Contracts gated on
BUNDLE_SIGNERshould give users a way to withdraw funds that does not depend on the sequencer being online or honest.