---
eip: 7873
label: EIP-7873
title: EOF - TXCREATE and InitcodeTransaction type
status: Stagnant
type: Standards Track
category: Core
created: 2025-01-31
requires: 3540, 3670, 3860, 7620
official: https://eips.ethereum.org/EIPS/eip-7873
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7873.md
canonical: https://eips.huatuo.xyz/eip-7873/
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]
---

# EIP-7873: EOF - TXCREATE and InitcodeTransaction type

> Adds a `TXCREATE` instruction to EOF and an accompanying transaction type allowing to create EOF contracts from transaction data

**TL;DR:** 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.

## What problem does it solve?

The 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.

Something 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.

## How it works

**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.

**New instruction** `TXCREATE` (`0xed`), usable from both EOF and legacy code:

1. Charges `32000` gas; fails in static context.
2. Pops `tx_initcode_hash, salt, input_offset, input_size, value`.
3. Finds the `initcodes` entry whose hash matches. If none (or the tx is not type 6), pushes `0` without consuming initcode gas.
4. Validates that container recursively; on failure pushes `0` (a "light" failure).
5. 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.

The 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.

Legacy 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.

## Sample code

Encoding of the new transaction type (per [EIP-2718](/eip-2718/)):

```
0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas,
             gas_limit, to, value, data, access_list, initcodes,
             y_parity, r, s])

signing hash = keccak256(0x06 || rlp([chain_id, nonce, max_priority_fee_per_gas,
             max_fee_per_gas, gas_limit, to, value, data, access_list, initcodes]))
```

`TXCREATE` stack usage, pseudocode:

```python
# stack: tx_initcode_hash, salt, input_offset, input_size, value
initcode = find(tx.initcodes, lambda c: keccak256(c) == tx_initcode_hash)
if tx.type != 0x06 or initcode is None or not eof_validate(initcode):
    push(0)                     # light failure
else:
    new_address = keccak256(b"\xff" + pad32(sender) + salt)[12:]
    push(new_address if run_initcode(initcode, memory[input_offset:input_offset+input_size], value) else 0)
```

## Things to know

- **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.
- It would make [EIP-7698](/eip-7698/) (EOF creation transactions) unnecessary; the spec suggests that EIP could be withdrawn.
- The spec's Security Considerations section is only "Needs discussion."
- Deployed code is still limited to `MAX_CODE_SIZE` (24,576 bytes, [EIP-170](/eip-170/)) and is charged 200 gas per byte.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7873
