Thanks for answering my question! Another question is: I wrote a bitcoin canister, then I sent a transaction from ICP to BTC, here I called the send_transaction
interface(I also found it in the ckbtc minter source code), and it returns a txid, but I can not find it in the mempool or blockstream, so do I miss any steps? (I checked the ckbtc source code again and again, and found that maybe I need an adapter to send my transaction to the bitcoin network?)
The bitcoin_send_transaction
method does not return any value, according to the interface specification The Internet Computer Interface Specification | Internet Computer.
If you crafted your own bitcoin transaction (e.g. using some btc library), you can already calculate its txid. The bitcoin_send_transaction
method only sends it out, but it does not promise that your transaction will be picked up by a bitcoin full node and become part of a future block. There could be many reasons for failures, the most common one is that your transaction blob is of a wrong format. You can debug this by trying to send the transaction yourself via bitcoin command line tools.
Yes, it doesn’t return any value, I just call the transaction.compute_txid() for the rust_bitcoin 0.32.1 version.
Thanks for the answer! I will check the transaction blob.