Hands-On Component: P2PKH Address Calculator
Lecture 5 · Wednesday, September 16, 2026
This calculator goes through each step that computes a P2PKH address from a public key.
Testnet4 P2PKH address calculator
Example public key:
03f8a6959facf2896be1d167115e814a330298b91bd32161cef753e6a7cd78d556Expected address:
myofnF2NWgLAwZ6rDhx66LhA7eJkqs3FHZ-
Let
pkbe the public key. -
Compute
h = SHA-256(pk). -
Compute
pkh = RIPEMD-160(h). This is the public-key hash, orHASH160(pk). -
Prepend the Testnet4 version byte:
p = 6f || pkh. -
Compute
c = SHA-256(SHA-256(p)). First SHA-256:Second SHA-256: -
Take the first four bytes of
cas the checksum, then computeb = p || c[0:4].Versioned payload + checksum: -
Compute
address = Base58(b).