Skip to main content
Ethereum addresses are 20-byte identifiers for accounts and contracts. The Address primitive provides type-safe construction, validation, EIP-55 checksumming, and contract address derivation.

Overview

Address is a branded Uint8Array type representing Ethereum addresses. It provides compile-time type safety while maintaining zero runtime overhead.

Quick Start

Why keccak256 Must Be Passed Explicitly

Voltaire requires you to pass keccak256 explicitly for checksumming and contract address derivation. This is intentional: Tree-shaking: Keccak256 adds ~5-10 KB to your bundle. By requiring explicit injection, bundlers can eliminate this code entirely if you never use checksum methods. Libraries that hardcode crypto dependencies force you to ship code you may never use. No global crypto dependencies: Voltaire avoids global singletons and hidden imports. Every dependency is explicit in your code, making the dependency graph predictable and auditable. Flexibility: You can inject any keccak256 implementation - the native Zig/WASM version, a pure JS fallback, or a Web Crypto wrapper. Your choice.

API Reference

Constructors

Conversion Methods

Comparison Methods

Validation Methods

Contract Address Derivation

Batch Operations

Constants

Practical Examples

Deriving Contract Addresses

Comparing and Sorting Addresses

ABI Encoding for Contract Calls

Deriving from Keys

Error Handling

Type Safety

The branded type prevents mixing addresses with other byte arrays:

Keccak256

Required for checksumming and contract address derivation

RLP

Required for CREATE address derivation

Signature

Recover addresses from signatures

Branded Types

Type-safe primitives with zero overhead