Got Error in calling Bitcoin integration Function (get_p2pkh_address)

I am using WSL 2 in my windows 10. I have follow all the steps to set up bitcoin integration locally. It works fine. When I open the candid UI and call the function get_p2pkh_address it shows me an error!

I have also tried calling the same from the terminal using the command

dfx canister call basic_bitcoin get_p2pkh_address

and It shows me the same error

Error: Failed update call.
Caused by: Failed update call.
  The Replica returned an error: code 4, message: "No route to canister aaaaa-aa"

What causing this error?

2 Likes

I came across the same error when I deploy basic_bitcoin example (either local or IC mainnet).

However, the other example - threshold-ecdsa works perfectly fine.
I have a quick look on the code.
threshold-ecdsa uses lower case secp256k1 while basic_bitcoin use uppercase Secp256k1.

After I updated basic_bitcoin to use lower case secp256k1 and redeploy, it works fine with local regtest and IC Bitcoin testnet.

Give it a try. See if it works.

Btw, I am on dfx 0.11.2.

4 Likes

@kinwo Thanks for looking into this.

This looks like a bug in the Motoko example. We just opened a PR now to fix this. In the future, don’t hesitate to open a PR if you find other issues :slight_smile:

Update: The fix has now been merged into the dfinity/examples repo.

4 Likes

Awesome! Thanks for updating it. I was about to submit PR. :+1: :grinning: