Zig Module Graph
build.zig registers explicit Zig modules so every cross-module import is checked by the build graph:
Always import via registered module names, never relative paths across package boundaries:
Runtime Execution Paths in @tevm/voltaire
@tevm/voltaire ships three entrypoints conforming to the same VoltaireAPI interface:
Platform Matrix
Design Invariants
- Zero-cost nominal types. In TypeScript,
AddressType,HashType,HexType, andUint256Typeare brandedUint8Arrayorstringtypes enforced strictly at compile time. - Validate on construction. Constructors (
Address.from,Hash.fromHex,Hex.from) reject malformed lengths, invalid hex digits, or out-of-range values immediately with typed error classes from@tevm/voltaire/errors. - Explicit Zig allocators. No global hidden heap allocations. Functions needing dynamic buffers accept
allocator: std.mem.Allocatorand transfer ownership to the caller. - Single C ABI surface.
packages/voltaire-zig/src/c_api.zigdefines the exported C symbols and generatesprimitives.h, which feeds Bun FFI, Swift (CVoltaire), Go (CGo), Python, and C consumers from one source of truth.
Related
- Codebase Map — Exact directory and file layout
- Build System — How
build.zig, Cargo, and pnpm fit together - Multi-Language Integration — C ABI, Rust FFI, and vendored C libraries

