Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article explores EIP-141, which designates an invalid instruction in the Ethereum Virtual Machine (EVM).

The following specification is the basis for this explanation, with additional context.

For other Ethereum improvement proposals, see the following page.

Overview

The proposal designates a specific instruction as deliberately invalid.

Motivation

An invalid instruction provides an unambiguous way to abort execution.

In computer programs, encountering an invalid instruction may indicate that execution has reached an unexpected state. Treating it as an error and halting execution can prevent further unintended operations.

This principle is particularly important in operating systems and critical applications, where error handling helps maintain reliability. The EVM likewise needs a well-defined instruction that deliberately terminates execution exceptionally.

Specification

Opcode 0xfe is designated as the INVALID instruction. It can be used to abort execution, effectively serving as an ABORT instruction.

An opcode (operation code) specifies an instruction for a processor or virtual machine to execute. In this case, 0xfe represents an invalid operation and provides a deliberate way to terminate EVM execution with an error.

Such an instruction is useful when a program encounters an unexpected state and must not continue executing. It is a building block for error handling and exceptional execution.

For more information about INVALID, see the following article.

Backward Compatibility

The proposal states that this opcode had not been assigned to a valid instruction, so its designation does not affect existing contracts.

Citation

Alex Beregszaszi (@axic), "EIP-141: Designated invalid EVM instruction," Ethereum Improvement Proposals, no. 141, February 2017. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-141.

Conclusion

EIP-141 designates opcode 0xfe as an explicitly invalid EVM instruction that can be used to abort execution.