EIP-2711 · Withdrawn · Core · 2020-06-11
EIP-2711: Sponsored, expiring and batch transactions.
A withdrawn proposal for a typed transaction that bundled three features: a separate gas payer (sponsored transactions), several calls executed in sequence (batching) and a validUntil timestamp (expiry).
What problem does it solve?
Three recurring pain points motivated this proposal:
- Users without ETH. Someone holding only stablecoins cannot move them, because gas must be paid in ETH from the same account. Contract-level workarounds need every contract to integrate them.
- No atomic multi-step actions for EOAs. "Send tokens, then call the contract that registers them" takes two transactions, and anything can happen between them.
- Transactions that linger. A transaction can sit in the mempool for days and execute long after it is useful. A built-in expiry would also give replay protection that does not depend on nonces.
How it works
It defined an EIP-2718 transaction with type 2 and four subtypes. Each carries a list of child transactions [to, value, data], plus nonce, ChainId (0 = any chain) and ValidUntil (0 = never expires; otherwise a block timestamp limit).
| Subtype | Who sets gasLimit |
Who sets gasPrice |
Gas payer signature |
|---|---|---|---|
| 1 | sender | sender | none (sender pays) |
| 2 | sender | sender | yes |
| 3 | sender | gas payer | yes |
| 4 | gas payer | gas payer | yes |
- The sender signs
keccak256(rlp([2, SenderPayload])). That address ismsg.senderandtx.origin, its nonce is used, and it pays anyvalue. - The gas payer (subtypes 2–4) signs over the sender payload, the sender's signature and its own fields. Its balance pays for gas.
- Child transactions run in order, and the receipt contains one result per child.
Sample code
Payload layout for subtype 3 (sender fixes the gas limit, sponsor picks the price), as RLP pseudocode:
TYPE = 2
children = [[to1, value1, data1], [to2, value2, data2]]
sender_payload = [3, children, nonce, chain_id, valid_until, gas_limit]
sender_sig = sign(sender_key, keccak256(rlp([TYPE, sender_payload]))) # [yParity, r, s]
gas_payer_payload = [gas_price]
gas_payer_sig = sign(payer_key,
keccak256(rlp([sender_payload, sender_sig, gas_payer_payload])))
tx = bytes([TYPE]) + rlp([*sender_payload, *sender_sig, *gas_payer_payload, *gas_payer_sig])
Things to know
- Status: Withdrawn. It was never deployed. Transaction type
0x02was later used by EIP-1559 for fee-market transactions, so this layout does not exist on Ethereum. - The same goals were later pursued in other ways: ERC-4337 brings sponsorship (paymasters) and batching through smart accounts, and EIP-7702 lets EOAs delegate to contract code that can batch calls and accept sponsored execution. EIP-3074 tried an opcode-based route and was also withdrawn.
- The spec left the base gas constants (
TRANSACTION_TYPE_2_BASE_GAS_PRICE, per-child cost) undefined.