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
For background on the ICP <-> BTC integration, refer to the [Learn Hub](https://learn.internetcomputer.org/hc/en-us/articles/34211154520084-Bitcoin-Integration).
13
+
For background on the ICP<>BTC integration, refer to the [Learn Hub](https://learn.internetcomputer.org/hc/en-us/articles/34211154520084-Bitcoin-Integration).
-[x][Local installation of Bitcoin](https://internetcomputer.org/docs/building-apps/chain-fusion/bitcoin/using-btc/local-development)
20
-
-[x] On macOS, an `llvm` version that supports the `wasm32-unknown-unknown` target is required. This is because the `bitcoin` library relies on `secp256k1-sys`, which requires `llvm` to build. The default `llvm` version provided by XCode does not meet this requirement. Instead, install the [Homebrew version](https://formulae.brew.sh/formula/llvm), using `brew install llvm`.
-[x] On macOS, an `llvm` version that supports the `wasm32-unknown-unknown` target is required. This is because the Rust `bitcoin` library relies on the `secp256k1-sys` crate, which requires `llvm` to build. The default `llvm` version provided by XCode does not meet this requirement. Instead, install the [Homebrew version](https://formulae.brew.sh/formula/llvm), using `brew install llvm`.
21
21
22
-
## Step 1: Building and deploying the smart contract
> Newly created bitcoin, like those you created with the above `bitcoin-cli` command cannot be spent until 10 additional blocks have been added to the chain. To make your bitcoin spendable, create 10 additional blocks. Choose one of the smart contract addresses as receiver of the block reward or use any valid bitcoin dummy address.
126
+
> Newly mined bitcoin, like those you created with the above `bitcoin-cli` command cannot be spent until 100 additional blocks have been added to the chain. To make your bitcoin spendable, create 100 additional blocks. Choose one of the smart contract addresses as receiver of the block reward or use any valid bitcoin dummy address.
The functionreturns the transaction ID, which you can track on [mempool.space testnet4](https://mempool.space/testnet4/).
132
+
The functionreturns the transaction ID. When interacting with the contract deployed on IC mainnet, you can track testnet transactions on [mempool.space](https://mempool.space/testnet4/).
133
133
134
-
## 6. Retrieving block headers
134
+
## Retrieving block headers
135
135
136
136
You can query historical block headers:
137
137
@@ -148,20 +148,7 @@ This calls `bitcoin_get_block_headers`, useful for validating blockchains or lig
148
148
- Keys are derived using structured derivation paths according to BIP-32.
149
149
- Key caching is used to avoid repeated calls to `get_ecdsa_public_key` and `get_schnorr_public_key`.
150
150
- Transactions are assembled and signed manually, ensuring maximum flexibility in construction and fee estimation.
151
-
152
-
## Conclusion
153
-
154
-
In this tutorial, you were able to:
155
-
156
-
- Deploy a smart contract locally that can receive & send bitcoin.
157
-
- Connect the smart contract to the local Bitcoin testnet.
158
-
- Send the smart contract some local testnet BTC.
159
-
- Check the local testnet BTC balance of the smart contract.
160
-
- Use the smart contract to send local testnet BTC to another local testnet BTC address.
161
-
162
-
The steps to develop Bitcoin dapps locally are extensively documented in [this tutorial](https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development).
163
-
164
-
Note that for _testing_ on mainnet, the [chain-key testing canister](https://github.com/dfinity/chainkey-testing-canister) can be used to save on costs for calling the threshold signing APIs for signing the BTC transactions.
151
+
- When _testing_ on mainnet, the [chain-key testing canister](https://github.com/dfinity/chainkey-testing-canister) can be used to save on costs for calling the threshold signing APIs for signing the BTC transactions.
165
152
166
153
## Security considerations and best practices
167
154
@@ -174,4 +161,4 @@ For example, the following aspects are particularly relevant for this app:
0 commit comments