What Is a P2PKH Address?

A P2PKH address, short for Pay-to-Public-Key-Hash, is a type of Bitcoin address that originated in the early days of Bitcoin, when the protocol was first developed by its creator, Satoshi Nakamoto.

A P2PKH address always starts with the number 1 and is followed by a unique string of alphanumeric characters. A P2PKH address is typically 34 or 33 characters long but could be as short as 26 characters. It consists of several components, which are structured as follows:

  1. Version byte: A single byte that indicates the address type, which is 0x00 for P2PKH addresses. This results in the address always starting with 1.
  2. Public key hash: A 20-byte hash of the user's public key, generated using the SHA-256 and RIPEMD-160 cryptographic hash functions.
  3. Checksum: A 4-byte error-detection code, created by hashing the version byte and public key hash with the SHA-256 function twice and taking the first four bytes of the result.

These components are combined and encoded using Base58Check encoding, a modified version of the Base58 encoding scheme. Base58Check encoding omits certain characters (0, O, I, and l) to reduce confusion and the chance of errors when entering an address manually.

For example, a P2PKH address might look like this: 1HSsBc7eEMUxcxGnCT3CgSMS2aFPEJA7cJ

As Bitcoin gained popularity, new address types, such as P2SH (Pay-to-Script-Hash) and SegWit (Segregated Witness) addresses, were introduced to improve the system's scalability and efficiency. Nonetheless, P2PKH (Pay-to-Public-Key-Hash) addresses remain widely used, providing a straightforward way for users to send and receive Bitcoin transactions while maintaining privacy and security.