Transaction Hash for ckBTC transactions

Hey Dfinity Developer Community,

I’m a junior developer that is fairly new with ICP and I’m exploring the JavaScript API library ic0. I’m reaching out in hopes of gaining some insights from your expertise in this area.

My current project involves developing a feature that monitors a specific ckBTC wallet and captures data from incoming transfers. A crucial part of this process is to store the transaction hashes in our database to verify the on chain transaction. However, I’ve encountered a challenge: the canister method “get_account_transactions” doesn’t seem to provide the transaction hashes directly.

Given that I have the ckBTC index for these transactions, could you guide me on how to extract the transaction hashes for ckBTC transfers? Any pointers or references to relevant documentation would be immensely helpful.

Hi there,

Welcome to the Dfinity Developer Community! It’s great to see new developers diving into the world of ICP.

Regarding your project and the challenge with the get_transactions method, your approach can be guided by the fact that ckBTC is an ICRC1 token. The ICRC1 standard provides a structured way to interact with tokens on the Internet Computer, including transaction details.

Here is the source for the ICRC1 standard documentation that you’ll find useful: ICRC1 Standard Documentation. It contains comprehensive information and guidelines that should help you navigate and implement the necessary features for monitoring ckBTC transactions.

Best of luck with your project!

There are no transaction hashes. The “transaction id” that you already have is all there is. It is the transactions serial number in the history of all transactions. You can think of it as a blockchain where each block contains exactly one transaction. Then the block number (= block height) uniquely identifies the transaction and becomes the “transaction id”. That is what the index canister that you are using accepts as input for get_blocks and what appears as id in the output of get_account_transactions.

Hi @b3hr4d,

Thank you a ton for the guidance. Will look through the ICRC1 documentation

Best,
Elliot

1 Like

Hey @Timo,

I see. It sounds like the fact that there is an index can be used as confirmation that there was a successful on chain transaction. Appreciate the help.

Best,
Elliot