▪️Build on Bitcoin bridge
Last updated
Was this helpful?
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.
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:
txid is the double hash of a Bitcoin transaction.
blockHeight is the height of the block that includes the transaction.
intermediateNodes is the Merkle inclusion proof of txid in the block.
index is the index of txid in the transactions of the block.
Last updated
Was this helpful?
Was this helpful?