ScriptPubKey
The scriptPubKey is the locking script placed on every bitcoin transaction output, defining the conditions that must be met to spend it. A typical native SegWit output locks funds with a script of just 22 bytes, committing to a hash of the owner's public key. What users see as an address is simply a human-readable encoding of a scriptPubKey.
Why it matters
Bitcoin does not track accounts or owners; it tracks unspent outputs, each guarded by its scriptPubKey. Ownership of bitcoin is precisely the ability to satisfy these scripts, nothing more. The design makes ownership programmable: the same field that usually demands one signature can instead demand several, enforce a waiting period, or commit to an entire tree of alternative conditions, which is the foundation for multisig custody, inheritance schemes, and layer two protocols.
How it works
When a wallet creates a payment, it converts the recipient's address into the corresponding scriptPubKey and writes it into the new output. To spend later, the recipient's wallet supplies unlocking data, in the scriptSig for legacy outputs or the witness for SegWit outputs, and every validating node executes the script to confirm the conditions are met. Standard patterns have evolved over time, from pay-to-public-key-hash addresses beginning with 1, through pay-to-script-hash beginning with 3, to bech32 SegWit and Taproot outputs beginning with bc1, each a different template for the same locking mechanism.
Related Terms
Ready to convert your gold to Bitcoin?
Get Your Free Kit →