Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Runtime model & ZEVM

Tevm and ZEVM share the same native execution engine, packaged for two different workflows:

  • ZEVM is the standalone Zig Ethereum client and native execution library.
  • Tevm embeds ZEVM's NodeRuntime inside Node.js over Node-API and wraps it in TypeScript/viem ergonomics, HTTP/WS/IPC servers, ethers adapters, MCP tooling, and Solidity bundler plugins.
TEVM Runtime Stack
HOST CONSUMERSViem / App / VitestEthers (TevmProvider)Browser (HTTP / WS)AI Agents (@tevm/mcp)MemoryClient (@tevm/memory-client)viem public · wallet · test (Anvil) · tevm* actionscreateMemoryClient() · createTevmTransport()RPC Servers (@tevm/server)HTTP · WebSocket subscriptions · Unix IPC · Express · Next.jscreateServer() · createIpcServer() · createHttpClient()ZevmEngine (@tevm/node) — Node-API / C ABI Boundaryrequest() · rpc(json) · events (request, response, block, close) · ready() · close()Serialized QueueNATIVE ZIG ENGINEZEVMNodeRuntime & RPC dispatcherChain, mempool, mining, filtersSnapshots & fork backendVoltaireAccount & storage stateEthereum primitives & RLPCryptography & precompilesGuillotine MiniNative EVM bytecode interpreterGas accounting & hardforksdebug_traceCall opcode tracer
Your TypeScript code talks to a serialized Node-API bridge. Native Zig code executes EVM bytecode, manages state, and dispatches JSON-RPC.

Ownership split

ComponentOwned byWhat it does
Guillotine MiniNative ZigEVM bytecode execution, hardfork rules (including Prague & Osaka), gas metering, debug_traceCall opcode tracer
VoltaireNative ZigAccount & storage state, Ethereum primitives, RLP, cryptography, standard precompiles
ZEVM (NodeRuntime)Native ZigChain management, mempool, automine/manual/interval mining, receipts, filters, snapshots, state blobs, fork backend, JSON-RPC dispatcher
@tevm/nodeTevm (JS/TS)Node-API handle wrapper (createZevmEngine), serialized request queue, NativeRpcError, EventEmitter, ready() / close()
@tevm/memory-clientTevm (JS/TS)Viem client (createMemoryClient) and transport (createTevmTransport) over ZevmEngine
@tevm/actionsTevm (JS/TS)Browser-safe typed RPC helpers (tevmCall, tevmContract, tevmDeploy, etc.)
@tevm/serverTevm (JS/TS)HTTP, WebSocket subscriptions, Unix IPC, Express, and Next.js transport adapters

Runtime modes in Tevm

1. Local in-process node (default)

createMemoryClient() or createZevmEngine() starts a deterministic local chain at block 0, timestamp 0, chain ID 31337, with 10 prefunded dev accounts and automining enabled.

2. Forked local node

Passing fork: { url, blockNumber } configures ZEVM's fork backend via anvil_reset. State loads lazily from the upstream endpoint at blockNumber; all local mutations, transactions, and mined blocks remain in memory starting at local height 0.

3. Networked server for browsers & external clients

Because the native addon runs in Node.js (>=24) rather than WebAssembly in the browser, browser frontends connect to a local @tevm/server over HTTP or WebSocket using viem's http() or webSocket() transport.

Hardfork activation & deterministic timestamps

Local genesis starts at timestamp 0, independent of wall-clock time. Hardfork rules (such as mainnet Osaka EIP-7939 CLZ, ModExp pricing bounds, and the 16,777,216 transaction gas cap at timestamp 1764798551) activate deterministically when block timestamps cross the chain's activation threshold.

You can test pre-fork and post-fork behavior in the same suite by advancing the timestamp with evm_setNextBlockTimestamp (or viem's setNextBlockTimestamp).

Where to look for native client docs

For standalone Zig CLI usage, light-mode startup checkpoints, or native ZEVM internals, see the ZEVM documentation.

Next: Engine API (ZevmEngine) · Migrating from the JS engine · JSON-RPC reference