Skip to content

Commit 4e03eb1

Browse files
marc0oloclaude
andauthored
docs: developer onboarding pass for all entry-point READMEs (#1466)
* docs: developer onboarding pass for all entry-point READMEs Every category directory now has a proper entry point focused on getting a newcomer from zero to a running example: - Root README: contribution invitation removed (repo is not soliciting external PRs while examples are restructured for the developer docs), 'New here?' path rewritten with language-labeled links (hello_world → who_am_i), wasm/ listed alongside the other categories. - motoko/ and hosting/ READMEs rewritten; rust/, native-apps/, and wasm/ READMEs created: each opens with a start-here path, then a categorized index of every example with a one-line description and relative links, and closes with the canonical security-best-practices link. - vetkeys indexes: motoko/vetkeys/README.md created; rust/vetkeys/README.md rewritten to link the local examples instead of the upstream vetkeys repository (which it pointed at exclusively, under partly wrong names). - Link conventions applied throughout: Internet Identity mentions link the developer docs guide in integration contexts (id.ai stays only for live-instance references, e.g. ic-pos mainnet notes); all external links verified against the current docs site; all relative links checked. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(hosting): clarify certified-assets (static-site) vs legacy asset canister The hosting examples run on the @dfinity/static-site recipe (certified-assets canister), which replaces the legacy asset canister going forward. Name both, state the direction, and mark photo-storage as the deliberate legacy exception (AssetManager uploads). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent fb786e7 commit 4e03eb1

10 files changed

Lines changed: 226 additions & 21 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ Get started building on ICP with the sample applications in this repository. Fro
66
77
The projects in this repository are not intended to be used as commercial applications and do not provide any explicit or implied support or warranty of any kind.
88

9-
You can also contribute your own project or suggest updates to published projects using the standard GitHub workflow.
10-
119
## Sample applications
1210

13-
**New here?** Start with [hello_world](motoko/hello_world/) (Motoko) or [hello_world](rust/hello_world/) (Rust) — a simple full-stack canister with a frontend. For user authentication with Internet Identity, see [who_am_i](motoko/who_am_i/) or [who_am_i](rust/who_am_i/).
11+
**New here?** Start with `hello_world` ([Motoko](motoko/hello_world/) or [Rust](rust/hello_world/)) — a simple full-stack canister with a frontend. Then move on to `who_am_i` ([Motoko](motoko/who_am_i/) or [Rust](rust/who_am_i/)) to add user authentication with [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity).
1412

1513
Canister examples are organized by language:
1614

@@ -21,6 +19,7 @@ Frontend-only and native app examples:
2119

2220
- [hosting/](hosting/) — frontend examples (React, static sites, etc.)
2321
- [native-apps/](native-apps/) — Unity and other native app integrations
22+
- [wasm/](wasm/) — canisters written directly in WebAssembly
2423

2524
## Local development
2625

hosting/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
# Hosting examples
22

3-
## Basic
3+
Frontend-only examples that run entirely on the Internet Computer — static sites, web apps, and game builds served on-chain with no custom backend. Each example is self-contained: follow its README to deploy it locally with `icp-cli`.
44

5-
- [`static-website`](https://github.com/dfinity/examples/tree/master/hosting/static-website) -- simple HTML website demo.
6-
- [`Unity-WebGL-sample`](https://github.com/dfinity/examples/tree/master/hosting/unity-webgl-template) -- simple Unity WebGL sample.
7-
- [`Godot-HTML5-sample`](https://github.com/dfinity/examples/tree/master/hosting/godot-html5-template) -- Godot HTML5 sample.
5+
These examples use the `@dfinity/static-site` recipe, which deploys the [certified-assets canister](https://github.com/dfinity/certified-assets) — the successor of the legacy [asset canister](https://docs.internetcomputer.org/guides/frontends/asset-canister) going forward, adding response certification, clean-URL canonicalization, and `_headers`/`_redirects` configuration. The one deliberate exception is [`photo-storage`](photo-storage/): it demonstrates programmatic uploads via `AssetManager`, an API only the legacy asset canister provides.
6+
7+
**New to ICP?** Start with [`static-website`](static-website/), the smallest possible deployment, then [`react`](react/) for a typical single-page app setup.
8+
9+
Prerequisites and dev-container setup are covered in the [repository README](../README.md).
10+
11+
## Examples
12+
13+
- [`static-website`](static-website/) — deploy a plain HTML/CSS website on ICP.
14+
- [`react`](react/) — a minimal React single-page application hosted fully on-chain.
15+
- [`photo-storage`](photo-storage/) — store and manage photos programmatically with `AssetManager` from `@icp-sdk/canisters/assets` (runs on the legacy asset canister).
16+
- [`godot-html5-template`](godot-html5-template/) — deploy a Godot HTML5 game build.
17+
- [`unity-webgl-template`](unity-webgl-template/) — deploy a Unity WebGL game build.
18+
- [`oisy-signer-demo`](oisy-signer-demo/) — connect to the OISY wallet signer, fetch token balances, and perform ICRC transfers.
19+
20+
## Security considerations and best practices
21+
22+
If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.

motoko/README.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,63 @@
11
# Motoko examples
22

3-
These examples demonstrate the use of Motoko as a backend language on the ICP platform.
3+
Canonical examples for building canisters on the Internet Computer with [Motoko](https://docs.internetcomputer.org/languages/motoko). Each example is self-contained: follow its README to deploy it locally with `icp-cli` and run its tests. Most examples have a Rust counterpart in [`../rust/`](../rust/) implementing the same Candid interface.
44

5-
## Security considerations and security best practices
5+
**New to ICP?** Start with [`hello_world`](hello_world/) — a full-stack canister with a frontend and the structural template for all examples. Then try [`who_am_i`](who_am_i/) for user authentication with [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity).
66

7-
If you base your application on one of these examples, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.
7+
Prerequisites and dev-container setup are covered in the [repository README](../README.md).
8+
9+
## Getting started
10+
11+
- [`hello_world`](hello_world/) — full-stack "Hello, world!" with a Motoko backend and a Vite frontend.
12+
- [`backend_only`](backend_only/) — the minimal canister: a single `greet` query function, no frontend.
13+
- [`who_am_i`](who_am_i/) — sign in with Internet Identity and see the principal your app receives.
14+
15+
## Full-stack applications
16+
17+
- [`daily_planner`](daily_planner/) — monthly calendar with notes and tasks; fetches historic facts via HTTPS outcalls.
18+
- [`superheroes`](superheroes/) — CRUD application with a React frontend.
19+
- [`filevault`](filevault/) — upload, download, and delete files stored per Internet Identity principal.
20+
- [`flying_ninja`](flying_ninja/) — 2D side-scroller game with an on-chain leaderboard.
21+
- [`ic-pos`](ic-pos/) — point-of-sale app accepting ICRC-1 token payments via QR codes.
22+
- [`llm_chatbot`](llm_chatbot/) — chat with a large language model from a canister.
23+
24+
## Tokens and payments
25+
26+
- [`icp_transfer`](icp_transfer/) — hold ICP in a canister and send it to other accounts via the ICP ledger.
27+
- [`icrc2-swap`](icrc2-swap/) — safe inter-canister call patterns for ICRC-2 token swaps.
28+
29+
## Chain fusion and signing
30+
31+
- [`basic_bitcoin`](basic_bitcoin/) — send and receive Bitcoin using threshold ECDSA and Schnorr signatures.
32+
- [`threshold-ecdsa`](threshold-ecdsa/) — a threshold ECDSA signing oracle.
33+
- [`threshold-schnorr`](threshold-schnorr/) — a threshold Schnorr (BIP340/BIP341, Ed25519) signing oracle.
34+
- [`evm_block_explorer`](evm_block_explorer/) — fetch block data from Ethereum and other EVM chains via the EVM RPC canister.
35+
36+
## HTTPS outcalls
37+
38+
- [`send_http_get`](send_http_get/) — make a `GET` request to an external API from a canister.
39+
- [`send_http_post`](send_http_post/) — make a `POST` request to an external API from a canister.
40+
41+
## Inter-canister patterns
42+
43+
- [`parallel_calls`](parallel_calls/) — parallel vs. sequential inter-canister calls.
44+
- [`pub-sub`](pub-sub/) — publisher/subscriber messaging using shared function references as callbacks.
45+
- [`composite_query`](composite_query/) — query functions that call other canisters' queries.
46+
- [`canister_factory`](canister_factory/) — create canisters dynamically via actor classes and the management canister.
47+
48+
## System features
49+
50+
- [`hello_cycles`](hello_cycles/) — the fundamental cycle management operations.
51+
- [`canister_logs`](canister_logs/) — canister logging with `Debug.print` and trap records.
52+
- [`low_wasm_memory`](low_wasm_memory/) — react to low Wasm memory with the `lowmemory` system hook.
53+
- [`query_stats`](query_stats/) — read a canister's own query statistics.
54+
- [`cert-var`](cert-var/) — certified variables: cryptographically verifiable query responses.
55+
- [`random_maze`](random_maze/) — cryptographic randomness from the network's random beacon.
56+
57+
## Encryption with vetKeys
58+
59+
The [`vetkeys/`](vetkeys/) directory contains examples for [vetKeys](https://docs.internetcomputer.org/concepts/vetkeys), from the low-level API to complete applications: [`basic_vetkd`](vetkeys/basic_vetkd/), [`basic_ibe`](vetkeys/basic_ibe/), [`basic_bls_signing`](vetkeys/basic_bls_signing/), [`password_manager`](vetkeys/password_manager/), [`password_manager_with_metadata`](vetkeys/password_manager_with_metadata/), and [`encrypted_notes_app_vetkd`](vetkeys/encrypted_notes_app_vetkd/).
60+
61+
## Security considerations and best practices
62+
63+
If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.

motoko/ic-pos/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IC-POS
22

3-
IC-POS is a simple Point of Sale (POS) app that accepts [ICRC-1](https://github.com/dfinity/ICRC-1) token payments on the Internet Computer. A merchant logs in with [Internet Identity](https://internetcomputer.org/internet-identity), configures a store, and charges customers by showing a QR code; incoming payments show up in the store with a live balance and transaction history.
3+
IC-POS is a simple Point of Sale (POS) app that accepts [ICRC-1](https://github.com/dfinity/ICRC-1) token payments on the Internet Computer. A merchant logs in with [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity), configures a store, and charges customers by showing a QR code; incoming payments show up in the store with a live balance and transaction history.
44

55
To let you try the full flow without spending real funds, this example uses the **TICRC1 test token** ([`3jkp5-oyaaa-aaaaj-azwqa-cai`](https://dashboard.internetcomputer.org/canister/3jkp5-oyaaa-aaaaj-azwqa-cai)) on mainnet, and a local ICRC-1 ledger + index when developing. Because the app talks to any ICRC-1 ledger, the same code works with real tokens (e.g. [ckBTC](https://internetcomputer.org/ckbtc/)) by pointing it at a different ledger.
66

motoko/vetkeys/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# vetKeys examples (Motoko)
2+
3+
Examples for [vetKeys](https://docs.internetcomputer.org/concepts/vetkeys) — verifiably encrypted threshold key derivation, the Internet Computer's primitive for on-chain encryption. Each example is self-contained: follow its README to deploy it locally with `icp-cli`. Rust counterparts live in [`../../rust/vetkeys/`](../../rust/vetkeys/).
4+
5+
**Start with** [`basic_vetkd`](basic_vetkd/) to understand the raw API, then move to the SDK-based examples.
6+
7+
## Basics
8+
9+
- [`basic_vetkd`](basic_vetkd/) — the raw VetKD management canister API: symmetric key derivation and IBE without any SDK abstraction.
10+
- [`basic_ibe`](basic_ibe/) — secure messaging with Identity-Based Encryption, using Internet Identity principals as encryption keys.
11+
- [`basic_bls_signing`](basic_bls_signing/) — a threshold BLS signing service where users can only sign for their own principal.
12+
13+
## Applications
14+
15+
- [`password_manager`](password_manager/) — a decentralized password manager built on Encrypted Maps, with shareable vaults.
16+
- [`password_manager_with_metadata`](password_manager_with_metadata/) — extends the password manager with unencrypted metadata alongside encrypted passwords.
17+
- [`encrypted_notes_app_vetkd`](encrypted_notes_app_vetkd/) — end-to-end encrypted note-taking with multi-device access and note sharing.
18+
19+
## Security considerations and best practices
20+
21+
If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.

native-apps/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Native app examples
2+
3+
Examples for integrating native applications (mobile, desktop, game engines) with canisters on the Internet Computer. Each example is self-contained: follow its README to deploy the canister side with `icp-cli` and build the native app.
4+
5+
Prerequisites and dev-container setup are covered in the [repository README](../README.md).
6+
7+
## Examples
8+
9+
- [`unity_ii_deeplink`](unity_ii_deeplink/) — authenticate a Unity mobile app through [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity) using a browser-based bridge canister and deep-link callbacks, then call a canister with the resulting delegation.
10+
11+
## Security considerations and best practices
12+
13+
If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.

native-apps/unity_ii_deeplink/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unity + Internet Identity
22

3-
This example shows how a Unity mobile app can authenticate users through [Internet Identity](https://internetcomputer.org/internet-identity) and call an ICP canister using the resulting delegation identity.
3+
This example shows how a Unity mobile app can authenticate users through [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity) and call an ICP canister using the resulting delegation identity.
44

55
The example consists of three parts:
66

rust/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Rust examples
2+
3+
Canonical examples for building canisters on the Internet Computer with [Rust](https://docs.internetcomputer.org/languages/rust). Each example is self-contained: follow its README to deploy it locally with `icp-cli` and run its tests. Most examples have a Motoko counterpart in [`../motoko/`](../motoko/) implementing the same Candid interface.
4+
5+
**New to ICP?** Start with [`hello_world`](hello_world/) — a full-stack canister with a frontend and the structural template for all examples. Then try [`who_am_i`](who_am_i/) for user authentication with [Internet Identity](https://docs.internetcomputer.org/guides/authentication/internet-identity).
6+
7+
Prerequisites and dev-container setup are covered in the [repository README](../README.md).
8+
9+
## Getting started
10+
11+
- [`hello_world`](hello_world/) — full-stack "Hello, world!" with a Rust backend and a Vite frontend.
12+
- [`backend_only`](backend_only/) — the minimal canister: a single `greet` query function, no frontend.
13+
- [`backend_wasm64`](backend_wasm64/) — the same minimal canister compiled for the Wasm64 target.
14+
- [`who_am_i`](who_am_i/) — sign in with Internet Identity and see the principal your app receives.
15+
16+
## Full-stack applications
17+
18+
- [`daily_planner`](daily_planner/) — monthly calendar with notes and tasks; fetches historic facts via HTTPS outcalls.
19+
- [`flying_ninja`](flying_ninja/) — 2D side-scroller game with an on-chain leaderboard.
20+
- [`photo_gallery`](photo_gallery/) — upload and view photos served via the HTTP gateway with cacheable responses.
21+
- [`llm_chatbot`](llm_chatbot/) — chat with a large language model from a canister.
22+
23+
## Tokens and payments
24+
25+
- [`icp_transfer`](icp_transfer/) — hold ICP in a canister and send it to other accounts via the ICP ledger.
26+
- [`receiving-icp`](receiving-icp/) — generate account identifiers and check balances to receive ICP.
27+
- [`exchange-rates`](exchange-rates/) — query crypto and fiat exchange rates from the Exchange Rate Canister (XRC).
28+
- [`stake_neuron_from_cli`](stake_neuron_from_cli/) — stake ICP into an NNS neuron from a Rust CLI binary using `ic-agent`.
29+
30+
## Chain fusion and signing
31+
32+
- [`basic_bitcoin`](basic_bitcoin/) — send and receive Bitcoin (P2PKH, P2WPKH, P2TR addresses).
33+
- [`basic_ethereum`](basic_ethereum/) — send and receive Ether using threshold ECDSA.
34+
- [`evm_block_explorer`](evm_block_explorer/) — fetch block data from Ethereum and other EVM chains via the EVM RPC canister.
35+
- [`threshold-ecdsa`](threshold-ecdsa/) — a threshold ECDSA signing oracle.
36+
- [`threshold-schnorr`](threshold-schnorr/) — a threshold Schnorr (BIP340/BIP341, Ed25519) signing oracle.
37+
- [`x509`](x509/) — issue and verify X.509 certificates with threshold signatures.
38+
39+
## HTTPS outcalls
40+
41+
- [`send_http_get`](send_http_get/) — make a `GET` request to an external API from a canister.
42+
- [`send_http_post`](send_http_post/) — make a `POST` request to an external API from a canister.
43+
44+
## Inter-canister patterns
45+
46+
- [`inter-canister-calls`](inter-canister-calls/) — bounded-wait and unbounded-wait calls, retries, and attaching cycles.
47+
- [`parallel_calls`](parallel_calls/) — parallel vs. sequential inter-canister calls.
48+
- [`composite_query`](composite_query/) — query functions that call other canisters' queries.
49+
- [`guards`](guards/) — how guard functions interact with asynchronous code.
50+
- [`candid_type_generation`](candid_type_generation/) — generate Rust types from an external canister's `.did` file.
51+
52+
## Canister operations and system features
53+
54+
- [`canister-info`](canister-info/) — retrieve metadata about any canister via the management canister.
55+
- [`canister-snapshots`](canister-snapshots/) — take and restore canister snapshots.
56+
- [`canister-snapshot-download`](canister-snapshot-download/) — download and upload canister snapshots.
57+
- [`canister_logs`](canister_logs/) — canister logging, traps, panics, and error handling.
58+
- [`low_wasm_memory`](low_wasm_memory/) — react to low Wasm memory with the `on_low_wasm_memory` hook.
59+
- [`periodic_tasks`](periodic_tasks/) — timers and heartbeats for scheduled execution.
60+
- [`performance_counters`](performance_counters/) — measure the work a canister performs.
61+
- [`query_stats`](query_stats/) — read a canister's own query statistics.
62+
63+
## Compute and AI
64+
65+
- [`image-classification`](image-classification/) — run an ONNX machine-learning model inside a canister.
66+
- [`face-recognition`](face-recognition/) — face detection and recognition with the Tract ONNX engine.
67+
- [`qrcode`](qrcode/) — long-running image processing in a single message execution.
68+
- [`simd`](simd/) — WebAssembly SIMD acceleration for compute-heavy workloads.
69+
70+
## Testing
71+
72+
- [`unit_testable_rust_canister`](unit_testable_rust_canister/) — structure a canister for comprehensive unit testing.
73+
74+
## Encryption with vetKeys
75+
76+
The [`vetkeys/`](vetkeys/) directory contains examples for [vetKeys](https://docs.internetcomputer.org/concepts/vetkeys), from the low-level API to complete applications: [`basic_vetkd`](vetkeys/basic_vetkd/), [`basic_ibe`](vetkeys/basic_ibe/), [`basic_timelock_ibe`](vetkeys/basic_timelock_ibe/), [`basic_bls_signing`](vetkeys/basic_bls_signing/), [`password_manager`](vetkeys/password_manager/), [`password_manager_with_metadata`](vetkeys/password_manager_with_metadata/), and [`encrypted_notes_app_vetkd`](vetkeys/encrypted_notes_app_vetkd/).
77+
78+
## Security considerations and best practices
79+
80+
If you base your application on one of these examples, we recommend you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on the Internet Computer. The examples provided here may not implement all the best practices.

0 commit comments

Comments
 (0)