Skip to main content

Module: utils

Functions

getMerkleProof

getMerkleProof(block, txHash, forWitness?): Object

Retrieve a Merkle proof for a Bitcoin transaction from a block's raw data.

Parameters

NameTypeDescription
blockBlockThe Bitcoin block containing the transaction.
txHashstringThe transaction hash to construct a proof for.
forWitness?booleanSet to true to construct a witness proof (default is false).

Returns

Object

An object containing the position, proof, and root of the Merkle proof.

NameType
posany
proofstring
rootstring

Defined in

utils.ts:166