Try it Live
Run Address examples in the interactive playground
Checksummed
EIP-55 checksummed address type providing mixed-case format for display and integrity verification.Overview
Checksummed is a branded hex string type representing an Ethereum address with EIP-55 checksum encoding. Unlike AddressType (a Uint8Array), Checksummed is a string with mixed casing that encodes integrity verification in the character case.
Key characteristics:
- Type: Branded string (not
Uint8Array) - Format: Mixed-case hex (e.g.,
0x742d35Cc6634C0532925a3b844Bc9e7595f51e3e) - Use cases: UI display, user input validation, QR codes, wallet integrations
- Validation: Checksum encodes keccak256 hash for detecting typos
Type Definition
Hex.Sized<20>.
Defined in: primitives/Address/AddressType/ChecksumAddress.js:8
ChecksumAddress API
- Standard API
- Tree-Shakeable Factory
ChecksumAddress.from(value)
Create checksummed address from any input format.Parameters:value: number | bigint | string | Uint8Array- Input to convert
Checksummed - EIP-55 checksummed hex stringNote: Uses keccak256 internally. Import keccak256 hash function to use this API.Defined in: primitives/Address/AddressType/ChecksumAddress.js:23Example:- Standard API
- Tree-Shakeable Factory
ChecksumAddress.isValid(str)
Validate EIP-55 checksum of address string.Parameters:str: string- Address string to validate
boolean - true if checksum is validNote: Uses keccak256 internally. Import keccak256 hash function to use this API.Defined in: primitives/Address/AddressType/ChecksumAddress.js:63EIP-55 Logic:- If all letters same case (all lower OR all upper), valid
- If mixed case, each letter’s case must match keccak256-based checksum
- Zero address with all same case always valid
EIP-55 Checksum Algorithm
The checksum encodes integrity verification in hexadecimal character casing:- Convert address to lowercase hex (without
0xprefix) - Compute keccak256 hash of lowercase hex string
- For each hex character:
- If character is a letter (a-f):
- If corresponding hash nibble >= 8: uppercase
- Otherwise: lowercase
- If character is a digit (0-9): unchanged
- If character is a letter (a-f):
Use Cases
UI Display
Display addresses with integrity verification:User Input Validation
Validate user-provided addresses and detect typos:QR Codes
Use checksummed addresses in QR codes for error detection:Wallet Integrations
Wallets expect checksummed addresses:Storage
Store addresses with checksums for verification on retrieval:Comparison with Other Formats
Example Walkthrough
- Lowercase hex:
5aaeb6053f3e94c9b9a09f33669435e7ef1beaed - Keccak256 hash of lowercase:
ce1b9e8e5e10a90a16c6c3ae3f56c5cf99d82e39c703c1a2adcdf2bd7ad9d685 - For each letter character:
aat position 1: hash nibble =c(12) >= 8 →Aaat position 2: hash nibble =e(14) >= 8 →Aeat position 3: hash nibble =1(1) < 8 →e- And so on…
Performance
Time complexity: O(n) where n = 20 bytes (constant time) Overhead: One keccak256 hash computation For repeated conversions, consider caching:Bundle Size Considerations
Tree-shaking:ChecksumAddress.From({ keccak256 })→ Crypto dependencies explicit - only bundled if importedChecksumAddress.IsValid({ keccak256 })→ Crypto dependencies explicit - only bundled if importedAddress.toLowercase()→ No crypto dependenciesAddress.toUppercase()→ No crypto dependencies
Related
- Address - Main Address class documentation
- toChecksummed - Convert address to checksummed format
- isValidChecksum - Validate EIP-55 checksum
- Variants - Overview of all address variants
- AddressType - Functional API and tree-shaking
- EIP-55: Mixed-case checksum - Specification
- Keccak256 - Keccak256 hash function

