EIP-6404 SSZ transactions

No call decision · Networking & nodes · EIP status Draft · created 2023-01-30

A proposal to change the serialization format of Ethereum transactions from RLP to SSZ. Existing RLP transactions are converted without loss, and the block header's transaction root also moves from MPT to SSZ.

Why it is needed

Ethereum transactions are currently stored using a serialization format called RLP (Recursive-Length Prefix). In this format, computing the signature hash (sig_hash) or the unique identifier (tx_hash) requires hashing the concatenated data as a single line, so even if only partial information is needed, the entire large call data must be read. The block header's transaction root is built as a Merkle Patricia Trie (MPT); since there is no on-chain commitment to tx_hash, inclusion proofs also require the full transaction data. The consensus layer rehashes the same transaction using SSZ, producing hashes incompatible with the execution layer. Edge cases such as legacy transactions lacking a prefix byte and inconsistent chain_id and v/y_parity semantics keep accumulating as technical debt. Also, because the consensus layer treats transactions as opaque data while still needing to validate blobs, the Engine API ends up more complex than necessary. This EIP converts RLP transactions losslessly into SSZ, unifying the transaction representation across both layers while continuing to support processing of existing RLP types.

What changes

Today

After EIP-6404

Who is affected

In depth

Normalized transaction representation

Converts existing RLP transaction types into SSZ ProgressiveContainer-based payloads. Replayable legacy, EIP-155 legacy, EIP-2930 access list, EIP-1559 fee market, EIP-4844 blob, and EIP-7702 set-code transactions are each defined in Basic (regular transfer) and Create (contract creation) variants. The final TransactionPayload is a CompatibleUnion holding 10 variants from 0x01 to 0x0a, and Transaction is a Container combining payload and signature. The original RLP TransactionType (0x00 to 0x04) is preserved in the type_ field, allowing recovery of the original RLP representation, sig_hash, and historical tx_hash. validate_transaction checks that the type_ value matches the payload class.

Signature representation and EIP-7932 integration

Signatures are represented as ExecutionSignature (ProgressiveByteList), with the first byte indicating the signature algorithm. secp256k1 is defined in EIP-7932 as SECP256K1_ALGORITHM = uint8(0x00). The calculate_penalty, validate_signature, verify_signature, and pubkey_to_address functions are imported from EIP-7932 and used for signature gas cost calculation (get_signature_gas_cost), signature validation (validate_execution_signature), and recovering the signer's address (recover_execution_signer). For transactions converted from existing RLP types, expected_signature_algorithm is fixed to SECP256K1_ALGORITHM.

Structuring fees and authorization lists

Fees are unified in units of FeePerGas (uint256). BasicFeesPerGas has a single regular field, while BlobFeesPerGas has two fields, regular and blob; only blob transactions' max_fees_per_gas uses BlobFeesPerGas. EIP-7702 authorizations are represented as RlpSetCodeAuthorization (a Container of payload and signature), and the payload is distinguished via a CompatibleUnion into a replayable variant (no chain_id) and a chain-pinned variant (with chain_id), using the magic value 0x05. During validation, if chain_id is present it must not be 0.

Unifying the block header and consensus ExecutionPayload

Converts the execution block header's txs-root from MPT to SSZ. The transaction list is placed in a ProgressiveList[Transaction], and its hash_tree_root() becomes the transactions_root. The consensus ExecutionPayload's transactions list is also no longer opaque bytes but uses the same Transaction type, so the transactions_root of the execution block and the consensus payload match. In the Engine API, the transactions field changes to a list of ssz.serialize(tx) bytes for each transaction. Consensus clients can check blob_kzg_commitments directly against the transaction's blob_versioned_hashes to discard invalid blocks early, and a future simplification of the Engine API could remove the need to pass blob_kzg_commitments.

The new identifier tx_root and the existing tx_hash

Each transaction is additionally given an identifier tx_root = Hash32(tx.hash_tree_root()). tx_root differs from the existing tx_hash, but existing APIs based on tx_hash can still be used. Because the conversion is lossless, the original RLP sig_hash and tx_hash can be recovered from the SSZ representation. Since transactions_root is effectively composed of a list of tx_roots, transaction inclusion proofs become possible, and partial data such as destination and amount can be proven without the full call data, reducing gas costs or zk proof costs when verifying L2 chain data in L1 contracts.

Backwards compatibility and caveats

Applications relying on the MPT-based transactions_root must migrate to the SSZ transactions_root. tx_hash has no on-chain commitment but is widely used in JSON-RPC and the Ethereum wire protocol, and thanks to the lossless conversion it can still be recovered. RLP and SSZ transaction encodings can collide, so only one format must be used within a single channel. The new design is built to extend to new fee types, new signature types, and entirely new transaction features such as CREATE2.

Current status

This EIP is in Draft status and its content may still change. It assumes EIP-155, 1559, 2718, 2930, 4844, 7495, 7702, 7916, 7932, and 8016, and no core developer call decision on fork inclusion is recorded in the provided materials.

Original EIP · ← EIPs