I looked at coinstring.js but it looks like it only validates simple BTC addresses (1-prepended addresses).

isValid(base58str, version)

Validates whether the address string or wallet import format string is valid.

base58str: A string that is either the wallet import format or public address.

version: Is an integer representing the version or Buffer. See below for more information.

Returns a true or false.

I'm looking for a JS library that can validate BIP16 P2SH addresses.


1 Answer 1


You can use the library you've linked.

Instead of using:

isValid(address, 0)


isValid(address, 5)

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.