▪️Build on Bitcoin bridge
Any application or user on the target chain can utilize the bridge to verify the inclusion of a particular transaction on Bitcoin. For instance, a user could demonstrate to a smart contract that a specific amount of BTC has been transferred to a particular address on Bitcoin. Additionally, a user might showcase ownership of a unique Ordinal on Bitcoin to the contract. To initiate a query to the bridge and confirm the inclusion of a specific transaction ID on Bitcoin, the user must pay the bridge fee, which is collected in the native token of the target chain.
Transaction inclusion query
The Bitcoin Relay has a function called checkTxProof that can be used to check the inclusion of a transaction in a block:
function checkTxProof(
bytes32 txid,
uint blockHeight,
bytes calldata intermediateNodes,
uint index
) external payable returns (bool);Where:
txidis the double hash of a Bitcoin transaction.blockHeightis the height of the block that includes the transaction.intermediateNodesis the Merkle inclusion proof oftxidin the block.indexis the index oftxidin the transactions of the block.
Last updated