Validate a mixed-case Ethereum address before importing it

A spreadsheet can preserve all 40 address digits and still corrupt a checked address by changing one letter’s case. Validate the original string before normalizing it for a database key.

Try a published test vector

Pass the following address through your checksum encoder. Preserve the incoming spelling separately for comparison.

0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359

The encoder hashes the lowercase hexadecimal text without its prefix using Keccak-256. Each letter becomes uppercase when its corresponding hash nibble is at least eight. Changing the first uppercase B in this example to lowercase must fail a strict comparison.

Choose how to handle lowercase imports

A completely lowercase export has already discarded the checksum signal. You can encode and display a checksummed copy, but this cannot recover a mistyped digit. Keep the network alongside the address because this checksum does not identify a chain. eips.ethereum.org ERC-55