diff --git a/AGENTS.md b/AGENTS.md index 7984899c47..09d86803c1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -363,6 +363,8 @@ Each example's README follows this structure: ```markdown # + + <2-3 sentences describing what the example demonstrates> ## Build and deploy from the command line @@ -389,8 +391,34 @@ Rust: `icp build backend && candid-extractor target/wasm32-unknown-unknown/relea ``` - Say **"canister"**, not "smart contract" — in READMEs and code comments alike. -- Each README links to its counterpart in the other language. +- **No back-references:** do not add a "View this sample's code on GitHub" link or a cross-language "also available in \" link. Readers arrive from GitHub and pick a language folder upfront, so both are redundant. (Language-*description* links — e.g. to the Motoko or Rust docs — are fine; those explain the language, they don't jump to the sibling example.) - **Backend-only examples:** omit the `## Updating the Candid interface` section — no frontend consumes the `.did` file. - **Child-canister examples:** add a note that an out-of-cycles error is fixed with `icp canister top-up --amount backend`. - **Links:** only add links you have verified resolve on the current docs site; prefer top-level pages over deep anchors when unsure. - **Docs over product pages:** when the context is learning or integrating a feature, link the developer docs (e.g. https://docs.internetcomputer.org/guides/authentication/internet-identity for Internet Identity); link the product itself (e.g. https://id.ai) only when referring to the live instance an end user interacts with. + +### ICP Ninja badge + +[ICP Ninja](https://icp.ninja) is a browser-based IDE that deploys a project to the mainnet for free. An example carries an "Open in ICP Ninja" badge only once it is **both eligible (rules below) and known to ICP Ninja**; the badge is the first thing under the H1, followed by a short callout: + +```markdown +# + +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master//) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. +``` + +- **Badge asset:** always `https://icp.ninja/assets/open.svg` (the official badge). **Import URL:** `https://icp.ninja/i?g=`. +- **The callout is dual-context.** ICP Ninja renders the README as its default preview, so the block is read both on GitHub (where the badge is the call-to-action) and inside Ninja (where "hit **Deploy**" is the actionable step). Keep both cues. + +**Eligibility — only add the badge when all of these hold:** + +- **No canister factory.** The example must not create canisters at runtime (e.g. `actor class` sub-canisters, `create_canister` + `install_code`). +- **At most 2 canisters in the `ic` environment.** Count the `ic` environment's canister list, not the local one (an example may deploy extra canisters locally — mock ledgers, pre-built infra — while restricting `ic` to `backend`+`frontend`). If a helper canister is only needed locally (e.g. a test subject, a mock ledger), restrict it to `local` via the `environments` block so `ic`/Ninja deploys only the real thing. +- **Deployable in Ninja's no-terminal environment.** No custom build scripts beyond the standard recipe build; no controller-only setup step a Ninja user can't perform (e.g. `photo-storage` needs an `authorize` call from a controller, so it is excluded despite being a single canister). +- **Demonstrable, not just deployable.** A user must be able to do something meaningful with a *fresh* deploy — the core method returns a real result (compute, an HTTPS/inter-canister call, a CRUD round-trip, canister logs, a derived address/key), **or** the README gives a clear path to make it meaningful using resources the user can obtain themselves (II login, faucet **TESTICP**/**TESTICRC1** tokens, passing a canister principal). Exclude examples whose headline function returns nothing without state the user can't supply — e.g. `candid_type_generation`'s `list_neurons` returns only neurons the caller controls, which a fresh canister has none of, so it always comes back empty. + +For token examples, the `ic` environment should use the **TESTICP**/**TESTICRC1** test ledgers (not the real ICP ledger) so users can exercise transfers with free faucet tokens — and the README should point at the [faucet](https://faucet.internetcomputer.org) and the steps to use it. + +Skip the badge for ineligible examples and for language-native/CLI examples that aren't a deployable canister project. Eligibility is necessary but not sufficient: an example that satisfies these rules but is not yet known to ICP Ninja should be **proposed to the Ninja team first**, and the badge added only once Ninja supports it. diff --git a/hosting/godot-html5-template/README.md b/hosting/godot-html5-template/README.md index 7b81d76ca5..a4fbd48ed1 100644 --- a/hosting/godot-html5-template/README.md +++ b/hosting/godot-html5-template/README.md @@ -1,7 +1,5 @@ # Godot HTML5 sample -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/godot-html5-template) - ## Overview The example shows how to deploy a Godot HTML5 build on ICP in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample. diff --git a/hosting/oisy-signer-demo/README.md b/hosting/oisy-signer-demo/README.md index a7cdbe3794..4cbb8ad91a 100644 --- a/hosting/oisy-signer-demo/README.md +++ b/hosting/oisy-signer-demo/README.md @@ -1,6 +1,8 @@ # OISY Signer Demo -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/oisy-signer-demo) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/hosting/oisy-signer-demo) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview @@ -12,12 +14,6 @@ Testnet tokens can be obtained for free using the [ICP Faucet](https://faucet.in The `/frontend` folder contains the web assets for the application's user interface, built with React, Vite, and Tailwind CSS. - - ## Build and deploy from the command line ### Prerequisites diff --git a/hosting/photo-storage/README.md b/hosting/photo-storage/README.md index e920eabfec..8d2ef9f304 100644 --- a/hosting/photo-storage/README.md +++ b/hosting/photo-storage/README.md @@ -1,7 +1,5 @@ # Photo storage example -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/photo-storage) - ## Overview The example shows how to store photos on ICP in an asset canister using the `AssetManager` from `@icp-sdk/canisters/assets`. The photo storage app is deployed as a frontend in an asset canister which is also used for photo upload. diff --git a/hosting/react/README.md b/hosting/react/README.md index 4a71f2d193..ce2b123e46 100644 --- a/hosting/react/README.md +++ b/hosting/react/README.md @@ -1,6 +1,8 @@ # Basic React Frontend -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/react) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/hosting/react) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview @@ -10,12 +12,6 @@ A minimal React application hosted entirely onchain on ICP. It demonstrates how The `/frontend` folder contains the web assets for the application's user interface, built with React, Vite, and Tailwind CSS. The frontend is deployed as an asset canister — no backend canister is needed. - - ## Build and deploy from the command line ### Prerequisites diff --git a/hosting/static-website/README.md b/hosting/static-website/README.md index db297510bb..2f449eca81 100644 --- a/hosting/static-website/README.md +++ b/hosting/static-website/README.md @@ -1,7 +1,5 @@ # Static website -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/static-website) - ## Overview The example shows how to deploy a simple, static website hosted on ICP. The website is very simple; it just displays the DFINITY logo. While the website in this example is very simple, the method would be the same for a more advanced static website, e.g., based on popular static site generators. diff --git a/hosting/unity-webgl-template/README.md b/hosting/unity-webgl-template/README.md index 71febd8317..23ff3f13dc 100644 --- a/hosting/unity-webgl-template/README.md +++ b/hosting/unity-webgl-template/README.md @@ -1,7 +1,5 @@ # Unity WebGL sample -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/unity-webgl-template) - ## Overview 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. The Unity WebGL build is deployed as frontend, no backend is needed in this sample. diff --git a/motoko/backend_only/README.md b/motoko/backend_only/README.md index 59ad7616cf..bbe835e3db 100644 --- a/motoko/backend_only/README.md +++ b/motoko/backend_only/README.md @@ -1,6 +1,10 @@ # Motoko backend -This backend-only example demonstrates how to write a simple smart contract for ICP. It implements a single `greet(name)` query function that returns a greeting string. +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/backend_only) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + +This backend-only example demonstrates how to write a simple canister for ICP. It implements a single `greet(name)` query function that returns a greeting string. ## Build and deploy from the command line diff --git a/motoko/basic_bitcoin/README.md b/motoko/basic_bitcoin/README.md index 7fb74f57f8..eba8979685 100644 --- a/motoko/basic_bitcoin/README.md +++ b/motoko/basic_bitcoin/README.md @@ -1,5 +1,9 @@ # Basic Bitcoin +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/basic_bitcoin) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how a canister can send and receive Bitcoin on the Internet Computer using threshold ECDSA and Schnorr signatures. It covers three address types (P2PKH, P2TR key-path, P2TR script-path), querying balances and UTXOs, reading chain state, and sending transactions. For a deeper understanding of the ICP ↔ Bitcoin integration, see the [Bitcoin integration concepts](https://docs.internetcomputer.org/concepts/chain-fusion/bitcoin). diff --git a/motoko/canister_factory/README.md b/motoko/canister_factory/README.md index ade4892d23..64354ff403 100644 --- a/motoko/canister_factory/README.md +++ b/motoko/canister_factory/README.md @@ -1,7 +1,5 @@ # Motoko Canister Factory -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/canister_factory) - ## Overview This example demonstrates two approaches to creating canisters dynamically on the Internet Computer: high-level actor class management (using the `system` keyword) and low-level management canister calls. It also shows the critical difference between upgrading a canister (state preserved) and reinstalling it (state reset). diff --git a/motoko/canister_logs/README.md b/motoko/canister_logs/README.md index 44de11506d..a12601c22c 100644 --- a/motoko/canister_logs/README.md +++ b/motoko/canister_logs/README.md @@ -1,5 +1,9 @@ # Canister logs +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/canister_logs) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates canister logging on the Internet Computer. Every message written with `Debug.print` and every trap is recorded in the canister's log, which can be retrieved at any time with `icp canister logs`. The example covers: - **Update calls** — `Debug.print` output from update methods diff --git a/motoko/daily_planner/README.md b/motoko/daily_planner/README.md index 7f882631c3..934bd21fc7 100644 --- a/motoko/daily_planner/README.md +++ b/motoko/daily_planner/README.md @@ -1,5 +1,9 @@ # Daily Planner +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/daily_planner) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + Daily Planner is a full-stack ICP example featuring a monthly calendar that tracks daily notes and tasks stored on the network. For each day, a historic fact can be fetched from an external API using HTTPS outcalls, demonstrating how ICP canisters can access data from external services. ## Build and deploy from the command line diff --git a/motoko/evm_block_explorer/README.md b/motoko/evm_block_explorer/README.md index f7c811d7c5..5103e1e53f 100644 --- a/motoko/evm_block_explorer/README.md +++ b/motoko/evm_block_explorer/README.md @@ -1,6 +1,8 @@ # EVM Block Explorer -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/evm_block_explorer) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/evm_block_explorer) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview @@ -8,14 +10,6 @@ The EVM Block Explorer example demonstrates how an ICP canister can fetch block The backend reaches the EVM RPC canister through the typed import `import EvmRpc "canister:evm_rpc"` in `backend/EvmRpcApi.mo` — no RPC actor type is hand-written. The import is typed against the EVM RPC canister's committed Candid interface (`candid/evm_rpc.did`), and the `--actor-env-alias` flag in `mops.toml` binds it to the `PUBLIC_CANISTER_ID:evm_rpc` environment variable that icp-cli injects (the local `evm_rpc` canister when developing, the shared `7hfb6-caaaa-aaaar-qadga-cai` on mainnet). The principal is resolved at canister install/upgrade; no principal is compiled into the Wasm, so the same artifact runs in every environment. - - ## Build and deploy from the command line ### Prerequisites diff --git a/motoko/filevault/README.md b/motoko/filevault/README.md index 64d602d6e8..b3c0ba4952 100644 --- a/motoko/filevault/README.md +++ b/motoko/filevault/README.md @@ -1,5 +1,9 @@ # FileVault +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/filevault) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + FileVault is a file storage application that allows you to upload files from your local computer and store them on the network. FileVault uses Internet Identity (II) for user login and authentication. Once files are uploaded, they can be downloaded at a later time, or they can be deleted. Each user's files are stored under their Internet Identity principal, so only that principal can access them through the canister's public interface. ## Build and deploy from the command line diff --git a/motoko/flying_ninja/README.md b/motoko/flying_ninja/README.md index 720ab9667f..d51105eccb 100644 --- a/motoko/flying_ninja/README.md +++ b/motoko/flying_ninja/README.md @@ -1,5 +1,9 @@ # Flying Ninja +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/flying_ninja) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + Flying Ninja is a 2D side-scroller game where players control a ninja character using the space bar to move up and down, dodging obstacles to earn points. When the game ends, players can submit their score to an on-chain leaderboard backed by a Motoko canister on ICP. ## Build and deploy from the command line diff --git a/motoko/hello_world/README.md b/motoko/hello_world/README.md index 271d07c808..4e361fac0d 100644 --- a/motoko/hello_world/README.md +++ b/motoko/hello_world/README.md @@ -1,6 +1,8 @@ # Hello, world! -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/hello_world) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/hello_world) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview diff --git a/motoko/icp_transfer/README.md b/motoko/icp_transfer/README.md index 44de72d122..a1fd4c10f8 100644 --- a/motoko/icp_transfer/README.md +++ b/motoko/icp_transfer/README.md @@ -1,6 +1,6 @@ # ICP Transfer -ICP Transfer demonstrates how a canister can hold ICP and send it to other accounts using the [ICP ledger](https://dashboard.internetcomputer.org/canister/ryjl3-tyaaa-aaaaa-aaaba-cai). The same example is also available in [Rust](https://github.com/dfinity/examples/tree/master/rust/icp_transfer). +ICP Transfer demonstrates how a canister can hold ICP and send it to other accounts using the [ICP ledger](https://dashboard.internetcomputer.org/canister/ryjl3-tyaaa-aaaaa-aaaba-cai). ## Account identifiers diff --git a/motoko/llm_chatbot/README.md b/motoko/llm_chatbot/README.md index 3c90eff0ca..3f31a62e39 100644 --- a/motoko/llm_chatbot/README.md +++ b/motoko/llm_chatbot/README.md @@ -1,5 +1,9 @@ # LLM Chatbot +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/llm_chatbot) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how an ICP canister can interact with a large language model (LLM) to generate text. The user can input a prompt and the canister will use the LLM to generate a response. Follow-up prompts continue the conversation with the full message history. ## How it works diff --git a/motoko/query_stats/README.md b/motoko/query_stats/README.md index 886d2e6999..6e8d42685f 100644 --- a/motoko/query_stats/README.md +++ b/motoko/query_stats/README.md @@ -1,5 +1,9 @@ # Query Stats +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/query_stats) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how a canister can read its own query statistics using `ic.canister_status`. It retrieves metrics such as the total number of query calls, instructions executed, and payload bytes. ## How query stats work diff --git a/motoko/send_http_get/README.md b/motoko/send_http_get/README.md index b611137a89..a22feb9b79 100644 --- a/motoko/send_http_get/README.md +++ b/motoko/send_http_get/README.md @@ -1,5 +1,9 @@ # HTTP: GET +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/send_http_get) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to use the Internet Computer's HTTPS outcalls feature to make a `GET` request from a Motoko canister. It sends a request to `postman-echo.com` and returns the echoed JSON response, showing how to pass query parameters and headers through HTTP outcalls. For a deeper understanding of HTTPS outcalls on the IC, see the [HTTPS outcalls documentation](https://docs.internetcomputer.org/concepts/https-outcalls). diff --git a/motoko/send_http_post/README.md b/motoko/send_http_post/README.md index ce4df048eb..6a1283076a 100644 --- a/motoko/send_http_post/README.md +++ b/motoko/send_http_post/README.md @@ -1,5 +1,9 @@ # HTTP: POST +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/send_http_post) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to use the ICP HTTPS outcalls feature to make a `POST` request from a Motoko canister. It sends a plain-text body to `postman-echo.com/post`, which echoes back the request as JSON, allowing you to verify the POST body and headers were sent correctly. For a deeper understanding of HTTPS outcalls on the IC, see the [HTTPS outcalls documentation](https://docs.internetcomputer.org/concepts/https-outcalls). diff --git a/motoko/superheroes/README.md b/motoko/superheroes/README.md index f3715f251c..03d0700c48 100644 --- a/motoko/superheroes/README.md +++ b/motoko/superheroes/README.md @@ -1,5 +1,9 @@ # Superheroes CRUD +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/superheroes) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to build a CRUD (Create, Read, Update, Delete) application on ICP using Motoko and React. The backend canister stores superhero records (a name and a list of superpowers), and exposes four methods: `create`, `read`, `update`, and `delete`. The React frontend provides a simple UI for interacting with each operation. ## Build and deploy from the command line diff --git a/motoko/threshold-ecdsa/README.md b/motoko/threshold-ecdsa/README.md index d820bc2076..de2f24fed0 100644 --- a/motoko/threshold-ecdsa/README.md +++ b/motoko/threshold-ecdsa/README.md @@ -1,5 +1,9 @@ # Threshold ECDSA +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/threshold-ecdsa) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates threshold ECDSA signing, part of ICP's [chain-key cryptography](https://docs.internetcomputer.org/concepts/chain-key-cryptography). The canister acts as a signing oracle: callers can request a threshold ECDSA public key derived from their principal, and sign arbitrary messages using the corresponding private key — without the canister ever holding the key material itself. ## Build and deploy from the command line diff --git a/motoko/threshold-schnorr/README.md b/motoko/threshold-schnorr/README.md index 36c9db73d3..1e063664f5 100644 --- a/motoko/threshold-schnorr/README.md +++ b/motoko/threshold-schnorr/README.md @@ -1,5 +1,9 @@ # Threshold Schnorr +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/threshold-schnorr) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates threshold Schnorr signing (BIP340/BIP341 and Ed25519), part of ICP's [chain-key cryptography](https://docs.internetcomputer.org/concepts/chain-key-cryptography). The canister acts as a signing oracle that creates Schnorr signatures using keys derived from the canister ID. Canisters do not hold private keys themselves — signing requests are routed to threshold Schnorr subnets that compute signatures using distributed key shares. ## Build and deploy from the command line diff --git a/motoko/vetkeys/basic_bls_signing/README.md b/motoko/vetkeys/basic_bls_signing/README.md index 847656ed57..3e1e5b8fec 100644 --- a/motoko/vetkeys/basic_bls_signing/README.md +++ b/motoko/vetkeys/basic_bls_signing/README.md @@ -1,9 +1,5 @@ # Threshold BLS Signatures (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/basic_bls_signing) - -Also available in: [Rust](../../../rust/vetkeys/basic_bls_signing) - The **Basic BLS signing** example demonstrates how to use **[VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** to implement a threshold BLS signing service on the **Internet Computer (IC)**, where every authenticated user can ask the canister to produce signatures, with the **Internet Identity Principal** identifying the signer. The canister ensures a user can only produce signatures for their own principal, not for someone else's. Furthermore, the vetKeys in this app can only be produced upon a user request, as specified in the canister code — the canister cannot produce signatures for arbitrary users or messages. To confirm the canister can only produce signatures in the intended way, users need to inspect the code installed in the canister. For this, it is crucial that canisters using VetKeys have their code public. diff --git a/motoko/vetkeys/basic_ibe/README.md b/motoko/vetkeys/basic_ibe/README.md index 73983979f4..0883f3c81c 100644 --- a/motoko/vetkeys/basic_ibe/README.md +++ b/motoko/vetkeys/basic_ibe/README.md @@ -1,9 +1,5 @@ # Identity-Based Encryption (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/basic_ibe) - -Also available in: [Rust](../../../rust/vetkeys/basic_ibe) - The **Basic IBE** example demonstrates how to use **[VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** to implement secure messaging between users by means of Identity-Based Encryption (IBE) on the **Internet Computer (IC)**. Users send encrypted messages to other users using their **Internet Identity Principal** as the encryption key identifier. The canister ensures that only the authorized user can access their private decryption key — even if someone else knows your principal, they cannot decrypt messages intended for you, because neither other users nor this canister can access your private key. Note that generally it is possible for a canister to request a decryption key to decrypt secrets as part of its code. However, doing so requires the canister to provide its own transport key instead of requesting a user's transport key, and this inherently makes the secrets public. Such functionality can be detected by inspecting the code, so it is crucial that canisters using VetKeys have their code public to allow verifying that the canister handles secrets in a secure way. diff --git a/motoko/vetkeys/basic_vetkd/README.md b/motoko/vetkeys/basic_vetkd/README.md index 3aea1a47cd..d62a26a33b 100644 --- a/motoko/vetkeys/basic_vetkd/README.md +++ b/motoko/vetkeys/basic_vetkd/README.md @@ -1,9 +1,5 @@ # Basic VetKD Demo (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/basic_vetkd) - -Also available in: [Rust](../../rust/vetkeys/basic_vetkd) - ## Overview Demonstrates the raw VetKD management canister API — the lowest-level building block for verifiably encrypted threshold key derivation on the Internet Computer. The example shows two use cases: symmetric key derivation (AES-GCM-256) and identity-based encryption (IBE), both driven directly via the management canister interface without any SDK abstraction. diff --git a/motoko/vetkeys/encrypted_notes_app_vetkd/README.md b/motoko/vetkeys/encrypted_notes_app_vetkd/README.md index 8068024a2e..7b59d25146 100644 --- a/motoko/vetkeys/encrypted_notes_app_vetkd/README.md +++ b/motoko/vetkeys/encrypted_notes_app_vetkd/README.md @@ -1,9 +1,5 @@ # Encrypted Notes: vetKD (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/encrypted_notes_app_vetkd) - -Also available in: [Rust](../../../rust/vetkeys/encrypted_notes_app_vetkd) - Encrypted notes is an example app for authoring and storing confidential information on the Internet Computer (ICP) in the form of short pieces of text. Users can create and access their notes via any number of automatically synchronized devices authenticated via Internet Identity (II). Notes are stored confidentially using vetKeys. The end-to-end encryption is performed by the app's frontend. In particular, the notes are encrypted with an AES key that is derived (directly in the browser) from a note-ID-specific vetKey obtained from the backend canister (in encrypted form, using an ephemeral transport key), which itself obtains it from the vetKD system API. This way, there is no need for any device management in the app, plus sharing of notes becomes possible. diff --git a/motoko/vetkeys/password_manager/README.md b/motoko/vetkeys/password_manager/README.md index 01e3647235..94cd3dba3a 100644 --- a/motoko/vetkeys/password_manager/README.md +++ b/motoko/vetkeys/password_manager/README.md @@ -1,9 +1,5 @@ # VetKey Password Manager (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/password_manager) - -Also available in: [Rust](../../../rust/vetkeys/password_manager) - The **VetKey Password Manager** is an example application demonstrating how to use **VetKeys** and **Encrypted Maps** to build a secure, decentralized password manager on the **Internet Computer (IC)**. This application allows users to create password vaults, store encrypted passwords, and share vaults with other users via their **Internet Identity Principal**. ## Features @@ -70,6 +66,6 @@ This example app does not implement key rotation, which is strongly recommended ## Additional resources -- **[Password Manager with Metadata](../../../rust/vetkeys/password_manager_with_metadata)** — if you need to store additional metadata alongside passwords. +- **[Password Manager with Metadata](../password_manager_with_metadata)** — if you need to store additional metadata alongside passwords. - **[What are VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** — more information about VetKeys and VetKD. - [Security best practices](https://docs.internetcomputer.org/guides/security/overview/) diff --git a/motoko/vetkeys/password_manager_with_metadata/README.md b/motoko/vetkeys/password_manager_with_metadata/README.md index da90db75d8..b91c50a055 100644 --- a/motoko/vetkeys/password_manager_with_metadata/README.md +++ b/motoko/vetkeys/password_manager_with_metadata/README.md @@ -1,9 +1,5 @@ # VetKey Password Manager with Metadata (Motoko) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/vetkeys/password_manager_with_metadata) - -Also available in: [Rust](../../../rust/vetkeys/password_manager_with_metadata) - The **VetKey Password Manager** is an example application demonstrating how to use **VetKeys** and **Encrypted Maps** to build a secure, decentralized password manager on the **Internet Computer (IC)**. This application allows users to create password vaults, store encrypted passwords, and share vaults with other users via their **Internet Identity Principal**. This version extends the basic password manager by supporting unencrypted metadata, such as URLs and tags, alongside encrypted passwords. The goal is to demonstrate how to make atomic updates to the Encrypted Maps canister, storing both encrypted and unencrypted data in a single update call. @@ -81,6 +77,6 @@ This example app does not implement key rotation, which is strongly recommended ## Additional resources -- **[Basic Password Manager](../../../rust/vetkeys/password_manager)** — a simpler example without metadata. +- **[Basic Password Manager](../password_manager)** — a simpler example without metadata. - **[What are VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** — more information about VetKeys and VetKD. - [Security best practices](https://docs.internetcomputer.org/guides/security/overview/) diff --git a/motoko/who_am_i/README.md b/motoko/who_am_i/README.md index e96a166d7e..f036142bf6 100644 --- a/motoko/who_am_i/README.md +++ b/motoko/who_am_i/README.md @@ -1,10 +1,12 @@ # Who am I? -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/motoko/who_am_i) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/motoko/who_am_i) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview -Who am I? demonstrates how entities on the Internet Computer are identified. Every entity, such as a user or canister smart contract, has a principal identifier. Principals can be used for identification and authentication. Who am I? uses Internet Identity (II) for user authentication, then displays the principal identifier associated with that Internet Identity on the user interface. +Who am I? demonstrates how entities on the Internet Computer are identified. Every entity, such as a user or canister, has a principal identifier. Principals can be used for identification and authentication. Who am I? uses Internet Identity (II) for user authentication, then displays the principal identifier associated with that Internet Identity on the user interface. ## Build and deploy from the command line diff --git a/rust/backend_only/README.md b/rust/backend_only/README.md index 7754d46745..1c574b42f7 100644 --- a/rust/backend_only/README.md +++ b/rust/backend_only/README.md @@ -1,6 +1,10 @@ # Rust backend -This backend-only example demonstrates how to write a simple smart contract for ICP. It implements a single `greet(name)` query function that returns a greeting string. +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/backend_only) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + +This backend-only example demonstrates how to write a simple canister for ICP. It implements a single `greet(name)` query function that returns a greeting string. ## Build and deploy from the command line diff --git a/rust/backend_wasm64/README.md b/rust/backend_wasm64/README.md index 30554f1e60..40f44736c3 100644 --- a/rust/backend_wasm64/README.md +++ b/rust/backend_wasm64/README.md @@ -1,10 +1,12 @@ # Rust backend (Wasm64) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/backend_wasm64) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/backend_wasm64) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview -This backend-only project demonstrates how to write a simple smart contract for ICP using **Wasm64** compilation target. +This backend-only project demonstrates how to write a simple canister for ICP using **Wasm64** compilation target. This example specifically showcases building and deploying canisters compiled to the Wasm64 target, which provides access to 64-bit memory addressing and can handle larger memory spaces compared to the traditional Wasm32 target. @@ -17,10 +19,6 @@ The Wasm64 target allows canisters to: This example uses the `build.sh` script to build for Wasm64 using Rust's nightly toolchain and the `-Z build-std` feature. - - ## Build and deploy from the command line ### Prerequisites diff --git a/rust/basic_bitcoin/README.md b/rust/basic_bitcoin/README.md index 5dba5ed09f..7cd918860c 100644 --- a/rust/basic_bitcoin/README.md +++ b/rust/basic_bitcoin/README.md @@ -1,5 +1,9 @@ # Basic Bitcoin +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/basic_bitcoin) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how a canister can receive and send bitcoin on the Internet Computer, including support for legacy (P2PKH), SegWit (P2WPKH), and Taproot (P2TR) address types. ## Architecture diff --git a/rust/basic_ethereum/README.md b/rust/basic_ethereum/README.md index 25c4436b33..5a42e5f5e1 100644 --- a/rust/basic_ethereum/README.md +++ b/rust/basic_ethereum/README.md @@ -1,6 +1,10 @@ # Basic Ethereum -This example demonstrates how to deploy a canister smart contract on the Internet Computer that can **send and receive Ether (ETH)** on the Ethereum network. The canister uses threshold ECDSA to sign Ethereum transactions and HTTPS outcalls to communicate with the Ethereum network via the EVM RPC canister. +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/basic_ethereum) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + +This example demonstrates how to deploy a canister on the Internet Computer that can **send and receive Ether (ETH)** on the Ethereum network. The canister uses threshold ECDSA to sign Ethereum transactions and HTTPS outcalls to communicate with the Ethereum network via the EVM RPC canister. ## Architecture diff --git a/rust/canister-info/README.md b/rust/canister-info/README.md index 1389059c8c..80f0269552 100644 --- a/rust/canister-info/README.md +++ b/rust/canister-info/README.md @@ -1,5 +1,9 @@ # Canister Info +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/canister-info) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to use the IC's [`canister_info`](https://docs.internetcomputer.org/references/management-canister/#canister_info) management call to retrieve information about any canister, including its recent change history (the IC retains up to 20 changes per canister). Two canisters are deployed: @@ -33,13 +37,15 @@ bash test.sh icp network stop ``` -After deploying, you can inspect any canister by passing its principal to the backend. For example, to inspect the `test` canister itself: +After deploying, you can inspect any canister by passing its principal to the backend. Locally, the `test` helper canister is deployed as a convenient subject: ```bash test_id=$(icp canister status test -i) icp canister call backend info "(principal \"$test_id\")" ``` +The `test` canister is deployed **locally only** — the `info` methods accept any canister principal, so on mainnet you can inspect the `backend` itself (`icp canister status backend -i -e ic`) or any other canister ID without it. + ## Canister history limit The IC retains only the **most recent 20 changes** per canister. The `info` function requests up to 20 changes via `num_requested_changes: Some(20)`. Once a canister exceeds 20 changes, older entries are dropped permanently. diff --git a/rust/canister-info/icp.yaml b/rust/canister-info/icp.yaml index 611553aa96..26c5572db1 100644 --- a/rust/canister-info/icp.yaml +++ b/rust/canister-info/icp.yaml @@ -3,10 +3,20 @@ canisters: recipe: type: "@dfinity/rust@v3.3.0" - # test is a pre-built canister deployed only to provide a subject for the - # backend's canister_info queries in test.sh. + # test is a pre-built canister that provides a subject for the backend's + # canister_info queries in test.sh. It is deployed locally only (see the + # environments block): the backend's info methods accept any canister + # principal, so on mainnet you can inspect the backend itself or any other + # canister without deploying this helper. - name: test build: steps: - type: pre-built path: test.wasm + +environments: + - name: local + network: local + - name: ic + network: ic + canisters: [backend] diff --git a/rust/canister_logs/README.md b/rust/canister_logs/README.md index fa8cd0b729..a46a4ebb15 100644 --- a/rust/canister_logs/README.md +++ b/rust/canister_logs/README.md @@ -1,11 +1,13 @@ # Canister logs +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/canister_logs) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates canister logging and error handling on the Internet Computer. It shows how to use `ic_cdk::println!` for diagnostic output, how traps, panics, and memory errors are automatically captured in the canister log, and how periodic timers generate log entries. The canister exposes methods to print messages, trigger explicit traps, cause panics, simulate stable-memory out-of-bounds errors, and call `raw_rand`. A key behavioral distinction is demonstrated: log messages from **update calls and replicated queries** are recorded in the canister log, while messages from **non-replicated query calls** are not. -See also the [Motoko version](../../motoko/canister_logs). - ## Build and deploy from the command line ### Prerequisites diff --git a/rust/daily_planner/README.md b/rust/daily_planner/README.md index d71b884643..18301cad06 100644 --- a/rust/daily_planner/README.md +++ b/rust/daily_planner/README.md @@ -1,5 +1,9 @@ # Daily Planner +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/daily_planner) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + Daily Planner is a full-stack ICP example featuring a monthly calendar that tracks daily notes and tasks stored on the network. For each day, a historic fact can be fetched from an external API using HTTPS outcalls, demonstrating how ICP canisters can access data from external services. ## Build and deploy from the command line diff --git a/rust/evm_block_explorer/README.md b/rust/evm_block_explorer/README.md index 25064b7182..05dc00655e 100644 --- a/rust/evm_block_explorer/README.md +++ b/rust/evm_block_explorer/README.md @@ -1,19 +1,13 @@ # EVM Block Explorer -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/evm_block_explorer) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/evm_block_explorer) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview The EVM Block Explorer example demonstrates how an ICP canister can fetch block data directly from Ethereum and other EVM-compatible chains. Using HTTPS outcalls via the [EVM RPC canister](https://github.com/dfinity/evm-rpc-canister), canisters on ICP can read on-chain data without a bridge or oracle. The same pattern applies to any EVM-compatible chain supported by the EVM RPC canister. - - ## Build and deploy from the command line ### Prerequisites diff --git a/rust/exchange-rates/README.md b/rust/exchange-rates/README.md index 732a36f6f0..61db079bea 100644 --- a/rust/exchange-rates/README.md +++ b/rust/exchange-rates/README.md @@ -1,5 +1,9 @@ # Exchange Rates Canister +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/exchange-rates) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + A Rust canister demonstrating how to query the [Exchange Rate Canister (XRC)](https://docs.internetcomputer.org/concepts/chain-fusion/exchange-rate-canister/) to get cryptocurrency and fiat currency exchange rates. The XRC returns real-time rates sourced via HTTPS outcalls to external data providers, with decentralized consensus across the subnet. diff --git a/rust/flying_ninja/README.md b/rust/flying_ninja/README.md index d7dc3117b2..6ce4daa9c7 100644 --- a/rust/flying_ninja/README.md +++ b/rust/flying_ninja/README.md @@ -1,5 +1,9 @@ # Flying Ninja +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/flying_ninja) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + Flying Ninja is a 2D side-scroller game where players control a ninja character using the space bar to move up and down, dodging obstacles to earn points. When the game ends, players can submit their score to an on-chain leaderboard backed by a Rust canister on ICP. ## Build and deploy from the command line diff --git a/rust/guards/README.md b/rust/guards/README.md index 41ab9694b4..559e310030 100644 --- a/rust/guards/README.md +++ b/rust/guards/README.md @@ -1,5 +1,9 @@ # Guards and async code +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/guards) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example canister shows some advanced behavior between guards and asynchronous code. This example is meant for Rust canister developers that are already familiar with [inter-canister calls](https://docs.internetcomputer.org/guides/canister-calls/inter-canister-calls) diff --git a/rust/hello_world/README.md b/rust/hello_world/README.md index 8c97cee049..4f74f33acb 100644 --- a/rust/hello_world/README.md +++ b/rust/hello_world/README.md @@ -1,6 +1,8 @@ # Hello, world! -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/hello_world) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/hello_world) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview diff --git a/rust/icp_transfer/README.md b/rust/icp_transfer/README.md index 5f0cac5889..01f918742a 100644 --- a/rust/icp_transfer/README.md +++ b/rust/icp_transfer/README.md @@ -1,6 +1,6 @@ # ICP Transfer -ICP Transfer demonstrates how a canister can hold ICP and send it to other accounts using the [ICP ledger](https://dashboard.internetcomputer.org/canister/ryjl3-tyaaa-aaaaa-aaaba-cai). The same example is also available in [Motoko](https://github.com/dfinity/examples/tree/master/motoko/icp_transfer). +ICP Transfer demonstrates how a canister can hold ICP and send it to other accounts using the [ICP ledger](https://dashboard.internetcomputer.org/canister/ryjl3-tyaaa-aaaaa-aaaba-cai). ## Account identifiers diff --git a/rust/image-classification/README.md b/rust/image-classification/README.md index 6f9d2a61df..48a6ba347d 100644 --- a/rust/image-classification/README.md +++ b/rust/image-classification/README.md @@ -1,11 +1,11 @@ # ICP image classification This example demonstrates running an ONNX machine-learning model inside an ICP canister. -The smart contract accepts an image from the user and runs image classification inference using the [Tract ONNX inference engine](https://github.com/sonos/tract) with the [MobileNet v2-7 model](https://github.com/onnx/models/tree/main/validated/vision/classification/mobilenet). +The canister accepts an image from the user and runs image classification inference using the [Tract ONNX inference engine](https://github.com/sonos/tract) with the [MobileNet v2-7 model](https://github.com/onnx/models/tree/main/validated/vision/classification/mobilenet). The example uses the WASI polyfill to run Tract (which relies on POSIX file I/O) inside the deterministic ICP runtime, and Wasm SIMD instructions for faster inference. -The smart contract consists of two canisters: +The example consists of two canisters: - **backend** — embeds the Tract ONNX inference engine with the MobileNet v2-7 model. It provides two classification endpoints: @@ -47,7 +47,7 @@ icp network stop ``` If the deployment is successful, the CLI will print the frontend URL. -Open that URL in a browser to interact with the smart contract. +Open that URL in a browser to interact with the canister. For frontend development with hot reload: diff --git a/rust/inter-canister-calls/README.md b/rust/inter-canister-calls/README.md index fbaa70cc66..11c483fea5 100644 --- a/rust/inter-canister-calls/README.md +++ b/rust/inter-canister-calls/README.md @@ -1,5 +1,9 @@ # Inter-canister calls +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/inter-canister-calls) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to make inter-canister calls in Rust on the Internet Computer. It shows both bounded-wait and unbounded-wait call styles, retry logic, and how to send cycles to another canister via the management canister. Two canisters are deployed: a `counter` canister that exposes a simple counter interface, and a `caller` canister that calls the counter using different inter-canister call patterns. ## Build and deploy from the command line diff --git a/rust/llm_chatbot/README.md b/rust/llm_chatbot/README.md index a552bed8c9..28329f1026 100644 --- a/rust/llm_chatbot/README.md +++ b/rust/llm_chatbot/README.md @@ -1,5 +1,9 @@ # LLM Chatbot +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/llm_chatbot) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how an ICP canister can interact with a large language model (LLM) to generate text. The user can input a prompt and the canister will use the LLM to generate a response. Follow-up prompts continue the conversation with the full message history. ## How it works diff --git a/rust/low_wasm_memory/README.md b/rust/low_wasm_memory/README.md index 71bd947601..9377eb46f0 100644 --- a/rust/low_wasm_memory/README.md +++ b/rust/low_wasm_memory/README.md @@ -2,8 +2,6 @@ This example demonstrates the low Wasm memory hook on the Internet Computer. The ICP runtime automatically executes a special `on_low_wasm_memory` system function when a canister's available Wasm memory falls below the configured `wasm_memory_threshold`. The example shows the execution order of the `heartbeat` and `on_low_wasm_memory` system functions as the canister progressively allocates memory until the threshold is reached. -If you're interested in how this example is implemented in Motoko, check out the [Motoko variation](../../motoko/low_wasm_memory). - For more information, see the [low Wasm memory hook specification](https://docs.internetcomputer.org/references/ic-interface-spec/canister-interface/#on-low-wasm-memory). ## Build and deploy from the command line diff --git a/rust/performance_counters/README.md b/rust/performance_counters/README.md index fb329a3edf..08abfad21f 100644 --- a/rust/performance_counters/README.md +++ b/rust/performance_counters/README.md @@ -1,5 +1,9 @@ # Performance counters +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/performance_counters) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + A canister can query one of the "performance counters", which is a deterministic monotonically increasing integer approximating the amount of work the canister has done. Developers can use this data to profile and optimize canister performance. ```Candid diff --git a/rust/periodic_tasks/README.md b/rust/periodic_tasks/README.md index 3c5c601b63..d8fe756b18 100644 --- a/rust/periodic_tasks/README.md +++ b/rust/periodic_tasks/README.md @@ -1,5 +1,9 @@ # Periodic tasks and timers +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/periodic_tasks) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + The Internet Computer allows canisters to execute code automatically — either after a specified delay or on a recurring schedule — without requiring any external trigger. There are two ways to schedule an automatic canister execution on the IC: diff --git a/rust/photo_gallery/README.md b/rust/photo_gallery/README.md index 6f52b9a71e..a5e0bc7126 100644 --- a/rust/photo_gallery/README.md +++ b/rust/photo_gallery/README.md @@ -1,5 +1,9 @@ # Photo Gallery +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/photo_gallery) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + A photo gallery application built on the Internet Computer. Users can upload and view photos stored on the network, served via the HTTP gateway with browser-cacheable responses. **Note:** This example is primarily a demo showing how the [`ic-http-certification`](https://docs.rs/ic-http-certification) crate and the HTTP gateway can serve images with long-lived `Cache-Control` headers. The canister uses *skip-certification* headers, which tell the HTTP gateway to bypass response verification — this is suitable for public, immutable content like uploaded images. It does not implement authentication or per-user access control. Use it at your own risk. diff --git a/rust/qrcode/README.md b/rust/qrcode/README.md index c5f9c89032..4e2328ff59 100644 --- a/rust/qrcode/README.md +++ b/rust/qrcode/README.md @@ -1,5 +1,9 @@ # QR code generator +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/qrcode) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example shows that an Internet Computer dapp can perform a long-running computation, like image processing, in a single message execution. This is possible due to a unique feature called Deterministic Time Slicing (DTS), which automatically divides long computations into smaller slices executed across multiple blocks. Developers can write long-running code as usual and don't require anything special to take advantage of DTS, as demonstrated in this example. diff --git a/rust/query_stats/README.md b/rust/query_stats/README.md index 3573e4506a..ce3db895d9 100644 --- a/rust/query_stats/README.md +++ b/rust/query_stats/README.md @@ -1,5 +1,9 @@ # Query Stats +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/query_stats) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how a canister can read its own query statistics using the management canister's `canister_status` endpoint. It retrieves metrics such as the total number of query calls, instructions executed, and payload bytes. ## How query stats work diff --git a/rust/receiving-icp/README.md b/rust/receiving-icp/README.md index 695f1c0196..e8274edfc0 100644 --- a/rust/receiving-icp/README.md +++ b/rust/receiving-icp/README.md @@ -1,5 +1,9 @@ # Receiving ICP +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/receiving-icp) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + A canister demonstrating how to receive ICP tokens by generating account identifiers and checking balances on the ICP ledger. The canister exposes methods to compute account identifiers (including subaccounts based on arbitrary 128-bit upper/lower values) and to query balances from the ledger canister. This makes it easy to give each user or purpose a distinct deposit address while keeping all ICP under one canister's control. @@ -50,6 +54,12 @@ icp deploy -e ic This targets the TESTICP ledger by default. To use the real ICP ledger, update `ICP_LEDGER_CANISTER_ID` in `icp.yaml` first. +**Try the receive flow with test tokens (no real ICP needed):** + +1. Call `account` to get the canister's deposit account identifier. +2. Request **TESTICP** for that account from the [ICP faucet](https://faucet.internetcomputer.org). +3. Call `get_balance` — it now reflects the received TESTICP. + ## Security considerations and best practices Refer to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for information on security and best practices for your ICP app. diff --git a/rust/send_http_get/README.md b/rust/send_http_get/README.md index 6be67c244c..7f35e23deb 100644 --- a/rust/send_http_get/README.md +++ b/rust/send_http_get/README.md @@ -1,13 +1,13 @@ # HTTP: GET +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/send_http_get) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to use the Internet Computer's HTTPS outcalls feature to make a `GET` request from a Rust canister. It sends a request to `postman-echo.com` and returns the echoed JSON response, showing how to pass query parameters and headers through HTTP outcalls. For a deeper understanding of HTTPS outcalls on the IC, see the [HTTPS outcalls documentation](https://docs.internetcomputer.org/concepts/https-outcalls/). - - ## Build and deploy from the command line ### Prerequisites diff --git a/rust/send_http_post/README.md b/rust/send_http_post/README.md index 539c556372..2ec85e564d 100644 --- a/rust/send_http_post/README.md +++ b/rust/send_http_post/README.md @@ -1,8 +1,8 @@ # HTTP: POST - +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/send_http_post) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. This example demonstrates how to use the ICP HTTPS outcalls feature to make a `POST` request from a Rust canister. It sends a plain-text body to `postman-echo.com/post`, which echoes back the request as JSON, allowing you to verify the POST body and headers were sent correctly. diff --git a/rust/simd/README.md b/rust/simd/README.md index e5532b5bc7..2960d78c67 100644 --- a/rust/simd/README.md +++ b/rust/simd/README.md @@ -1,5 +1,9 @@ # WebAssembly SIMD Example +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/simd) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + Unlike other blockchains, the Internet Computer supports WebAssembly SIMD ([Single Instruction, Multiple Data](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data)) instructions. This, combined with state-of-the-art Rust compiler support, diff --git a/rust/threshold-ecdsa/README.md b/rust/threshold-ecdsa/README.md index 2327965b2c..ffa2e4bc29 100644 --- a/rust/threshold-ecdsa/README.md +++ b/rust/threshold-ecdsa/README.md @@ -1,8 +1,10 @@ # Threshold ECDSA -This example demonstrates threshold ECDSA signing, part of ICP's [chain-key cryptography](https://docs.internetcomputer.org/concepts/chain-key-cryptography/#chain-key-signatures-threshold-ecdsa-and-schnorr). The canister acts as a signing oracle: callers can request a threshold ECDSA public key derived from their principal, and sign arbitrary messages using the corresponding private key — without the canister ever holding the key material itself. +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/threshold-ecdsa) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. -See the [Motoko version](../../motoko/threshold-ecdsa) for a comparison. +This example demonstrates threshold ECDSA signing, part of ICP's [chain-key cryptography](https://docs.internetcomputer.org/concepts/chain-key-cryptography/#chain-key-signatures-threshold-ecdsa-and-schnorr). The canister acts as a signing oracle: callers can request a threshold ECDSA public key derived from their principal, and sign arbitrary messages using the corresponding private key — without the canister ever holding the key material itself. ## Build and deploy from the command line diff --git a/rust/threshold-schnorr/README.md b/rust/threshold-schnorr/README.md index 0a9770b0c2..32a509af82 100644 --- a/rust/threshold-schnorr/README.md +++ b/rust/threshold-schnorr/README.md @@ -10,9 +10,6 @@ More specifically: - The canister uses the caller's principal bytes as the key derivation path. - The canister requests a signature from the threshold Schnorr subnet, which computes it using threshold cryptography. -This walkthrough focuses on the [Rust](https://github.com/dfinity/examples/tree/master/rust/threshold-schnorr) implementation. -There is also a [Motoko version](https://github.com/dfinity/examples/tree/master/motoko/threshold-schnorr) in the same repo. - ## Build and deploy from the command line ### Prerequisites diff --git a/rust/unit_testable_rust_canister/README.md b/rust/unit_testable_rust_canister/README.md index 1c67a87f86..130a9f4d35 100644 --- a/rust/unit_testable_rust_canister/README.md +++ b/rust/unit_testable_rust_canister/README.md @@ -1,5 +1,9 @@ # Unit Testable Rust Canister +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/unit_testable_rust_canister) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + This example demonstrates how to structure a Rust canister for comprehensive unit testing by isolating non-deterministic dependencies behind interfaces. It uses dependency injection so that inter-canister calls and stable memory operations can all be mocked in fast pure-Rust unit tests. diff --git a/rust/vetkeys/basic_bls_signing/README.md b/rust/vetkeys/basic_bls_signing/README.md index 95b9a30870..d92bfc5939 100644 --- a/rust/vetkeys/basic_bls_signing/README.md +++ b/rust/vetkeys/basic_bls_signing/README.md @@ -1,9 +1,5 @@ # Threshold BLS Signatures (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/basic_bls_signing) - -Also available in: [Motoko](../../../motoko/vetkeys/basic_bls_signing) - The **Basic BLS signing** example demonstrates how to use **[VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** to implement a threshold BLS signing service on the **Internet Computer (IC)**, where every authenticated user can ask the canister to produce signatures, with the **Internet Identity Principal** identifying the signer. The canister ensures a user can only produce signatures for their own principal, not for someone else's. Furthermore, the vetKeys in this app can only be produced upon a user request, as specified in the canister code — the canister cannot produce signatures for arbitrary users or messages. To confirm the canister can only produce signatures in the intended way, users need to inspect the code installed in the canister. For this, it is crucial that canisters using VetKeys have their code public. diff --git a/rust/vetkeys/basic_ibe/README.md b/rust/vetkeys/basic_ibe/README.md index 78b530bbb7..bd0720fa99 100644 --- a/rust/vetkeys/basic_ibe/README.md +++ b/rust/vetkeys/basic_ibe/README.md @@ -1,9 +1,5 @@ # Identity-Based Encryption (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/basic_ibe) - -Also available in: [Motoko](../../../motoko/vetkeys/basic_ibe) - The **Basic IBE** example demonstrates how to use **[VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** to implement secure messaging between users by means of Identity-Based Encryption (IBE) on the **Internet Computer (IC)**. Users send encrypted messages to other users using their **Internet Identity Principal** as the encryption key identifier. The canister ensures that only the authorized user can access their private decryption key — even if someone else knows your principal, they cannot decrypt messages intended for you, because neither other users nor this canister can access your private key. Note that generally it is possible for a canister to request a decryption key to decrypt secrets as part of its code. However, doing so requires the canister to provide its own transport key instead of requesting a user's transport key, and this inherently makes the secrets public. Such functionality can be detected by inspecting the code, so it is crucial that canisters using VetKeys have their code public to allow verifying that the canister handles secrets in a secure way. diff --git a/rust/vetkeys/basic_timelock_ibe/README.md b/rust/vetkeys/basic_timelock_ibe/README.md index 4324485404..69142eb31c 100644 --- a/rust/vetkeys/basic_timelock_ibe/README.md +++ b/rust/vetkeys/basic_timelock_ibe/README.md @@ -1,18 +1,18 @@ # Timelock Encryption - +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/vetkeys/basic_timelock_ibe) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. The **Basic Timelock IBE** example demonstrates how to use **[VetKeys](https://docs.internetcomputer.org/concepts/vetkeys)** to implement a secret-bid auction using timelock encryption on the **Internet Computer (IC)**. This application allows users authenticated with their **Internet Identity Principal** to create auction lots with a description and deadline, and other users to place a secret bid for the lot. The bids in this example are just dummy integer values, contrary to real-world use cases where users would place bids holding some value. -This canister (IC smart contract) ensures that: +This canister ensures that: 1. Only authorized users can create auction lots and place secret bids until the lot is closed. 2. The bids stay secret until the lot is closed. 3. The winner is chosen fairly among all the placed bids, once the lot closes and the canister decrypts the secret bids. Note that once secret bids are decrypted they inherently become public. Note that generally it is possible for a canister to request a decryption key to decrypt secrets at any time. -The code of smart contract determines the rules for when the decryption happens. +The canister's code determines the rules for when the decryption happens. In this example, the decryption happens only after the lot is closed and does not accept new bids. A canister functionality for decrypting secrets can be detected by inspecting the code and, therefore, it is crucial that canisters using VetKeys have their code public to allow to verify that the canister handles secrets in a secure and intended way. diff --git a/rust/vetkeys/basic_vetkd/README.md b/rust/vetkeys/basic_vetkd/README.md index 2f383529c3..3e6bc707bf 100644 --- a/rust/vetkeys/basic_vetkd/README.md +++ b/rust/vetkeys/basic_vetkd/README.md @@ -1,9 +1,5 @@ # Basic VetKD Demo (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/basic_vetkd) - -Also available in: [Motoko](../../motoko/vetkeys/basic_vetkd) - ## Overview Demonstrates the raw VetKD management canister API — the lowest-level building block for verifiably encrypted threshold key derivation on the Internet Computer. The example shows two use cases: symmetric key derivation (AES-GCM-256) and identity-based encryption (IBE), both driven directly via the management canister interface without any SDK abstraction. diff --git a/rust/vetkeys/encrypted_notes_app_vetkd/README.md b/rust/vetkeys/encrypted_notes_app_vetkd/README.md index ee481289df..7dca1834ba 100644 --- a/rust/vetkeys/encrypted_notes_app_vetkd/README.md +++ b/rust/vetkeys/encrypted_notes_app_vetkd/README.md @@ -1,9 +1,5 @@ # Encrypted Notes: vetKD (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/encrypted_notes_app_vetkd) - -Also available in: [Motoko](../../../motoko/vetkeys/encrypted_notes_app_vetkd) - Encrypted notes is an example app for authoring and storing confidential information on the Internet Computer (ICP) in the form of short pieces of text. Users can create and access their notes via any number of automatically synchronized devices authenticated via Internet Identity (II). Notes are stored confidentially using vetKeys. The end-to-end encryption is performed by the app's frontend. In particular, the notes are encrypted with an AES key that is derived (directly in the browser) from a note-ID-specific vetKey obtained from the backend canister (in encrypted form, using an ephemeral transport key), which itself obtains it from the vetKD system API. This way, there is no need for any device management in the app, plus sharing of notes becomes possible. diff --git a/rust/vetkeys/password_manager/README.md b/rust/vetkeys/password_manager/README.md index 05dc04806a..70bdc7e92d 100644 --- a/rust/vetkeys/password_manager/README.md +++ b/rust/vetkeys/password_manager/README.md @@ -1,9 +1,5 @@ # VetKey Password Manager (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/password_manager) - -Also available in: [Motoko](../../../motoko/vetkeys/password_manager) - The **VetKey Password Manager** is an example application demonstrating how to use **VetKeys** and **Encrypted Maps** to build a secure, decentralized password manager on the **Internet Computer (IC)**. This application allows users to create password vaults, store encrypted passwords, and share vaults with other users via their **Internet Identity Principal**. ## Features diff --git a/rust/vetkeys/password_manager_with_metadata/README.md b/rust/vetkeys/password_manager_with_metadata/README.md index c3348538fe..9e081603a4 100644 --- a/rust/vetkeys/password_manager_with_metadata/README.md +++ b/rust/vetkeys/password_manager_with_metadata/README.md @@ -1,9 +1,5 @@ # VetKey Password Manager with Metadata (Rust) -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/vetkeys/password_manager_with_metadata) - -Also available in: [Motoko](../../../motoko/vetkeys/password_manager_with_metadata) - The **VetKey Password Manager** is an example application demonstrating how to use **VetKeys** and **Encrypted Maps** to build a secure, decentralized password manager on the **Internet Computer (IC)**. This application allows users to create password vaults, store encrypted passwords, and share vaults with other users via their **Internet Identity Principal**. This version extends the basic password manager by supporting unencrypted metadata, such as URLs and tags, alongside encrypted passwords. The goal is to demonstrate how to make atomic updates to the Encrypted Maps canister, storing both encrypted and unencrypted data in a single update call. diff --git a/rust/who_am_i/README.md b/rust/who_am_i/README.md index 4adf100699..1277321bcc 100644 --- a/rust/who_am_i/README.md +++ b/rust/who_am_i/README.md @@ -1,10 +1,12 @@ # Who am I? -[View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/rust/who_am_i) +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/who_am_i) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. ## Overview -Who am I? demonstrates how entities on the Internet Computer are identified. Every entity, such as a user or canister smart contract, has a principal identifier. Principals can be used for identification and authentication. Who am I? uses Internet Identity (II) for user authentication, then displays the principal identifier associated with that Internet Identity on the user interface. +Who am I? demonstrates how entities on the Internet Computer are identified. Every entity, such as a user or canister, has a principal identifier. Principals can be used for identification and authentication. Who am I? uses Internet Identity (II) for user authentication, then displays the principal identifier associated with that Internet Identity on the user interface. ## Build and deploy from the command line diff --git a/rust/x509/README.md b/rust/x509/README.md index b013d08137..79aecc692f 100644 --- a/rust/x509/README.md +++ b/rust/x509/README.md @@ -1,5 +1,9 @@ # X.509 +[![Open in ICP Ninja](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/tree/master/rust/x509) + +> 🥷 **Try it live — no local setup.** [ICP Ninja](https://icp.ninja) is a web-based IDE that builds and deploys this project to the mainnet for free, right in your browser. Click the badge above, or hit **Deploy** if you're already in Ninja. To build and run it locally instead, follow the steps below. + A minimal example canister demonstrating two use cases of [X.509](https://en.wikipedia.org/wiki/X.509) certificates on the Internet Computer: 1. How to create an X.509 certification authority (CA) certificate whose private key is a **threshold signing key** — the CA's private key is never revealed in cleartext and cannot be revealed due to the properties of the threshold signature protocols on the Internet Computer. This means that only the canister can sign child certificates.