Bitcoin Smart Contracts on the Internet Computer

Coding Bitcoin

Canister with Bitcoin
ICP offers protocol-level integration with the Bitcoin network. A canister smart contract, the Bitcoin canister, operates effectively as an on-chain “Bitcoin light node”, receiving, holding, and indexing the complete set of unspent transaction outputs (UTXOs) in an efficiently queryable form. This Bitcoin canister offers other smart contracts on ICP the ability to submit signed transactions to the Bitcoin network. Submitted Bitcoin transactions are signed using chain-key signatures (ckECDSA), an enhanced version of threshold ECDSA available only on the Internet Computer (the only version that is secure in an asynchronous environment such as the Internet).

ckECDSA combined with the Bitcoin canister offers canister smart contracts running on the IC the ability to custody and transact native Bitcoin without the need for any additional third-party off-chain custodial or bridging solutions.

ckBTC is a pair of ICP smart contracts building on the Bitcoin canister and ckECDSA services. The contracts work together to enable users and canister smart contracts on ICP to send and receive BTC value within seconds — far faster than is possible with native BTC chain transactions, while also always allowing users and smart contracts to send and receive value to and from native BTC network addresses.

ckBTC exposes an ICRC-1 ledger interface (the fungible token standard of the IC) making it simple for all wallets on the IC to offer ckBTC support. Many wallets also support the additional inter-network transfers to and from BTC addresses.

The two contracts work in concert to ensure that the total value of ckBTC cannot exceed the BTC held by the two contracts. This can always be verified by viewing the on-chain dashboards and metrics of the two contracts: ckBTC Minter dashboard, ckBTC Minter metrics, ckBTC Ledger metrics.
Tracked Bitcoin UTXOs
Info circle
The number of Bitcoin unspent transaction outputs (UTXOs) that are being tracked by the Bitcoin canister. This is very close to the number of UTXOs on the Bitcoin network. Differences between this figure and the number of UTXOs on the Bitcoin network are explained by the slight lag of ingesting Bitcoin blocks as well as the UTXOs of unstable blocks, i.e., blocks that are not yet settled and can help resolve forks.
-
Expand chart
Bitcoin Canister Stable Memory Usage
Info circle
The amount of stable memory that the Bitcoin Canister uses to track the UTXO state of the Bitcoin network. The Bitcoin canister stores the Bitcoin UTXO set in stable memory and operates directly on data structures therein.
-
Expand chart
Synced Bitcoin Block Height
Info circle
The block height of the Bitcoin blockchain up to which the Bitcoin canister has synced. This usually lags the Bitcoin blockchain by only a few seconds, which is the time that it takes a mined Bitcoin block to propagate through the Bitcoin network, and to be ingested into the Internet Computer and processed by the Bitcoin canister.
-
Expand chart
ckBTC Canisters
loading
ckBTC Transactions
loading