{"eip":6404,"title":"SSZ transactions","description":"Migration of RLP transactions to SSZ","authors":["Etan Kissling (@etan-status)","Gajinder Singh (@g11tech)","Vitalik Buterin (@vbuterin)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2023-01-30","requires":[155,1559,2718,2930,4844,7495,7702,7916,7932,8016],"discussionsTo":"https://ethereum-magicians.org/t/eip-6404-ssz-transactions/12783","repo":"EIPs","label":"EIP-6404","officialUrl":"https://eips.ethereum.org/EIPS/eip-6404","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6404.md","url":"https://eips.huatuo.xyz/eip-6404/","tldr":{"en":"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.","ja":"Ethereum のすべてのトランザクションタイプを RLP から SSZ に再エンコードするドラフト計画。トランザクションが Merkle ツリーのルートを持つようになり、安価な部分証明が可能になり、コンセンサスレイヤーがすでにデータをハッシュする方法とも揃う。","ko":"이더리움의 모든 트랜잭션 타입을 RLP에서 SSZ로 다시 인코딩하는 초안 계획. 트랜잭션이 머클 트리 루트를 갖게 되어 저렴한 부분 증명이 가능해지고, 합의 계층이 이미 데이터를 해시하는 방식과도 맞아떨어진다.","zh":"一项草案计划，把以太坊的每种交易类型从 RLP 重新编码为 SSZ，使交易拥有默克尔树根，从而支持廉价的部分证明，并与共识层已有的数据哈希方式保持一致。"},"tags":["ssz","rlp","transactions","serialization","core"],"explainers":{"en":{"lang":"en","tldr":"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.","tags":["ssz","rlp","transactions","serialization","core"],"related":[2718,4844,7495,7916,7932],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6404/","markdown":"## What problem does it solve?\n\nExecution-layer transactions are encoded with **RLP**, while the consensus layer uses **SSZ** for everything else. That mismatch causes real friction:\n\n- **Linear hashing.** The signing hash and `tx_hash` are 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.\n- **Weak inclusion proofs.** The block's `transactions_root` is a Merkle-Patricia trie over serialized transactions, so there is no direct commitment to `tx_hash`.\n- **Two incompatible roots.** The beacon chain hashes the same transactions via SSZ as opaque bytes, producing a root unrelated to the execution header's.\n- **Technical debt.** Legacy transactions lack a type byte, `v` / `y_parity` and `chain_id` semantics differ between types, and field order is inconsistent.\n\nEIP-6404 proposes a lossless conversion of all existing transaction types to a single, normalised SSZ representation.\n\n## How it works\n\n- Each [EIP-2718](/eip-2718/) type (legacy, access list, EIP-1559, [EIP-4844](/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`.\n- Containers use **progressive** SSZ types ([EIP-7495](/eip-7495/) `ProgressiveContainer`, [EIP-7916](/eip-7916/) `ProgressiveList`), so new fields can be added later without changing the Merkle positions of old ones.\n- Fees are grouped into a struct: `max_fees_per_gas` holds `regular` and, for blob transactions, `blob`.\n- Signatures become an opaque byte list prefixed with an algorithm ID per [EIP-7932](/eip-7932/) (`0x00` = secp256k1), leaving room for other schemes.\n- The original RLP type is kept, so the RLP form, `sig_hash` and historical `tx_hash` can always be recomputed.\n\nBlock-level changes:\n\n- The execution header's `transactions_root` becomes the SSZ `hash_tree_root` of the transaction list, identical to the consensus `ExecutionPayload` root.\n- The Engine API sends transactions SSZ-encoded.\n- Each transaction gains a new identifier, `tx_root = hash_tree_root(tx)`; existing `tx_hash`-based APIs remain.\n\n## Sample code\n\nShape of an EIP-1559 transaction in the new format (SSZ pseudocode from the spec, abbreviated):\n\n```python\nclass BasicFeesPerGas(ProgressiveContainer(active_fields=[1])):\n    regular: uint256\n\nclass RlpBasicTransactionPayload(ProgressiveContainer(active_fields=[1]*10)):\n    type_: uint8                     # 0x02, original RLP type\n    chain_id: uint256\n    nonce: uint64\n    max_fees_per_gas: BasicFeesPerGas\n    gas: uint64\n    to: Bytes20\n    value: uint256\n    input_: ProgressiveByteList\n    access_list: ProgressiveList[AccessTuple]\n    max_priority_fees_per_gas: BasicFeesPerGas\n\nclass Transaction(Container):\n    payload: TransactionPayload      # union of all payload kinds\n    signature: ProgressiveByteList   # [algorithm byte] + signature bytes\n\ntx_root = tx.hash_tree_root()        # new identifier\nblock_header.transactions_root = ProgressiveList[Transaction](txs).hash_tree_root()\n```\n\nWith 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.\n\n## Things to know\n\n- **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.\n- Tools that verify the old MPT `transactions_root` would need to migrate. `tx_hash` keeps working in JSON-RPC and devp2p, but there is no on-chain commitment to it.\n- RLP and SSZ encodings can collide, so a single channel must use only one format.\n- The spec's intrinsic-gas helper still contains a \"FIXME\", a sign that details are unsettled.\n"},"ja":{"lang":"ja","tldr":"Ethereum のすべてのトランザクションタイプを RLP から SSZ に再エンコードするドラフト計画。トランザクションが Merkle ツリーのルートを持つようになり、安価な部分証明が可能になり、コンセンサスレイヤーがすでにデータをハッシュする方法とも揃う。","tags":["ssz","rlp","transactions","serialization","core"],"related":[2718,4844,7495,7916,7932],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6404/","markdown":"## 何を解決するのか\n\n実行レイヤーのトランザクションは **RLP** でエンコードされる一方、コンセンサスレイヤーはそれ以外のすべてに **SSZ** を使います。この不一致は実際の摩擦を生みます。\n\n- **線形のハッシュ。** 署名ハッシュと `tx_hash` は、RLP エンコード全体に対する keccak256 です。トランザクションについて何かを証明するには、宛先や value だけであっても、大きな calldata を含む全体が必要です。\n- **弱い包含証明。** ブロックの `transactions_root` はシリアライズされたトランザクション上の Merkle-Patricia トライなので、`tx_hash` への直接のコミットメントがありません。\n- **互換性のない 2 つのルート。** ビーコンチェーンは同じトランザクションを SSZ で不透明なバイト列としてハッシュし、実行ヘッダーのものとは無関係なルートを生成します。\n- **技術的負債。** レガシートランザクションには型バイトがなく、`v` / `y_parity` と `chain_id` のセマンティクスが型ごとに異なり、フィールドの順序も一貫していません。\n\nEIP-6404 は、既存のすべてのトランザクションタイプを、正規化された単一の SSZ 表現へ可逆に変換することを提案します。\n\n## 仕組み\n\n- 各 [EIP-2718](/eip-2718/) タイプ（レガシー、アクセスリスト、EIP-1559、[EIP-4844](/eip-4844/) blob、EIP-7702 set-code）に SSZ のペイロードコンテナが与えられます。コントラクト作成と EIP-155 以前の「リプレイ可能」なレガシートランザクションには独自のバリアントがあり、`CompatibleUnion` 内に 10 種類のペイロードができます。\n- コンテナは **progressive** な SSZ 型（[EIP-7495](/eip-7495/) の `ProgressiveContainer`、[EIP-7916](/eip-7916/) の `ProgressiveList`）を使うため、後から新しいフィールドを追加しても古いフィールドの Merkle 上の位置は変わりません。\n- 手数料は構造体にまとめられます。`max_fees_per_gas` は `regular` と、blob トランザクションの場合は `blob` を持ちます。\n- 署名は、[EIP-7932](/eip-7932/) に従いアルゴリズム ID（`0x00` = secp256k1）を先頭に付けた不透明なバイトリストになり、他の方式の余地を残します。\n- 元の RLP タイプが保持されるため、RLP 形式、`sig_hash`、過去の `tx_hash` はいつでも再計算できます。\n\nブロックレベルの変更:\n\n- 実行ヘッダーの `transactions_root` は、トランザクションリストの SSZ `hash_tree_root` になり、コンセンサスの `ExecutionPayload` のルートと同一になります。\n- Engine API はトランザクションを SSZ エンコードで送ります。\n- 各トランザクションに新しい識別子 `tx_root = hash_tree_root(tx)` が加わります。既存の `tx_hash` ベースの API は残ります。\n\n## サンプルコード\n\n新しい形式での EIP-1559 トランザクションの形（仕様の SSZ 疑似コード、省略あり）:\n\n```python\nclass BasicFeesPerGas(ProgressiveContainer(active_fields=[1])):\n    regular: uint256\n\nclass RlpBasicTransactionPayload(ProgressiveContainer(active_fields=[1]*10)):\n    type_: uint8                     # 0x02, original RLP type\n    chain_id: uint256\n    nonce: uint64\n    max_fees_per_gas: BasicFeesPerGas\n    gas: uint64\n    to: Bytes20\n    value: uint256\n    input_: ProgressiveByteList\n    access_list: ProgressiveList[AccessTuple]\n    max_priority_fees_per_gas: BasicFeesPerGas\n\nclass Transaction(Container):\n    payload: TransactionPayload      # union of all payload kinds\n    signature: ProgressiveByteList   # [algorithm byte] + signature bytes\n\ntx_root = tx.hash_tree_root()        # new identifier\nblock_header.transactions_root = ProgressiveList[Transaction](txs).hash_tree_root()\n```\n\nMerkle ルートがあれば、検証者（たとえば L2 のデータを確認する L1 コントラクト）は、トランザクション全体ではなく短いブランチで `to` と `value` を証明できます。\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** 何度も改訂されており、進行中の他の提案（progressive SSZ 型、署名アルゴリズムのレジストリ）に依存しています。ここでは特定のアップグレードに予定されていません。頼る前に現在のアップグレード計画を確認してください。\n- 旧来の MPT の `transactions_root` を検証するツールは移行が必要です。`tx_hash` は JSON-RPC と devp2p では引き続き使えますが、それに対するオンチェーンのコミットメントはありません。\n- RLP と SSZ のエンコードは衝突しうるため、1 つのチャネルでは 1 つの形式だけを使わなければなりません。\n- 仕様の固有ガスのヘルパーには今も「FIXME」が残っており、詳細が固まっていないことを示しています。\n"},"ko":{"lang":"ko","tldr":"이더리움의 모든 트랜잭션 타입을 RLP에서 SSZ로 다시 인코딩하는 초안 계획. 트랜잭션이 머클 트리 루트를 갖게 되어 저렴한 부분 증명이 가능해지고, 합의 계층이 이미 데이터를 해시하는 방식과도 맞아떨어진다.","tags":["ssz","rlp","transactions","serialization","core"],"related":[2718,4844,7495,7916,7932],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6404/","markdown":"## 어떤 문제를 해결하나요?\n\n실행 계층의 트랜잭션은 **RLP**로 인코딩되는 반면, 합의 계층은 그 밖의 모든 것에 **SSZ**를 씁니다. 이 불일치는 실제 마찰을 일으킵니다.\n\n- **선형 해싱.** 서명 해시와 `tx_hash`는 전체 RLP 인코딩에 대한 keccak256입니다. 트랜잭션에 대해 무엇이든 증명하려면, 수신자나 value만 필요하더라도 큰 calldata를 포함한 전체가 필요합니다.\n- **약한 포함 증명.** 블록의 `transactions_root`는 직렬화된 트랜잭션에 대한 머클-패트리샤 트라이이므로 `tx_hash`에 대한 직접적인 커밋이 없습니다.\n- **호환되지 않는 두 개의 루트.** 비콘 체인은 같은 트랜잭션을 SSZ로 불투명한 바이트로 해시해, 실행 헤더의 루트와 무관한 루트를 만듭니다.\n- **기술 부채.** 레거시 트랜잭션에는 타입 바이트가 없고, `v` / `y_parity`와 `chain_id`의 의미가 타입마다 다르며, 필드 순서도 일관되지 않습니다.\n\nEIP-6404는 기존의 모든 트랜잭션 타입을 정규화된 단일 SSZ 표현으로 무손실 변환하자고 제안합니다.\n\n## 어떻게 동작하나요?\n\n- 각 [EIP-2718](/eip-2718/) 타입(레거시, 액세스 리스트, EIP-1559, [EIP-4844](/eip-4844/) blob, EIP-7702 set-code)에 SSZ 페이로드 컨테이너가 주어집니다. 컨트랙트 생성과 EIP-155 이전의 \"재생 가능(replayable)\" 레거시 트랜잭션에는 각자의 변형이 있어, `CompatibleUnion`에 열 가지 페이로드가 있습니다.\n- 컨테이너는 **점진적(progressive)** SSZ 타입([EIP-7495](/eip-7495/)의 `ProgressiveContainer`, [EIP-7916](/eip-7916/)의 `ProgressiveList`)을 사용하므로, 나중에 새 필드를 추가해도 기존 필드의 머클 위치가 바뀌지 않습니다.\n- 수수료는 구조체로 묶입니다. `max_fees_per_gas`는 `regular`와, blob 트랜잭션의 경우 `blob`을 담습니다.\n- 서명은 [EIP-7932](/eip-7932/)에 따라 알고리즘 ID(`0x00` = secp256k1)를 앞에 붙인 불투명한 바이트 리스트가 되어, 다른 방식을 위한 여지를 남깁니다.\n- 원래의 RLP 타입이 유지되므로 RLP 형식, `sig_hash`, 과거의 `tx_hash`를 언제든 다시 계산할 수 있습니다.\n\n블록 수준의 변경:\n\n- 실행 헤더의 `transactions_root`는 트랜잭션 리스트의 SSZ `hash_tree_root`가 되어, 합의 계층의 `ExecutionPayload` 루트와 같아집니다.\n- Engine API는 트랜잭션을 SSZ 인코딩으로 보냅니다.\n- 각 트랜잭션은 새 식별자 `tx_root = hash_tree_root(tx)`를 얻으며, 기존의 `tx_hash` 기반 API는 그대로 남습니다.\n\n## 샘플 코드\n\n새 형식에서의 EIP-1559 트랜잭션의 모양(명세의 SSZ 의사 코드, 축약):\n\n```python\nclass BasicFeesPerGas(ProgressiveContainer(active_fields=[1])):\n    regular: uint256\n\nclass RlpBasicTransactionPayload(ProgressiveContainer(active_fields=[1]*10)):\n    type_: uint8                     # 0x02, original RLP type\n    chain_id: uint256\n    nonce: uint64\n    max_fees_per_gas: BasicFeesPerGas\n    gas: uint64\n    to: Bytes20\n    value: uint256\n    input_: ProgressiveByteList\n    access_list: ProgressiveList[AccessTuple]\n    max_priority_fees_per_gas: BasicFeesPerGas\n\nclass Transaction(Container):\n    payload: TransactionPayload      # union of all payload kinds\n    signature: ProgressiveByteList   # [algorithm byte] + signature bytes\n\ntx_root = tx.hash_tree_root()        # new identifier\nblock_header.transactions_root = ProgressiveList[Transaction](txs).hash_tree_root()\n```\n\n머클 루트가 있으면 검증자(예: L2 데이터를 확인하는 L1 컨트랙트)는 트랜잭션 전체 대신 짧은 브랜치로 `to`와 `value`를 증명할 수 있습니다.\n\n## 알아둘 점\n\n- **상태: Draft.** 여러 차례 개정되었으며 진행 중인 다른 제안(점진적 SSZ 타입, 서명 알고리즘 레지스트리)에 의존합니다. 여기서는 특정 업그레이드에 예정되어 있지 않습니다. 의존하기 전에 현재 업그레이드 계획을 확인하세요.\n- 기존 MPT `transactions_root`를 검증하는 도구는 마이그레이션해야 합니다. `tx_hash`는 JSON-RPC와 devp2p에서 계속 동작하지만 그에 대한 온체인 커밋은 없습니다.\n- RLP와 SSZ 인코딩은 충돌할 수 있으므로 하나의 채널은 한 가지 형식만 사용해야 합니다.\n- 명세의 고유 가스(intrinsic-gas) 헬퍼에는 여전히 \"FIXME\"가 있어, 세부 사항이 확정되지 않았음을 보여줍니다.\n"},"zh":{"lang":"zh","tldr":"一项草案计划，把以太坊的每种交易类型从 RLP 重新编码为 SSZ，使交易拥有默克尔树根，从而支持廉价的部分证明，并与共识层已有的数据哈希方式保持一致。","tags":["ssz","rlp","transactions","serialization","core"],"related":[2718,4844,7495,7916,7932],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6404/","markdown":"## 它解决什么问题？\n\n执行层的交易用 **RLP** 编码，而共识层的其他一切都使用 **SSZ**。这种不匹配造成了实实在在的摩擦：\n\n- **线性哈希。** 签名哈希和 `tx_hash` 都是对整个 RLP 编码做的 keccak256。要证明关于某笔交易的任何事情，即使只是它的接收方或 value，你也需要它的全部内容，包括很大的 calldata。\n- **薄弱的包含证明。** 区块的 `transactions_root` 是对序列化交易构建的默克尔-帕特里夏 trie，所以并没有对 `tx_hash` 的直接承诺。\n- **两个互不兼容的根。** 信标链通过 SSZ 把同样的交易作为不透明字节来哈希，产生的根与执行层区块头中的根毫无关系。\n- **技术债务。** 旧式交易没有类型字节，`v` / `y_parity` 和 `chain_id` 的语义在不同类型之间不一致，字段顺序也不统一。\n\nEIP-6404 提议把所有现有交易类型无损地转换为单一的、规范化的 SSZ 表示。\n\n## 它如何运作\n\n- 每种 [EIP-2718](/eip-2718/) 类型（旧式、访问列表、EIP-1559、[EIP-4844](/eip-4844/) blob、EIP-7702 set-code）都有一个 SSZ 载荷容器。合约创建和 EIP-155 之前的\"可重放\"旧式交易有各自的变体，在 `CompatibleUnion` 中共有十种载荷。\n- 容器使用**渐进式（progressive）** SSZ 类型（[EIP-7495](/eip-7495/) 的 `ProgressiveContainer`、[EIP-7916](/eip-7916/) 的 `ProgressiveList`），因此以后可以添加新字段，而不改变旧字段的默克尔位置。\n- 费用被归入一个结构体：`max_fees_per_gas` 包含 `regular`，对 blob 交易还包含 `blob`。\n- 签名变成一个不透明的字节列表，按 [EIP-7932](/eip-7932/) 以算法 ID（`0x00` = secp256k1）为前缀，为其他方案留出空间。\n- 原始的 RLP 类型被保留，所以 RLP 形式、`sig_hash` 和历史的 `tx_hash` 始终可以重新计算。\n\n区块层面的变化：\n\n- 执行层区块头的 `transactions_root` 变为交易列表的 SSZ `hash_tree_root`，与共识层 `ExecutionPayload` 的根相同。\n- Engine API 以 SSZ 编码发送交易。\n- 每笔交易获得一个新的标识符 `tx_root = hash_tree_root(tx)`；现有基于 `tx_hash` 的 API 仍然保留。\n\n## 示例代码\n\n新格式下 EIP-1559 交易的形态（规范中的 SSZ 伪代码，有所缩写）：\n\n```python\nclass BasicFeesPerGas(ProgressiveContainer(active_fields=[1])):\n    regular: uint256\n\nclass RlpBasicTransactionPayload(ProgressiveContainer(active_fields=[1]*10)):\n    type_: uint8                     # 0x02, original RLP type\n    chain_id: uint256\n    nonce: uint64\n    max_fees_per_gas: BasicFeesPerGas\n    gas: uint64\n    to: Bytes20\n    value: uint256\n    input_: ProgressiveByteList\n    access_list: ProgressiveList[AccessTuple]\n    max_priority_fees_per_gas: BasicFeesPerGas\n\nclass Transaction(Container):\n    payload: TransactionPayload      # union of all payload kinds\n    signature: ProgressiveByteList   # [algorithm byte] + signature bytes\n\ntx_root = tx.hash_tree_root()        # new identifier\nblock_header.transactions_root = ProgressiveList[Transaction](txs).hash_tree_root()\n```\n\n有了默克尔根，验证者（例如检查 L2 数据的 L1 合约）可以用一条很短的分支证明 `to` 和 `value`，而不需要整笔交易。\n\n## 需要注意\n\n- **状态：Draft。** 它已被多次修订，并依赖其他进行中的提案（渐进式 SSZ 类型、签名算法注册表）。这里没有把它安排进任何具体的升级；在依赖它之前，请查看当前的升级计划。\n- 验证旧的 MPT `transactions_root` 的工具需要迁移。`tx_hash` 在 JSON-RPC 和 devp2p 中继续可用，但链上没有对它的承诺。\n- RLP 和 SSZ 编码可能发生冲突，所以同一个通道必须只使用一种格式。\n- 规范中的固有 gas 辅助函数仍然包含一个\"FIXME\"，说明细节尚未确定。\n"}},"requiredBy":[6465,6466,6493,7919]}
