# Error when interacting with Bitcoin integration API

**URL:** <https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831>\
**Category:** Rust\
**Created:** [November 1, 2024, 7:30am UTC](https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831 "2024-11-01T07:30:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amschel99](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/amschel99/32/18280_2.png) [@amschel99](https://forum.dfinity.org/u/amschel99)\
**Post date:** [November 1, 2024, 7:30am UTC](https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831/1 "2024-11-01T07:30:26Z")

</div>

Hello. I’m building a canister that can receive btc and also send btc. The first thing I’ve done is create a p2pkh address for the canister and that’s working. Now I have this method called get\_utxos

```auto

pub async fn get_utxos(network: BitcoinNetwork, address: String) -> GetUtxosResponse {
    let filter = None;
    let utxos_res = bitcoin_get_utxos(GetUtxosRequest {
        address,
        network,
        filter,
    })
    .await;

    utxos_res.unwrap().0
}

```

I’m using bitcoin api from ic-cdk crate.  
When I call this method , I get , CanisterError:IC0539: Error from canister g4xu7-ji… Canister exceeded it’s current Wasm memory limit if 4026531840 bytes… I believe this canister is the bitcoin integration canister… How do I solve this?

---

<div class="post-metadata">

**Author:** ![amschel99](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/amschel99/32/18280_2.png) [@amschel99](https://forum.dfinity.org/u/amschel99)\
**Post date:** [November 1, 2024, 7:40am UTC](https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831/2 "2024-11-01T07:40:53Z")

</div>

I tried this on the ICP dashboard and it doesn’t work. I think theres an issue with the canister when you provide a p2pkh as an argument

---

<div class="post-metadata">

**Author:** ![Manu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/manu/32/3999_2.png) [@Manu](https://forum.dfinity.org/u/Manu)\
**Post date:** [November 1, 2024, 8:13am UTC](https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831/3 "2024-11-01T08:13:03Z")

</div>

There are many issues with the current Bitcoin testnet, independent of ICPs integration, which also causes issues for the bitcoin canister. The bitcoin community therefore has proposed a new testnet, called testnet4. DFINITY plans on changing the bitcoin testnet canister to work with testnet4. You can read more about it [here](https://forum.dfinity.org/t/direct-integration-with-bitcoin/6147/729).

In the mean time, you can use bitcoin mainnet.

---

<div class="post-metadata">

**Author:** ![amschel99](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/amschel99/32/18280_2.png) [@amschel99](https://forum.dfinity.org/u/amschel99)\
**Post date:** [November 2, 2024, 9:28am UTC](https://forum.dfinity.org/t/error-when-interacting-with-bitcoin-integration-api/36831/4 "2024-11-02T09:28:15Z")

</div>

Thanks. It works fine on mainnet
