Skip to main content

Module check

Module check 

Source
Expand description

Transaction checks.

Code in this file can freely assume that no pre-V4 transactions are present.

Constants§

MAX_P2SH_SIGOPS
The maximum number of signature operations in the redeem script of a standard P2SH input.
MAX_STANDARD_SCRIPTSIG_SIZE
The maximum size in bytes of the scriptSig of a standard transaction input.

Functions§

are_inputs_standard
Returns true if all of a transaction’s transparent inputs are standard.
check_for_duplicates 🔒
Check for duplicate items in a collection.
coinbase_expiry_height
Returns Ok(()) if the expiry height for the coinbase transaction is valid according to specifications 7.1 and ZIP-203.
coinbase_orchard_component_empty
Checks that a coinbase transaction has an empty Orchard component from NU6.3 onward.
coinbase_outputs_are_decryptable
Checks compatibility with ZIP-212 shielded Sapling and Orchard coinbase output decryption
coinbase_tx_no_prevout_joinsplit_spend
Check that a coinbase transaction has no PrevOut inputs, JoinSplits, or spends.
consensus_branch_id
Checks the nConsensusBranchId field.
count_script_push_ops 🔒
Count the number of push operations in a script.
disabled_add_to_sprout_pool
Check if a transaction is adding to the sprout pool after Canopy network upgrade given a block height and a network.
extract_p2sh_redeemed_script 🔒
Extract the redeemed script bytes from a P2SH scriptSig.
has_enough_ironwood_flags
Checks that a transaction with Ironwood actions has at least one Ironwood flag set.
has_enough_orchard_flags
Checks that the transaction has enough orchard flags.
has_inputs_and_outputs
Checks that the transaction has inputs and outputs.
joinsplit_has_vpub_zero
Check if JoinSplits in the transaction have one of its v_{pub} values equal to zero.
lock_time_has_passed
Checks if the transaction’s lock time allows this transaction to be included in a block.
mempool_standard_input_scripts
Standardness (policy) checks on a mempool transaction’s transparent input scripts, applied before the transaction is dispatched to script verification. The goal is to avoid the expensive verification for non-standard transactions which would be rejected anyway by Storage::reject_if_non_standard_tx(); this is a subset of the checks in that function.
non_coinbase_expiry_height
Returns Ok(()) if the expiry height for a non coinbase transaction is valid according to specifications 7.1 and ZIP-203.
orchard_cross_address_disabled
Checks that the Orchard pool does not enable cross-address transfers (NU6.3 onward).
orchard_value_balance_non_negative
Checks that no net new value is shielded into the Orchard pool from NU6.3 onward.
script_sig_args_expected 🔒
Returns the expected number of scriptSig arguments for a given script kind.
spend_conflicts
Check if a transaction has any internal spend conflicts.
standard_script_kind
Classify a script using the zcash_script solver.
tx_transparent_coinbase_spends_maturity
Accepts a transaction, block height, block UTXOs, and the transaction’s spent UTXOs from the chain.
validate_expiry_height_max 🔒
Checks that the expiry height of a transaction does not exceed the maximal value.
validate_expiry_height_mined 🔒
Checks that a transaction does not exceed its expiry height.