multichain
/index /tools /32 bitcoin-locking-scripts
live

What an address
actually locks.

Templates
05
P2PKH → P2TR
Checksum
Local
Base58Check · bech32(m)
Network
None
zero requests
Auth
None
no wallet, no signup
/32LOCKING SCRIPT EXPLAINER
awaiting input

/reference — the five standard locks

typelocks tospender revealsera
P2PKHkey hash (20 B)sig + pubkey2009 · legacy
P2SHscript hash (20 B)args + redeem script2012 · BIP-16
P2WPKHkey hash (20 B)witness sig + pubkey2017 · SegWit
P2WSHscript hash (32 B)witness args + script2017 · SegWit
P2TRtweaked pubkey (32 B)schnorr sig · or script branch2021 · Taproot

/faq

01

What is a locking script?

Every Bitcoin output carries a small program (the scriptPubKey) that states the conditions for spending it. An address is just a compact, checksummed encoding of one of these programs. Coins are not "in" an address; they are locked by its script.

02

Why do addresses not contain public keys?

Most templates lock to a hash of the key or script rather than the thing itself. That keeps addresses short, and the actual key is only revealed at spend time. Taproot flips this: the address encodes a (tweaked) public key directly.

03

What makes Taproot spends more private?

A key-path spend reveals only a signature, whether the output was a simple wallet or a complex multi-condition contract. Script alternatives live in a Merkle tree and only the branch actually used is ever revealed.

04

Can I derive the address from a script, or vice versa?

Yes, both directions are mechanical: address decodes to a hash or program, which slots into a fixed template. This page does address → script; the Script disassembler decodes any raw script hex, standard or not.