Backtrace
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
Inherited from
Properties
args
args:
any
[] =[]
Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:28
Inherited from
artifact
static
artifact:Artifact
Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:15
Inherited from
stateType?
static
optional
stateType:string
Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:16
Inherited from
Methods
loadArtifact()
static
loadArtifact(artifact
): typeofSmartContractLib
Defined in: packages/scrypt-ts-btc/src/smart-contract/smartContractLib.ts:18
Parameters
artifact
Returns
typeof SmartContractLib
Inherited from
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:
- the current spending UTXO is the output of prevTx
- the specific input of prevTx is the output of prevPrevTx
Parameters
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
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
backtrace info to verify, including prevTx and prevPrevTx informations
t_genesisOutpoint
expected genesis outpoint of the contract which usually is a contract property and trustable
t_selfScript
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
backtrace info to verify, including prevTx and prevPrevTx informations
t_genesisScript
expected genensis locking script which usually is a contract property and trustable
t_selfScript
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