Direct Integration with Bitcoin

Dear community

Here’s an update regarding the Bitcoin canister implementation, with a focus on stable memory usage and another (solved) challenge.

Due to the memory requirements of the Bitcoin Mainnet canister, the available stable memory per canister on the IC has been increased first to 16, then to 32 GB some weeks back. This has been done IC wide, so everyone can benefit from this stable memory increase.

Bitcoin Testnet canister

The Bitcoin Testnet canister is making use of the increased memory limit already, currently using over 13 GB, and it has been working pretty smoothly so far.

Bitcoin Mainnet canister

The Bitcoin Mainnet state is currently around 29 GB in our data representation. We added additional indices to speed up the get_balance method. The additional data structures consume around 7 GB extra, so the overall memory requirements now are around 36 GB. This is over the 32 Gb limit we currently have on the IC.

We have been exploring different options on how to resolve this. Optimizing the data representation would bring us below 32 GB, but only slightly, so that we would run into the same problem again soon, add additional complexity, and get other disadvantages. Thus, we decided to take the easier path of increasing the stable memory limit from 32 GB to 48 GB. This gives us some headroom for the future to not immediately run into the same issue again with the growing Bitcoin UTXO size.

23 Likes