Skip to main content

Module sigop

Module sigop 

Source

Functions§

count_sigops_in_script
Count sigops in a script (legacy counting)
count_tapscript_sigops
Count sigops in a tapscript per BIP 342 (CountTapscriptSigOps).
get_legacy_sigop_count
Get legacy sigop count from transaction
get_legacy_sigop_count_accurate
Legacy sigop count with accurate OP_CHECKMULTISIG (OP_1..OP_16 = 1..16, else 20). Used for BIP54 per-tx 2500 limit to match Core’s GetSigOpCount(fAccurate=true).
get_p2sh_sigop_count
Get P2SH sigop count from transaction
get_transaction_sigop_cost
Get total transaction sigop cost
get_transaction_sigop_cost_with_utxos
Same as get_transaction_sigop_cost but accepts pre-fetched UTXOs in input order. Avoids redundant overlay lookups when caller already has UTXO data.
get_transaction_sigop_cost_with_witness_slices
Same as get_transaction_sigop_cost but accepts per-input witness slices directly. Avoids flattening witness data in block validation hot path.
get_transaction_sigop_count
Get total transaction sigop count (BIP54 limit).
get_transaction_sigop_count_for_bip54
BIP54 per-tx sigop count: legacy (accurate) + P2SH + witness. Matches Core’s CheckSigopsBIP54 (GetSigOpCount(scriptSig, true) for legacy).
is_pay_to_script_hash
Check if a script is P2SH (Pay-to-Script-Hash) — Orange Paper 5.2.1 IsP2SH