Locking Script
  • Hash256
  • Hash160
  • Reverse Bytes

scriptPubKey The locking mechanism placed on an output.

A scriptPubKey (more easily thought of as a "locking script") is a Script that you put on an output to prevent others from spending it.

Standard Scripts

There are a few set patterns of locking scripts that are commonly used in bitcoin:

1. Pay To Pubkey

4104a9d6840fdd1497b3067b8066db783acf90bf42071a38fe2cf6d2d8a04835d0b5c45716d8d6012ab5d56c7824c39718f7bc7486d389cd0047f53785f9a63c0c9dac 04a9d6840fdd1497b3067b8066db783acf90bf42071a38fe2cf6d2d8a04835d0b5c45716d8d6012ab5d56c7824c39718f7bc7486d389cd0047f53785f9a63c0c9d OP_CHECKSIG
hex | opcodes

2. Pay To Pubkey Hash

76a914fde0a08625e327ba400644ad62d5c571d2eec3de88ac OP_DUP OP_HASH160 fde0a08625e327ba400644ad62d5c571d2eec3de OP_EQUALVERIFY OP_CHECKSIG
hex | opcodes

Details This is the most common locking script. You can only unlock this if you have the private key that corresponds to the public key placed in to the script.

This is the default locking script used when you make a standard bitcoin transaction. In fact, this locking script is used so often you might think that various "locking scripts" weren't a thing.

3. Pay To Multisig

51210378ee11c3fb97054877a809ce083db292b16d971bcdc6aa4c8f92087133729d8b211283b5fbf5cc62d4399dfa1025c3e306295264494722c5085ceadadf1291f6812521a31752c9f17c628edc4c69c4c0846f8d814b21e046eabe06f9968a037ce0741c7453ae OP_1 0378ee11c3fb97054877a809ce083db292b16d971bcdc6aa4c8f92087133729d8b 1283b5fbf5cc62d4399dfa1025c3e306295264494722c5085ceadadf1291f68125 a31752c9f17c628edc4c69c4c0846f8d814b21e046eabe06f9968a037ce0741c74 OP_3 OP_CHECKMULTISIG
hex | opcodes

4. Pay To Script Hash

a91410b0ed2d1698ff0f0ea151cf41988d05b728746a87 OP_HASH160 10b0ed2d1698ff0f0ea151cf41988d05b728746a OP_EQUAL
hex | opcodes


OP_RETURN 68656c6c6f20776f726c64
hex | opcodes

By Greg Walker,

Last Updated: 24 May 2019
  • 24 May 2019: Added Hashover comment system (basic functionality to test it out)
  • 28 Jan 2019: glosarry/nulldata.png - first draft
  • 21 Dec 2018: small wording change
  • 26 Nov 2018: Added sub titles to every page.
  • 25 Nov 2018: Subtitles for pages in Glossary. Looks good.
  • 25 May 2018: glossary/scriptPubKey - updated title and script code styling
  • 18 May 2018: browser/transaction/output - better highlighting of opcodes and data for: p2pk, p2pkh, p2ms, p2sh (incomplete)
  • 18 May 2018: /glossary/p2pk - first draft
  • 26 Apr 2018: Added link to Script page.
  • 11 Mar 2018: Glossary | Public Key

Hey there, it's Greg.

I'll let you know about cool website updates, or if something seriously interesting happens in bitcoin.

Don't worry, it doesn't happen very often.