Travelling to block #--- #---
0
HODL tight!

Script

Protocol

This term is part of the Bitcoin glossary — See all terms

Script is Bitcoin's tiny programming language: the set of rules attached to each output that says who is allowed to spend it next.

Every transaction output carries a small script — a locking script — that poses a question, and whoever spends it must provide an unlocking script with the answer. The classic form asks for a signature from a specific key: prove you control this address and you may spend. More elaborate scripts can require several signatures, a time delay, or the preimage of a hash.

Bitcoin deliberately keeps its language tiny and not Turing-complete, so scripts always terminate and can never run forever or eat up memory. You will see the common shapes written as P2PKH, P2WPKH and P2TR — pay to public key hash, its SegWit version and the Taproot version — which are just different answers to the same question of who can spend this.

Last blocks