bitcoin-scripts
Installation
SKILL.md
Bitcoin Script
Quick refs: opcodes.md, output-types.md, tapscript.md
Bitcoin Script is a stack-based, non-Turing-complete (no loops), forth-like language. Each opcode pushes/pops bytes from a stack. Validity = stack contains a single non-zero element after execution.
Execution model
- Initialize empty stack.
- Concatenate
scriptSig + scriptPubKey(legacy) — execute serialized. (Disabled post-BIP16 P2SH for the segwit/taproot path.) - (For SegWit/Taproot) Witness stack pushes are pre-loaded onto the
stack, then
scriptPubKey(or witness script) executes. - After execution: top of stack must be non-zero / true.