canic
Facade crate that re-exports the main Canic stack for canister projects:
- endpoint and lifecycle macros
- core runtime/types
- curated IC CDK helpers
- stable-memory helpers under
canic::memory
Most downstream canister projects should start here instead of reaching for lower-level crates directly.
Use the explicit module paths for the larger bundled surfaces:
canic::api::*for runtime APIscanic::cdk::*for curated IC CDK helperscanic::memory::*for stable-memory helpers and macros
Default Surface
The default feature set is intentionally small:
metrics- exportscanic_metricsin ordinary builds unless you opt out
Disable default features in Cargo.toml when you need an even narrower facade
dependency.
Optional Features
These features can also be selected explicitly when default features are off:
metricscontrol-plane- enables root control-plane supportsharding- enables sharding-oriented runtime support fromcanic-coreauth-root-canister-sig-create- enables root canister-signature proof creationauth-root-canister-sig-verify- enables IC canister-signature proof verificationauth-shard-secp256k1-verify- enables shard secp256k1 token-signature verificationauth-threshold-ecdsa-public-key- enables threshold ECDSA public-key fetchesauth-threshold-ecdsa-sign- enables threshold ECDSA signing callsauth-delegated-token-verify- enables delegated-token verification, including root canister-signature and shard secp256k1 verification
Typical Use
Use canic in both [dependencies] and [build-dependencies] so the build
macros and runtime macros come from the same facade crate.
Each canister crate declares its role in package metadata:
[]
= "demo"
= "app"
Use canic::build!("../canic.toml") from build.rs and canic::start!() from
lib.rs. The fleet value must match [fleet] name = "..." in the selected
canic.toml. role = "root" selects the root lifecycle and root endpoint
bundle; ordinary roles select the non-root lifecycle and endpoint bundle.
This crate lives in the Canic workspace. See the workspace guide at
../../README.md for full setup, topology, and example canisters.