BSV.Tokens.Template.StasBtg (bsv_sdk v1.5.0)

Copy Markdown View Source

STAS-BTG unlocking script template (Path A — BTG proof).

Produces unlocking scripts: <sig> <pubkey> <prefix> <output> <suffix> OP_TRUE

Summary

Functions

Estimated unlocking script length including BTG proof data.

Sign a STAS-BTG input using Path A (BTG proof), producing <sig> <pubkey> <prefix> <output> <suffix> OP_TRUE.

Create a STAS-BTG Path A (BTG proof) unlocker from a private key and previous raw transaction.

Types

t()

@type t() :: %BSV.Tokens.Template.StasBtg{
  prev_raw_tx: binary(),
  prev_vout: non_neg_integer(),
  private_key: BSV.PrivateKey.t(),
  sighash_flag: non_neg_integer()
}

Functions

estimate_length(stas_btg, tx, input_index)

Estimated unlocking script length including BTG proof data.

sign(stas_btg, tx, input_index)

Sign a STAS-BTG input using Path A (BTG proof), producing <sig> <pubkey> <prefix> <output> <suffix> OP_TRUE.

unlock(key, prev_raw_tx, prev_vout, opts \\ [])

@spec unlock(BSV.PrivateKey.t(), binary(), non_neg_integer(), keyword()) :: t()

Create a STAS-BTG Path A (BTG proof) unlocker from a private key and previous raw transaction.