Skip to main content

ICP as a Bitcoin L2

The Internet Computer adds the missing smart contract layer to Bitcoin. Leveraging Chain Fusion Technology, ICP can directly read and write to Bitcoin, enabling dapps that natively interact with Bitcoin.

Build DEXs offering BTC or BRC20 trading pairs, lending markets using Ordinals as collateral, or Web3 SocialFi services allowing satoshis to be sent via chat messages.

Native Bitcoin

The Internet Computer (ICP) is integrated with the Bitcoin network at the protocol level. The canister smart contracts it hosts can create Bitcoin addresses as well as send and receive bitcoin directly on the Bitcoin network. This means bitcoin can be easily and securely incorporated into DeFi and Web3 services on the Internet Computer blockchain, without having to trust wrapped bitcoin from centralized bridging services, which are at high risk of being taken down or hacked. Between 2021 and 2022, more than 2 billion dollars was stolen by exploiting unsecure blockchain bridges.

The ICP x BTC integration comprises two key building blocks (and APIs): Network integration & chain-key ECDSA

Combining these building blocks, canisters can directly and securely hold, receive, and send bitcoin seamlessly as if the Internet Computer and the Bitcoin network were one blockchain. Another way of looking at it, is that the Bitcoin integration is the same as running a Bitcoin node on chain.

What is chain-key cryptography

Network integration

One key tech development allowing smart contracts on the Internet Computer to obtain the balances of Bitcoin addresses as well as directly send and receive bitcoin is inter-chain communication. As the ICP blockchain creates transactions for the Bitcoin blockchain, its nodes directly transmit the transaction to the nodes of the Bitcoin network, without any need for intermediaries that might censor them. ICP nodes also directly pull blocks from the Bitcoin network to maintain Bitcoin's current UTXO set, allowing canisters to query the balance of Bitcoin addresses and their UTXOs. Creating bitcoin transactions and querying UTXO sets are made available to canisters by the Bitcoin API.

Chain-key ECDSA

The real innovation behind Bitcoin integration is chain-key ECDSA signing — advanced threshold cryptography integrated with ICP. In short, chain-key ECDSA is a set of cryptographic protocols that allow Internet Computer nodes to cooperatively create ECDSA signatures, which can be used to sign bitcoin transactions, using a highly fault-tolerant, decentralized network that is resilient to attacks by malicious nodes. The secret key is never stored in one place, instead it is broken down into key shares held by ICP nodes that are re-shared periodically. When requested, nodes use their key shares to collectively sign BTC transactions without recreating the original secret key. This signing protocol assumes a threshold of nodes to be honest.

Chain-key bitcoin

Chain-key Bitcoin (ckBTC) can be sent with 1-2 second finality and negligible fees — a multi-chain bitcoin twin, trustlessly created by chain-key cryptography and a pair of canister smart contracts that directly hold raw bitcoin without relying on intermediaries.

In 2021, El Salvador became the first country in the world to use Bitcoin as legal tender. However, as bitcoin transactions are slow and have high fees, they are not practical for daily economic activities such as buying groceries or getting a coffee.

The Bitcoin network integration on the Internet Computer is extremely powerful in terms of security and interoperability, but every bitcoin transaction still suffers the same low throughput, high latency, and high fees native to the Bitcoin network. Recent surge in popularity of Bitcoin Ordinals and BRC-20 tokens resulted in Bitcoin's network to be highly congested. This pushed transaction fees above $30, rendering casual every-day transactions completely impractical.

Chain-key Bitcoin (ckBTC), a multi-chain bitcoin twin on ICP introduces layer 2 functionality fuelled by ICP properties like speed, scalability and low transaction fees to bitcoin. ckBTC helps reduce the load on the Bitcoin network, while making every-day bitcoin transactions feasible, which realizes a key part of Satoshi's original vision.

ckBTC implements ICRC-1, the fungible token standard on the Internet Computer, and can be integrated easily by any Web3 service running on ICP.

Code ckBTCBTC <> ICP user guide

Watch & Learn

From concept to coding — learn all about the Bitcoin Integration feature on ICP through these videos.

Explore more videos

Interview

The What, the How and Why of Bitcoin Integration

With Andrew Chepreghy & Manu Drijvers

Code Bitcoin

Directly process bitcoin on the Bitcoin ledger using ICP smart contracts. Add bitcoin to your ICP Web3 services or create native Bitcoin DeFi.