CHIPs · CHIP-2024-12 · superseded

OP_EVAL: Function Evaluation

Proposed a single OP_EVAL opcode to run bytecode from the stack as a function. Withdrawn in May 2025 and replaced by the Functions CHIP (OP_DEFINE/OP_INVOKE), which activated in 2026.

Verified
Read the spec ↗ Discussion ↗ By Jason Dreyzehner

Summary

OP_EVAL (Function Evaluation) “would let Bitcoin Cash contracts be efficiently factored into reusable functions,” to shrink contracts for finite field arithmetic, pairing-based cryptography, zero-knowledge proofs, homomorphic encryption and post-quantum cryptography.

Note: it shares the “CHIP-2024-12” prefix with P2S, a separate CHIP.

Motivation

The same as its successor: remove duplicated bytecode from contracts. OP_EVAL took the simplest route, one opcode that executes a stack item as code.

Current status

Superseded. On 28 May 2025, Jason Dreyzehner posted “Withdrawing OP_EVAL” and opened a new topic for CHIP-2025-05 Functions, which uses OP_DEFINE and OP_INVOKE with immutable, pre-defined function bodies. The thread debated static analysis of contracts at length. Functions activated in the May 2026 upgrade.

Sources

  1. CHIP 2024-12 OP_EVAL: Function Evaluation (Bitcoin Cash Research)
  2. Withdrawing OP_EVAL (Bitcoin Cash Research)
  3. CHIP-2025-05 Functions specification