2

I need to be able to validate BTC addresses. I keep reading how characters 0, O, I, l are not allowed to avoid visual ambiguity.

That said, I've run into a couple of address which contain these characters, and they seem to be fine: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq bc1qvtrafpjnl3ygg2w40eldlq7ggdgg8wuu3nqcxe

So what's going on with these? Do these rules not apply to bc1 address? Are they more of a recommendation than a requirement? Thanks

2 Answers 2

3

There are two different encodings being used for Bitcoin addresses.

Native segwit addresses are encoded using the Bech32(m) encoding. Bech32 uses the 32 symbols 023456789acdefghjklmnpqrstuvwxyz to encode data. On mainnet bitcoin native segwit addresses start with the human readable part bc and the separator 1. The prefix is different on test networks.

All prior addresses use Base58. Base58 uses the numbers from 1-9 (excluding 0) and all letters of the English alphabet in uppercase and lowercase, excluding capital O, capital I, and lowercase l, because 0 and O, as well as I and l are easy to confuse in many fonts. This leaves the 58 symbols: _123456789ABCDEFGH_JKLMN_PQRSTUVWXYZabcdefghijk_mnopqrstuvwxyz. (Omissions are included in the symbol line-up as underscores in case the letters in the text were hard to parse out of context of the order.)

-1

As I understand it, those characters, when lowercase and uppercase, can be confused with numbers or other characters like 0 and o. They really don't have much difference in appearance

1
  • 1
    That is correct, but not an answer to the question. Commented May 9 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.