Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Tevm Logo
Native Ethereum Node for TypeScript

Embed the native ZEVM engine directly in Node.js — with a viem-compatible client, HTTP/WebSocket/IPC servers, opcode tracing, and direct Solidity imports.

pnpm add tevm viem
import { createMemoryClient, parseAbi } from 'tevm'
 
const client = createMemoryClient()
try {
  // Deploy a minimal contract that returns 42
  const deployed = await client.tevmDeploy({
    bytecode: '0x600a600c600039600a6000f3602a60005260206000f3',
  })
 
  // Call it with typed ABI decoding, or use any viem public/wallet/test action
  const result = await client.tevmContract({
    address: deployed.createdAddress!,
    abi: parseAbi(['function answer() view returns (uint256)']),
    functionName: 'answer',
  })
 
  console.log(result.data) // 42n
} finally {
  await client.tevmClose()
}

In-Process Native Engine

Runs ZEVM, Voltaire, and Guillotine Mini over Node-API. Each client owns isolated chain state with no external daemon.

Architecture →

Viem & Ethers Native

Full viem public, wallet, and Anvil test actions out of the box, plus TevmProvider for ethers v6.

Viem tutorial →

Lazy Mainnet Forking

Fork any EVM RPC at a pinned block. State loads lazily on cache miss; local writes never leave your process.

Forking guide →

HTTP, WebSocket & IPC

Expose any local client over HTTP, WebSocket subscriptions, or Unix IPC for browser apps and external tools.

Server guide →

Direct Solidity Imports

Import .sol files as typed TypeScript modules in Vite, Rollup, esbuild, Webpack, Rspack, and Bun.

Bundler tutorial →

Native Tracing & MCP

Record opcode traces with debug_traceCall or give AI coding agents isolated EVM sessions via @tevm/mcp.

Tracing & events →
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.

"If you're building a blockchain application on the web, I'm almost certain there is a use case for Tevm. It might change everything, and at worse it would most likely improve your devX."

Plain-text docs for LLMs: llms.txt · llms-full.txt