|
|
|
@ -134,7 +134,7 @@ image::images/mbc3_0701.png["input_and_output_scripts"]
|
|
|
|
|
|
|
|
|
|
===== The script execution stack
|
|
|
|
|
|
|
|
|
|
Bitcoin's scripting language is called a stack-based language because it
|
|
|
|
|
Bitcoin's ((("scripts", "stack", id="script-stack")))((("stack", id="stack")))scripting language is called a stack-based language because it
|
|
|
|
|
uses a data structure called a _stack_. A stack is a very simple data
|
|
|
|
|
structure that can be visualized as a stack of cards. A stack has two
|
|
|
|
|
base operations: push and pop. Push adds an item on top of the stack. Pop
|
|
|
|
@ -152,7 +152,7 @@ of +TRUE+ or +FALSE+. For example, +OP_EQUAL+ pops two items from the stack
|
|
|
|
|
and pushes +TRUE+ (+TRUE+ is represented by the number 1) if they are equal
|
|
|
|
|
or +FALSE+ (represented by zero) if they are not equal. Bitcoin
|
|
|
|
|
transaction scripts usually contain a conditional operator, so that they
|
|
|
|
|
can produce the +TRUE+ result that signifies a valid transaction.
|
|
|
|
|
can produce the +TRUE+ result that signifies a valid ((("scripts", "stack", startref="script-stack")))((("stack", startref="stack")))transaction.
|
|
|
|
|
|
|
|
|
|
===== A simple script
|
|
|
|
|
|
|
|
|
|