A simple, stack-based, Forth-like programming language using "opcodes" to express spending conditions.
Script is used to define how funds may be spent. A script consists of two parts. In a transaction output funds are assigned to a locking script, the scriptPubKey
. The corresponding transaction input provides a method for initializing a stack as input to the scriptPubKey
, the scriptSig
. In segwit output types, the witness encodes the stack directly. The set of commands in Script are referred to as "opcodes".
There are a number of standard scripts and scripts which are defined by an address. These include Pay-to-Public-Key-Hash, Pay-to-Script-Hash, Pay-to-Witness-Public-key-hash, and Pay-to-Witness-Script-Hash.
This tag should be used for questions regarding scripts and opcodes used in transactions.