← Back to Bitcoin Improvement Proposals
BIPinformationaltransactions

BIP-346: correct TxFieldSelector index upper bound

Previously `parse_inout_selection` only rejected indices strictly greater than `nb_items`, allowing `idx == nb_items` to pass through and later cause a panic when indexing transaction inputs/outputs. Tightened the bounds check in `parse_inout_selection` to treat `idx >= nb_items` as out of bounds, enforcing the intended `0..nb_items-1` index range for `TxFieldSelector` individual mode.

No reviews
yyhrnk·Updated Feb 11, 2026·0 reviews·0 attestations·View source
Collections:BIPs — Open

Specification

Previously parse_inout_selection only rejected indices strictly greater than nb_items, allowing idx == nb_items to pass through and later cause a panic when indexing transaction inputs/outputs.

Tightened the bounds check in parse_inout_selection to treat idx >= nb_items as out of bounds, enforcing the intended 0..nb_items-1 index range for TxFieldSelector individual mode.

Discussion (0 threads)

Sign in to start a discussion on this spec.