bdk_chain::bitcoin

Module sighash

Expand description

Signature hash implementation (used in transaction signing).

Efficient implementation of the algorithm to compute the message to be signed according to Bip341, Bip143 and legacy (before Bip143).

Computing signature hashes is required to sign a transaction and this module is designed to handle its complexity efficiently. Computing these hashes is as simple as creating SighashCache and calling its methods.

Structs§

  • The Annex struct is a slice wrapper enforcing first byte is 0x50.
  • Integer is not a consensus valid sighash type.
  • Hash of a transaction according to the legacy signature algorithm.
  • This type is consensus valid but an input including it would prevent the transaction from being relayed on today’s Bitcoin network.
  • A single prevout was been provided but all prevouts are needed without ANYONECANPAY.
  • The number of supplied prevouts differs from the number of inputs in the transaction.
  • Information related to the script path spending.
  • Hash of a transaction according to the segwit version 0 signature algorithm.
  • Efficiently calculates signature hash message for legacy, segwit and taproot inputs.
  • Error returned for failure during parsing one of the sighash types.
  • Using SIGHASH_SINGLE requires an output at the same index as the input.
  • Taproot-tagged hash with tag "TapSighash".
  • The tag used for TapSighash

Enums§