{"eip":2972,"title":"Wrapped Legacy Transactions","description":"Two new transaction types for wrapping legacy transactions with and without a chain ID.","authors":["Micah Zoltu (@MicahZoltu)"],"status":"Withdrawn","type":"Standards Track","category":"Core","created":"2020-09-12","requires":[155,2718],"discussionsTo":"https://ethereum-magicians.org/t/eip-2972-wrapped-legacy-transactions/4604","repo":"EIPs","label":"EIP-2972","officialUrl":"https://eips.ethereum.org/EIPS/eip-2972","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2972.md","url":"https://eips.huatuo.xyz/eip-2972/","tldr":{"en":"A withdrawn idea to wrap legacy transactions in two new EIP-2718 typed envelopes (SSZ-encoded signature plus the original RLP payload) so legacy encoding could be retired without invalidating old signatures.","ja":"レガシートランザクションを 2 つの新しい EIP-2718 型付きエンベロープ（SSZ エンコードされた署名と元の RLP ペイロード）で包み、古い署名を無効にせずにレガシーエンコーディングを廃止できるようにする、撤回されたアイデア。","ko":"레거시 트랜잭션을 두 가지 새로운 EIP-2718 타입 봉투(SSZ로 인코딩한 서명과 원래의 RLP 페이로드)로 감싸, 오래된 서명을 무효화하지 않고 레거시 인코딩을 없앨 수 있게 하려던 철회된 아이디어.","zh":"一个已撤回的想法：把传统交易包装进两种新的 EIP-2718 类型化信封（SSZ 编码的签名加上原始 RLP 载荷），这样既能淘汰传统编码，又不会使旧签名失效。"},"tags":["transactions","typed-transactions","ssz","rlp","withdrawn"],"explainers":{"en":{"lang":"en","tldr":"A withdrawn idea to wrap legacy transactions in two new EIP-2718 typed envelopes (SSZ-encoded signature plus the original RLP payload) so legacy encoding could be retired without invalidating old signatures.","tags":["transactions","typed-transactions","ssz","rlp","withdrawn"],"related":[2718,155,2930],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2972/","markdown":"## What problem does it solve?\n\n[EIP-2718](/eip-2718/) introduced typed transactions: `TransactionType || TransactionPayload`. Client developers would have liked every transaction in a block to use that envelope so they could eventually drop the special handling for old-style RLP transactions.\n\nBut legacy transactions can't simply be re-signed in a new format: some were signed long ago, by keys or devices that can't produce a new signature, and funds could get stuck. EIP-2972 tried to bridge this by defining typed transactions that are **signature-compatible** with legacy ones, so any client could re-encode an existing legacy transaction into the new form automatically.\n\n## How it works\n\nTwo transaction types, matching the two legacy flavours:\n\n| Type | Encoding | Legacy equivalent |\n| --- | --- | --- |\n| `0x00` | `0x00 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data]))` | Pre-[EIP-155](/eip-155/), no chain ID |\n| `0x01` | `0x01 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0]))` | EIP-155 with chain ID |\n\nKey ideas:\n\n- The inner RLP list is exactly what the legacy signer signed, so the existing signature stays valid.\n- The signature is pulled out to the front as fixed-size SSZ fields (`yParity`, `r`, `s`), so a verifier can check it without first decoding RLP and unpacking chain ID from `v`.\n- Receipts get matching typed SSZ encodings.\n- After the fork, plain `rlp(nonce, …, v, r, s)` transactions would no longer be valid in blocks; nodes would convert them on receipt.\n\nSince the same signature produces both the legacy and wrapped encodings, and they share a nonce, only one can ever be included.\n\n## Sample code\n\nPseudocode for wrapping an EIP-155 legacy transaction as type `0x01`:\n\n```python\ndef wrap_legacy_155(tx):\n    signed = rlp.encode([tx.nonce, tx.gas_price, tx.gas_limit, tx.to,\n                         tx.value, tx.data, tx.chain_id, 0, 0])\n    y_parity = (tx.v - 35 - 2 * tx.chain_id)  # recover parity from EIP-155 v\n    # SSZ container: yParity (bool), r, s (bytes32), offset to signedData (uint32 LE)\n    body = (bytes([y_parity]) + tx.r.to_bytes(32, \"big\") + tx.s.to_bytes(32, \"big\")\n            + (69).to_bytes(4, \"little\") + signed)\n    return b\"\\x01\" + body\n```\n\nThe 4-byte little-endian offset of 69 (`0x45000000`) is why the spec notes that the SSZ encoding equals `yParity ‖ r ‖ s ‖ 0x45000000 ‖ rlp(...)`.\n\n## Things to know\n\n- **Status: Withdrawn.** Hashing and Merkleization of these transactions were still marked TODO in the spec.\n- Ethereum went another way: legacy transactions stayed valid in their original RLP form alongside typed ones. Type `0x01` was instead assigned to access-list transactions in [EIP-2930](/eip-2930/), so the type numbers here are historical only.\n- The goal of moving transactions and receipts to SSZ has been pursued by later, separate proposals.\n"},"ja":{"lang":"ja","tldr":"レガシートランザクションを 2 つの新しい EIP-2718 型付きエンベロープ（SSZ エンコードされた署名と元の RLP ペイロード）で包み、古い署名を無効にせずにレガシーエンコーディングを廃止できるようにする、撤回されたアイデア。","tags":["transactions","typed-transactions","ssz","rlp","withdrawn"],"related":[2718,155,2930],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2972/","markdown":"## 何を解決するのか\n\n[EIP-2718](/eip-2718/) は型付きトランザクション `TransactionType || TransactionPayload` を導入しました。クライアント開発者は、ブロック内のすべてのトランザクションがこのエンベロープを使うようになれば、旧来の RLP トランザクションの特別扱いをいずれ取り除けるので望ましいと考えていました。\n\nしかし、レガシートランザクションを新しい形式で単純に署名し直すことはできません。ずっと昔に、新しい署名を作れない鍵やデバイスで署名されたものもあり、資金が取り出せなくなるおそれがあります。EIP-2972 は、レガシーと**署名互換**な型付きトランザクションを定義することで、この問題の橋渡しを試みました。どのクライアントも、既存のレガシートランザクションを自動的に新しい形式に再エンコードできます。\n\n## 仕組み\n\n2 つのレガシーの種類に対応する、2 つのトランザクションタイプがあります。\n\n| タイプ | エンコーディング | 対応するレガシー |\n| --- | --- | --- |\n| `0x00` | `0x00 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data]))` | [EIP-155](/eip-155/) 以前、チェーン ID なし |\n| `0x01` | `0x01 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0]))` | チェーン ID 付きの EIP-155 |\n\n主なアイデア：\n\n- 内側の RLP リストは、レガシーの署名者が署名したものとまったく同じなので、既存の署名は有効なままです。\n- 署名は固定長の SSZ フィールド（`yParity`、`r`、`s`）として先頭に取り出されるため、検証者は先に RLP をデコードして `v` からチェーン ID を取り出さなくても、署名を検証できます。\n- レシートにも、対応する型付きの SSZ エンコーディングが用意されます。\n- フォーク後は、素の `rlp(nonce, …, v, r, s)` トランザクションはブロック内で有効ではなくなり、ノードは受信時にそれらを変換します。\n\n同じ署名からレガシー形式とラップ形式の両方のエンコーディングが作られ、両者は nonce を共有するため、どちらか一方しか取り込まれません。\n\n## サンプルコード\n\nEIP-155 のレガシートランザクションをタイプ `0x01` としてラップする疑似コード:\n\n```python\ndef wrap_legacy_155(tx):\n    signed = rlp.encode([tx.nonce, tx.gas_price, tx.gas_limit, tx.to,\n                         tx.value, tx.data, tx.chain_id, 0, 0])\n    y_parity = (tx.v - 35 - 2 * tx.chain_id)  # recover parity from EIP-155 v\n    # SSZ container: yParity (bool), r, s (bytes32), offset to signedData (uint32 LE)\n    body = (bytes([y_parity]) + tx.r.to_bytes(32, \"big\") + tx.s.to_bytes(32, \"big\")\n            + (69).to_bytes(4, \"little\") + signed)\n    return b\"\\x01\" + body\n```\n\n4 バイトのリトルエンディアンのオフセット 69（`0x45000000`）が、仕様が SSZ エンコーディングを `yParity ‖ r ‖ s ‖ 0x45000000 ‖ rlp(...)` と等しいと述べている理由です。\n\n## 知っておくべきこと\n\n- **ステータス：Withdrawn。** これらのトランザクションのハッシュ化と Merkle 化は、仕様の中でまだ TODO のままでした。\n- Ethereum は別の道を選びました。レガシートランザクションは、型付きのものと並んで元の RLP 形式のまま有効であり続けました。タイプ `0x01` は代わりに [EIP-2930](/eip-2930/) でアクセスリストトランザクションに割り当てられたため、ここでのタイプ番号は歴史的なものにすぎません。\n- トランザクションとレシートを SSZ に移行するという目標は、後の別の提案で追求されています。\n"},"ko":{"lang":"ko","tldr":"레거시 트랜잭션을 두 가지 새로운 EIP-2718 타입 봉투(SSZ로 인코딩한 서명과 원래의 RLP 페이로드)로 감싸, 오래된 서명을 무효화하지 않고 레거시 인코딩을 없앨 수 있게 하려던 철회된 아이디어.","tags":["transactions","typed-transactions","ssz","rlp","withdrawn"],"related":[2718,155,2930],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2972/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-2718](/eip-2718/)은 타입 트랜잭션 `TransactionType || TransactionPayload`을 도입했습니다. 클라이언트 개발자들은 블록의 모든 트랜잭션이 이 봉투를 쓰게 되면, 옛 방식 RLP 트랜잭션에 대한 특수 처리를 언젠가 없앨 수 있어 좋겠다고 생각했습니다.\n\n하지만 레거시 트랜잭션을 새 형식으로 단순히 다시 서명할 수는 없습니다. 일부는 아주 오래전에, 새 서명을 만들 수 없는 키나 장치로 서명되었고 자금이 묶일 수 있기 때문입니다. EIP-2972는 레거시와 **서명 호환**되는 타입 트랜잭션을 정의해서 이 간극을 메우려 했습니다. 그러면 어떤 클라이언트든 기존 레거시 트랜잭션을 자동으로 새 형태로 다시 인코딩할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n두 가지 레거시 유형에 대응하는 두 트랜잭션 타입이 있습니다.\n\n| 타입 | 인코딩 | 대응하는 레거시 |\n| --- | --- | --- |\n| `0x00` | `0x00 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data]))` | [EIP-155](/eip-155/) 이전, 체인 ID 없음 |\n| `0x01` | `0x01 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0]))` | 체인 ID가 있는 EIP-155 |\n\n핵심 아이디어:\n\n- 안쪽 RLP 리스트는 레거시 서명자가 서명한 것과 정확히 같으므로, 기존 서명이 그대로 유효합니다.\n- 서명은 고정 크기 SSZ 필드(`yParity`, `r`, `s`)로 앞쪽에 빼내어지므로, 검증자는 먼저 RLP를 디코딩하고 `v`에서 체인 ID를 풀어내지 않고도 서명을 확인할 수 있습니다.\n- 영수증(receipt)에도 대응하는 타입 SSZ 인코딩이 있습니다.\n- 포크 이후에는 평범한 `rlp(nonce, …, v, r, s)` 트랜잭션이 블록에서 더 이상 유효하지 않게 되며, 노드가 수신 시 이를 변환합니다.\n\n같은 서명이 레거시 인코딩과 감싼 인코딩을 모두 만들어 내고 둘이 nonce를 공유하므로, 둘 중 하나만 포함될 수 있습니다.\n\n## 샘플 코드\n\nEIP-155 레거시 트랜잭션을 타입 `0x01`로 감싸는 의사 코드:\n\n```python\ndef wrap_legacy_155(tx):\n    signed = rlp.encode([tx.nonce, tx.gas_price, tx.gas_limit, tx.to,\n                         tx.value, tx.data, tx.chain_id, 0, 0])\n    y_parity = (tx.v - 35 - 2 * tx.chain_id)  # recover parity from EIP-155 v\n    # SSZ container: yParity (bool), r, s (bytes32), offset to signedData (uint32 LE)\n    body = (bytes([y_parity]) + tx.r.to_bytes(32, \"big\") + tx.s.to_bytes(32, \"big\")\n            + (69).to_bytes(4, \"little\") + signed)\n    return b\"\\x01\" + body\n```\n\n4바이트 리틀 엔디언 오프셋 69(`0x45000000`)가 바로 명세가 SSZ 인코딩이 `yParity ‖ r ‖ s ‖ 0x45000000 ‖ rlp(...)`와 같다고 언급하는 이유입니다.\n\n## 알아둘 점\n\n- **상태: Withdrawn.** 이 트랜잭션들의 해싱과 머클화는 명세에서 여전히 TODO로 표시되어 있었습니다.\n- 이더리움은 다른 길을 택했습니다. 레거시 트랜잭션은 타입 트랜잭션과 나란히 원래의 RLP 형태로 계속 유효했습니다. 타입 `0x01`은 대신 [EIP-2930](/eip-2930/)에서 액세스 리스트 트랜잭션에 할당되었으므로, 여기의 타입 번호는 역사적인 의미만 있습니다.\n- 트랜잭션과 영수증을 SSZ로 옮긴다는 목표는 이후의 별도 제안들에서 계속 추진되었습니다.\n"},"zh":{"lang":"zh","tldr":"一个已撤回的想法：把传统交易包装进两种新的 EIP-2718 类型化信封（SSZ 编码的签名加上原始 RLP 载荷），这样既能淘汰传统编码，又不会使旧签名失效。","tags":["transactions","typed-transactions","ssz","rlp","withdrawn"],"related":[2718,155,2930],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2972/","markdown":"## 它解决什么问题？\n\n[EIP-2718](/eip-2718/) 引入了类型化交易：`TransactionType || TransactionPayload`。客户端开发者希望区块中的每笔交易都使用这种信封，这样最终就能去掉对旧式 RLP 交易的特殊处理。\n\n但传统交易不能简单地用新格式重新签名：有些是很久以前由无法产生新签名的密钥或设备签署的，资金可能会因此卡住。EIP-2972 试图通过定义与传统交易**签名兼容**的类型化交易来弥合这一点，使任何客户端都能自动把现有的传统交易重新编码为新形式。\n\n## 它如何运作\n\n两种交易类型，对应两种传统交易形态：\n\n| 类型 | 编码 | 对应的传统形态 |\n| --- | --- | --- |\n| `0x00` | `0x00 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data]))` | [EIP-155](/eip-155/) 之前，无链 ID |\n| `0x01` | `0x01 ‖ ssz(yParity, r, s, rlp([nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0]))` | 带链 ID 的 EIP-155 |\n\n关键思路：\n\n- 内层 RLP 列表正是传统签名者所签署的内容，所以现有签名依然有效。\n- 签名被提取到前面，作为固定大小的 SSZ 字段（`yParity`、`r`、`s`），因此验证者无需先解码 RLP 再从 `v` 中解出链 ID，就可以检查签名。\n- 收据也有与之对应的类型化 SSZ 编码。\n- 分叉之后，普通的 `rlp(nonce, …, v, r, s)` 交易将不再在区块中有效；节点在收到时会转换它们。\n\n由于同一个签名既能生成传统编码也能生成包装编码，并且两者共享 nonce，所以最终只有一个能被打包。\n\n## 示例代码\n\n把 EIP-155 传统交易包装为类型 `0x01` 的伪代码：\n\n```python\ndef wrap_legacy_155(tx):\n    signed = rlp.encode([tx.nonce, tx.gas_price, tx.gas_limit, tx.to,\n                         tx.value, tx.data, tx.chain_id, 0, 0])\n    y_parity = (tx.v - 35 - 2 * tx.chain_id)  # recover parity from EIP-155 v\n    # SSZ container: yParity (bool), r, s (bytes32), offset to signedData (uint32 LE)\n    body = (bytes([y_parity]) + tx.r.to_bytes(32, \"big\") + tx.s.to_bytes(32, \"big\")\n            + (69).to_bytes(4, \"little\") + signed)\n    return b\"\\x01\" + body\n```\n\n4 字节小端偏移量 69（`0x45000000`）就是规范指出 SSZ 编码等于 `yParity ‖ r ‖ s ‖ 0x45000000 ‖ rlp(...)` 的原因。\n\n## 需要注意\n\n- **状态：Withdrawn。** 这些交易的哈希和 Merkle 化在规范中仍被标记为 TODO。\n- 以太坊走了另一条路：传统交易以原始 RLP 形式继续有效，与类型化交易并存。类型 `0x01` 后来在 [EIP-2930](/eip-2930/) 中被分配给了访问列表交易，所以这里的类型编号只有历史意义。\n- 把交易和收据迁移到 SSZ 的目标，已由后来的其他独立提案继续推进。\n"}}}
