Skip to main content

Module templates

Module templates 

Source
Expand description

Structural script-template scanner.

Matches frequent script shapes (unexecuted IF + CHECKSIG remainder, OP_RETURN prefixes, data-like n-of-m). Matching a template is not a protocol change and does not interpret application-layer meaning.

Enums§

ScriptTemplate
Parse result for a single script (spans live here, not on policy labels).
UnexecIfRemainder

Constants§

NULLDATA_CNTRPRTY
Known OP_RETURN payload prefixes (bytes after the push opcode, not brand names).
NULLDATA_OMNI
NULLDATA_OTS
OpenTimestamps Bitcoin attestation tag (TimeAttestation.TAG).

Functions§

scan
Scan one script (tapscript, scriptPubKey, or witness element).
scan_tx
Classify a transaction: witnesses first, then outputs. First non-Unknown wins.
scan_witness
Scan each witness element; first non-Unknown wins (UnexecIf is preferred).
try_verify_p2tr_unexec_if_fast_path
P2TR script-path: one UnexecIf + PUSH32 CHECKSIG remainder. Skips the interpreter walk.