EIPs Explained

EIP-7692 · Stagnant · Meta · 2024-04-17

EIP-7692: EVM Object Format (EOFv1) Meta

The umbrella list of EIPs that together make up EOFv1, a versioned, validated container format for EVM bytecode; it is now Stagnant.

What problem does it solve?

EVM bytecode today is an unstructured blob. Code and data are mixed, jump destinations are only discovered at runtime, and there is no version field, so the EVM cannot be cleanly upgraded without breaking existing contracts. Tools and clients must analyze every contract defensively.

The EVM Object Format (EOF) proposes a structured container for contract code that is validated once at deploy time. Because EOF touches many parts of the EVM, it was split into a dozen separate EIPs. EIP-7692 is the Meta EIP that tracks which of them belong to the first version, EOFv1 (nicknamed "Mega EOF").

How it works

The Meta EIP itself specifies no behavior; it is a list. The pieces, grouped by the devnet where they were introduced:

eof-devnet-0

  • EIP-3540: the container format with a magic prefix, a version byte and separate code/data sections.
  • EIP-3670: code validation at deploy time (no undefined opcodes, no truncated immediates).
  • EIP-4200: static relative jumps (RJUMP, RJUMPI, RJUMPV).
  • EIP-4750: functions as separate code sections (CALLF/RETF).
  • EIP-5450: stack validation, so stack underflow/overflow is ruled out before execution.
  • EIP-6206: JUMPF and non-returning functions.
  • EIP-7480: instructions for reading the data section.
  • EIP-663: SWAPN, DUPN, EXCHANGE.
  • EIP-7069: revamped EXTCALL-style call instructions.
  • EIP-7620: EOF contract creation (EOFCREATE, RETURNCODE).
  • EIP-7698: creation transactions (later removed in eof-devnet-1).

eof-devnet-1 added EIP-7873 (TXCREATE and an initcode transaction type).

eof-devnet-2 added EIP-7834 (separate metadata section), EIP-7761 (EXTCODETYPE), EIP-7880 (EXTCODEADDRESS) and EIP-5920 (PAY opcode).

Sample code

An illustrative layout of an EOFv1 container, following EIP-3540 (field order only, not a complete contract):

EF 00                 magic + EOF marker
01                    version 1
01 0004               type section, size 4
02 0001 0003          1 code section, size 3
FF 0000               data section, size 0
00                    header terminator
00 80 0002            types: 0 inputs, non-returning, max stack 2
5F 5F 00              code: PUSH0 PUSH0 STOP

Things to know

  • Status is Stagnant. EOF was not shipped in Fusaka, and this Meta EIP is no longer actively progressing. Treat the list as historical.
  • Several EOF ideas live on separately: for example EIP-8024 proposes backward-compatible SWAPN/DUPN/EXCHANGE for legacy bytecode.
  • Rationale and security discussion are in the individual EIPs, not here.
  • EOF containers are not valid on mainnet today; do not target EOF for production deployments.

#evm #eof #bytecode #meta #core

Details

Authors
Alex Beregszaszi (@axic), Paweł Bylica (@chfast), Andrei Maiboroda (@gumb0), Piotr Dobaczewski (@pdobacz), Danno Ferrin (@shemnon)
Status
Stagnant
Type
Meta
Created
2024-04-17
Requires
Required by

Machine-readable: Markdown · JSON