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
@@ -7,7 +12,7 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";
7
12
## Overview
8
13
The example shows how to deploy a Godot HTML5 build on the IC in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample.
9
14
10
-
This example project can be cloned, installed and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.
15
+
This example project can be cloned, installed, and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same.
The example shows how to deploy a simple Unity WebGL build on the IC in an asset canister. It just shows a Unity WebGL build with the URP template installed.
11
+
The example shows how to deploy a simple Unity WebGL build on ICP in an asset canister. It just shows a Unity WebGL build with the URP template installed.
8
12
9
13
The Unity WebGL build is deployed as frontend, no backend is needed in this sample.
10
14
@@ -37,7 +41,11 @@ When the local replica is up and running, run this command to deploy the caniste
37
41
dfx deploy
38
42
```
39
43
40
-
If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this: `https://\<canister-id\>.raw.ic0.app`.
44
+
If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this:
45
+
46
+
```
47
+
https://\<canister-id\>.raw.ic0.app
48
+
```
41
49
42
50
## License
43
51
This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project.
@@ -14,11 +18,11 @@ Actor references should be used sparingly, and only when necessary, to provide a
14
18
Providing an incorrect interface may cause subsequent communication with the actor to fail with serialization (but not memory) errors.
15
19
:::
16
20
17
-
The example defines one Motoko actor: `main.mo` binds the name IC to the actor obtained by asserting an interface for the textual actor reference "aaaaa-aa". This is the identity, in textual format, of the well-known (that is, systemprovided) management canister which is typically used to install, top up, and otherwise manage canisters on the IC.
21
+
The example defines one Motoko actor: `main.mo` binds the name IC to the actor obtained by asserting an interface for the textual actor reference "aaaaa-aa". This is the identity, in textual format, of the well-known (that is, system-provided) management canister which is typically used to install, top up, and otherwise manage canisters on the IC.
18
22
19
23
The full interface of the management canister is provided in the Interface Computer interface specification. For this simple example, we only need a subset of the specified operations, and, due to Candid sub-typing, can even import them at less informative types than described in the full specification. To provide access to more operations, one would simply add them to the actor type, at the appropriate Motoko translation of the original Candid signature.
20
24
21
-
Our actor exposes a single burn method that uses its local IC actor reference to provision, create, query, stop and delete a transient canister, in order to burn half of the actor's cycle balance.
25
+
Our actor exposes a single burn method that uses its local IC actor reference to provision, create, query, stop, and delete a transient canister, to burn half of the actor's cycle balance.
22
26
23
27
This application of IC is meant to be illustrative, not necessarily useful.
24
28
@@ -66,4 +70,4 @@ The output will resemble the following:
66
70
67
71
# Security considerations best practices
68
72
69
-
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [Security Best Practices](https://internetcomputer.org/docs/current/references/security/) for developing on ICP. This example may not implement all the best practices.
73
+
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/current/references/security/) for developing on ICP. This example may not implement all the best practices.
This tutorial will walk you through how to deploy a sample [canister smart contract](https://wiki.internetcomputer.org/wiki/Canister_smart_contract)**that can send and receive Bitcoin** on the Internet Computer.
11
13
@@ -14,7 +16,7 @@ This tutorial will walk you through how to deploy a sample [canister smart contr
14
16
This example internally leverages the [ECDSA API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-ecdsa_public_key)
15
17
and [Bitcoin API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin-api) of the Internet Computer.
16
18
17
-
For deeper understanding of the ICP < > BTC integration, see the IC wiki article on [Bitcoin integration](https://wiki.internetcomputer.org/wiki/Bitcoin_Integration).
19
+
For a deeper understanding of the ICP < > BTC integration, see the [Bitcoin integration documentation](/docs/current/developer-docs/multi-chain/bitcoin/overview).
Your canister is live and ready to use! You can interact with it using either the command line, or using the Candid UI, which is the link you see in the output above.
67
+
Your canister is live and ready to use! You can interact with it using either the command line or the Candid UI, which is the link you see in the output above.
66
68
67
69
In the output above, to see the Candid Web UI for your bitcoin canister, you would use the URL `https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=<YOUR-CANISTER-ID>`. Here are the two methods you will see:
68
70
@@ -84,7 +86,7 @@ Or, if you prefer the command line:
* The Bitcoin address you see will be different from the one above, because the
89
+
* The Bitcoin address you see will be different from the one above because the
88
90
ECDSA public key your canister retrieves is unique.
89
91
90
92
* We are generating a Bitcoin testnet address, which can only be
@@ -97,7 +99,7 @@ Now that the canister is deployed and you have a Bitcoin address, it's time to r
97
99
some testnet bitcoin. You can use one of the Bitcoin faucets, such as [coinfaucet.eu](https://coinfaucet.eu),
98
100
to receive some bitcoin.
99
101
100
-
Enter your address and click on "Send testnet bitcoins". In the example below we will use Bitcoin address `n31eU1K11m1r58aJMgTyxGonu7wSMoUYe7`, but you would use your own address. The canister will be receiving 0.011 test BTC on the Bitcoin Testnet.
102
+
Enter your address and click on "Send testnet bitcoins". In the example below we will use Bitcoin address `n31eU1K11m1r58aJMgTyxGonu7wSMoUYe7`, but you will use your address. The canister will be receiving 0.011 test BTC on the Bitcoin Testnet.
101
103
102
104
103
105
Once the transaction has at least one confirmation, which can take a few minutes,
@@ -124,18 +126,18 @@ You can send bitcoin using the `send` endpoint on your canister.
124
126
In the Candid UI, add a destination address and an amount to send. In the example
125
127
below, we're sending 4'321 Satoshi (0.00004321 BTC) back to the testnet faucet.
126
128
127
-
Via command line, the same call would look like this:
129
+
Via the command line, the same call would look like this:
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).
136
138
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).
137
139
3. Building a transaction, using some of the UTXOs from step 2 as input and the destination address and amount to send as output.
138
-
The fee percentiles obtained from step 1 is used to set an appropriate fee.
140
+
The fee percentiles obtained from step 1 are used to set an appropriate fee.
139
141
4. Signing the inputs of the transaction using the [sign_with_ecdsa API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-sign_with_ecdsa).
140
142
5. Sending the signed transaction to the Bitcoin network using the [bitcoin_send_transaction API](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-bitcoin_send_transaction).
141
143
@@ -149,7 +151,7 @@ reflected in your current balance.
149
151
In this tutorial, you were able to:
150
152
151
153
* Deploy a canister smart contract on the ICP blockchain that can receive & send Bitcoin.
152
-
* Use a cycles faucet to deploy the canister to ICP blockchain on mainnet for free.
154
+
* Use a cycles faucet to deploy the canister to ICP blockchain on the mainnet for free.
153
155
* Connect the canister to the Bitcoin testnet.
154
156
* Send the canister some testnet BTC.
155
157
* Check the testnet BTC balance of the canister.
@@ -165,5 +167,5 @@ This example is extensively documented in the following tutorials:
165
167
If you base your application on this example, we recommend you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/current/references/security/) for developing on the Internet Computer. This example may not implement all the best practices.
166
168
167
169
For example, the following aspects are particularly relevant for this app:
168
-
*[Certify query responses if they are relevant for security](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#certify-query-responses-if-they-are-relevant-for-security), since the app e.g. offers method to read balances.
170
+
*[Certify query responses if they are relevant for security](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#certify-query-responses-if-they-are-relevant-for-security), since the app e.g. offers a method to read balances.
169
171
*[Use a decentralized governance system like SNS to make a canister have a decentralized controller](https://internetcomputer.org/docs/current/references/security/rust-canister-development-security-best-practices#use-a-decentralized-governance-system-like-sns-to-make-a-canister-have-a-decentralized-controller), since decentralized control may be essential for canisters holding Bitcoin on behalf of users.
@@ -9,11 +13,12 @@ This sample project demonstrates a basic [decentralized autonomous organization]
9
13
10
14
## Overview
11
15
12
-
A `basic_dao` can be initialized with a set of accounts: mappings from principal IDs to an amount of tokens. Account owners can query their account balance by calling `account_balance` and transfer tokens to other accounts by calling `transfer`. Anyone can call `list_accounts` to view all accounts.
16
+
A `basic_dao` can be initialized with a set of accounts: mappings from principal IDs to a number of tokens. Account owners can query their account balance by calling `account_balance` and transfer tokens to other accounts by calling `transfer`. Anyone can call `list_accounts` to view all accounts.
13
17
14
-
Account owners can submit proposals by calling `submit_proposal`. A proposal specifies a canister, method and arguments for this method. Account owners can cast votes (either `Yes` or `No`) on a proposal by calling `vote`. The amount of votes cast is equal to amount of tokens the account owner has. If enough `Yes` votes are cast, `basic_dao` will execute the proposal by calling the proposal’s given method with the given args against the given canister. If enough `No` votes are cast, the proposal is not executed, and is instead marked as `Rejected`.
18
+
Account owners can submit proposals by calling `submit_proposal`. A proposal specifies a canister, method, and arguments for this method. Account owners can cast votes (either `Yes` or `No`) on a proposal by calling `vote`. The amount of votes cast is equal to the amount of tokens the account owner has. If enough `Yes` votes are cast, `basic_dao` will execute the proposal by calling the proposal’s given method with the given args against the given canister. If enough `No` votes are cast, the proposal is not executed, and is instead marked as `Rejected`.
15
19
16
-
Certain system parameters, like the number of `Yes` votes needed to pass a proposal, can be queried by calling `get_system_params`. These system params can be modified via the proposal process, i.e. a proposal can be made to call `update_system_params` with updated values. The below demo does exactly that.
20
+
Certain system parameters, like the number of `Yes` votes needed to pass a proposal, can be queried by calling `get_system_params`. These system parameters can be modified via the proposal process, i.e. a proposal can be made to call `update_system_params` with updated values.
21
+
This workflow is demonstrated below.
17
22
18
23
View the [canister service definition](https://github.com/dfinity/examples/blob/master/rust/basic_dao/src/basic_dao/src/basic_dao.did) for more details.
19
24
@@ -67,4 +72,4 @@ If you base your application on this example, we recommend you familiarize yours
67
72
68
73
For example, the following aspects are particularly relevant for this app:
69
74
*[Use a decentralized governance system like SNS to make a canister have a decentralized controller](https://internetcomputer.org/docs/current/references/security/rust-canister-development-security-best-practices#use-a-decentralized-governance-system-like-sns-to-make-a-canister-have-a-decentralized-controller), since this is a DAO's use case.
70
-
*[Certify query responses if they are relevant for security](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#certify-query-responses-if-they-are-relevant-for-security), since e.g. account_balance and list_accounts are query calls that a client may want to issue as update call.
75
+
*[Certify query responses if they are relevant for security](https://internetcomputer.org/docs/current/references/security/general-security-best-practices#certify-query-responses-if-they-are-relevant-for-security), since e.g. `account_balance` and `list_accounts` are query calls that a client may want to issue as update call.
0 commit comments