Expand description
This module provides utility functions for working with Utreexo proofs.
These functions can be used, for example, when verifying if a mempool transaction is valid; to consume a block (delete transactions included in it from the mempool); or to validate a block.
Structs§
- Utreexo
Leaf Error - Error while reconstructing a leaf’s scriptPubKey, returned by
process_proof.
Enums§
- Leaf
Error Kind - Errors that may occur while reconstructing a leaf’s scriptPubKey.
Functions§
- get_
block_ adds - From a block, gets the roots that will be included on the acc, certifying that any utxo will not be spent in the same block.
- get_
script_ type - This function returns the scriptPubKey type (i.e. address type) of a given script data. It can be:
- process_
proof - This function processes a proof of inclusion for a given block.
It takes a
UData, a slice of transactions, the block height, and a function to get the block hash. It returns a Result containing a Proof, a vector of deleted hashes, and aUtxoMap, which is defined asHashMap<OutPoint, UtxoData>. - reconstruct_
leaf_ data - Reconstructs the leaf data from a CompactLeafData, the UTXO’s block hash, and its spending tx input.
- reconstruct_
script_ pubkey - Reconstructs the output script, also called scriptPubKey, from a CompactLeafData and the spending tx input. Returns an error if we can’t reconstruct the script (the input doesn’t contain the required data).