What is the reference algorithm for validating a Bitcoin address? I need to validate Bitcoin addresses in an application I'm developing; I have found various code samples for various languages (even on StackOverflow), but none specific for the one I am using (C#); also, all of those samples seem to come from volunteers around the world, but I've been unable to find an "official" reference algorithm for address validation.

This links explains how an address is generated, but even it has some dubious statements, like "this is the most commonly used Bitcoin Address format" at the end of the article; also, it doesn't explain how to actually validate one if you're not doing the address generation.

What is the official, reference algorithm for checking the validity of a Bitcoin address?

Of course, I'm only interested in syntactic validity; I don't care if the address was ever actually used, if it has any Bitcoin balance, or if the user really is in possession of the associated private key.

Please avoid code samples, as they are language-specific; what I'm asking for is a detailed description of the steps required for validation, so that it can be implemented in any language of choice.
Please avoid code samples, as they are language-specific; what I'm asking for is a detailed description of the steps required for validation, so that it can be implemented in any language of choice.


You won't find any documentation other than the wiki which is generally out of date and incorrect, so code samples will have to do. Check the reference client Bitcoin Core, and some of the JavaScript implementations in BitcoinJS. It's not difficult, just base58 encoding with a version byte of 0x01 at the front and a truncated hash at the rear. P2SH transactions have a different version byte but are still valid in the same fashion.