Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

CrateFor
canton-ledgerThe Ledger API client:
• submit, recover an ambiguous submission
• read the active contract set
• stream updates, resumably
• point reads
• interactive submission
canton-authOIDC client-credentials tokens, cached and refreshed, with Keycloak, Auth0 and Okta presets.
canton-damlThe runtime under generated bindings:
• Daml types, Template and Choice
• command builders
• the JSON and gRPC value codecs
canton-codegen-clidpm-codegen-rust: turns a DAR into a typed bindings crate.
canton-tokenToken-standard workflows over the registry API: transfers, allocations, settlement.
canton-signerThe Signer trait for external signing, with an Ed25519 implementation.
canton-adminParties, packages and users over the Ledger API’s admin services, and topology reads over the Canton admin API.
canton-pqsTyped 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

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.