What Is Bitcoin Script?
Also known as: Script, Bitcoin Scripting Language
In short
Bitcoin Script is a simple, stack-based and deliberately limited programming language that defines the conditions under which coins in Bitcoin transactions can be spent. It enables features such as multisig and time locks.
Every Bitcoin output is protected by a locking script (scriptPubKey); this script specifies which conditions must be met to spend the coins. The person who wants to spend the coins adds to their transaction an unlocking script (scriptSig or witness data) that satisfies these conditions. Nodes run the two scripts together, and if the result is true, the spend is considered valid. The most common example is the P2PKH script, which requires a valid signature belonging to the recipient's public key.
Script, similarly to the Forth language, pushes data onto a stack and processes it with operation codes (opcodes) such as OP_CHECKSIG and OP_HASH160. It contains no loops and is not Turing-complete; this limitation makes script execution time predictable and protects the network against resource-exhaustion attacks. This structure makes it possible to build multisig wallets, time-locked transactions and the hash time-locked contracts used by the Lightning Network.
Script's capabilities have been extended over the years through soft forks. SegWit moved signature data into a separate field; Taproot introduced Schnorr signatures and structures that reveal only the used portion of complex spending conditions. This design, which is more restricted than Ethereum's general-purpose smart contracts, is the result of a priority on security and simplicity.
Last updated: · This content is for information purposes only and is not investment advice.

