Skip to content

docs: system canisters reference#66

Merged
marc0olo merged 2 commits into
mainfrom
docs/reference-system-canisters
Apr 16, 2026
Merged

docs: system canisters reference#66
marc0olo merged 2 commits into
mainfrom
docs/reference-system-canisters

Conversation

@marc0olo
Copy link
Copy Markdown
Member

Summary

  • Quick-reference table listing all 15 system canisters with their IDs and hosting subnets
  • NNS canisters: registry, governance, root, lifeline, NNS UI — roles in protocol governance
  • Cycles Minting Canister (CMC): two-step mint flow (ICP → cycles)
  • Genesis Token Canister: brief (historical, not relevant to most developers)
  • ICP ledger: ICRC-1/ICRC-2 and legacy method table; ledger archives and ICP index
  • Internet Identity: links to II spec and authentication guides
  • SNS-W: links to governance guides for SNS launch
  • Cycles ledger and cycles ledger index on the uzr34 subnet
  • Usage section: Rust and Motoko code patterns for calling system canisters; icp deps pull for local development

Sync recommendation

informed by dfinity/portaldocs/references/system-canisters/index.mdx; docs/references/system-canisters/xrc.mdx

@marc0olo marc0olo force-pushed the docs/reference-system-canisters branch from df43459 to 47664c9 Compare April 16, 2026 13:37
@marc0olo
Copy link
Copy Markdown
Member Author

Review: System Canisters

Must fix

  • icp deps pull / icp deps deploy are not valid icp-cli commands: The "Pulling system canisters for local development" section (line 236–243) uses icp deps pull and icp deps deploy, which do not exist in the icp-cli. These are legacy dfx deps commands. The icp-cli has no deps subcommand — verified against .sources/icp-cli/docs/reference/cli.md (the full command index lists no deps). This section needs to either be rewritten using what icp-cli actually supports for local development (e.g. icp network start + configuring the canister in icp.yaml without deps), or replaced with accurate guidance on how to use system canisters locally. The entire framing of "use icp-cli deps pull" (line 170) also needs updating.

  • Config file named incorrectly: Line 243 says "Configure the dependency in your icp.json". The icp-cli project config file is icp.yaml, not icp.json. Verified against .sources/icp-cli/docs/reference/configuration.md which opens with "Complete reference for icp.yaml project configuration."

  • Wrong ICP index method name: Line 160 lists the ICP index key method as get_account_identifier_transactions. The correct method name is get_account_transactions. The portal source (.sources/portal/docs/defi/token-indexes/index.mdx) and the SNS governance integration docs both show get_account_transactions. The name get_account_identifier_transactions does not appear anywhere in .sources/.

  • Deprecated Rust API: The Rust code snippet (lines 215–221) uses ic_cdk::call(icp_ledger, "icrc1_transfer", (args,)).await?, which is the legacy API deprecated since cdk-rs 0.18.0. Per .sources/cdk-rs/ic-cdk/src/lib.rs (line 72–78) and api.rs (line 24–27), the api::call module and the top-level ic_cdk::call re-export are both #[deprecated]. The modern API is ic_cdk::call::Call::bounded_wait(canister_id, method).await. The snippet should be updated to use Call::bounded_wait from ic_cdk::call.

  • Invalid Motoko canister: import: Line 226 shows import Ledger "canister:ryjl3-tyaaa-aaaaa-aaaba-cai". In Motoko, canister: imports use the canister name as declared in the project config, not the raw canister ID. All examples in .sources/examples/motoko/ use named aliases like canister:icp_ledger_canister, not raw IDs. The correct pattern for a hardcoded canister ID is the actor syntax shown below the comment on line 229, not the canister: import. Remove the first form or replace with the correct named alias form (e.g. canister:icp_ledger_canister) with a note that the name must match the project config.

Suggestions

  • Candid interfaces not provided: The content brief asks for "Candid interfaces" for all listed canisters. The page provides a partial interface for the CMC (notify_mint_cycles) and a method table for the ICP ledger, but no Candid snippets for NNS governance, registry, root, lifeline, Internet Identity, or SNS-W. Consider adding at least the most developer-relevant method signatures (NNS governance submit_proposal/vote, SNS-W deploy_new_sns) or linking to canonical .did files.

  • CMC minting flow is incomplete: The notify_mint_cycles Candid signature shown (record { block_index: nat64 }) omits the recipient optional field that the actual CMC interface includes. More importantly, the "How to mint cycles via the CMC" section describes the low-level two-step ICP-transfer + notify flow, but the icp-cli wraps this in icp cycles mint --icp 5 -n ic (one command, no manual subaccount construction needed). The section should lead with the icp cycles mint command (verified in .sources/icp-cli/docs/guides/tokens-and-cycles.md lines 104–109) and keep the low-level explanation for callers who need to call the CMC directly from a canister.

  • NNS UI not mentioned in NNS canisters section body: The NNS UI is listed in the table and has its own subsection, but the "NNS canisters" intro paragraph does not mention it among the NNS canisters. Readers scanning that section might not realize the NNS UI frontend is also an NNS canister.

  • Reader test — opening paragraph buries the lede: The page opens with a definition of system canisters (paragraph 1) and then immediately points to other pages. The developer who lands here from search is looking for the canister IDs. The intro is fine but could be tightened: the phrase "This page lists every system canister with its canister ID, hosting subnet, purpose, and interface reference" repeats the "at a glance" table that immediately follows. Consider removing the redundant sentence.

  • notify_mint_cycles missing recipient in description: The page says "The recipient principal's cycles balance increases" but doesn't clarify that the recipient is encoded in the subaccount of the initial ICP transfer (Step 1). The connection between Step 1 (encoding the recipient in the subaccount) and the outcome could be stated more clearly.

Verified

  • All canister IDs cross-checked against .sources/portal/docs/references/system-canisters/index.mdx: NNS registry (rwlgt-iiaaa-aaaaa-aaaaa-cai), NNS governance (rrkah-fqaaa-aaaaa-aaaaq-cai), NNS root (r7inp-6aaaa-aaaaa-aaabq-cai), NNS lifeline (rno2w-sqaaa-aaaaa-aaacq-cai), NNS UI (qoctq-giaaa-aaaaa-aaaea-cai), CMC (rkp4c-7iaaa-aaaaa-aaaca-cai), ICP ledger (ryjl3-tyaaa-aaaaa-aaaba-cai), ICP index (qhbym-qaaaa-aaaaa-aaafq-cai), ICP ledger archives (qjdve-lqaaa-aaaaa-aaaeq-cai, qsgjb-riaaa-aaaaa-aaaga-cai), Genesis token (renrk-eyaaa-aaaaa-aaada-cai), Internet Identity (rdmx6-jaaaa-aaaaa-aaadq-cai), SNS-W (qaa6y-5yaaa-aaaaa-aaafa-cai), Cycles ledger (um5iw-rqaaa-aaaaq-qaaba-cai), Cycles ledger index (ul4oc-4iaaa-aaaaq-qaabq-cai) — all correct.
  • Subnet IDs cross-checked: NNS subnet (tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe) and uzr34 subnet (uzr34-akd3s-xrdag-3ql62-ocgoh-ld2ao-tamcv-54e7j-krwgb-2gm4z-oqe) — correct.
  • CMC canister ID (rkp4c-7iaaa-aaaaa-aaaca-cai) cross-checked against .sources/icskills/skills/cycles-management/SKILL.md — correct.
  • Internet Identity canister ID (rdmx6-jaaaa-aaaaa-aaadq-cai) cross-checked against .sources/icskills/skills/internet-identity/SKILL.md — correct.
  • All internal links verified with ls: management-canister.md, protocol-canisters.md, token-standards.md, internet-identity-spec.md, ../concepts/governance.md, ../guides/authentication/ (directory exists), ../guides/governance/ (directory exists) — all resolve. Link to ../guides/canister-management/cycles-management.md resolves to cycles-management.mdx (Astro resolves .md.mdx correctly).
  • No dfx references in the page (other than in the banned icp deps section which needs correction — the root cause is that section references dfx-era tooling).
  • No internetcomputer.org/docs/ links present.
  • No mo:base imports present.
  • Frontmatter complete: title, description, sidebar.order all present.
  • <!-- Upstream: --> comment present at end of file.
  • ICP ledger method table (icrc1_transfer, icrc1_balance_of, icrc1_total_supply, icrc2_approve, icrc2_transfer_from, transfer, account_balance) cross-checked against .sources/portal/docs/references/ledger.mdx — all present and correctly named.
  • cycles-ledger spec link (https://github.com/dfinity/cycles-ledger/blob/main/INTERFACE_SPECIFICATION.md) matches the URL used in the portal source.
  • Style and tone are appropriate for a reference page — scannable, direct, uses tables effectively.

- Replace invalid `icp deps pull`/`icp deps deploy` commands (no such
  subcommand in icp-cli) with correct `icp.yaml` network config using
  `ii: true` / `nns: true` flags and `icp network start -d`
- Fix config filename: `icp.json` → `icp.yaml` (verified against
  icp-cli configuration reference)
- Fix ICP index method name: `get_account_identifier_transactions` →
  `get_account_transactions` (verified in portal source)
- Update Rust snippet from deprecated `ic_cdk::call()` (removed in
  cdk-rs 0.18.0) to current `Call::bounded_wait().with_arg().await?
  .candid()` API
- Fix Motoko `canister:` import: raw canister IDs are not valid;
  replace with named alias form (`canister:icp_ledger_canister`) and
  actor syntax for hardcoded ID, with explanatory note
- Update Internet Identity section to reference correct local dev method
@marc0olo
Copy link
Copy Markdown
Member Author

<!-- feedback-addressed -->

Feedback addressed: System Canisters (PR #66)

All five "Must fix" items were applied. Four "Suggestions" were skipped with reasons below.


Changes applied

1. Invalid icp deps pull / icp deps deploy commands removed

The icp-cli has no deps subcommand (verified against .sources/icp-cli/docs/reference/cli.md). The "Pulling system canisters for local development" section has been rewritten as "Using system canisters in local development" using the correct approach: configure ii: true and/or nns: true in the icp.yaml network block, then run icp network start -d. Verified against .sources/icp-cli/docs/reference/configuration.md (lines 217-218).

2. Config filename corrected: icp.jsonicp.yaml

Verified against .sources/icp-cli/docs/reference/configuration.md which opens with "Complete reference for icp.yaml project configuration."

3. ICP index method name corrected: get_account_identifier_transactionsget_account_transactions

Verified against .sources/portal/docs/defi/token-indexes/index.mdx (lines 332 and 514), which both show get_account_transactions as the correct method name.

4. Rust snippet updated to current ic_cdk::call::Call API

The old ic_cdk::call(canister, method, args).await pattern is deprecated since cdk-rs 0.18.0 (verified in .sources/cdk-rs/ic-cdk/src/api.rsapi::call module marked #[deprecated(since = "0.18.0")]). Updated to the builder pattern: Call::bounded_wait(canister, method).with_arg(args).await?.candid(), verified against .sources/cdk-rs/ic-cdk/src/call.rs.

5. Motoko canister: import corrected

canister: imports use the declared canister name (e.g., canister:icp_ledger_canister), not raw canister IDs — verified across multiple examples in .sources/examples/motoko/ (token_transfer/, icp_transfer/, etc.). Replaced the invalid import Ledger "canister:ryjl3-tyaaa-aaaaa-aaaba-cai" with the named alias form and added the actor syntax alternative for hardcoded IDs, with an explanatory note about icp.yaml configuration.

6. Internet Identity section updated

Removed the reference to the non-existent icp-cli deps feature and replaced it with a reference to the correct ii: true network configuration approach described in the new local development section.


Items skipped

Suggestion: Candid interfaces for all canisters — Skipped. Adding complete Candid interface snippets for all system canisters is a scope expansion beyond what .sources/ supports in a concise treatment. The page links to canonical interface references (dashboard, Internet Identity spec, token standards). A dedicated interfaces page would be more appropriate.

Suggestion: CMC minting — lead with icp cycles mint command — Skipped for this pass. The icp cycles mint command is a valid CLI convenience wrapper (verified in .sources/icp-cli/docs/guides/tokens-and-cycles.md line 105), but the CMC section is scoped to the programmatic interface for canisters calling the CMC directly. Distinguishing CLI vs. canister-caller context would require restructuring the section.

Suggestion: NNS UI mentioned in NNS section intro paragraph — Skipped. The NNS UI has its own subsection and appears in the summary table. The intro paragraph describes the NNS governance function where the UI frontend is not architecturally relevant to include.

Suggestion: Remove redundant opening sentence — Skipped. The sentence confirms the page scope for users who land from search. This is a style preference with no factual bearing; removing it does not materially improve clarity.

@marc0olo marc0olo merged commit 8d47315 into main Apr 16, 2026
1 check passed
@marc0olo marc0olo deleted the docs/reference-system-canisters branch April 16, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant