Reviewed Aug 2026
DE
BA-06 · LESSON 01

Stack-machine execution

KEY DEFINITIONS

Terms used in this lesson

OP_ADD
A Bitcoin Script operation that removes two script numbers and pushes their sum.
OP_EQUAL
A Bitcoin Script operation that compares two byte strings and pushes true or false.
Witness
Signatures, scripts, or other data supplied to satisfy a Bitcoin output’s spending condition.
OP_VERIFY
A Bitcoin Script operation that consumes a value and immediately fails if it is false.
SegWit
Segregated Witness: a Bitcoin upgrade that separates authorization data from the transaction identifier and introduces versioned witness programs.
Tapscript
The version of Bitcoin Script used by a Taproot script-path spend.
UTXO
Unspent transaction output: one discrete chunk of bitcoin that can be used as a transaction input.

Script is a deliberately constrained stack language whose success depends on final truth and consensus limits.

35 min Difficulty 2/5 Not started

Loading lesson visuals...

01

Learn the idea

Bitcoin Script is a stack-based language for evaluating whether a transaction input satisfies the output it spends. A stack is a last-in, first-out list of byte strings. An opcode is an instruction that pushes, removes, compares, or verifies stack items. The applicable Script rules succeed only when execution finishes without error and with the required true result.

GUIDED EXPLANATION1/5 ideas inspected
1

Load unlocking data

For modern outputs, witness items are placed on the initial stack in their serialized order under the witness-program rules.

Inspect each idea before the worked example.
The worked example follows the explanation

Inspect every idea above to open it.

Important distinctionBitcoin Script executes once when an output is created.

The output commits a condition. The relevant script is evaluated later by validating nodes when a transaction attempts to spend that output.

02
FINISH LEARNING FIRST

The questions unlock after every required learning activity

Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.