Skip to content

docs: expand cycle-costs reference with Threshold cryptography and Chain integrations sections#272

Open
marc0olo wants to merge 9 commits into
mainfrom
docs/cycle-costs-special-features
Open

docs: expand cycle-costs reference with Threshold cryptography and Chain integrations sections#272
marc0olo wants to merge 9 commits into
mainfrom
docs/cycle-costs-special-features

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented May 26, 2026

Summary

  • Fills in the four previously-stub cost entries under new structured sections: threshold ECDSA/Schnorr signing, VetKeys, EVM RPC canister, Bitcoin integration API (with explicit base-cost and min-to-attach columns)
  • Splits the cost reference into two sections: ## Threshold cryptography (threshold ECDSA/Schnorr signing, VetKeys) and ## External integrations (HTTPS outcalls, EVM RPC canister, SOL RPC canister, Bitcoin, Dogecoin) — threshold signing is a core ICP protocol capability, not an external integration; HTTPS outcalls are generic HTTP calls, not chain-specific
  • Adds Dogecoin integration API cost table (mainnet-only; costs verified against dfinity/dogecoin-canister interface/src/lib.rs)
  • Adds SOL RPC canister section with pricing formula (standard HTTPS outcall + 10M cycles × n per-node processing fee × rpc_providers), verified against dfinity/sol-rpc-canister source
  • Reorders external integrations by pricing mechanism: HTTPS outcalls (base primitive) → EVM RPC → SOL RPC (HTTPS-outcall-based formula) → Bitcoin → Dogecoin (two-tier model)
  • Corrects EVM RPC collateral: the collateral cycles are consumed by the EVM RPC canister as a reserve, not refunded; adds a note that sending above the minimum is safe (surplus is returned)
  • Reorders page sections for Diataxis: Cycle units → Replication factors → Cost table → formulas → Threshold cryptography → External integrations → XDR exchange rate (primary content front-loaded; lookup appendix at the end)
  • Renames "Cycles units" → "Cycle units"; moves XDR rate section to end; embeds current rate inline in the intro
  • Fixes "On-chain (certified, from a canister)" label in the XDR rate section → "From canister code (certified)"
  • Expands the XDR exchange rate section with full CMC/XRC mechanics and three methods for getting the current rate: ICP Dashboard API, CMC Prometheus metrics endpoint, and certified on-chain pattern
  • Adds a "Querying the current ICP/XDR rate" subsection to system-canisters.md (CMC section): Candid signature, xdr_permyriad_per_icp unit semantics, and Prometheus metrics table
  • Applies Diataxis pass to concepts/cycles.md: replaces messaging cost table with prose + link to the reference; splits single "Protocol integrations" bullet and paragraph into separate "Threshold cryptography" and "External integrations" entries, each linking to the corresponding reference section
  • Removes duplicate EVM RPC formula from ethereum.mdx; corrects stale collateral figure to the current formula; adds link to the cycle costs reference
  • Adds cycle costs reference link to solana.mdx
  • Normalizes CycleOps description: "Onchain monitoring" → "Network-based monitoring"
  • Brand voice pass: replaces "onchain"/"on-chain" with precise attributes and "decentralized" with accurate alternatives across concept, guide, and reference pages; domain exceptions kept for DeFi/MEV context and governance API identifiers
  • Normalizes compound terms to offchain, crosschain throughout

Review guidance

Most of the diff is mechanical brand voice changes (commits 9e655a8 and 5662531) touching 34 files with 1–3 line changes each — word substitutions only, no semantic changes. You can skip or skim those.

Focus review on these files and topics:

File What to check
docs/references/cycle-costs.md New cost tables (Dogecoin, SOL RPC, VetKeys, threshold signing) — verify numbers; section structure (Threshold cryptography / External integrations split); EVM RPC collateral description
docs/concepts/cycles.md Diataxis pass — messaging table replaced with prose, two new section bullets with links; does it still give a clear mental model?
docs/references/system-canisters.md New XDR rate query subsection in the CMC section — Candid signature, xdr_permyriad_per_icp semantics, Prometheus table
docs/guides/chain-fusion/ethereum.mdx EVM RPC collateral correction — "consumed, not refunded" is the key factual change; verify the formula and the note about surplus cycles

EVM RPC collateral is the most important factual change in this PR. The original text said collateral cycles "are currently refunded in full", which was wrong. The source (canhttp/canhttp/src/cycles/mod.rs, msg_cycles_accept(request_cost + collateral)) shows the collateral is accepted and consumed. A second pair of eyes on the corrected wording is welcome.

Cross-linking structure

concepts/cycles.mdreferences/cycle-costs.md#threshold-cryptography
concepts/cycles.mdreferences/cycle-costs.md#external-integrations
concepts/cycles.mdreferences/cycle-costs.md#cost-table
references/system-canisters.md (CMC) → references/cycle-costs.md#getting-the-current-xdrusd-rate
concepts/chain-fusion/exchange-rate-canister.mdreferences/system-canisters.md#cycles-minting-canister-cmc
guides/chain-fusion/ethereum.mdxreferences/cycle-costs.md#evm-rpc-canister
guides/chain-fusion/solana.mdxreferences/cycle-costs.md#sol-rpc-canister

Accuracy verification

All cycle numbers verified against upstream source:

  • Portal docs/references/bitcoin-how-it-works.mdx, docs/references/t-sigs-how-it-works.mdx, docs/building-apps/chain-fusion/ethereum/evm-rpc/costs.mdx, docs/building-apps/network-features/vetkeys/api.mdx
  • dfinity/dogecoin-canister interface/src/lib.rs (Fees::mainnet())
  • dfinity/sol-rpc-canister canister/src/constants.rs, canister/src/memory/mod.rs, canister/src/http/mod.rs
  • EVM RPC collateral: traced through canhttp/canhttp/src/cycles/mod.rsmsg_cycles_accept(request_cost + collateral) confirms collateral is consumed, not returned
  • CMC: icp-cli/crates/icp-canister-interfaces/src/cycles_minting_canister.rs; metrics endpoint verified live
  • ICP Dashboard API: /api/v3/icp-usd-rate and /api/v3/icp-xdr-conversion-rates verified live

Sync recommendation

docs/references/cycle-costs.md: hand-written (informed by multiple upstream sources listed in the Upstream comment)

…d Bitcoin API costs

The Special features section was a stub with TODO comments for threshold
signing and Bitcoin API. Adds complete cost tables for all four feature
categories, verified against portal source material.

- Threshold ECDSA / Schnorr signing: cost table by key name (test_key_1
  and key_1), with note that cost is determined by the signing subnet
- VetKeys (vetkd_derive_key): same cost structure, same subnet layout
- EVM RPC canister: full cost formula plus collateral cycles requirement
  and worked example
- Bitcoin API: testnet and mainnet tables with base cost, minimum cycles
  to attach, and USD column; two-tier pricing model explained in prose

Also fixes the chain-key-cryptography.md link to point to the specific
#threshold-ecdsa-and-schnorr-signing anchor, and adds a cross-reference
from vetkeys.md to the cycle-costs reference.
@marc0olo marc0olo requested a review from a team as a code owner May 26, 2026 06:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

🤖 Here's your preview: https://uc7il-jaaaa-aaaam-ai2gq-cai.icp0.io

- Remove dead-end HTTPS outcalls subsection under Special features
- Split Bitcoin API USD column into base cost and min-to-attach columns
- Fix EVM RPC description: formula uses different constants from HTTPS outcalls
- Add subnet IDs to ECDSA/Schnorr signing table (consistency with VetKeys)
- Add back-link from Bitcoin guide inline table to cycle-costs reference
- Update XDR rate May 2025 ($1.354820) -> May 2026 ($1.366430) across
  cycle-costs.md, subnet-types.md, and concepts/cycles.md
- Fix 34-node storage/month: was incorrectly $1.70, correct value is $1.18
  (861B cycles * $1.366430/T = $1.18, not $1.70)
@marc0olo marc0olo changed the title docs: expand cycle costs reference with signing, VetKeys, EVM RPC, and Bitcoin API docs: expand and update cycle costs reference with special features and May 2026 rates May 26, 2026
… and new chain API tables

- Rename "Special features" to "Protocol integrations" and move HTTPS
  outcalls inside it as first subsection (all four integration types now
  grouped together)
- Add dedicated XDR exchange rate section (May 22, 2026: 1 XDR = $1.366430
  USD); remove month/year suffixes from all column headers
- Add Dogecoin integration API cost table (mainnet-only, costs verified
  against dfinity/dogecoin-canister interface/src/lib.rs; identical to
  Bitcoin Mainnet tier)
- Add SOL RPC canister section with pricing formula (standard HTTPS outcall
  + 10_000_000 cycles × n per-node processing fee × rpc_providers),
  verified against dfinity/sol-rpc-canister constants.rs and http/mod.rs;
  reference getBalanceCyclesCost and sibling query methods for per-call
  estimates
- Update upstream comment to include dogecoin-canister and sol-rpc-canister
  source files
@marc0olo marc0olo changed the title docs: expand and update cycle costs reference with special features and May 2026 rates docs: expand cycle-costs reference — Protocol integrations section with Dogecoin and SOL RPC May 26, 2026
@marc0olo
Copy link
Copy Markdown
Member Author

Feedback addressed:

  • Added dedicated XDR exchange rate section (May 22, 2026: 1 XDR = $1.366430 USD); all ~USD (May 2026) column headers now read ~USD
  • Renamed Special featuresProtocol integrations; moved HTTPS outcalls inside it as first subsection so all external-network integrations are grouped together
  • Added Dogecoin integration API cost table, verified against dfinity/dogecoin-canister interface/src/lib.rs (Fees::mainnet())
  • Added SOL RPC canister section with the verified pricing formula and references to <method>CyclesCost query endpoints
  • Updated upstream comment to include dogecoin-canister and sol-rpc-canister source files

marc0olo added 2 commits May 26, 2026 11:15
- cycle-costs.md: expand XDR exchange rate section with CMC mechanics
  (5-minute XRC sampling, get_icp_xdr_conversion_rate returns ICP/XDR not
  XDR/USD), three machine-readable methods to derive XDR/USD (ICP dashboard
  API derivation formula, CMC metrics endpoint, on-chain XRC+CMC pattern)
- system-canisters.md: add "Querying the current ICP/XDR rate" subsection
  under CMC — documents get_icp_xdr_conversion_rate Candid signature,
  xdr_permyriad_per_icp unit semantics, and Prometheus metrics fields
  (cmc_icp_xdr_conversion_rate, cmc_avg_icp_xdr_conversion_rate,
  cmc_cycles_per_xdr); cross-links to cycle-costs#getting-the-current-xdrusd-rate
- cycles.md: add sentence pointing to cycle-costs for programmatic rate
  lookup, and note that CMC samples from XRC every 5 minutes
- exchange-rate-canister.md: clarify CMC is the XRC's primary consumer
  (calls every 5 minutes for ICP/XDR to use in cycle minting)
Replace "onchain"/"on-chain" with specific attributes (on the network,
canister code, network-enforced, etc.) and "decentralized" with precise
alternatives (distributed, community-governed, governed by the NNS)
across 27 concept, guide, and reference pages. Domain exceptions kept
for DeFi/MEV context and governance API identifiers per brand voice rules.
@marc0olo marc0olo requested a review from a team as a code owner May 26, 2026 09:41
@marc0olo
Copy link
Copy Markdown
Member Author

Brand voice and Diataxis pass applied across 27 pages:

  • Replaced all "onchain"/"on-chain" instances with specific network attributes: "on the network", "canister code", "network-enforced", "signed by the network", "to the network", etc. — the bare term is now gone from all concept, guide, and reference pages
  • Replaced "decentralized" with precise alternatives: "distributed" (pseudorandom, protocol, trust), "community-governed" (DAO/SNS application descriptions), "governed by the NNS" (governance system descriptions), "independent node providers" (network operator descriptions) — domain exceptions kept for DeFi/MEV context ("decentralized exchanges") and governance API identifiers (e.g., RegisterDappCanisters)
  • Build passes clean (npm run build); all 263 warnings pre-exist in the Motoko synced files and are out of scope

Use offchain/crosschain (no hyphen) consistently, matching tamperproof
style. Replace "tokenize your application" in choose-your-path.md with
precise language: "issue a governance token and transfer control".
@marc0olo marc0olo requested review from a team as code owners May 26, 2026 10:32
@github-actions github-actions Bot added the interface-spec Changes to the IC interface specification label May 26, 2026
marc0olo added 2 commits May 26, 2026 13:16
…pages

- concepts/cycles.md: replace messaging cost table with prose + link to
  cycle-costs.md; strip USD values from storage/canister creation numbers
- guides/chain-fusion/ethereum.mdx: remove duplicated EVM RPC formula,
  fix stale collateral cycles figure (0.00028 TC → 10_000_000 * nodes * rpc_services),
  link to cycle-costs.md#evm-rpc-canister for the full spec
- guides/chain-fusion/solana.mdx: add link to cycle-costs.md#sol-rpc-canister
- guides/canister-management/cycles-management.mdx: replace "Onchain" with
  "Network-based" in CycleOps description
…in integrations

- Splits `## Protocol integrations` in cycle-costs.md into two sections:
  `## Threshold cryptography` (threshold ECDSA/Schnorr, VetKeys) and
  `## Chain integrations` (HTTPS outcalls, EVM RPC, SOL RPC, Bitcoin, Dogecoin)
- Reorders sections for Diataxis: Cycle units → Replication factors → Cost
  table → formulas → Threshold cryptography → Chain integrations → XDR rate
- Reorders chain integrations by pricing mechanism: HTTPS outcalls (base
  primitive) → EVM RPC → SOL RPC (HTTPS-outcall-based) → Bitcoin → Dogecoin
  (two-tier model)
- Corrects EVM RPC collateral: consumed by the canister, not refunded; adds
  note that sending above the minimum is safe
- Renames "Cycles units" → "Cycle units"; moves XDR rate section to end;
  embeds current rate inline in the intro
- Fixes "On-chain (certified, from a canister)" → "From canister code
  (certified)" in the XDR rate section
- Fixes "specialized subnets" description to accurately describe the mechanism
- Updates concepts/cycles.md: replaces messaging cost table with prose + link;
  replaces single "Protocol integrations" bullet and paragraph with separate
  "Threshold cryptography" and "Chain integrations" entries, each linking to
  the corresponding reference section
- Removes duplicate EVM RPC formula from ethereum.mdx; corrects stale
  collateral figure to the current formula
@marc0olo marc0olo changed the title docs: expand cycle-costs reference — Protocol integrations section with Dogecoin and SOL RPC docs: expand cycle-costs reference with Threshold cryptography and Chain integrations sections May 26, 2026
@marc0olo marc0olo requested a review from Dfinity-Bjoern May 26, 2026 14:46
@marc0olo
Copy link
Copy Markdown
Member Author

marc0olo commented May 26, 2026

@Dfinity-Bjoern sorry for the noise in his PR. some icp brand voice changes were also applied in between and I didn't want to revert those along the way.

please focus on the Review guidance in the PR summary. the rest is just cosmetics.

following pages are relevant in the preview deployment:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interface-spec Changes to the IC interface specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant