Canton Rust SDK
An async Rust SDK for the Canton Network Ledger API. It covers:
- gRPC and JSON transports. It talks Ledger API v2 over gRPC and over JSON (HTTP and WebSocket), with the same core operations on both. Interactive submission, health checks and explicit paging are gRPC-only.
- Type-safe codegen from DARs. Daml templates become Rust types.
- The token standard, CIP-56 and CIP-0112.
- Interactive submission with a pluggable signer.
- A typed client for the Participant Query Store.
The SDK is open source under Apache-2.0. Its development is funded by the Canton Dev Fund (proposal #407).
cargo add canton
What is in it
canton is a thin facade over the family, so one dependency gets all of it at
one version. The crates behind it can also be used one at a time:
| Crate | For |
|---|---|
canton-ledger | The Ledger API client: • submit, recover an ambiguous submission • read the active contract set • stream updates, resumably • point reads • interactive submission |
canton-auth | OIDC client-credentials tokens, cached and refreshed, with Keycloak, Auth0 and Okta presets. |
canton-daml | The runtime under generated bindings: • Daml types, Template and Choice• command builders • the JSON and gRPC value codecs |
canton-codegen-cli | dpm-codegen-rust: turns a DAR into a typed bindings crate. |
canton-token | Token-standard workflows over the registry API: transfers, allocations, settlement. |
canton-signer | The Signer trait for external signing, with an Ed25519 implementation. |
canton-admin | Parties, packages and users over the Ledger API’s admin services, and topology reads over the Canton admin API. |
canton-pqs | Typed queries against a PQS (Scribe) store. |
canton-splice-* | Pre-built bindings for the Splice and token-standard DARs. |
The full list, including the internal crates, is in the README.
Where to start
- New to the SDK: Getting started, then Local development and testing to get a participant to talk to.
- Building against your own Daml model: Typed bindings from a DAR.
- Moving tokens: The token standard.
- Keys held outside the participant: Interactive submission and external signing.
- Which Canton, Daml-LF and Rust versions are supported: the compatibility matrix.
- How the SDK is maintained, what that covers and what it does not: Maintenance.
The API reference for every crate is on docs.rs.
Status
Releases are on crates.io. Before 1.0, breaking changes go into a new minor version and are listed in the changelog. The changes already decided for 1.0 are recorded in ADR-0010.
Bugs and questions go to GitHub issues. Vulnerabilities go privately, as the security policy describes.