Skip to main content

Module chunk

Module chunk 

Source
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§

ScriptChunk
A single parsed element of a Bitcoin script.

Functions§

decode_script
Decode raw script bytes into a vector of ScriptChunk values.
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.