January 2019
Beginner to intermediate
372 pages
11h 17m
English
Verification of the transaction is performed using an unlocking script and a locking script. Bitcoin uses a simple custom scripting language called Script, which is similar to the stack-based execution language Forth. To validate the transaction, the unlocking script in the input is executed alongside its corresponding locking script. The stack-based execution should return a true value and successfully execute the unlocking script.
In the example, the input's scriptSig and the referenced output's scriptPubKey are evaluated (in that order), with scriptPubKey using the values left on the stack by scriptSig. The input is authorized if scriptPubKey returns true.
Read now
Unlock full access