Skip to content

Commit 91037ed

Browse files
committed
docs: split Protocol integrations into Threshold cryptography and Chain 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
1 parent 890b262 commit 91037ed

3 files changed

Lines changed: 79 additions & 72 deletions

File tree

docs/concepts/cycles.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Cycles cover four resource categories:
1212
- **Compute**: executing instructions (update calls, timers, heartbeats)
1313
- **Storage**: Wasm heap memory and stable memory, charged per byte per second
1414
- **Messaging**: ingress messages from users, inter-canister calls, responses
15-
- **Special features**: HTTPS outcalls, threshold signatures, Bitcoin integration, EVM RPC
15+
- **Threshold cryptography**: threshold ECDSA/Schnorr signing and VetKeys key derivation
16+
- **Chain integrations**: HTTPS outcalls, EVM RPC, SOL RPC, Bitcoin, Dogecoin
1617

1718
Query calls are free: they run on a single node, do not go through consensus, and are not charged.
1819

@@ -68,7 +69,9 @@ Each resource category is metered and charged differently:
6869

6970
**Messaging** costs are charged to the sending canister. Ingress messages (user to canister) are charged to the receiving canister. Each inter-canister call has a fixed base cost plus a per-byte variable cost. The calling canister also prepays the maximum-size reply cost upfront; if the actual reply is smaller, the difference is refunded.
7071

71-
**Special features** (HTTPS outcalls, threshold signatures, Bitcoin API calls) charge the calling canister an additional amount on top of standard messaging costs. These features require extra protocol-level work and are priced accordingly.
72+
**Threshold cryptography** (threshold ECDSA/Schnorr signing, VetKeys key derivation) charges the calling canister an additional amount on top of standard messaging costs. The extra cost reflects the computationally intensive threshold cryptographic operations and cross-subnet coordination required to produce the result. For exact amounts, see [Threshold cryptography costs](../references/cycle-costs.md#threshold-cryptography).
73+
74+
**Chain integrations** (HTTPS outcalls, EVM RPC, SOL RPC, Bitcoin, Dogecoin) charge an additional amount because every node on the relevant subnet must participate in each outbound call to an external network. For exact amounts, see [Chain integration costs](../references/cycle-costs.md#chain-integrations).
7275

7376
## Cycles ledger
7477

docs/guides/chain-fusion/ethereum.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ Every EVM RPC call requires cycles. The cost depends on the request size, respon
581581
- Use `requestCost` to get an exact estimate before making a raw JSON-RPC call.
582582
- The Candid-RPC methods (like `eth_getBlockByNumber`) automatically retry with larger response sizes if needed, consuming more cycles from your budget.
583583

584-
An additional collateral of `10_000_000 * nodes * rpc_services` cycles must be attached; these are currently refunded in full.
584+
An additional `10_000_000 * nodes * rpc_services` collateral cycles must be attached per call; these are consumed by the EVM RPC canister as a reserve for future pricing changes and are not returned. Any cycles above the total minimum are returned, so it is safe to send more than needed.
585585

586586
## Development setup
587587

docs/references/cycle-costs.md

Lines changed: 73 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,11 @@ sidebar:
55
order: 8
66
---
77

8-
Canisters pay for the resources they consume and operations they perform using [**cycles**](../concepts/cycles.md). The price of cycles is pegged to [XDR](glossary.md#xdr) (Special Drawing Rights): **1 trillion cycles = 1 XDR**. See the [XDR exchange rate](#xdr-exchange-rate) section for the rate used in USD columns throughout this page.
8+
Canisters pay for the resources they consume and operations they perform using [**cycles**](../concepts/cycles.md). The price of cycles is pegged to [XDR](glossary.md#xdr) (Special Drawing Rights): **1 trillion cycles = 1 XDR**. USD values throughout this page use **1 XDR = $1.366430**; see [XDR exchange rate](#xdr-exchange-rate) at the end of this page for the current rate and how to look it up programmatically.
99

1010
You can use the [pricing calculator](https://3d5wy-5aaaa-aaaag-qkhsq-cai.icp0.io/) to estimate the cost for your app.
1111

12-
## XDR exchange rate
13-
14-
The cycle price is fixed by protocol: **1 trillion cycles = 1 XDR**. This ratio is set by NNS governance and does not change with ICP token price movements.
15-
16-
All USD values on this page use **1 XDR = $1.366430** (May 22, 2026). Use cycle counts for precise budgeting; only the USD conversion fluctuates.
17-
18-
### How the CMC tracks the rate
19-
20-
The [Cycles Minting Canister (CMC)](../references/system-canisters.md#cycles-minting-canister-cmc) (`rkp4c-7iaaa-aaaaa-aaaca-cai`) calls the [exchange rate canister (XRC)](../references/protocol-canisters.md#exchange-rate-canister-xrc) every 5 minutes for the current ICP/XDR rate. The CMC exposes `get_icp_xdr_conversion_rate`, which returns `xdr_permyriad_per_icp`: the number of XDR per ICP, expressed in units of 1/10000 (for example, `19482` means 1 ICP = 1.9482 XDR). This is an ICP/XDR rate; the CMC does not track XDR/USD.
21-
22-
### Getting the current XDR/USD rate
23-
24-
**Manual lookup:** The [IMF's SDR valuation page](https://www.imf.org/external/np/fin/data/rms_sdrv.aspx) is the authoritative source. The page returns HTTP 403 to automated HTTP clients and cannot be fetched programmatically.
25-
26-
**ICP Dashboard API (unsigned, easy for scripts):** Fetch the ICP/USD price and the ICP/XDR rate, then derive XDR/USD:
27-
28-
```bash
29-
# ICP/USD (returns [[timestamp, "price_as_string"]])
30-
GET https://ic-api.internetcomputer.org/api/v3/icp-usd-rate
31-
32-
# ICP/XDR in permyriad (returns [[timestamp, xdr_permyriad_per_icp]])
33-
GET https://ic-api.internetcomputer.org/api/v3/icp-xdr-conversion-rates?limit=1
34-
35-
xdr_usd = icp_usd / (xdr_permyriad_per_icp / 10_000)
36-
```
37-
38-
Example: ICP/USD = $2.67, ICP/XDR = 19482 / 10000 = 1.9482 → XDR/USD = 2.67 / 1.9482 ≈ $1.37.
39-
40-
The ICP Dashboard API is not certified: responses are unsigned and not verifiable on-chain.
41-
42-
**CMC metrics endpoint (Prometheus, unsigned):** The CMC exposes a Prometheus metrics endpoint at `https://rkp4c-7iaaa-aaaaa-aaaca-cai.raw.icp0.io/metrics` that includes `cmc_icp_xdr_conversion_rate` (current ICP/XDR) and `cmc_avg_icp_xdr_conversion_rate` (30-day moving average used for node provider rewards). Neither is certified. Apply the same formula to derive XDR/USD.
43-
44-
**On-chain (certified, from a canister):** Call the XRC for `ICP/USD` as a crypto/fiat pair (1B cycles, refunded if unused), and call the CMC `get_icp_xdr_conversion_rate` for ICP/XDR. Derive XDR/USD = ICP_USD / (xdr_permyriad_per_icp / 10_000). See [Fetch exchange rates](../guides/chain-fusion/exchange-rates.md) for XRC integration code.
45-
46-
## Cycles units
12+
## Cycle units
4713

4814
| Abbreviation | Name | In numbers | XDR value | Approx. USD value |
4915
|--------------|----------|-------------------|-----------|-------------------|
@@ -63,7 +29,7 @@ See [Subnet types](subnet-types.md) for subnet-specific details.
6329

6430
## Cost table
6531

66-
USD values use the rate in the [XDR exchange rate](#xdr-exchange-rate) section. Use cycle counts for precise budgeting.
32+
USD values use the rate stated in the intro. Use cycle counts for precise budgeting.
6733

6834
<!-- Needs human verification: cloud pricing comparison requested in content brief — no upstream source found in .sources/ for ICP vs. cloud provider cost comparison. -->
6935

@@ -118,27 +84,9 @@ When a canister grows its memory (via `memory.grow`, `ic0.stable_grow()`, or Was
11884

11985
Reserved cycles are non-transferable. Controllers can disable reservation by setting `reserved_cycles_limit = 0`, but opted-out canisters cannot allocate new memory when subnet usage exceeds 750 GiB.
12086

121-
## Protocol integrations
122-
123-
The following ICP features involve calls to external networks or specialized subnets and carry additional cycle costs beyond the base execution and messaging fees.
124-
125-
### HTTPS outcalls
126-
127-
HTTPS outcall costs scale with subnet size (`n` = number of nodes):
128-
129-
```
130-
total_fee = base_fee + size_fee
131-
base_fee = (3_000_000 + 60_000 * n) * n
132-
size_fee = (400 * request_bytes + 800 * max_response_bytes) * n
133-
```
87+
## Threshold cryptography
13488

135-
`request_bytes` is the total serialized request size (URL + headers + body + transform name/context). `max_response_bytes` defaults to 2 MiB if not explicitly set by the canister.
136-
137-
| Component | 13-node cycles | ~USD | 34-node cycles | ~USD |
138-
|-----------|----------------|------|----------------|------|
139-
| Per call (base) | 49_140_000 | ~$0.0000671 | 171_360_000 | ~$0.000234 |
140-
| Per request byte | 5_200 | ~$0.0000000071 | 13_600 | ~$0.0000000186 |
141-
| Per reserved response byte | 10_400 | ~$0.0000000142 | 27_200 | ~$0.0000000372 |
89+
Threshold signing and key derivation are core ICP protocol capabilities: the cryptographic operations happen entirely within the ICP network, distributed across the nodes of a designated subnet. The extra cost reflects computationally intensive threshold cryptography and cross-subnet coordination.
14290

14391
### Threshold ECDSA and Schnorr signing
14492

@@ -162,6 +110,28 @@ If the canister may be blackholed or called by other canisters, send more cycles
162110

163111
If the canister may be blackholed or called by other canisters, send more cycles than the listed cost: unused cycles are refunded.
164112

113+
## Chain integrations
114+
115+
These features involve outbound calls to external networks. Every node on the relevant subnet participates in each call, which is the primary driver of the additional cost. The subsections below are ordered by pricing mechanism: HTTPS outcalls first as the base primitive, then the two RPC canisters that build on it, then the native chain integrations that use a two-tier pricing model.
116+
117+
### HTTPS outcalls
118+
119+
HTTPS outcall costs scale with subnet size (`n` = number of nodes):
120+
121+
```
122+
total_fee = base_fee + size_fee
123+
base_fee = (3_000_000 + 60_000 * n) * n
124+
size_fee = (400 * request_bytes + 800 * max_response_bytes) * n
125+
```
126+
127+
`request_bytes` is the total serialized request size (URL + headers + body + transform name/context). `max_response_bytes` defaults to 2 MiB if not explicitly set by the canister.
128+
129+
| Component | 13-node cycles | ~USD | 34-node cycles | ~USD |
130+
|-----------|----------------|------|----------------|------|
131+
| Per call (base) | 49_140_000 | ~$0.0000671 | 171_360_000 | ~$0.000234 |
132+
| Per request byte | 5_200 | ~$0.0000000071 | 13_600 | ~$0.0000000186 |
133+
| Per reserved response byte | 10_400 | ~$0.0000000142 | 27_200 | ~$0.0000000372 |
134+
165135
### EVM RPC canister
166136

167137
Calls to the EVM RPC canister use an HTTPS-outcall-based pricing structure with higher per-byte constants than standard HTTPS outcalls, scaled by the number of RPC services used for multi-provider consistency:
@@ -177,7 +147,25 @@ Calls to the EVM RPC canister use an HTTPS-outcall-based pricing structure with
177147

178148
Typical cost: 10^8 to 10^9 cycles (~$0.0001 to $0.001 USD). On a 34-node subnet with a 1 kB request and 1 kB response using one RPC service: ~$0.00052.
179149

180-
An additional `10_000_000 * nodes_in_subnet * rpc_services` collateral cycles must be attached; these are currently refunded in full. Start with 10_000_000_000 cycles and adjust based on observed costs. Use the `requestCost` query method on the EVM RPC canister to estimate costs before calling.
150+
An additional `10_000_000 * nodes_in_subnet * rpc_services` collateral cycles must be attached per call; these are consumed by the EVM RPC canister as a reserve for future pricing changes and are not returned to the caller. Any cycles you attach above the total minimum (formula + collateral) are returned, so it is safe to send more than needed. Start with 10_000_000_000 cycles and adjust based on observed costs. Use the `requestCost` query method on the EVM RPC canister to get an exact estimate before calling.
151+
152+
### SOL RPC canister
153+
154+
The SOL RPC canister prices each call using the standard HTTPS outcall formula plus a `10_000_000 cycles × n` per-node processing fee, scaled by the number of RPC providers used:
155+
156+
```
157+
total_fee = (
158+
(3_000_000 + 60_000 * n) * n // base HTTP outcall fee
159+
+ (400 * request_bytes + 800 * max_response_bytes) * n // size fee
160+
+ 10_000_000 * n // processing fee
161+
) * rpc_providers
162+
```
163+
164+
`n` is the number of nodes in the subnet hosting the SOL RPC canister. Because each method uses a different default `max_response_bytes` and request serialization size, costs vary per method. As a reference point: `getBalance` with 3 RPC providers on a 34-node subnet costs approximately 1.7 billion cycles (~$0.0023 USD).
165+
166+
To get the exact cycle estimate for a specific call before attaching cycles, use the corresponding query endpoint on the SOL RPC canister: `getBalanceCyclesCost`, `getBlockCyclesCost`, `getSlotCyclesCost`, `getTransactionCyclesCost`, `sendTransactionCyclesCost`, and equivalents for each method.
167+
168+
See the [Solana guide](../guides/chain-fusion/solana.mdx) for integration examples.
181169

182170
### Bitcoin integration API
183171

@@ -226,23 +214,39 @@ The Dogecoin integration API follows the same two-tier pricing model as the Bitc
226214

227215
See the [Dogecoin guide](../guides/chain-fusion/dogecoin.md) for integration patterns.
228216

229-
### SOL RPC canister
217+
## XDR exchange rate
230218

231-
The SOL RPC canister prices each call using the standard HTTPS outcall formula plus a `10_000_000 cycles × n` per-node processing fee, scaled by the number of RPC providers used:
219+
The cycle price is fixed by protocol: **1 trillion cycles = 1 XDR**. This ratio is set by NNS governance and does not change with ICP token price movements.
232220

233-
```
234-
total_fee = (
235-
(3_000_000 + 60_000 * n) * n // base HTTP outcall fee
236-
+ (400 * request_bytes + 800 * max_response_bytes) * n // size fee
237-
+ 10_000_000 * n // processing fee
238-
) * rpc_providers
221+
All USD values on this page use **1 XDR = $1.366430** (May 22, 2026). Use cycle counts for precise budgeting; only the USD conversion fluctuates.
222+
223+
### How the CMC tracks the rate
224+
225+
The [Cycles Minting Canister (CMC)](../references/system-canisters.md#cycles-minting-canister-cmc) (`rkp4c-7iaaa-aaaaa-aaaca-cai`) calls the [exchange rate canister (XRC)](../references/protocol-canisters.md#exchange-rate-canister-xrc) every 5 minutes for the current ICP/XDR rate. The CMC exposes `get_icp_xdr_conversion_rate`, which returns `xdr_permyriad_per_icp`: the number of XDR per ICP, expressed in units of 1/10000 (for example, `19482` means 1 ICP = 1.9482 XDR). This is an ICP/XDR rate; the CMC does not track XDR/USD.
226+
227+
### Getting the current XDR/USD rate
228+
229+
**Manual lookup:** The [IMF's SDR valuation page](https://www.imf.org/external/np/fin/data/rms_sdrv.aspx) is the authoritative source. The page returns HTTP 403 to automated HTTP clients and cannot be fetched programmatically.
230+
231+
**ICP Dashboard API (unsigned, easy for scripts):** Fetch the ICP/USD price and the ICP/XDR rate, then derive XDR/USD:
232+
233+
```bash
234+
# ICP/USD (returns [[timestamp, "price_as_string"]])
235+
GET https://ic-api.internetcomputer.org/api/v3/icp-usd-rate
236+
237+
# ICP/XDR in permyriad (returns [[timestamp, xdr_permyriad_per_icp]])
238+
GET https://ic-api.internetcomputer.org/api/v3/icp-xdr-conversion-rates?limit=1
239+
240+
xdr_usd = icp_usd / (xdr_permyriad_per_icp / 10_000)
239241
```
240242

241-
`n` is the number of nodes in the subnet hosting the SOL RPC canister. Because each method uses a different default `max_response_bytes` and request serialization size, costs vary per method. As a reference point: `getBalance` with 3 RPC providers on a 34-node subnet costs approximately 1.7 billion cycles (~$0.0023 USD).
243+
Example: ICP/USD = $2.67, ICP/XDR = 19482 / 10000 = 1.9482 → XDR/USD = 2.67 / 1.9482 ≈ $1.37.
242244

243-
To get the exact cycle estimate for a specific call before attaching cycles, use the corresponding query endpoint on the SOL RPC canister: `getBalanceCyclesCost`, `getBlockCyclesCost`, `getSlotCyclesCost`, `getTransactionCyclesCost`, `sendTransactionCyclesCost`, and equivalents for each method.
245+
The ICP Dashboard API is not certified: responses are unsigned and not verifiable by the network.
244246

245-
See the [Solana guide](../guides/chain-fusion/solana.mdx) for integration examples.
247+
**CMC metrics endpoint (Prometheus, unsigned):** The CMC exposes a Prometheus metrics endpoint at `https://rkp4c-7iaaa-aaaaa-aaaca-cai.raw.icp0.io/metrics` that includes `cmc_icp_xdr_conversion_rate` (current ICP/XDR) and `cmc_avg_icp_xdr_conversion_rate` (30-day moving average used for node provider rewards). Neither is certified. Apply the same formula to derive XDR/USD.
248+
249+
**From canister code (certified):** Call the XRC for `ICP/USD` as a crypto/fiat pair (1B cycles, refunded if unused), and call the CMC `get_icp_xdr_conversion_rate` for ICP/XDR. Derive XDR/USD = ICP_USD / (xdr_permyriad_per_icp / 10_000). See [Fetch exchange rates](../guides/chain-fusion/exchange-rates.md) for XRC integration code.
246250

247251
## Related pages
248252

0 commit comments

Comments
 (0)