EIP-7873 The EOF TXCREATE instruction and initcode transactions (EOF - TXCREATE and InitcodeTransaction type)
No call decision · EVM & execution · EIP status Stagnant · created 2025-01-31
Adds a new instruction, TXCREATE (0xed), and a new transaction type, InitcodeTransaction (0x06), allowing new code-format (EOF) contracts to be deployed using code carried in the transaction.
Why it is needed
As Ethereum prepares EOF (EVM Object Format), a new contract code format, it has established the principle that deployed code should not be inspectable by other code. Because of this principle, EOF contracts cannot be deployed using the existing deployment methods: creation transactions (transactions with an empty recipient address) or the CREATE and CREATE2 instructions. That would leave regular accounts (EOAs) with no way to deploy an EOF contract for the first time. This proposal creates a path where initcode (deployment-preparation code) is carried in the transaction data, and a TXCREATE instruction inside a contract extracts that code and deploys it. Every contract creation method possible in the existing EVM becomes possible under EOF as well, and smart contract wallets gain the same ability as EOAs to deploy arbitrary EOF contracts.
What changes
Today
- Under the EOF framework, EOF contracts cannot be deployed using creation transactions or CREATE and CREATE2
- Regular accounts have no way to put an EOF contract on chain for the first time
- For a smart contract wallet to deploy arbitrary EOF code, it would need an expensive workaround of putting the code on chain twice
After EIP-7873
- A new transaction (type 0x06) with an initcodes field allows the code to be deployed to be carried along in the transaction
- A contract uses the TXCREATE instruction to pull initcode out of a transaction and deploy an EOF contract.
- Because the address is determined only by the sender address and the salt, deployment to the same address across multiple chains can be committed to in advance.
Who is affected
- Wallet & app developers: Smart contract wallets can deploy arbitrary EOF contracts just like EOAs can, creating a deployment path that fits the account abstraction roadmap.
- Contract deployer: EOF code gets uploaded via a deployer contract (toehold) that uses InitcodeTransaction and TXCREATE. The initcode data cost is calculated on the same basis as calldata.
- Client teams: Implementations must add validation rules for the new transaction type, execution rules for TXCREATE, and per transaction caching of container validation results.
- Block builders: Existing type 0, 1, and 2 creation transactions keep their current rules, so no additional checking logic is needed.
In depth
InitcodeTransaction structure and signing
The new transaction type INITCODE_TX_TYPE (0x06) is an EIP-1559 (type 2) transaction with an added initcodes: List[ByteList[MAX_INITCODE_SIZE], MAX_INITCODE_COUNT] field. The TransactionPayload is the RLP serialization of [chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes, y_parity, r, s], and the signature is a secp256k1 signature over keccak256(INITCODE_TX_TYPE || rlp([...up to initcodes])). Since initcodes can only be accessed via the TXCREATE instruction, this transaction is meant to be sent to a contract that executes TXCREATE. The ReceiptPayload is rlp([status, cumulative_transaction_gas_used, logs_bloom, logs]).
Transaction validation rules and mempool DoS prevention
An InitcodeTransaction is invalid if it has zero initcodes entries or more than MAX_INITCODE_COUNT (256). It is also invalid if any entry has zero length or exceeds MAX_INITCODE_SIZE (2 * MAX_CODE_SIZE, i.e. twice 24576), and invalid if to is nil. The transaction validation stage does not check whether initcodes conform to the EOF specification; that check only happens when accessed via TXCREATE. This avoids the possibility of DoS attacks targeting the mempool. The transaction itself remains valid even if TXCREATE is never called during execution.
Gas accounting: initcodes cost the same as calldata
This extends EIP-7623's token based calculation so that initcode data is charged the same cost as calldata. STANDARD_TOKEN_COST = 4, TOTAL_COST_FLOOR_PER_TOKEN = 10, and tokens are counted as 1 for a zero byte and 4 for a nonzero byte. Transaction gas is 21000 + max(STANDARD_TOKEN_COST * (calldata tokens + initcodes tokens) + execution gas, TOTAL_COST_FLOOR_PER_TOKEN * (calldata tokens + initcodes tokens)). Implementations are expected to cache container validation results for the duration of the current transaction's execution, and the cost of each container validation is expected to be fully covered by this initcodes fee.
TXCREATE (0xed) execution rules
This is introduced together with the EIP-3540 activation block. It deducts TX_CREATE_COST (32000) gas and fails with an exception in static mode. It pops tx_initcode_hash, salt, input_offset, input_size, and value from the stack, pays the memory expansion cost, then searches the transaction's initcodes for a container with a matching hash. It recursively validates the initcode container and all subcontainers; unlike normal validation, the header's data_size must equal the actual data_section size, and there must be no RETURN or STOP. Execution applies EIP-150's 63/64 rule and increments the sending account's nonce. On success it ends with RETURNCODE{deploy_container_index}(aux_data_offset, aux_data_size); if the deployment container, with aux_data appended to its data section, exceeds MAX_CODE_SIZE (24576), it aborts with an exception. Finally it deducts GAS_CODE_DEPOSIT (200) * deployed code size in gas. Rules not explicitly specified behave the same as or similarly to CREATE2.
Why the lenient failure mode was chosen
TXCREATE has two lenient failure cases: when the initcode container is not present in the transaction, and when EOF validation fails. In both cases, 0 is pushed onto the stack, the caller's nonce is not incremented, and no initcode execution gas is consumed. An alternative considered was treating both cases as hard failures that consume all remaining gas, but a more granular and lenient failure mode was chosen so gas costs match what the EVM actually did. By contrast, when the initcode execution itself fails, 0 is pushed onto the stack but the nonce stays incremented, and if it was a REVERT, returndata may be populated.
The exception allowing an EOF instruction in legacy EVM
TXCREATE is an exceptional EOF instruction that can also be called from legacy (non EOF) code. Without this, neither legacy contracts nor creation transactions would be able to upload EOF code for the first time. Alternatives considered were keeping the existing approach of reading initcode from memory (which violates the code non observability requirement), modifying legacy creation transactions, or introducing a predeployed Creator Contract. This design means EIP-7698 (EOF creation transactions) is no longer required for EOF deployment and can be dropped from EOFv1 and withdrawn. Also, unlike the nonce based address of creation transactions, the keccak256(0xff || sender32 || salt)[12:] scheme allows counterfactual deployment to the same address across multiple chains. Introducing legacy code also has no effect on JUMPDEST analysis, since this instruction has no immediate argument.
Handling of 0xEF00 code in existing transaction types
One option considered was making type 0 (Frontier), 1 (AccessList), and 2 (FeeMarket) creation transactions invalid if their input starts with 0xef00, but that would require block builders to add new logic to filter out this new invalid condition. Instead, this EIP chooses not to interpret the input as an EOF container and simply executes it as ordinary bytecode. In that case, the undefined 0xEF instruction executes immediately and aborts, so no EOF code ends up being deployed. The same applies when an EIP-7702 delegation designator appears as the code of a creation transaction: the transaction is valid, but the first instruction, 0xEF, is an invalid opcode, so execution aborts entirely. This choice preserves consistency of client behavior and avoids changing block builders' existing logic.
Proposal status: Stagnant
This EIP's status in the source document is Stagnant. It is a Standards Track Core proposal created on January 31, 2025, and requires EIP-3540, 3670, 3860, and 7620. The Security Considerations section in the source is marked only as 'Needs discussion.' No decision to include it in a specific fork has been confirmed in core developer calls to date.