Direct Integration with Bitcoin

Hi everybody!

DFINITY would like to propose some changes to ICP’s bitcoin integration.

What problems are we seeing today?

  • Bitcoin testnet (testnet3) is not in a great state. In the past months, the testnet has been frequently plagued by “block storms”, where the block rate goes much higher than intended. Bitcoin is designed to create one block every 10 minutes, but on testnet, blocks occasionally appear at more than 100x that speed. This also leads to frequent long forks, the likes of which are unthinkable for BTC mainnet. ICPs Bitcoin integration has not been designed to handle such block storms or very long forks. This meant that the BTC testnet API was often unavailable (because the bitcoin canister was still busy syncing testnet but unable to keep up with a block storm), and it has even gotten stuck on a 50+ block long fork, requiring a reinstall of the bitcoin testnet canister.
  • It’s difficult for DFINITY to quickly respond to issues with BTC testnet as it’s governed by the NNS and specified in the interface spec of ICP.
  • Bitcoin testnet is also difficult to use because TBTC, the testnet bitcoin token, has become difficult to obtain. This somewhat defeats the purpose of a testnet.

How are we proposing to improve it?

  1. Mark the BTC API in the interface specification as deprecated, and encourage canister developers to call the BTC canisters (BTC mainnet canister, BTC testnet canister) directly rather than through the management canister. The interface specification of the bitcoin canisters will move to a separate document. This change will remove the need to have the BTC API defined in multiple places, and make calls slightly faster for developers. Eventually we’d hope to remove the BTC API entirely from the interface spec, but we would need to make sure that the API is not getting meaningful usage anymore first.
  2. Move control of the BTC testnet canister (and the corresponding “watchdog” canister gjqfs-iaaaa-aaaan-aaada-cai) to DFINITY. Since this is only testnet, it’s not security critical so it’s acceptable to be centrally controlled, and this allows DFINITY to iterate quickly and address any issues without additional delay from governance proposals. This proposed change is related to step 1, removing the BTC API from the interface specification, as it would not be acceptable for DFINITY to control a canister that implements part of the interface of the Internet Computer, but we now believe that the bitcoin testnet API should not have been part of ICP’s interface specification.
    The Bitcoin mainnet canister would of course remain under NNS control.
  3. Change the Bitcoin testnet canister to use Bitcoin’s testnet4, rather than the current testnet3. Testnet4 includes code changes to how the mining difficulty can be adjusted, which should avoid block storms (details can be found in BIP 94). Also testnet token availability for testnet4 is currently much better than for testnet3.

Please let us know what you think!

19 Likes