Back to lessons

Chapter 5 - 0 of 10 quizzes passed

Addresses and Spending Conditions

An address is a spending condition, not an account.

  • Explain how an address is derived for P2PKH, P2WPKH, and P2TR
  • Describe what a checksum protects and why address reuse hurts privacy

From key to address depends on the type

There is no single formula from a public key to an address. For P2PKH, the public key is hashed with HASH160 and encoded in Base58Check. For P2WPKH, the same hash is encoded in Bech32 with a bc1 prefix. For P2TR (Taproot), the key is tweaked and encoded as an x-only public key in Bech32m; there is no hash of the key. Each type is a different spending condition.

Checksums catch mistakes

Addresses include checksums. If you mistype a character, wallet software can usually detect that the address is invalid before broadcasting. The checksum does not recover funds sent to a valid but wrong address, and it does not protect against malware that swaps the address on your screen. Always verify the destination on the signing device.

Addresses are locks

A transaction creates an output locked to a spending condition. The address is a human-readable way to describe that condition. The matching key later provides the signature needed to unlock and spend it. This is why “sending coins to an address” really means “creating an output that this script can spend.”

Reuse and privacy

Reusing one address links every payment to the same owner and makes chain analysis easier. Good wallets generate a fresh address for each payment and may use change outputs that need careful handling. A watch-only wallet can track an extended public key (xpub) without holding the spending keys, which is useful for accounting and for air-gapped setups.

Try it

Regtest demonstration only. Never send funds to this address: anyone who knows this text can recreate its key. Never enter a real seed phrase, private keys or passwords here.

compressed public key025e26ff9ca96d7d42cf31652772a80b70b8dc5aecc2eca2bd1580f25979a184a7
regtest address — never fundbcrt1qqtvyjlkfh9zzdq4cnqj6c5ewd8g6fljcz28hes

What you should take away

An address encodes a spending condition, and the derivation differs by type: hashed keys for P2PKH/P2WPKH, a tweaked x-only key for Taproot. Checksums catch typos, not malice; fresh addresses protect privacy.

Retrieve, then apply

Why use a fresh receiving address, and why is a valid checksum insufficient?

Check your explanation

Reuse links payments. A checksum catches many transcription errors but does not authenticate the recipient. A watch-only wallet can derive addresses but cannot sign.

Checkpoint

Question 1 of 3

An attacker replaces a copied address with another valid address. Will its checksum protect you?

Question 2 of 3

Which address type puts a tweaked public key in the output instead of a hash of the key?

Question 3 of 3

Why use a fresh receiving address for each payment?

Sources

Reviewed 2026-10-25 · not financial advice