You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(chain-fusion): diagram styling, KYT flows, and Bitcoin canister corrections (#176)
## Summary
Follow-up to #174. Changes that were not pushed before that PR was
merged.
**PlantUML diagram styling (`plugins/remark-plantuml.mjs`,
`src/styles/custom.css`):**
- Wrap each diagram in `<figure class="plantuml-diagram">` for CSS
targeting
- Elevated background (`--icp-bg-elev`) and `border-radius: 6px` as
visual container (no explicit border needed)
- Dark mode: `filter: invert(1) hue-rotate(180deg)` on the image
preserves hue relationships while flipping luminance
- Darken actor border, lifeline, participant border, and note border
from hairline (`#e5ddcf`) to muted (`#6b6660`) so all structural lines
remain legible after dark mode inversion
**Bitcoin canister corrections (`bitcoin.mdx`, `dogecoin.md`):**
- Replace "management canister" with "Bitcoin canister" for `bitcoin_*`
API calls
- The management canister Bitcoin API is deprecated; documented in
`management-canister.md`
- All remaining "management canister" references correctly describe
`sign_with_ecdsa` / `sign_with_schnorr`, which do stay on the management
canister
**ckBTC flow diagrams (`bitcoin.mdx`):**
- Deposit diagram: add Bitcoin Checker (KYT), ckBTC Ledger participant,
and 4-confirmation note
- Withdrawal diagram: add Bitcoin Checker for destination address KYT
check and async note for batched Bitcoin submission
- Prose updated: names the 4-confirmation threshold, 100-satoshi KYT fee
per UTXO, quarantine behaviour for failed UTXOs, and
`retrieve_btc_status_v2` for withdrawal tracking
**Confirmation count (`bitcoin.mdx`, `chain-key-tokens.mdx`):**
- Update ckBTC minimum confirmations from 6 to 4 in the diagram note,
deposit flow prose, and the `chain-key-tokens.mdx` callout (distinct
from the table/description already updated in #173)
## Sync recommendation
`informed by dfinity/ic rs/bitcoin/ckbtc/minter/README.adoc;
dfinity/bitcoin-canister INTERFACE_SPECIFICATION.md;
wiki.internetcomputer.org/wiki/Chain-key_Bitcoin`
Copy file name to clipboardExpand all lines: docs/guides/chain-fusion/bitcoin.mdx
+23-12Lines changed: 23 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ICP provides a protocol-level integration with the Bitcoin network. Canisters ca
12
12
There are two approaches to working with Bitcoin on ICP:
13
13
14
14
-**ckBTC (chain-key Bitcoin)**: a 1:1 BTC-backed token native to ICP. Transfers settle in 1-2 seconds with a 10 satoshi fee. Best for most applications that need to accept, hold, or transfer Bitcoin value.
15
-
-**Direct Bitcoin API**: call the management canister to read UTXOs, get balances, and submit raw Bitcoin transactions. Best for advanced use cases that need full control over Bitcoin transactions (custom scripts, Ordinals, Runes, BRC-20).
15
+
-**Direct Bitcoin API**: call the Bitcoin canister to read UTXOs, get balances, and submit raw Bitcoin transactions. Best for advanced use cases that need full control over Bitcoin transactions (custom scripts, Ordinals, Runes, BRC-20).
16
16
17
17
This guide covers both approaches.
18
18
@@ -34,19 +34,25 @@ ckBTC is the recommended path for most developers. The ckBTC minter canister hol
34
34
```plantuml
35
35
actor User
36
36
participant "ckBTC Minter" as Minter
37
+
participant "Bitcoin Checker" as KYT
38
+
participant "ckBTC Ledger" as Ledger
37
39
participant "Bitcoin Network" as BTC
38
40
39
-
User -> Minter: get_btc_address(account)
41
+
User -> Minter: get_btc_address(owner, subaccount)
40
42
Minter --> User: btc_address
41
43
User -> BTC: send BTC to btc_address
42
-
User -> Minter: update_balance(account)
43
-
Minter --> User: ckBTC minted to ICRC-1 account
44
+
note right of BTC: 4 confirmations required
45
+
User -> Minter: update_balance(owner, subaccount)
46
+
Minter -> KYT: check UTXO
47
+
KYT --> Minter: ok
48
+
Minter -> Ledger: mint ckBTC (amount - kyt_fee)
49
+
Minter --> User: MintedUtxos
44
50
```
45
51
46
-
1. Call `get_btc_address` on the minter with the user's principal and subaccount. This returns a unique Bitcoin address controlled by the minter.
47
-
2.The user sends BTC to that address using any Bitcoin wallet.
48
-
3. Wait for Bitcoin confirmations (the minter requires confirmations before minting).
49
-
4. Call `update_balance` on the minter with the same principal and subaccount. The minter checks for new UTXOsand mints equivalent ckBTC to the user's ICRC-1 account.
52
+
1. Call `get_btc_address` on the minter with the user's principal and subaccount. This returns a unique Bitcoin address controlled by the minter via threshold ECDSA.
53
+
2.Send BTC to that address from any Bitcoin wallet.
54
+
3. Wait for 4 Bitcoin confirmations (mainnet). The minter will not process UTXOs until the required number of confirmations is reached.
55
+
4. Call `update_balance` on the minter. The minter checks for new UTXOs, runs a KYT (Know-Your-Transaction) compliance check via the Bitcoin Checker canister, and mints ckBTC to the user's ICRC-1 account. A KYT fee of 100 satoshis is deducted per UTXO. UTXOs that fail the KYT check are quarantined and not minted.
Withdrawal is a two-step process: approve the minter to spend your ckBTC, then call `retrieve_btc_with_approval`. The minimum withdrawal is 50,000 satoshis (0.0005 BTC).
265
+
Withdrawal is a two-step process: approve the minter to spend your ckBTC, then call `retrieve_btc_with_approval`. Before burning ckBTC, the minter runs a KYT check on the destination Bitcoin address. The Bitcoin transaction is submitted asynchronously — the minter batches pending requests to optimize miner fees. Track status with `retrieve_btc_status_v2(block_index)`. The minimum withdrawal is 50,000 satoshis (0.0005 BTC).
255
266
256
267
<TabssyncKey="lang">
257
268
<TabItemlabel="Motoko">
@@ -493,7 +504,7 @@ For a complete working example with all type definitions and error handling, see
493
504
494
505
## Direct Bitcoin API
495
506
496
-
For use cases that require full control over Bitcoin transactions (custom scripts, Ordinals, Runes, BRC-20), you can call the Bitcoin API directly through the management canister. This involves generating addresses with threshold ECDSA or Schnorr signatures, building raw transactions, and submitting them to the Bitcoin network.
507
+
For use cases that require full control over Bitcoin transactions (custom scripts, Ordinals, Runes, BRC-20), you can call the Bitcoin canister directly. This involves generating addresses with threshold ECDSA or Schnorr signatures, building raw transactions, and submitting them to the Bitcoin network.
-[Chain-key cryptography](../../concepts/chain-key-cryptography.md): learn how threshold ECDSA and Schnorr signatures work
1166
1177
-[Chain-key tokens](../digital-assets/chain-key-tokens.md): explore ckBTC, ckETH, and other chain-key tokens
1167
1178
-[Ethereum integration](ethereum.md): apply similar patterns for Ethereum
1168
-
-[Management canister reference](../../reference/management-canister.md): full API reference for `bitcoin_get_utxos`, `sign_with_ecdsa`, and other management canister methods
1179
+
-[Management canister reference](../../reference/management-canister.md): full API reference for `sign_with_ecdsa`, `sign_with_schnorr`, and other management canister methods (note: the `bitcoin_*` methods in the management canister are deprecated; use the Bitcoin canister directly)
1169
1180
-[Bitcoin canister API specification](https://github.com/dfinity/bitcoin-canister/blob/master/INTERFACE_SPECIFICATION.md): detailed API documentation
1170
1181
-[Bitcoin integration (Learn Hub)](https://learn.internetcomputer.org/hc/en-us/articles/34211154520084): protocol-level details of how ICP connects to Bitcoin
Copy file name to clipboardExpand all lines: docs/guides/chain-fusion/dogecoin.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ ICP canisters can interact directly with the Dogecoin network without bridges or
14
14
-**Dogecoin canister**: a system canister controlled by the NNS that exposes an API for querying Dogecoin network state (UTXOs, balances, block information) and submitting signed transactions.
15
15
-**Threshold ECDSA**: canisters request threshold ECDSA signatures from the management canister to sign Dogecoin transactions. The private key is never reconstructed; it exists only as secret shares distributed across subnet nodes.
16
16
17
-
This is the same model as the [Bitcoin integration](bitcoin.md), using a UTXO-based transaction model and secp256k1 ECDSA signatures. The main difference is that Dogecoin transactions are submitted through the Dogecoin canister rather than the Bitcoin management canister API.
17
+
This is the same model as the [Bitcoin integration](bitcoin.md), using a UTXO-based transaction model and secp256k1 ECDSA signatures. The main difference is that Dogecoin transactions are submitted through the Dogecoin canister rather than the Bitcoin canister.
18
18
19
19
## How it works
20
20
@@ -118,7 +118,7 @@ For a complete, working implementation covering all steps (including deriving a
118
118
119
119
The [Bitcoin integration guide](bitcoin.md) covers the same conceptual steps with complete inline code. Because Dogecoin is a fork of Bitcoin and shares the same UTXO model and secp256k1 ECDSA signatures, the patterns translate directly with these differences:
120
120
121
-
- Use the Dogecoin canister for UTXO queries and transaction submission (not the management canister's `bitcoin_*` API)
121
+
- Use the Dogecoin canister for UTXO queries and transaction submission (not the Bitcoin canister's `bitcoin_*` API)
122
122
- Use Dogecoin's P2PKH address format (mainnet addresses start with `D`)
Developers familiar with the Bitcoin integration will find the Dogecoin integration conceptually identical. The primary practical difference is calling the Dogecoin canister rather than the management canister's Bitcoin API.
140
+
Developers familiar with the Bitcoin integration will find the Dogecoin integration conceptually identical. The primary practical difference is calling the Dogecoin canister rather than the Bitcoin canister.
Copy file name to clipboardExpand all lines: docs/guides/digital-assets/chain-key-tokens.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ The deposit flow has two steps:
34
34
1.**Get a deposit address**: call `get_btc_address` on the ckBTC minter with the owner principal and an optional subaccount. The minter returns a unique Bitcoin address.
35
35
2.**Mint ckBTC**: after BTC is sent to that address, call `update_balance` on the minter. The minter checks for new UTXOs and mints ckBTC to the corresponding ICRC-1 account.
36
36
37
-
The minter requires a minimum number of Bitcoin confirmations before minting (currently 6 on mainnet). `update_balance` returns `NoNewUtxos` if confirmations have not yet been reached: your app should poll or prompt the user to wait.
37
+
The minter requires a minimum number of Bitcoin confirmations before minting (currently 4 on mainnet). `update_balance` returns `NoNewUtxos` if confirmations have not yet been reached: your app should poll or prompt the user to wait.
0 commit comments