Skip to main content

Module policy

Module policy 

Source
Expand description

Mempool transaction standardness policy checks.

These functions implement zcashd’s mempool policy for rejecting non-standard transactions. They mirror the logic in zcashd’s IsStandardTx() and AreInputsStandard().

Constants§

MAX_P2SH_SIGOPS 🔒
Maximum sigops allowed in a P2SH redeemed script (zcashd MAX_P2SH_SIGOPS). https://github.com/zcash/zcash/blob/v6.11.0/src/policy/policy.h#L20
MAX_STANDARD_MULTISIG_PUBKEYS 🔒
Maximum number of public keys allowed in a standard multisig script. https://github.com/zcash/zcash/blob/v6.11.0/src/policy/policy.cpp#L46-L48
MAX_STANDARD_SCRIPTSIG_SIZE 🔒
Maximum size in bytes of a standard transaction’s scriptSig (zcashd MAX_STANDARD_SCRIPTSIG_SIZE). https://github.com/zcash/zcash/blob/v6.11.0/src/policy/policy.cpp#L92-L99
MAX_STANDARD_TX_SIGOPS 🔒
Maximum number of signature operations allowed per standard transaction (zcashd MAX_STANDARD_TX_SIGOPS). https://github.com/zcash/zcash/blob/v6.11.0/src/policy/policy.h#L22

Functions§

are_inputs_standard 🔒
Returns true if all transparent inputs are standard.
count_script_push_ops 🔒
Count the number of push operations in a script.
extract_p2sh_redeemed_script 🔒
Extract the redeemed script bytes from a P2SH scriptSig.
p2sh_redeemed_script_sigop_count 🔒
Extracts the P2SH redeemed script’s sigop count for a single input.
p2sh_sigop_count 🔒
Returns the total number of P2SH sigops across all inputs of the transaction.
script_sig_args_expected 🔒
Returns the expected number of scriptSig arguments for a given script kind.
standard_script_kind 🔒
Classify a script using the zcash_script solver.