Back to browse
GitHub Repository

Zig Ethereum client library. Faster than alloy.rs on 20/26 benchmarks.

73 starsC

Eth.zig – Pure Zig Ethereum library, 19/26 benchmark wins vs. alloy.rs

by kookamo·Feb 27, 2026·2 points·0 comments

AI Analysis

●●●BangerWizardrySlick

Zig comptime crypto library outperforms Rust's backed-by-Paradigm standard on 19/26 benchmarks.

Strengths
  • Rigorous benchmark comparison: 1.37x–4x wins on core ops (u256 div, ABI encode)
  • Pure Zig crypto stack (secp256k1, Keccak, BIP-32/39/44) eliminates FFI fragility
  • Comptime function selectors and event topics zero cost at runtime
Weaknesses
  • Zig ecosystem adoption minimal vs. Rust/Go; doesn't displace alloy.rs yet
  • Loses on secp256k1 signing due to Rust's precomputed EC tables (architectural trade-off)
  • Production maturity unclear; Paradigm's alloy backed by enterprise funding
Target Audience

Zig developers, Ethereum dapp builders, performance-critical blockchain applications

Similar To

alloy.rs · ethers.js · web3.py

Post Description

Hi HN, 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: https://ethzig.org Repo: https://github.com/StrobeLabs/eth.zig Benchmarks: https://github.com/StrobeLabs/eth.zig/blob/main/bench/RESULT...

Would love feedback, especially from Zig and Ethereum devs

Similar Projects

AI/ML●●●Banger

MicroGPT-C – C99 GPT for Edge Training and Tiny Model Pipelines

Karpathy's microgpt in C99, proves tiny coordinated models beat single large models on logic.

WizardryBig Brain
Ajay__soni
103mo ago