You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: expand cycle-costs reference with Threshold cryptography and External integrations sections (#272)
## Summary
Expands `docs/references/cycle-costs.md` with four previously-stub cost
entries and restructures the page into two named sections:
- **Threshold cryptography**: threshold ECDSA/Schnorr signing, VetKeys
- **External integrations**: HTTPS outcalls, EVM RPC, SOL RPC, Bitcoin,
Dogecoin
Applies a Diataxis pass to `concepts/cycles.md` (prose replaces the cost
table, links to the new sections) and adds an XDR rate query subsection
to `system-canisters.md`.
## Review guidance
| File | What to check |
|---|---|
| `docs/references/cycle-costs.md` | New cost tables (Dogecoin, SOL RPC,
VetKeys, threshold signing) — verify numbers; section structure; EVM RPC
collateral description |
| `docs/concepts/cycles.md` | Messaging table replaced with prose and
links — does it still give a clear mental model? |
| `docs/references/system-canisters.md` | New XDR rate 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 |
**Key factual correction**: the original text said EVM RPC collateral
cycles "are currently refunded in full" — that's wrong. Tracing through
`canhttp/src/cycles/mod.rs` shows `msg_cycles_accept(request_cost +
collateral)`, meaning collateral is consumed. A second pair of eyes on
the corrected wording is welcome.
## Sync recommendation
`docs/references/cycle-costs.md`: hand-written (informed by multiple
upstream sources listed in the `Upstream` comment)
Copy file name to clipboardExpand all lines: docs/concepts/chain-fusion/exchange-rate-canister.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ The exchange rate canister (XRC) is a system canister that provides exchange rat
7
7
8
8
The canister ID is `uf6dk-hyaaa-aaaaq-qaaaq-cai`.
9
9
10
-
The NNS cycle minting canister uses the XRC to convert ICP to cycles at the XDR-pegged rate. Application canisters can also call the XRC directly to build financial features such as decentralized exchanges, payment systems, and portfolio tools.
10
+
The [Cycles Minting Canister (CMC)](../../references/system-canisters.md#cycles-minting-canister-cmc) is the XRC's primary consumer: it calls the XRC every 5 minutes for the current ICP/XDR rate to use when converting ICP tokens to cycles. Application canisters can also call the XRC directly to build financial features such as exchanges, payment systems, and portfolio tools.
Copy file name to clipboardExpand all lines: docs/concepts/chain-key-cryptography.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ The following master keys are deployed at the time of writing. The Network Nervo
98
98
99
99
Test keys are available for development and run on smaller subnets with lower signing costs. They should not be used for anything of value. Production keys run on high-replication subnets (34+ nodes) for stronger security guarantees. Each key is also reshared to a backup subnet for availability: if the signing subnet fails, the backup can take over without generating a new key.
100
100
101
-
For signing costs, see [Cycle costs](../references/cycle-costs.md).
101
+
For signing costs, see [Cycle costs](../references/cycle-costs.md#threshold-ecdsa-and-schnorr-signing).
-**Threshold cryptography**: threshold ECDSA/Schnorr signing and VetKeys key derivation
16
+
-**External integrations**: HTTPS outcalls, EVM RPC, SOL RPC, Bitcoin, Dogecoin
16
17
17
18
Query calls are free: they run on a single node, do not go through consensus, and are not charged.
18
19
@@ -28,6 +29,8 @@ For step-by-step instructions, see [Acquiring cycles](../guides/canister-managem
28
29
29
30
Unlike ICP tokens, whose price fluctuates with markets, cycles are pegged to the [Special Drawing Right (XDR)](https://www.imf.org/external/np/fin/data/rms_sdrv.aspx): a basket of currencies maintained by the IMF. **1 trillion (T) cycles = 1 XDR** (approximately $1.30–$1.40 USD). This peg makes infrastructure costs predictable for developers regardless of ICP token price movements.
30
31
32
+
The [CMC](../references/system-canisters.md#cycles-minting-canister-cmc) samples the current ICP/XDR rate from the [exchange rate canister](../references/protocol-canisters.md#exchange-rate-canister-xrc) every 5 minutes. For how to look up the current XDR/USD rate programmatically or from a canister, see [Getting the current XDR/USD rate](../references/cycle-costs.md#getting-the-current-xdrusd-rate).
33
+
31
34
## Pricing
32
35
33
36
### Compute
@@ -44,18 +47,13 @@ Compute allocation costs 10M cycles per 1% per second. Best-effort scheduling (0
44
47
45
48
### Storage
46
49
47
-
Storage is charged per byte per second for both Wasm heap memory and stable memory. Storing 1 GiB for one year costs approximately 4T cycles (≈$5.40 USD, May 2025). The cost is the same whether the data is in heap or stable memory.
50
+
Storage is charged per byte per second for both Wasm heap memory and stable memory. Storing 1 GiB for one year costs approximately 4T cycles. The cost is the same whether the data is in heap or stable memory.
48
51
49
52
When a canister allocates new storage bytes on a subnet that is more than 750 GiB full, the system moves cycles from the canister's main balance into a **reserved cycles balance** to cover future storage payments for those bytes. This reservation is non-transferable and grows linearly as the subnet fills toward its 2 TiB capacity.
50
53
51
54
### Messaging
52
55
53
-
| Message type | Cost |
54
-
|---|---|
55
-
| Query call | Free |
56
-
| Ingress update (user → canister) | 1.2M base + 2K cycles/byte, paid by receiving canister |
57
-
| Inter-canister call | 260K base + 1K cycles/byte, paid by sending canister |
58
-
| Canister creation | 500B cycles (≈$0.68, May 2025) |
56
+
Query calls are free. Update messages carry a base fee plus a per-byte variable cost; ingress messages (user to canister) are charged to the receiving canister, while inter-canister calls are charged to the sending canister. Canister creation carries a one-time fee. For exact cycle counts and USD equivalents, see [Cycle costs](../references/cycle-costs.md#cost-table).
59
57
60
58
### Replication factor
61
59
@@ -71,7 +69,9 @@ Each resource category is metered and charged differently:
71
69
72
70
**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.
73
71
74
-
**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
+
**External 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 [External integration costs](../references/cycle-costs.md#external-integrations).
Copy file name to clipboardExpand all lines: docs/concepts/vetkeys.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ The only supported curve is `bls12_381_g2`. Two key names are available:
71
71
|`test_key_1`| Local + mainnet | Development and testing | 10,000,000,000 |
72
72
|`key_1`| Mainnet only | Production | 26,153,846,153 |
73
73
74
-
`vetkd_public_key` carries no cycle cost. `vetkd_derive_key` consumes cycles at the rates above. If a canister may be blackholed or called by other canisters, send more cycles than the advertised cost: unused cycles are refunded, and this ensures calls succeed if the subnet grows in size.
74
+
`vetkd_public_key` carries no cycle cost. `vetkd_derive_key` consumes cycles at the rates above. If a canister may be blackholed or called by other canisters, send more cycles than the advertised cost: unused cycles are refunded, and this ensures calls succeed if the subnet grows in size. See [Cycle costs](../references/cycle-costs.md#vetkd) for USD equivalents and full details.
Copy file name to clipboardExpand all lines: docs/guides/chain-fusion/bitcoin.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1010,7 +1010,7 @@ fn select_one_utxo<'a>(
1010
1010
1011
1011
### Cycle costs
1012
1012
1013
-
All Bitcoin API calls require cycles attached to the call. In Rust, the `ic-cdk-bitcoin-canister` crate handles this automatically. In Motoko, attach cycles explicitly with `(with cycles = amount)`.
1013
+
All Bitcoin API calls require cycles attached to the call. In Rust, the `ic-cdk-bitcoin-canister` crate handles this automatically. In Motoko, attach cycles explicitly with `(with cycles = amount)`. The table below shows minimum cycles to attach; for base costs and USD values see [Cycle costs](../../references/cycle-costs.md#bitcoin-integration-api).
Where `nodes` = 34 (fiduciary subnet) and `rpc_count` = number of providers queried.
575
+
Every EVM RPC call requires cycles. The cost depends on the request size, response size, subnet size, and number of providers queried. For the full pricing formula, see [EVM RPC canister costs](../../references/cycle-costs.md#evm-rpc-canister).
584
576
585
577
**Practical guidance:**
586
578
@@ -589,9 +581,7 @@ Where `nodes` = 34 (fiduciary subnet) and `rpc_count` = number of providers quer
589
581
- Use `requestCost` to get an exact estimate before making a raw JSON-RPC call.
590
582
- The Candid-RPC methods (like `eth_getBlockByNumber`) automatically retry with larger response sizes if needed, consuming more cycles from your budget.
591
583
592
-
### Collateral cycles
593
-
594
-
Callers must include at least 0.00028 TC of additional "collateral cycles" to account for possible future API price increases. These are currently fully refunded, but this may change.
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.
Send 10B cycles per RPC call as a starting budget: unused cycles are refunded. Set `max_response_bytes` to the minimum needed; smaller values reduce costs.
330
+
Send 10B cycles per RPC call as a starting budget: unused cycles are refunded. Set `max_response_bytes` to the minimum needed; smaller values reduce costs. For the full pricing formula, see [SOL RPC canister costs](../../references/cycle-costs.md#sol-rpc-canister).
0 commit comments