January 2019
Beginner to intermediate
372 pages
11h 17m
English
We need to understand the basic execution of the Script language before trying to make sense of the locking and unlocking scripts. Script is simple, a stack-based language that is processed from left to right. It is intentionally not Turing-complete. It doesn't have a complex control flow, such as loops, other than conditions. This makes sure that the program is executed in a predictable time. This was done intentionally to avoid denial-of-service attacks, which create infinite execution loops. The simplicity of the Script language ensures that Bitcoin is not vulnerable to any attacks of this nature.
Script is also stateless, meaning that there is no information stored prior to or after execution. This ensures that execution is not ...