Glossary | Locking Script

Locking Script scriptPubKey

A locking script is a Script you put on an output to prevent others from spending it.


You can use any combination of OP_codes you want when creating a locking script, which allows you to lock up your outputs in different ways.


1. Lock to an Address. (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.

2. Lock to a hash value. (pay-to-script-hash)

a91410b0ed2d1698ff0f0ea151cf41988d05b728746a87 OP_HASH160 10b0ed2d1698ff0f0ea151cf41988d05b728746a OP_EQUAL
hex | opcodes

2. Lock to multiple addresses.

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

By Greg Walker,

Last Updated: Mar 11 2018
  • Mar 11 2018: Glossary | Public Key