Expand description
Script chunk parsing for extracting data pushes and opcodes. Script chunk parsing and encoding.
A script chunk is either an opcode or a data push with its associated bytes. This module handles decoding raw script bytes into structured chunks and encoding push data with the correct OP_PUSHDATA prefix.
Structs§
- Script
Chunk - A single parsed element of a Bitcoin script.
Functions§
- decode_
script - Decode raw script bytes into a vector of
ScriptChunkvalues. - encode_
push_ datas - Encode multiple data payloads into a single byte vector with push prefixes.
- push_
data_ prefix - Compute the OP_PUSHDATA prefix bytes for a data payload of the given length.