January 2019
Beginner to intermediate
372 pages
11h 17m
English
Bitcoin uses a similar method of script execution but has a different set of opcodes. Bitcoin transactions use locking and unlocking scripts, which are executed together to verify a transaction. As mentioned earlier, a locking script is a spending condition specified in the transaction output, and an unlocking script satisfies this condition when the two scripts are executed together.
We can create a simple locking and unlocking script by breaking down the previous script example. Part of the script could form a locking script, as shown here:
4 OP_ADD 6 OP_EQUAL
This could only be satisfied by an unlocking script:
2
Any node will validate these scripts by combining and executing the locking and unlocking scripts ...