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
trueif 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
nConsensusBranchIdfield. - 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_scriptsolver. - 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.