EIP-6404 · Draft · Core · 2023-01-30
EIP-6404: SSZ transactions
A draft plan to re-encode every Ethereum transaction type from RLP into SSZ, so transactions get a Merkle-tree root that allows cheap partial proofs and match how the consensus layer already hashes data.
What problem does it solve?
Execution-layer transactions are encoded with RLP, while the consensus layer uses SSZ for everything else. That mismatch causes real friction:
- Linear hashing. The signing hash and
tx_hashare a keccak256 over the whole RLP encoding. To prove anything about a transaction, even just its recipient or value, you need all of it, including large calldata. - Weak inclusion proofs. The block's
transactions_rootis a Merkle-Patricia trie over serialized transactions, so there is no direct commitment totx_hash. - Two incompatible roots. The beacon chain hashes the same transactions via SSZ as opaque bytes, producing a root unrelated to the execution header's.
- Technical debt. Legacy transactions lack a type byte,
v/y_parityandchain_idsemantics differ between types, and field order is inconsistent.
EIP-6404 proposes a lossless conversion of all existing transaction types to a single, normalised SSZ representation.
How it works
- Each EIP-2718 type (legacy, access list, EIP-1559, EIP-4844 blob, EIP-7702 set-code) gets an SSZ payload container. Contract creations and pre-EIP-155 "replayable" legacy transactions get their own variants, giving ten payload kinds in a
CompatibleUnion. - Containers use progressive SSZ types (EIP-7495
ProgressiveContainer, EIP-7916ProgressiveList), so new fields can be added later without changing the Merkle positions of old ones. - Fees are grouped into a struct:
max_fees_per_gasholdsregularand, for blob transactions,blob. - Signatures become an opaque byte list prefixed with an algorithm ID per EIP-7932 (
0x00= secp256k1), leaving room for other schemes. - The original RLP type is kept, so the RLP form,
sig_hashand historicaltx_hashcan always be recomputed.
Block-level changes:
- The execution header's
transactions_rootbecomes the SSZhash_tree_rootof the transaction list, identical to the consensusExecutionPayloadroot. - The Engine API sends transactions SSZ-encoded.
- Each transaction gains a new identifier,
tx_root = hash_tree_root(tx); existingtx_hash-based APIs remain.
Sample code
Shape of an EIP-1559 transaction in the new format (SSZ pseudocode from the spec, abbreviated):
class BasicFeesPerGas(ProgressiveContainer(active_fields=[1])):
regular: uint256
class RlpBasicTransactionPayload(ProgressiveContainer(active_fields=[1]*10)):
type_: uint8 # 0x02, original RLP type
chain_id: uint256
nonce: uint64
max_fees_per_gas: BasicFeesPerGas
gas: uint64
to: Bytes20
value: uint256
input_: ProgressiveByteList
access_list: ProgressiveList[AccessTuple]
max_priority_fees_per_gas: BasicFeesPerGas
class Transaction(Container):
payload: TransactionPayload # union of all payload kinds
signature: ProgressiveByteList # [algorithm byte] + signature bytes
tx_root = tx.hash_tree_root() # new identifier
block_header.transactions_root = ProgressiveList[Transaction](txs).hash_tree_root()
With a Merkle root, a verifier (for example an L1 contract checking L2 data) can prove to and value with a short branch instead of the whole transaction.
Things to know
- Status: Draft. It has been revised many times and depends on other in-progress proposals (progressive SSZ types, signature algorithm registry). It is not scheduled for any specific upgrade here; check current upgrade plans before relying on it.
- Tools that verify the old MPT
transactions_rootwould need to migrate.tx_hashkeeps working in JSON-RPC and devp2p, but there is no on-chain commitment to it. - RLP and SSZ encodings can collide, so a single channel must use only one format.
- The spec's intrinsic-gas helper still contains a "FIXME", a sign that details are unsettled.