BSV-ex v0.4.1 BSV.Transaction.Signature View Source

Module for signing transactions.

Link to this section Summary

Functions

Generates a transaction preimage, suing the given sighash type

Generates a transaction digest for signing, using the given sighash type.

Signs the given transaction input with the given private key.

Link to this section Functions

Link to this function

preimage(tx, index, sighash_type)

View Source
preimage(BSV.Transaction.t(), integer(), integer()) :: binary()

Generates a transaction preimage, suing the given sighash type

Link to this function

sighash(tx, vin, sighash_type)

View Source
sighash(BSV.Transaction.t(), integer(), integer()) :: binary()

Generates a transaction digest for signing, using the given sighash type.

Link to this macro

sighash_all?(sighash_type)

View Source (macro)
Link to this macro

sighash_anyone_can_pay?(sighash_type)

View Source (macro)
Link to this macro

sighash_forkid?(sighash_type)

View Source (macro)
Link to this macro

sighash_none?(sighash_type)

View Source (macro)
Link to this macro

sighash_single?(sighash_type)

View Source (macro)
Link to this function

sign_input(tx, vin, arg, options \\ [])

View Source
sign_input(BSV.Transaction.t(), integer(), binary(), keyword()) ::
  {binary(), integer()}

Signs the given transaction input with the given private key.

Options

The accepted options are:

  • :sighash_type - Optionally specify the sighash type by passing an 8-bit integer. Defaults to SIGHASH_FORKID.