Skip to main content
Voltaire, Viem, and Ethers.js are all popular Ethereum libraries. This page compares how to perform common operations across all three libraries.

Address Operations

Creating and Checksumming Addresses

Keccak256 Hashing

Hashing Strings and Bytes

ABI Encoding & Decoding

Function Calls

Event Logs

Key Differences

Skills vs Library Abstractions

The biggest philosophical difference between Voltaire and other libraries is how higher-level abstractions are delivered. Ethers.js and Viem provide monolithic abstractions as library exports:
These abstractions are excellent “off-the-rack” solutions, but they come with trade-offs:
  • Rigidity — Can’t easily modify internals (caching, retry logic, error handling)
  • Bundle bloat — Include features you don’t use
  • Security surface — More code means more potential vulnerabilities
Voltaire takes the shadcn/ui approach with Skills:
Skills are copyable reference implementations you own. We provide ethers-style, viem-style, and React Skills—use them as-is or customize for your contracts.
Use the Voltaire MCP Server to have AI generate custom Skills tailored to your specific contracts and requirements.

Type System

Voltaire uses branded types for compile-time type safety with zero runtime overhead:
Viem uses template literal types for compile-time format checking:
Ethers.js uses plain strings with runtime-only validation:
In Voltaire, the branded type signature proves the value was already runtime validated - if you have an Address, it’s guaranteed valid.

Tree-Shaking

Voltaire provides granular tree-shakeable imports but primarily documents a simpler class-based API:
Viem has tree-shakeable functions by default:
Both Voltaire and Viem use ox under the hood, amortizing bundle cost if you use both libraries. Ethers.js v6 improved tree-shaking but still bundles more:

WASM Acceleration

Voltaire provides optional WASM acceleration for performance-critical operations. In some cases like Keccak256, the WASM version is both faster and smaller than the JavaScript implementation:
Viem and Ethers.js use JavaScript implementations only.

See Also