Script
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access