{"eip":2242,"title":"Transaction Postdata","description":"An additional, optional transaction field is added for \"postdata,\" data that is posted on-chain but that cannot be read from the EVM.","authors":["John Adler (@adlerjohn)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2019-08-16","discussionsTo":"https://ethereum-magicians.org/t/eip-2242-transaction-postdata/3557","repo":"EIPs","label":"EIP-2242","officialUrl":"https://eips.ethereum.org/EIPS/eip-2242","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2242.md","url":"https://eips.huatuo.xyz/eip-2242/","tldr":{"en":"A proposal to add an optional 'postdata' field to transactions: data posted on-chain for layer-2 systems to retrieve later, never readable by the EVM, and charged a flat 1 gas per byte.","ja":"トランザクションに任意の「postdata」フィールドを追加する提案。レイヤー 2 システムが後で取得できるようにオンチェーンに投稿されるデータで、EVM からは読めず、1 バイトあたり一律 1 ガスが課金される。","ko":"트랜잭션에 선택적 'postdata' 필드를 추가하자는 제안. 레이어 2 시스템이 나중에 가져갈 수 있도록 온체인에 게시되는 데이터로, EVM은 읽을 수 없으며 바이트당 일괄 1 가스가 부과된다.","zh":"一项为交易增加可选“postdata”字段的提案：该数据发布在链上供二层系统日后获取，EVM 无法读取，并按每字节固定 1 gas 收费。"},"tags":["data-availability","layer2","transactions","core"],"explainers":{"en":{"lang":"en","tldr":"A proposal to add an optional 'postdata' field to transactions: data posted on-chain for layer-2 systems to retrieve later, never readable by the EVM, and charged a flat 1 gas per byte.","tags":["data-availability","layer2","transactions","core"],"related":[2028,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2242/","markdown":"## What problem does it solve?\n\nOptimistic side chains and rollups with fraud proofs need to publish their block data on Ethereum so anyone can check it later. They do not need the EVM to *read* that data; they only need it to be available in the chain's history.\n\nIn 2019 the only way to publish data was `calldata`, which the EVM can access and which is priced accordingly. [EIP-2028](/eip-2028/) made calldata cheaper, but it is still paying for a capability these systems do not use. EIP-2242 follows \"don't pay for what you don't use\": add a separate place for data that is stored on-chain but invisible to execution.\n\n## How it works\n\nFrom a fork block, transactions may carry one extra, optional field at the end, `postdata`, and the signature covers it along with the other fields.\n\n- `postdata` is an RLP-encoded pair `(version, data)`.\n- `version` is `0` for this EIP; future EIPs can define other versions with different interpretations.\n- `data` is an RLP list of binary blobs. The protocol does not interpret it.\n- The cost is **1 gas per byte**, deducted from the transaction's gas limit up front. If that leaves no gas, the transaction fails with out-of-gas.\n- No opcode can read `postdata`. Layer-2 software reads it from the transaction history instead.\n\nBecause the field is optional and appended, existing transactions remain valid, but nodes need a hard fork to accept the new form. The author notes it only helps systems using fraud proofs: validity-proof (zk) systems need the data authenticated immediately, which this does not provide.\n\n## Sample code\n\nTransaction layout and gas charge as pseudocode:\n\n```python\n# signed payload = RLP([nonce, gasPrice, startGas, to, value, data, postdata?])\npostdata = rlp.encode([0, [batch_1_bytes, batch_2_bytes]])   # (version, list of blobs)\n\ndef intrinsic_postdata_gas(tx):\n    return len(tx.postdata) * 1        # 1 gas per byte of postdata\n\ndef apply(tx):\n    gas_left = tx.start_gas - intrinsic_postdata_gas(tx)\n    if gas_left \u003c= 0:\n        raise OutOfGas()\n    # execute tx.data as usual; tx.postdata is never exposed to the EVM\n```\n\n## Things to know\n\n- Status is **Stagnant**; it was never adopted.\n- The underlying idea, cheap data for layer 2 that the EVM cannot read, shipped later in a different form: blob transactions in [EIP-4844](/eip-4844/), which use a separate fee market and keep blob data only for a limited time rather than in permanent history.\n- The spec uses an older field naming (`startGas`, `from` in the serialized list) and leaves test cases and implementation as TODO.\n"},"ja":{"lang":"ja","tldr":"トランザクションに任意の「postdata」フィールドを追加する提案。レイヤー 2 システムが後で取得できるようにオンチェーンに投稿されるデータで、EVM からは読めず、1 バイトあたり一律 1 ガスが課金される。","tags":["data-availability","layer2","transactions","core"],"related":[2028,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2242/","markdown":"## 何を解決するのか\n\nOptimistic なサイドチェーンや、不正証明（fraud proof）を使うロールアップは、後から誰でも検証できるよう、ブロックデータを Ethereum に公開する必要があります。EVM がそのデータを *読む* 必要はなく、チェーンの履歴の中で入手可能でありさえすればよいのです。\n\n2019 年当時、データを公開する唯一の方法は `calldata` でした。これは EVM からアクセスでき、その分の価格が付いています。[EIP-2028](/eip-2028/) で calldata は安くなりましたが、これらのシステムが使わない機能の代金を払っていることに変わりはありません。EIP-2242 は「使わないものには払わない」という考え方に従い、オンチェーンに保存されるが実行からは見えないデータのための別の置き場を追加します。\n\n## 仕組み\n\nフォークブロック以降、トランザクションは末尾に任意のフィールド `postdata` を 1 つ追加で持てるようになり、署名は他のフィールドと一緒にこれもカバーします。\n\n- `postdata` は RLP エンコードされた `(version, data)` のペアです。\n- この EIP では `version` は `0` です。将来の EIP が、異なる解釈を持つ別のバージョンを定義できます。\n- `data` はバイナリ blob の RLP リストです。プロトコルはこれを解釈しません。\n- コストは **1 バイトあたり 1 ガス** で、トランザクションのガスリミットから先に差し引かれます。差し引いて残りのガスがなければ、トランザクションは out-of-gas で失敗します。\n- `postdata` を読める opcode はありません。レイヤー 2 のソフトウェアはトランザクション履歴から読み取ります。\n\nこのフィールドは任意で末尾に追加されるため、既存のトランザクションは有効なままですが、ノードが新しい形式を受け付けるにはハードフォークが必要です。著者は、これが役立つのは不正証明を使うシステムだけだと述べています。有効性証明（zk）システムはデータをすぐに認証する必要があり、これはそれを提供しないためです。\n\n## サンプルコード\n\n疑似コードで示すトランザクションのレイアウトとガス課金:\n\n```python\n# signed payload = RLP([nonce, gasPrice, startGas, to, value, data, postdata?])\npostdata = rlp.encode([0, [batch_1_bytes, batch_2_bytes]])   # (version, list of blobs)\n\ndef intrinsic_postdata_gas(tx):\n    return len(tx.postdata) * 1        # 1 gas per byte of postdata\n\ndef apply(tx):\n    gas_left = tx.start_gas - intrinsic_postdata_gas(tx)\n    if gas_left \u003c= 0:\n        raise OutOfGas()\n    # execute tx.data as usual; tx.postdata is never exposed to the EVM\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、採用されることはありませんでした。\n- 根底にあるアイデア、つまり EVM からは読めないレイヤー 2 向けの安価なデータは、後に別の形で実現しました。[EIP-4844](/eip-4844/) の blob トランザクションで、独立した手数料市場を使い、blob データを永続的な履歴ではなく限られた期間だけ保持します。\n- 仕様は古いフィールド名（`startGas`、シリアライズされたリスト内の `from`）を使っており、テストケースと実装は TODO のままです。\n"},"ko":{"lang":"ko","tldr":"트랜잭션에 선택적 'postdata' 필드를 추가하자는 제안. 레이어 2 시스템이 나중에 가져갈 수 있도록 온체인에 게시되는 데이터로, EVM은 읽을 수 없으며 바이트당 일괄 1 가스가 부과된다.","tags":["data-availability","layer2","transactions","core"],"related":[2028,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2242/","markdown":"## 어떤 문제를 해결하나요?\n\n낙관적(optimistic) 사이드체인과 사기 증명(fraud proof)을 쓰는 롤업은 누구나 나중에 검증할 수 있도록 블록 데이터를 이더리움에 게시해야 합니다. 이들은 EVM이 그 데이터를 *읽을* 필요는 없고, 체인 기록에서 구할 수 있기만 하면 됩니다.\n\n2019년에는 데이터를 게시하는 유일한 방법이 `calldata`였는데, EVM이 접근할 수 있는 만큼 가격도 그에 맞게 매겨져 있습니다. [EIP-2028](/eip-2028/)이 calldata를 더 싸게 만들었지만, 여전히 이 시스템들이 쓰지 않는 기능의 값을 치르고 있습니다. EIP-2242는 \"쓰지 않는 것에는 돈을 내지 않는다\"를 따라, 온체인에 저장되지만 실행에서는 보이지 않는 데이터를 위한 별도의 공간을 추가합니다.\n\n## 어떻게 동작하나요?\n\n특정 포크 블록부터 트랜잭션은 끝에 선택적 필드 `postdata`를 하나 더 실을 수 있고, 서명은 다른 필드와 함께 이것도 포함합니다.\n\n- `postdata`는 RLP로 인코딩된 `(version, data)` 쌍입니다.\n- 이 EIP에서 `version`은 `0`이며, 이후 EIP가 다른 해석을 갖는 다른 버전을 정의할 수 있습니다.\n- `data`는 바이너리 blob의 RLP 리스트입니다. 프로토콜은 이를 해석하지 않습니다.\n- 비용은 **바이트당 1 가스**이고, 트랜잭션의 가스 한도에서 미리 차감됩니다. 차감한 뒤 남는 가스가 없으면 트랜잭션은 out-of-gas로 실패합니다.\n- `postdata`를 읽을 수 있는 opcode는 없습니다. 레이어 2 소프트웨어는 트랜잭션 기록에서 읽습니다.\n\n이 필드는 선택적이고 끝에 덧붙이는 방식이라 기존 트랜잭션은 계속 유효하지만, 노드가 새 형식을 받아들이려면 하드포크가 필요합니다. 작성자는 이것이 사기 증명을 쓰는 시스템에만 도움이 된다고 말합니다. 유효성 증명(zk) 시스템은 데이터가 즉시 인증되어야 하는데 이것은 그렇게 해 주지 않기 때문입니다.\n\n## 샘플 코드\n\n의사 코드로 나타낸 트랜잭션 구조와 가스 부과:\n\n```python\n# signed payload = RLP([nonce, gasPrice, startGas, to, value, data, postdata?])\npostdata = rlp.encode([0, [batch_1_bytes, batch_2_bytes]])   # (version, list of blobs)\n\ndef intrinsic_postdata_gas(tx):\n    return len(tx.postdata) * 1        # 1 gas per byte of postdata\n\ndef apply(tx):\n    gas_left = tx.start_gas - intrinsic_postdata_gas(tx)\n    if gas_left \u003c= 0:\n        raise OutOfGas()\n    # execute tx.data as usual; tx.postdata is never exposed to the EVM\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며 채택된 적이 없습니다.\n- 근본 아이디어인 \"EVM이 읽을 수 없는, 레이어 2를 위한 저렴한 데이터\"는 나중에 다른 형태로 구현되었습니다. [EIP-4844](/eip-4844/)의 blob 트랜잭션으로, 별도의 수수료 시장을 쓰고 blob 데이터를 영구 기록이 아니라 제한된 기간 동안만 보관합니다.\n- 명세는 예전 필드 이름(`startGas`, 직렬화된 리스트의 `from`)을 쓰며 테스트 케이스와 구현은 TODO로 남아 있습니다.\n"},"zh":{"lang":"zh","tldr":"一项为交易增加可选“postdata”字段的提案：该数据发布在链上供二层系统日后获取，EVM 无法读取，并按每字节固定 1 gas 收费。","tags":["data-availability","layer2","transactions","core"],"related":[2028,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2242/","markdown":"## 它解决什么问题？\n\n乐观侧链以及使用欺诈证明的 rollup 需要把区块数据发布到以太坊上，让任何人日后都能检查。它们并不需要 EVM *读取*这些数据，只需要数据在链的历史中可获取。\n\n2019 年时，发布数据的唯一方式是 `calldata`，EVM 可以访问它，定价也相应较高。[EIP-2028](/eip-2028/) 降低了 calldata 的价格，但这些系统仍在为用不到的能力付费。EIP-2242 遵循“不用的不付费”：新增一个单独的位置，存放保存在链上但对执行不可见的数据。\n\n## 它如何运作\n\n从某个分叉区块开始，交易可以在末尾携带一个额外的可选字段 `postdata`，签名会与其他字段一起覆盖它。\n\n- `postdata` 是经 RLP 编码的 `(version, data)` 二元组。\n- 本 EIP 中 `version` 为 `0`；未来的 EIP 可以定义其他版本并赋予不同的解释。\n- `data` 是二进制 blob 的 RLP 列表。协议不解释它。\n- 费用为**每字节 1 gas**，预先从交易的 gas 上限中扣除。如果扣除后没有剩余 gas，交易会因 out-of-gas 而失败。\n- 没有任何 opcode 可以读取 `postdata`。二层软件通过交易历史来读取它。\n\n由于该字段是可选的并且追加在末尾，现有交易仍然有效，但节点需要一次硬分叉才能接受新的格式。作者指出，这只对使用欺诈证明的系统有帮助：有效性证明（zk）系统需要数据立即得到认证，而这个方案无法提供。\n\n## 示例代码\n\n用伪代码表示的交易布局和 gas 收费：\n\n```python\n# signed payload = RLP([nonce, gasPrice, startGas, to, value, data, postdata?])\npostdata = rlp.encode([0, [batch_1_bytes, batch_2_bytes]])   # (version, list of blobs)\n\ndef intrinsic_postdata_gas(tx):\n    return len(tx.postdata) * 1        # 1 gas per byte of postdata\n\ndef apply(tx):\n    gas_left = tx.start_gas - intrinsic_postdata_gas(tx)\n    if gas_left \u003c= 0:\n        raise OutOfGas()\n    # execute tx.data as usual; tx.postdata is never exposed to the EVM\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**；它从未被采用。\n- 其背后的想法，即为二层提供 EVM 无法读取的廉价数据，后来以另一种形式落地：[EIP-4844](/eip-4844/) 中的 blob 交易，使用独立的费用市场，并且只在有限时间内保留 blob 数据，而不是永久保存在历史中。\n- 规范使用了较旧的字段命名（`startGas`，序列化列表中的 `from`），并把测试用例和实现留作 TODO。\n"}}}
