zabi-rs
The fastest, zero-allocation EVM ABI decoder for Rust.
zabi-rs is designed for high-performance applications (MEV bots, indexers, embedded devices) where every microsecond and byte of memory counts. It decodes EVM ABI data by validating and wrapping the raw specific byte slices, avoiding Vec and String allocations entirely.
β‘ Features
- Zero Allocation: No heap allocations (
malloc) during decoding. - no_std Compatible: Ready for embedded, WASM, and kernel-mode usage.
- Safe & Fast: heavily audited
unsafepointer arithmetic wrapped in safe APIs. - Ecosystem Ready: Drop-in compatible with
alloy-primitivestypes (optional).
π Quick Start
[]
= "0.0.13"
use ;
ποΈ Performance
zabi-rs is orders of magnitude faster than traditional decoders because it skips the parsing/allocation phase.
| Benchmark | zabi-rs | alloy-rs | ethers-rs |
|---|---|---|---|
| Uint256 | ~0.9 ns | ~27 ns | ~78 ns |
| Simple Tuple | ~7.8 ns | ~63 ns | ~121 ns |
| Large Array | ~2.5 ns | ~831 ns | ~5,170 ns |
> Benchmarks run on M2 Air. See benches/ for details.
π Documentation
πΊοΈ Roadmap
Check out docs/roadmap.md for future plans (Zero-Copy Encoding, WASM).
License
MIT