Formal semanticsmodels EVM bytecode

KEVM

Also known as K semantics of the EVM, evm-semantics

An executable formal semantics of the Ethereum Virtual Machine written in the K framework. It runs the Ethereum conformance tests and is the model behind Runtime Verification's Kontrol.

Stage 1 · Validated Written in K Open source · BSD-3-Clause v1.0.921 · 5 months ago

What it covers

Models
EVM bytecode, Hardforks from Frontier to Osaka (with gaps, see coverage); work on Amsterdam (Glamsterdam) started in September 2026
Fragment
EVM bytecode execution: the opcodes, gas, precompiled contracts, transactions, and enough block processing to run the Ethereum blockchain tests. Precompile cryptography (hashing, elliptic curves, KZG, BLS12-381) is computed by a native C++ plugin, and only on concrete inputs. Also includes helper modules for proofs (ABI encoding, Solidity storage layout).
Written in
K
Usable in
—
Validation
K generates an interpreter (LLVM backend) from the semantics. The CSF 2018 paper reports that it passed the official Ethereum test suites of the time (VMTests and GeneralStateTests). Today the CI runs the ethereum/tests conformance tests and the execution-spec-tests fixtures on every pull request. The known-failure list for execution-spec-tests (November 2026) names about 3,000 test files: most are for Amsterdam, which is still in development, and 86 are for Osaka, the fork live on mainnet.
Maintained by
Runtime Verification

Stage

Computed from the evidence below; see the criteria. MechanizedMechanized. Written in a form a computer can check, rather than on paper. means a computer can check the definition.

Stage 0 Mechanized Met
  • Met: Machine-checked or machine-readable definition evidence
  • Met: Fragment and version are stated Each hardfork is a named gas and feature schedule (FRONTIER ... OSAKA, AMSTERDAM). evidence
Stage 1 Validated Met
  • Met: Can be executed or tested LLVM backend for concrete execution, Haskell backend for symbolic execution. evidence
  • Met: Published results against conformance tests or real implementations Conformance tests (ethereum/tests and execution-spec-tests) run in CI. Known failures are listed in tests/failing.llvm. evidence
Stage 2 Authoritative Next
  • Not met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: no; full coverage: no; tracks new versions: unknown. Not adopted by the Ethereum Foundation or the EIP process. Osaka, live on mainnet since December 2025, is not fully covered: the P256VERIFY precompile (EIP-7951) is missing, and 86 Osaka test files are on the known-failure list (14 for P256VERIFY, 10 for the modexp gas change EIP-7883). New hardforks are added in practice (Amsterdam work began in September 2026), but no stated time commitment was found. evidence

Coverage

Which parts of EVM bytecode the model defines.

EVM-specific features

EVM-specific features
FeatureSupportNotes
Gas Gas accounting and out-of-gas behavior. SupportedSupported.Gas costs per hardfork are defined in gas.md and schedule.md.
Source
Gas costs per hardfork are defined in gas.md and schedule.md. source
Storage Persistent contract storage. SupportedSupported.
Source
source
External calls Calls to other contracts, including reentrancy. SupportedSupported.CALL, DELEGATECALL, STATICCALL, CREATE and CREATE2, including nested calls.
Source
CALL, DELEGATECALL, STATICCALL, CREATE and CREATE2, including nested calls. source
Precompiles Built-in contracts such as hashing and elliptic-curve operations. PartialPartial.Precompiles at addresses 1 to 17 (up to Prague's BLS12-381 operations) are defined, but the cryptography is not written in K: it calls a native library (blockchain-k-plugin) and is computed only when the inputs are concrete. Osaka's P256VERIFY precompile (EIP-7951) is missing.
Source
Precompiles at addresses 1 to 17 (up to Prague's BLS12-381 operations) are defined, but the cryptography is not written in K: it calls a native library (blockchain-k-plugin) and is computed only when the inputs are concrete. Osaka's P256VERIFY precompile (EIP-7951) is missing. source

Used by

Toolchains in this index whose proofs are about this model.

  • Kontrol Write properties as Foundry tests in Solidity; Kontrol checks them for all inputs by symbolically running the compiled EVM bytecode on KEVM.

Sources

esc