{"eip":7873,"title":"EOF - TXCREATE and InitcodeTransaction type","description":"Adds a `TXCREATE` instruction to EOF and an accompanying transaction type allowing to create EOF contracts from transaction data","authors":["Piotr Dobaczewski (@pdobacz)","Andrei Maiboroda (@gumb0)","Paweł Bylica (@chfast)","Alex Beregszaszi (@axic)","Danno Ferrin (@shemnon)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2025-01-31","requires":[3540,3670,3860,7620],"discussionsTo":"https://ethereum-magicians.org/t/eip-7873-eof-txcreate-instruction-and-initcodetransaction-type/22765","repo":"EIPs","label":"EIP-7873","officialUrl":"https://eips.ethereum.org/EIPS/eip-7873","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7873.md","url":"https://eips.huatuo.xyz/eip-7873/","tldr":{"en":"Proposed a TXCREATE opcode and a new type-6 InitcodeTransaction carrying initcode blobs, giving EOF a way to deploy contracts since EOF bans classic creation transactions and CREATE/CREATE2.","ja":"TXCREATE opcode と、initcode の blob を運ぶ新しいタイプ 6 の InitcodeTransaction を提案した EIP。EOF は従来のコントラクト作成トランザクションと CREATE/CREATE2 を禁止するため、EOF にコントラクトをデプロイする手段を与える。","ko":"TXCREATE opcode와 initcode blob을 담는 새로운 타입 6 InitcodeTransaction을 제안했던 EIP. EOF는 기존의 컨트랙트 생성 트랜잭션과 CREATE/CREATE2를 금지하므로, EOF에 컨트랙트를 배포할 방법을 마련해 준다.","zh":"提议了一个 TXCREATE opcode 和一种携带 initcode blob 的新类型 6 InitcodeTransaction，为 EOF 提供部署合约的方式，因为 EOF 禁止了传统的创建交易以及 CREATE/CREATE2。"},"tags":["eof","evm","contract-creation","transactions","stagnant"],"explainers":{"en":{"lang":"en","tldr":"Proposed a TXCREATE opcode and a new type-6 InitcodeTransaction carrying initcode blobs, giving EOF a way to deploy contracts since EOF bans classic creation transactions and CREATE/CREATE2.","tags":["eof","evm","contract-creation","transactions","stagnant"],"related":[3540,7620,7692,2718,7698],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7873/","markdown":"## What problem does it solve?\n\nThe EVM Object Format (EOF, [EIP-3540](/eip-3540/)) removes code observability. As a result EOF contracts cannot be deployed by the legacy routes: a creation transaction (empty `to`), `CREATE` or `CREATE2`. [EIP-7620](/eip-7620/) adds `EOFCREATE`, but that only deploys subcontainers already embedded in an existing contract.\n\nSomething is still needed for an EOA or a factory to deploy **arbitrary** EOF code supplied at transaction time, including deterministic, counterfactual addresses that do not depend on nonces. EIP-7873 provides it.\n\n## How it works\n\n**New transaction type** `InitcodeTransaction`, type `0x06`. It is an [EIP-1559](/eip-1559/) transaction plus a field `initcodes`: a list of 1 to 256 byte strings, each non-empty and at most `MAX_INITCODE_SIZE`. `to` must be set: the transaction calls a contract (for example a factory) that uses `TXCREATE`. Initcode bytes are charged like calldata, including the [EIP-7623](/eip-7623/) floor. They are not EOF-validated at transaction validation time, to avoid mempool DoS.\n\n**New instruction** `TXCREATE` (`0xed`), usable from both EOF and legacy code:\n\n1. Charges `32000` gas; fails in static context.\n2. Pops `tx_initcode_hash, salt, input_offset, input_size, value`.\n3. Finds the `initcodes` entry whose hash matches. If none (or the tx is not type 6), pushes `0` without consuming initcode gas.\n4. Validates that container recursively; on failure pushes `0` (a \"light\" failure).\n5. Runs it with memory input as calldata. On success it ends with `RETURNCODE` (from EIP-7620), the deploy container is stored, and the new address is pushed.\n\nThe address is `keccak256(0xff || sender32 || salt)[12:]`, the same scheme as `EOFCREATE`. Whether to mix the initcode hash into `salt` is up to the caller.\n\nLegacy creation transactions (types 0, 1 and 2 with empty `to`) do not parse EOF: input starting with `0xEF` simply executes the undefined `0xEF` opcode and halts.\n\n## Sample code\n\nEncoding of the new transaction type (per [EIP-2718](/eip-2718/)):\n\n```\n0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas,\n             gas_limit, to, value, data, access_list, initcodes,\n             y_parity, r, s])\n\nsigning hash = keccak256(0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas,\n             max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes]))\n```\n\n`TXCREATE` stack usage, pseudocode:\n\n```python\n# stack: tx_initcode_hash, salt, input_offset, input_size, value\ninitcode = find(tx.initcodes, lambda c: keccak256(c) == tx_initcode_hash)\nif tx.type != 0x06 or initcode is None or not eof_validate(initcode):\n    push(0)                     # light failure\nelse:\n    new_address = keccak256(b\"\\xff\" + pad32(sender) + salt)[12:]\n    push(new_address if run_initcode(initcode, memory[input_offset:input_offset+input_size], value) else 0)\n```\n\n## Things to know\n\n- **Status: Stagnant**, as are EOF itself ([EIP-3540](/eip-3540/), [EIP-7620](/eip-7620/)) and the EOF meta EIP [EIP-7692](/eip-7692/). None of this is live on Ethereum mainnet.\n- It would make [EIP-7698](/eip-7698/) (EOF creation transactions) unnecessary; the spec suggests that EIP could be withdrawn.\n- The spec's Security Considerations section is only \"Needs discussion.\"\n- Deployed code is still limited to `MAX_CODE_SIZE` (24,576 bytes, [EIP-170](/eip-170/)) and is charged 200 gas per byte.\n"},"ja":{"lang":"ja","tldr":"TXCREATE opcode と、initcode の blob を運ぶ新しいタイプ 6 の InitcodeTransaction を提案した EIP。EOF は従来のコントラクト作成トランザクションと CREATE/CREATE2 を禁止するため、EOF にコントラクトをデプロイする手段を与える。","tags":["eof","evm","contract-creation","transactions","stagnant"],"related":[3540,7620,7692,2718,7698],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7873/","markdown":"## 何を解決するのか\n\nEVM Object Format（EOF、[EIP-3540](/eip-3540/)）は、コードの観測可能性を取り除きます。その結果、EOF コントラクトは従来の経路（作成トランザクション（`to` が空）、`CREATE`、`CREATE2`）ではデプロイできません。[EIP-7620](/eip-7620/) は `EOFCREATE` を追加しますが、これは既存のコントラクトにすでに埋め込まれたサブコンテナをデプロイするだけです。\n\nEOA やファクトリーが、トランザクション時に与えられた**任意の** EOF コードをデプロイする手段は、依然として必要です。nonce に依存しない、決定論的で反事実的な（counterfactual）アドレスも含みます。EIP-7873 はそれを提供します。\n\n## 仕組み\n\n**新しいトランザクションタイプ** `InitcodeTransaction`、タイプ `0x06`。[EIP-1559](/eip-1559/) のトランザクションに `initcodes` フィールドを加えたものです。これは 1 個から 256 個のバイト列のリストで、それぞれ空でなく、`MAX_INITCODE_SIZE` 以下でなければなりません。`to` は設定する必要があり、トランザクションは `TXCREATE` を使うコントラクト（たとえばファクトリー）を呼び出します。initcode のバイトは、[EIP-7623](/eip-7623/) の下限を含め、calldata と同様に課金されます。メンプールへの DoS を避けるため、トランザクション検証時には EOF の検証は行われません。\n\n**新しい命令** `TXCREATE`（`0xed`）。EOF コードとレガシーコードのどちらからでも使えます。\n\n1. `32000` gas を消費。静的コンテキストでは失敗。\n2. `tx_initcode_hash, salt, input_offset, input_size, value` をポップ。\n3. ハッシュが一致する `initcodes` のエントリを探す。見つからない（またはトランザクションがタイプ 6 でない）場合は、initcode の gas を消費せずに `0` をプッシュ。\n4. そのコンテナを再帰的に検証。失敗した場合は `0` をプッシュ（「軽い」失敗）。\n5. メモリの入力を calldata として実行。成功すると（EIP-7620 の）`RETURNCODE` で終了し、デプロイコンテナが保存され、新しいアドレスがプッシュされる。\n\nアドレスは `keccak256(0xff || sender32 || salt)[12:]` で、`EOFCREATE` と同じ方式です。initcode のハッシュを `salt` に混ぜるかどうかは呼び出し側に任されています。\n\nレガシーの作成トランザクション（`to` が空のタイプ 0、1、2）は EOF を解析しません。`0xEF` で始まる入力は、未定義の `0xEF` opcode を実行して停止するだけです。\n\n## サンプルコード\n\n新しいトランザクションタイプのエンコード（[EIP-2718](/eip-2718/) に基づく）:\n\n```\n0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas,\n             gas_limit, to, value, data, access_list, initcodes,\n             y_parity, r, s])\n\nsigning hash = keccak256(0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas,\n             max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes]))\n```\n\n`TXCREATE` のスタック使用の疑似コード:\n\n```python\n# stack: tx_initcode_hash, salt, input_offset, input_size, value\ninitcode = find(tx.initcodes, lambda c: keccak256(c) == tx_initcode_hash)\nif tx.type != 0x06 or initcode is None or not eof_validate(initcode):\n    push(0)                     # light failure\nelse:\n    new_address = keccak256(b\"\\xff\" + pad32(sender) + salt)[12:]\n    push(new_address if run_initcode(initcode, memory[input_offset:input_offset+input_size], value) else 0)\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant**。EOF 自体（[EIP-3540](/eip-3540/)、[EIP-7620](/eip-7620/)）と、EOF のメタ EIP である [EIP-7692](/eip-7692/) も Stagnant です。これらはいずれも Ethereum メインネットでは稼働していません。\n- [EIP-7698](/eip-7698/)（EOF の作成トランザクション）は不要になります。仕様は、その EIP を取り下げてよいと示唆しています。\n- 仕様の Security Considerations セクションは「Needs discussion.」とあるだけです。\n- デプロイされるコードは依然として `MAX_CODE_SIZE`（24,576 バイト、[EIP-170](/eip-170/)）に制限され、1 バイトあたり 200 gas が課金されます。\n"},"ko":{"lang":"ko","tldr":"TXCREATE opcode와 initcode blob을 담는 새로운 타입 6 InitcodeTransaction을 제안했던 EIP. EOF는 기존의 컨트랙트 생성 트랜잭션과 CREATE/CREATE2를 금지하므로, EOF에 컨트랙트를 배포할 방법을 마련해 준다.","tags":["eof","evm","contract-creation","transactions","stagnant"],"related":[3540,7620,7692,2718,7698],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7873/","markdown":"## 어떤 문제를 해결하나요?\n\nEVM Object Format(EOF, [EIP-3540](/eip-3540/))은 코드 관찰 가능성을 없앱니다. 그 결과 EOF 컨트랙트는 기존 경로, 즉 생성 트랜잭션(`to`가 비어 있음), `CREATE`, `CREATE2`로는 배포할 수 없습니다. [EIP-7620](/eip-7620/)은 `EOFCREATE`를 추가하지만, 이는 이미 기존 컨트랙트에 내장된 하위 컨테이너만 배포합니다.\n\nEOA나 팩토리가 트랜잭션 시점에 제공되는 **임의의** EOF 코드를 배포할 방법은 여전히 필요합니다. nonce에 의존하지 않는 결정적이고 반사실적(counterfactual)인 주소도 포함됩니다. EIP-7873이 이를 제공합니다.\n\n## 어떻게 동작하나요?\n\n**새 트랜잭션 타입** `InitcodeTransaction`, 타입 `0x06`. [EIP-1559](/eip-1559/) 트랜잭션에 `initcodes` 필드를 더한 것입니다. 이 필드는 1개에서 256개의 바이트 문자열 목록이며, 각각 비어 있지 않고 `MAX_INITCODE_SIZE` 이하여야 합니다. `to`는 반드시 설정해야 하며, 트랜잭션은 `TXCREATE`를 사용하는 컨트랙트(예: 팩토리)를 호출합니다. initcode 바이트는 [EIP-7623](/eip-7623/)의 하한을 포함해 calldata와 같은 방식으로 요금이 부과됩니다. 멤풀 DoS를 막기 위해 트랜잭션 검증 시점에는 EOF 검증을 하지 않습니다.\n\n**새 명령어** `TXCREATE`(`0xed`). EOF 코드와 기존 코드 모두에서 사용할 수 있습니다.\n\n1. `32000` gas를 소모하며, 정적 컨텍스트에서는 실패합니다.\n2. `tx_initcode_hash, salt, input_offset, input_size, value`를 팝합니다.\n3. 해시가 일치하는 `initcodes` 항목을 찾습니다. 없으면(또는 트랜잭션이 타입 6이 아니면) initcode gas를 소모하지 않고 `0`을 푸시합니다.\n4. 그 컨테이너를 재귀적으로 검증합니다. 실패하면 `0`을 푸시합니다(\"가벼운\" 실패).\n5. 메모리 입력을 calldata로 삼아 실행합니다. 성공하면 (EIP-7620의) `RETURNCODE`로 끝나고, 배포 컨테이너가 저장되며, 새 주소가 푸시됩니다.\n\n주소는 `keccak256(0xff || sender32 || salt)[12:]`이며, `EOFCREATE`와 같은 방식입니다. initcode 해시를 `salt`에 섞을지는 호출자에게 달려 있습니다.\n\n기존 생성 트랜잭션(`to`가 비어 있는 타입 0, 1, 2)은 EOF를 파싱하지 않습니다. `0xEF`로 시작하는 입력은 정의되지 않은 `0xEF` opcode를 실행하고 멈출 뿐입니다.\n\n## 샘플 코드\n\n새 트랜잭션 타입의 인코딩([EIP-2718](/eip-2718/) 기준):\n\n```\n0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas,\n             gas_limit, to, value, data, access_list, initcodes,\n             y_parity, r, s])\n\nsigning hash = keccak256(0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas,\n             max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes]))\n```\n\n`TXCREATE`의 스택 사용, 의사 코드:\n\n```python\n# stack: tx_initcode_hash, salt, input_offset, input_size, value\ninitcode = find(tx.initcodes, lambda c: keccak256(c) == tx_initcode_hash)\nif tx.type != 0x06 or initcode is None or not eof_validate(initcode):\n    push(0)                     # light failure\nelse:\n    new_address = keccak256(b\"\\xff\" + pad32(sender) + salt)[12:]\n    push(new_address if run_initcode(initcode, memory[input_offset:input_offset+input_size], value) else 0)\n```\n\n## 알아둘 점\n\n- **상태: Stagnant**이며, EOF 자체([EIP-3540](/eip-3540/), [EIP-7620](/eip-7620/))와 EOF 메타 EIP [EIP-7692](/eip-7692/)도 마찬가지입니다. 이 중 어느 것도 이더리움 메인넷에서 동작하지 않습니다.\n- [EIP-7698](/eip-7698/)(EOF 생성 트랜잭션)이 불필요해지며, 명세는 그 EIP를 철회해도 된다고 시사합니다.\n- 명세의 Security Considerations 섹션은 \"Needs discussion.\"뿐입니다.\n- 배포되는 코드는 여전히 `MAX_CODE_SIZE`(24,576바이트, [EIP-170](/eip-170/))로 제한되며 바이트당 200 gas가 부과됩니다.\n"},"zh":{"lang":"zh","tldr":"提议了一个 TXCREATE opcode 和一种携带 initcode blob 的新类型 6 InitcodeTransaction，为 EOF 提供部署合约的方式，因为 EOF 禁止了传统的创建交易以及 CREATE/CREATE2。","tags":["eof","evm","contract-creation","transactions","stagnant"],"related":[3540,7620,7692,2718,7698],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7873/","markdown":"## 它解决什么问题？\n\nEVM 对象格式（EOF，[EIP-3540](/eip-3540/)）移除了代码的可观察性。因此 EOF 合约无法通过传统途径部署：创建交易（`to` 为空）、`CREATE` 或 `CREATE2`。[EIP-7620](/eip-7620/) 增加了 `EOFCREATE`，但它只能部署已经嵌入现有合约中的子容器。\n\nEOA 或工厂合约仍然需要一种办法来部署在交易时才提供的**任意** EOF 代码，包括不依赖 nonce 的确定性反事实（counterfactual）地址。EIP-7873 提供了这种办法。\n\n## 它如何运作\n\n**新的交易类型** `InitcodeTransaction`，类型为 `0x06`。它是在 [EIP-1559](/eip-1559/) 交易基础上增加一个 `initcodes` 字段：1 到 256 个字节串组成的列表，每个都非空且不超过 `MAX_INITCODE_SIZE`。必须设置 `to`：该交易调用一个使用 `TXCREATE` 的合约（例如工厂合约）。initcode 字节按 calldata 的方式计费，包括 [EIP-7623](/eip-7623/) 的下限。在交易验证阶段不会进行 EOF 验证，以避免对内存池发起 DoS。\n\n**新的指令** `TXCREATE`（`0xed`），EOF 代码和传统代码都可以使用：\n\n1. 消耗 `32000` gas；在静态上下文中失败。\n2. 弹出 `tx_initcode_hash, salt, input_offset, input_size, value`。\n3. 查找哈希匹配的 `initcodes` 条目。如果没有（或交易不是类型 6），则压入 `0`，且不消耗 initcode 的 gas。\n4. 递归验证该容器；失败时压入 `0`（一种\"轻量\"失败）。\n5. 以内存中的输入作为 calldata 运行它。成功时以 `RETURNCODE`（来自 EIP-7620）结束，存储部署容器，并压入新地址。\n\n地址为 `keccak256(0xff || sender32 || salt)[12:]`，与 `EOFCREATE` 方案相同。是否把 initcode 哈希混入 `salt`，由调用方决定。\n\n传统的创建交易（`to` 为空的类型 0、1 和 2）不会解析 EOF：以 `0xEF` 开头的输入只会执行未定义的 `0xEF` opcode 然后停止。\n\n## 示例代码\n\n新交易类型的编码（依据 [EIP-2718](/eip-2718/)）：\n\n```\n0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas,\n             gas_limit, to, value, data, access_list, initcodes,\n             y_parity, r, s])\n\nsigning hash = keccak256(0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas,\n             max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes]))\n```\n\n`TXCREATE` 的栈使用，伪代码：\n\n```python\n# stack: tx_initcode_hash, salt, input_offset, input_size, value\ninitcode = find(tx.initcodes, lambda c: keccak256(c) == tx_initcode_hash)\nif tx.type != 0x06 or initcode is None or not eof_validate(initcode):\n    push(0)                     # light failure\nelse:\n    new_address = keccak256(b\"\\xff\" + pad32(sender) + salt)[12:]\n    push(new_address if run_initcode(initcode, memory[input_offset:input_offset+input_size], value) else 0)\n```\n\n## 需要注意\n\n- **状态：Stagnant**，EOF 本身（[EIP-3540](/eip-3540/)、[EIP-7620](/eip-7620/)）以及 EOF 元 EIP [EIP-7692](/eip-7692/) 也都是 Stagnant。这些都没有在以太坊主网上线。\n- 它会让 [EIP-7698](/eip-7698/)（EOF 创建交易）变得不必要；规范建议可以撤回那个 EIP。\n- 规范的 Security Considerations 一节只有\"Needs discussion.\"。\n- 部署的代码仍受 `MAX_CODE_SIZE`（24,576 字节，[EIP-170](/eip-170/)）限制，并按每字节 200 gas 计费。\n"}}}
