EIP-8442: 64-bit Opcodes for the EVM

EIP-8442: 64-bit Opcodes for the EVM

Not every computation needs 256 bits. Counters, offsets, lengths, and the inner loops of hashes and big-number arithmetic fit in 64, and the EVM makes them pay for 256 at every step. This proposal adds twenty-eight instructions that compute on the low 64 bits of their operands: the EVM64 instruction set of EIP-7937 — the same operations at the same costs — encoded as ordinary single-byte opcodes rather than behind a prefix byte. Each is the twin of an existing instruction, at the existing opcode plus 0xC0.

The instructions take no immediate data and enter no mode: they mix freely with the rest of the instruction set, and every result is an ordinary 256-bit word. Alone they make interpreted arithmetic modestly cheaper. Composed with static control flow they compound: code compiled to RISC-V under both executes 19 to 51 times fewer instructions than today’s interpreted EVM, because a stack slot becomes a machine register only when its offset is static and its value fits the register.

Update Log

External Reviews

  • None as of 2026-10-15

Outstanding Issues

  • None as of 2026-10-15
1 Like

Thanks for setting out EIP-8442. It retains 256-bit stack words while adding operations that use only the low 64 bits and zero-extend results to 256 bits. This makes narrower arithmetic explicit without introducing a persistent 64-bit mode.

Semantics and conformance:

The specification and shared test vectors should pin down signed two’s-complement interpretation, 64-bit wrapping, full-width modular intermediates, shift boundaries, and exceptional cases such as division by zero and signed minimum divided by negative one. They should also cover masking, zero-extension, and MLOAD64/MSTORE64’s 32-byte memory window, including memory-expansion gas.

Opcode allocation and performance:

Resolve the encoding question before implementation proceeds: EIP-7937 uses 0xC0 as a multibyte-instruction prefix, while EIP-8442 assigns single-byte opcodes in 0xC0–0xDF. That overlap can make bytecode decoding ambiguous. Clarify whether the proposals are alternatives or specify allocation and activation rules that avoid conflict.

Treat the reported performance gains as workload-specific. Larger RISC-V instruction-count reductions depend on static control flow and compilation; instruction counts are not gas savings. Reproducible benchmarks should publish code, toolchain, inputs, methods, and separate gas, interpreted, compiled, and proving results.

Practical review path:

First settle EIP-7937 compatibility and the opcode range. Then use shared edge-case vectors to check independent clients, measure per-operation and representative-program gas, and document results so others can reproduce them.

Compiler support should emit these operations only when range analysis proves 64-bit inputs or truncation is intended, with optimized output checked against 256-bit source semantics.

The eip-7937 and eip-8442 are mutually exclusive, so there is no conflict – if one goes in the other can’t. I think @sorpaas is supporting eip-8442 for the fork after Hegota, so it’s not going to be a practical issue anyway.

The gains reported are specific only to the tests given, which are not an exhaustive performance suite, just examples of three kinds of computational workload.

The assets include everything you ask for. The entire chain from code and inputs to results.

(Compilers can’t change gas - it’s consensus - so only ticks are reported.)

Thank you for the clarifications. If EIP-7937 and EIP-8442 are mutually exclusive, that resolves the practical opcode-decoding concern; stating that relationship explicitly in the specifications would help future readers.

It’s also helpful to know the performance results are examples across three workload types, with code, inputs, and results available for reproduction. Understood that gas remains consensus-defined and the reported ticks are a separate performance measure.

The remaining validation step I’d suggest is shared edge-case vectors tested across independent clients. Covering operand order, signed minimum divided by −1, zero divisors and moduli, modular-operation intermediates, shifts at and above 64, exponent masking, calldata offsets, and the 32-byte memory window would help confirm consistent boundary and exception behavior.

Agreed, and most of it is there. The Test Cases table has the signed minimum over −1, division by zero, the unreduced modular intermediates, shifts at 63, 64 and 100, the masked exponent, and the calldata and memory windows; the asset test_evm64.py checks every instruction against an independent 256-bit twin on twenty thousand cases with garbage high bits; and the EELS PR (ethereum/execution-specs#3829) fills 231 execution-spec-tests fixtures from the same vectors, which is how they reach the other clients. Your list found gaps in the fixed vectors: zero moduli for the modular instructions, the signed and modulo divisions by zero, shifts at exactly 64, and a shift amount with high bits set. Added them, thanks.

Thanks for the precise follow-up. The existing test table and 20,000 comparisons against an independent 256-bit implementation already cover much of the semantic and differential testing. The 231 execution-spec fixtures generated from the same vectors also provide a clear path for other clients to use them.

The fixed-vector gaps I noted have now been added: zero moduli, signed and modulo division by zero, a shift of exactly 64, and shift amounts with high bits set. That addresses my concern and strengthens the case for consistent independent-client validation.