Skip to content

Commit 62efb28

Browse files
authored
Merge pull request #1117 from dfinity/mducroux/basic-bitcoin-readme
Update README.md for Basic Bitcoin example
2 parents 7c9de05 + 1597d13 commit 62efb28

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

rust/basic_bitcoin/README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ For a deeper understanding of the ICP < > BTC integration, see the [Bitcoin inte
1919
* [x] Install the [IC
2020
SDK](https://internetcomputer.org/docs/current/developer-docs/getting-started/install).
2121
* [x] On macOS, `llvm` with the `wasm32-unknown-unknown` target (which is not included in the XCode installation by default) is required.
22-
To install, run `brew install llvm`.
22+
To install, run `brew install llvm`.
23+
* [x] On macOS, ensure that Cargo is using the correct `clang` installed by Homebrew. By default, Cargo might use the system’s clang,
24+
which doesn’t support WebAssembly targets. To make sure Cargo uses the correct one, run `export CC_wasm32_unknown_unknown=/opt/homebrew/opt/llvm/bin/clang`.
2325

2426
## Step 1: Building and deploying sample code
2527

@@ -54,7 +56,7 @@ dfx deploy --network=ic basic_bitcoin --argument '(variant { testnet })'
5456

5557
**We're initializing the canister with `variant { testnet }` so that the
5658
canister connects to the [Bitcoin testnet](https://en.bitcoin.it/wiki/Testnet).
57-
To be specific, this connects to `Testnet3`, which is the current Bitcoin test
59+
To be specific, this connects to `Testnet4`, which is the current Bitcoin test
5860
network used by the Bitcoin community. This means that the addresses generated
5961
in the smart contract can only be used to receive or send funds only on Bitcoin
6062
testnet.**
@@ -117,7 +119,7 @@ is one of `[p2pkh, p2tr_key_only, p2tr]` (corresponding to the three types of
117119
addresses described above, in the same order).
118120

119121
Or, if you prefer the command line:
120-
`dfx canister --network=ic call basic_bitcoin get_${type}_address`
122+
`dfx canister --network=ic call basic_bitcoin get_${type}_address`
121123

122124
## Step 3: Receiving bitcoin
123125

@@ -176,8 +178,8 @@ dfx canister --network=ic call basic_bitcoin send_from_p2pkh_address '(record {
176178

177179
The `send_from_${type}` endpoint can send bitcoin by:
178180

179-
1. Getting the percentiles of the most recent fees on the Bitcoin network using the [bitcoin_get_current_fee_percentiles API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-method-bitcoin_get_current_fee_percentiles).
180-
2. Fetching your unspent transaction outputs (UTXOs), using the [bitcoin_get_utxos API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-method-bitcoin_get_utxos).
181+
1. Getting the percentiles of the most recent fees on the Bitcoin network using the [bitcoin_get_current_fee_percentiles API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin_get_current_fee_percentiles).
182+
2. Fetching your unspent transaction outputs (UTXOs), using the [bitcoin_get_utxos API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin_get_utxos).
181183
3. Building a transaction, using some of the UTXOs from step 2 as input and the destination address and amount to send as output.
182184
The fee percentiles obtained from step 1 is used to set an appropriate fee.
183185
4. Signing the inputs of the transaction using the
@@ -222,10 +224,7 @@ In this tutorial, you were able to:
222224
* Check the testnet BTC balance of the canister.
223225
* Use the canister to send testnet BTC to another testnet BTC address.
224226

225-
This example is extensively documented in the following tutorials:
226-
227-
* [Deploying your first Bitcoin dapp](https://internetcomputer.org/docs/current/samples/deploying-your-first-bitcoin-dapp).
228-
* [Developing Bitcoin dapps locally](https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development).
227+
This example is extensively documented in the following tutorial: [Developing Bitcoin dapps locally](https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development).
229228

230229
Note that for *testing* on mainnet, the [chain-key testing
231230
canister](https://github.com/dfinity/chainkey-testing-canister) can be used to

0 commit comments

Comments
 (0)