An Ethereum library in pure Zig, beats alloy.rs on 19/26 benchmarks

I built eth.zig – a complete Ethereum client library in pure Zig with zero dependencies (no C bindings, no system libraries, just zig build).

It covers ABI encoding, RLP, secp256k1 ECDSA, Keccak-256, BIP-32/39/44 HD wallets, ERC-20/721 wrappers, JSON-RPC (HTTP + WebSocket), ENS, EIP-712, and
Multicall3.

The interesting part: it beats Paradigm’s alloy.rs (Rust) on 19 out of 26 benchmarks. ABI encoding is 1.92x faster, u256 division is 4x faster, Keccak-256 is
1.37x faster. alloy.rs wins on secp256k1 signing (precomputed EC tables) and a few paths where Rust’s sol! macro generates specialized code.

What made this possible is Zig’s comptime – function selectors and event topics are computed at compile time with zero runtime cost. The entire crypto stack
(secp256k1, Keccak-256, BIP-32/39/44) is pure Zig.

Docs
Repo
Benchmarks

Would love feedback, especially from Zig and Ethereum devs.

4 Likes