Skip to content

Standard Scripts & Address Types (P2PK → P2TR)

People say “send Bitcoin to this address,” but Bitcoin has no concept of an address at the protocol level — only outputs with locking scripts. An address is a user-facing shorthand: a compact, error-checked encoding that tells a sender’s wallet which kind of lock to build and what to put in it. This page traces the standard lock shapes from the original P2PK to modern Taproot, and shows what each address string actually commits to.

An address is a commitment to a locking script

Section titled “An address is a commitment to a locking script”

When you hand someone an address, you are really saying: “build an output whose scriptPubKey is of type X, committing to my key/script Y.” The wallet decodes the address, recognizes the type from its prefix and encoding, and constructs the matching lock. The address never travels onto the chain — only the scriptPubKey it described does.

address (you give this out)
│ decode + error-check
"type + committed key/script hash"
│ wallet builds
scriptPubKey (this is what's stored on-chain)

Two encodings dominate. Base58Check (legacy, leading 1 or 3) and Bech32 / Bech32m (SegWit and Taproot, bc1...). The encoding details — checksums, character sets, why typos are caught — live in addresses & encoding.

Each new type was introduced to fix a shortcoming of the last: smaller, safer, more private, or more flexible.

The original. The lock is simply <pubKey> OP_CHECKSIG — “sign for this exact public key.” It has no short address form (the raw key is large) and exposes the public key on-chain immediately. Used in the earliest blocks; essentially obsolete today.

The classic 1... address. The lock commits to the hash of the public key: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG. Smaller than P2PK and the raw key stays hidden until spending. This is the script we stepped through.

The 3... address. Instead of committing to a key, the lock commits to the hash of an entire redeem script: OP_HASH160 <scriptHash> OP_EQUAL. The spender later reveals the full script and satisfies it. This is what made complex locks (multisig, escrow) usable as ordinary-looking addresses — the sender doesn’t need to know or pay for the complicated script; the recipient reveals it only when spending.

P2WPKH — Pay to Witness-Public-Key-Hash (SegWit v0)

Section titled “P2WPKH — Pay to Witness-Public-Key-Hash (SegWit v0)”

The bc1q... address. Functionally P2PKH, but the unlocking data (signature + key) moves into the witness rather than scriptSig. This fixed transaction malleability and made the signature cheaper, because witness bytes are discounted when computing transaction weight. (Its sibling P2WSH is the SegWit version of P2SH for arbitrary scripts.)

The bc1p... address. Taproot commits to either a single (Schnorr) public key or a hidden tree of alternative spending scripts — and lets the common “just one key” case look identical to any other Taproot spend on-chain, revealing the extra scripts only if they’re used. The result is better privacy and cheaper, more flexible contracts. The cryptography (Schnorr signatures, key aggregation) is covered in Taproot, Schnorr & MuSig.

TypeAddress prefixEncodingCommits toIntroduced for
P2PK(no address)a raw public keythe original coinbase payouts
P2PKH1...Base58Checkhash of a public keysmaller addresses, hide key until spend
P2SH3...Base58Checkhash of a redeem scriptarbitrary locks as simple addresses
P2WPKHbc1q...Bech32hash of a public key (in witness)malleability fix, cheaper signatures
P2WSHbc1q... (longer)Bech32hash of a witness scriptSegWit version of P2SH
P2TRbc1p...Bech32ma Schnorr key or script treeprivacy, flexibility, cheaper contracts

How do address types help untrusting strangers agree on one ledger? An address compresses “here is exactly the lock to put on my coins, with a checksum so you can’t get it wrong” into a string a stranger can paste. The sender doesn’t need to trust the recipient about how the funds will be guarded — the address itself, once decoded, fully and verifiably specifies the on-chain scriptPubKey that every node will independently enforce. And because each new type is a backward-compatible soft fork, the network can adopt better locks over time while every node — old or new — still agrees on one history. The address is the handshake; the script is the contract; consensus is the enforcement.

  1. Why does Bitcoin have “no addresses” at the protocol level, and what does an address actually encode?
  2. What does P2SH commit to that P2PKH does not, and why was that useful?
  3. What changed between P2PKH and P2WPKH, and which two problems did the change address?
  4. Match each prefix — 1..., 3..., bc1q..., bc1p... — to its script type.
  5. How do soft forks let Bitcoin introduce new address types without splitting the ledger?