BSV.Transaction.Sighash (bsv_sdk v1.1.0)

Copy Markdown View Source

BIP-143 style signature hash computation for BSV (with FORKID).

Summary

Functions

calc_preimage(tx, input_index, prev_output_script_bin, sighash_type, satoshis)

@spec calc_preimage(
  BSV.Transaction.t(),
  non_neg_integer(),
  binary(),
  non_neg_integer(),
  non_neg_integer()
) :: {:ok, binary()} | {:error, term()}

Compute the BIP-143 preimage.

signature_hash(tx, input_index, prev_output_script_bin, sighash_type, satoshis)

@spec signature_hash(
  BSV.Transaction.t(),
  non_neg_integer(),
  binary(),
  non_neg_integer(),
  non_neg_integer()
) :: {:ok, <<_::256>>} | {:error, term()}

Compute the signature hash for an input.