Try it Live
Run Address examples in the interactive playground
Address
Ethereum addresses are 20-byte identifiers for accounts (both externally-owned and contracts). They’re derived from public keys (EOAs) or calculated deterministically during contract deployment.Overview
Address is a specialized brandedUint8Array that extends the 20-byte (Bytes20) type with address-specific semantics, including EIP-55 mixed-case checksumming for error detection and validation.
- Type Definition
Uint8Array (20 bytes). TypeScript enforces type safety through a unique Symbol brand, preventing accidental mixing with other Uint8Arrays while maintaining zero runtime overhead.Developer Experience
Despite being aUint8Array, addresses display formatted in most environments:
Uint8Array.
API Styles
Voltaire offers two API styles for Address:- Class API
- Functional API
- Namespace Import
Quick Start
- Basic Usage
- From Public Key
- Contract Addresses
Practical Examples
See Fundamentals for detailed explanations of address derivation, checksumming, and contract address calculation.API Methods
Constructors
from(value)- Universal constructor from any inputfromHex(hex)- Parse hex string (with or without 0x prefix)fromBytes(bytes)- Create from Uint8Array (must be 20 bytes)fromNumber(value)- Create from bigint or numberfromPublicKey(x, y)- Derive from secp256k1 public keyfromPrivateKey(privateKey)- Derive from private keyzero()- Create zero address (0x0000…0000)
Conversions
toHex(address)- Convert to lowercase hex string with 0x prefixtoChecksummed(address)- Convert to EIP-55 mixed-case checksummed hextoShortHex(address)- Format for display (0x742d…1e3e)toBytes(address)- Return raw Uint8Array
Validation
isValid(value)- Check if value can be converted to addressisValidChecksum(hex)- Verify EIP-55 checksum (case-sensitive)assert(value, options?)- Assert value is valid address, with optional strict checksum validation
Comparisons
equals(a, b)- Check equalitycompare(a, b)- Compare for sorting (-1, 0, 1)
Contract Addresses
calculateCreateAddress(address, nonce)- Calculate CREATE deployment addresscalculateCreate2Address(address, salt, initCode)- Calculate CREATE2 deployment address
Reference
- Fundamentals - Address derivation, checksumming, and deployment
- Usage Patterns - Common patterns and best practices
- AddressType - Type definition and branded type pattern
- Variants - Additional utilities and variants
- WASM - WebAssembly implementation details
Complete API
Types
- AddressType
- AddressLike
- Hex Variants
Uint8Array (20 bytes), TypeScript enforces type safety through Symbol branding.Constants
NATIVE_ASSET_ADDRESS (ERC-7528)
- Representing ETH in token lists alongside ERC-20 tokens
- Multicall operations mixing ETH and token transfers
- DEX interfaces treating ETH as a “token”
Usage Patterns
Validating User Input
Sorting and Deduplicating
Predicting Contract Addresses
Tree-Shaking
Import only what you need for optimal bundle size:Related
- Address (Effect) - Effect.ts integration with Schema validation
- Keccak256 - Keccak256 hashing for address derivation and verification
- Bytes - Fixed-size byte types including Bytes32 for salts
- Uint - Unsigned integer types for address arithmetic
Try It Yourself
Specification References
- EIP-55 - Mixed-case checksum address encoding
- EIP-1014 - CREATE2 opcode and deterministic addresses
- Ethereum Yellow Paper - Address derivation (Section 7)
- Account Model - EOA vs Contract accounts

