3 Addresses
This chapter explains how Bitcoin replaces human names with cryptographic identifiers and introduces addresses to balance privacy, efficiency, and user safety. Using the cookie-token spreadsheet narrative, it motivates why visible identities leak sensitive behavior, how pseudonymous identifiers help, and why users need protection against costly typing mistakes when sharing payment details.
The system first swaps names for public keys so payments become pseudonymous and verifiable by signatures. To shrink data and add a security margin, public keys in the ledger are then replaced by 20-byte public key hashes produced as RIPEMD160(SHA256(pubkey)), known as pay-to-public-key-hash (P2PKH). The sender still includes a public key (to verify the signature), while the ledger stores and matches on hashes; this saves space and limits exposure of raw keys but doesn’t by itself improve privacy. To prevent catastrophic typos, users exchange Base58Check-encoded versions of public key hashes called addresses: a version byte + PKH + a 4-byte checksum (double-SHA256) is encoded in a human-friendly alphabet. Wallets decode the address back to the PKH and validate the checksum before creating a payment, making unnoticed errors extremely unlikely.
Even with hashes and addresses, transaction patterns can reveal behavior, so the chapter stresses using a new address for each payment to reduce linkability. Practically, this lets the “Lisa” role verify signatures and balances without managing a names-to-keys registry, while users safely exchange addresses that detect mistakes before funds are sent. The result mirrors real Bitcoin: pseudonymous accounting via PKH, compact identifiers, Base58Check addresses for human use, and the operational best practice of address reuse avoidance to enhance privacy.
Cookie token addresses are exactly the same as Bitcoin addresses. They are mainly used by wallet software.
Replacing the names with public keys. The spreadsheet is now much more unreadable, which is good from a privacy perspective.
New style payment using public keys instead of names.
Faiza creates her public key and gives it to the company. The company creates a payment with Faiza’s public key as the recipient.
. Replace the public keys with the RIPEMD160 hash of the SHA256 hash of the public key.
7. John buys a cookie. The sender is still a public key, but the recipient is a public key hash instead of a public key. Lisa needs to create the public key hash from the public key in order to verify the balance and execute the payment.
Bitcoin addresses.
10 Overview of the base58check encoding which transforms a public key hash into a cookie token address
Base58check encoding John’s public key hash. A version is added to the hash, and then a checksum is created and appended to the versioned hash. Last, the checksummed, versioned hash is base58 encoded.
Encoding John’s versioned and checksummed public key hash with base58. The essential part is where you divide the number by 58 and keep the remainders. The remainders are then mapped one by one in the lookup table.
Base58check decoding is basically done by reversing the base58check encoding. Typing errors are detected when the checksums don’t match.
The names in the spreadsheet has been replaced with public key hashes.
Recap
In this chapter you learned that
- Privacy is important for you, not just for criminals.
- Using public key hashes instead of personal names as recipient for payments is important for privacy and more secure.
- Encoding a PKH as a Bitcoin address, or cookie token address, reduces the risk of sending money into void. The checksum in the address will prevent that.
- Only users care about Bitcoin addresses. The Bitcoin network, or Lisa, deals with plain public key hashes.
- You can have as many Bitcoin addresses as you like. Using multiple addresses, preferably one per received payment, improves your privacy.
Grokking Bitcoin ebook for free