Function isChecksumAddress

  • Checks if the checksum of an address is correct.

    The address has 3 parts in this order:

    • prefix: 1 byte
    • data: 20 bytes
    • checksum: 4 bytes

    checks:

    • It must be "pay to public key hash" (P2PKH). That is prefix 0
    • checksum = first 4 bytes of sha256(sha256(prefix + data))

    See How to generate a bitcoin address step by step.

    Parameters

    • address: string | Uint8Array

    Returns boolean

Generated using TypeDoc