Skip to main content

Backtrace

bitcoinjs-lib v0.2.9-beta.16


bitcoinjs-lib / Backtrace

Class: Backtrace

Defined in: packages/scrypt-ts-btc/src/smart-contract/builtin-libs/backtrace.ts:20

Library for verifying backtraces all the way to the genesis point.

Onchain​

Extends​

Constructors​

new Backtrace()​

new Backtrace(...args): Backtrace

Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:29

Parameters​

args​

...SupportedParamType[]

Returns​

Backtrace

Inherited from​

SmartContractLib.constructor

Properties​

args​

args: any[] = []

Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:28

Inherited from​

SmartContractLib.args


artifact​

static artifact: Artifact

Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:15

Inherited from​

SmartContractLib.artifact


stateType?​

static optional stateType: string

Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:16

Inherited from​

SmartContractLib.stateType

Methods​

loadArtifact()​

static loadArtifact(artifact): typeof SmartContractLib

Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:18

Parameters​

artifact​

Artifact

Returns​

typeof SmartContractLib

Inherited from​

SmartContractLib.loadArtifact


verifyChainTxs()​

static verifyChainTxs(backtraceInfo, t_prevTxInputList): ChainTxVerifyResponse

Defined in: packages/scrypt-ts-btc/src/smart-contract/builtin-libs/backtrace.ts:74

Tx chain verification to ensure:

  1. the current spending UTXO is the output of prevTx
  2. the specific input of prevTx is the output of prevPrevTx

Parameters​

backtraceInfo​

BacktraceInfo

backtrace info to verify, including prevTx and prevPrevTx preimages

t_prevTxInputList​

FixedArray\<ByteString, 6>

input list of the prevTx which should be trustable

Returns​

ChainTxVerifyResponse

locking script and outpoint of the specified output of prevPrevTx


verifyFromOutpoint()​

static verifyFromOutpoint(backtraceInfo, t_genesisOutpoint, t_selfScript, t_prevTxInputList): void

Defined in: packages/scrypt-ts-btc/src/smart-contract/builtin-libs/backtrace.ts:30

Back-to-genesis backtrace verification for a contract which can be backtraced to the genesis outpoint. It will be a valid backtraceInfo if the prevPrevOutpoint is the genesis outpoint or the prevPrevScript is the selfScript.

Parameters​

backtraceInfo​

BacktraceInfo

backtrace info to verify, including prevTx and prevPrevTx informations

t_genesisOutpoint​

ByteString

expected genesis outpoint of the contract which usually is a contract property and trustable

t_selfScript​

ByteString

expected self locking script, i.e. this.ctx.spentScript, of the currect spending UTXO context which is trustable

t_prevTxInputList​

FixedArray\<ByteString, 6>

input list of the prevTx which should be trustable

Returns​

void


verifyFromScript()​

static verifyFromScript(backtraceInfo, t_genesisScript, t_selfScript, t_prevTxInputList): void

Defined in: packages/scrypt-ts-btc/src/smart-contract/builtin-libs/backtrace.ts:52

Back-to-genesis backtrace verification for a contract which can be backtraced to the genesis script. It will be a valid backtraceInfo if the prevPrevScript is the genesis script or the selfScript.

Parameters​

backtraceInfo​

BacktraceInfo

backtrace info to verify, including prevTx and prevPrevTx informations

t_genesisScript​

ByteString

expected genensis locking script which usually is a contract property and trustable

t_selfScript​

ByteString

expected self locking script, i.e. this.ctx.spentScript, of the current spending UTXO context and is trustable

t_prevTxInputList​

FixedArray\<ByteString, 6>

input list of the prevTx which should be trustable

Returns​

void