Canton provides a set of tools and APIs for building applications against the ledger. This page covers what each component does and when to use it.Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
Canton SDK
The Daml SDK bundles the compiler, code generators, sandbox, and supporting tools you need to develop Canton applications. The main entry point is thedpm command-line tool.
Key capabilities of dpm:
dpm build— Compile Daml source code into a DAR file (Daml Archive)dpm codegen-java— Generate Java bindings from a compiled DARdpm codegen-js— Generate TypeScript/JavaScript bindings from a compiled DARdpm sandbox— Start a local Canton sandbox node for testingdpm test— Run Daml Script testsdpm new— Scaffold a new project from a template
dpm has additional functionality which can be explored by adding the --help option, such as dpm inspect-dar --help or dpm test --help
The SDK also includes the Daml Studio VS Code extension for syntax highlighting, type checking, and error diagnostics.
Code Generation
Code generation produces type-safe client bindings from your Daml model. Instead of constructing raw gRPC messages or JSON payloads by hand, you work with generated classes that mirror your templates and choices.Java Bindings
TypeScript Bindings
Ledger API (gRPC)
The Ledger API is the primary interface for submitting commands and reading transactions. It is accessible via the gRPC or JSON API transport exposed by the validator’s participant node. The Ledger API provides:- Command submission — Create contracts and exercise choices. Commands are submitted as a party acting on the ledger, and the validator processes them through the synchronizer.
- Transaction stream — Subscribe to a stream of committed transactions for one or more parties. Your backend processes these events to keep its state up to date.
- Active contract set — Query the currently active contracts visible to a party.
- Package management — Upload DAR files to a validator.
- User and party management — Create and admin parties on the validator.
JSON API
In Canton 3.x, the JSON API is integrated into the validator. It provides an HTTP/JSON interface to the Ledger API. Architecturally, the JSON API LAPI endpoint translates all of its calls to flow through the gRPC LAPI endpoint. Use the JSON API when:- You want simpler HTTP integration without a gRPC client
- You are prototyping and want to test commands with
curl - Your language or platform has limited gRPC support
x975 for each validator (e.g., 2975 for the App User validator).
For production backends that need very high throughput, the gRPC Ledger API is the better choice because it avoids the serialization overhead of the JSON translation layer.
Participant Query Store (PQS)
PQS is a service that subscribes to a validator’s transaction stream and projects contract data into a PostgreSQL database. Your backend queries this database with standard SQL. PQS is the right choice when you need:- Filtered queries across many contracts (e.g., “all licenses expiring this month”)
- Aggregations and reporting
- Full-text search or complex joins
- A read path that doesn’t load the Ledger API
repository/ and pqs/ modules demonstrate how to query PQS tables for contract data.
Wallet SDK
The Wallet SDK provides integration with Canton Coin (CC) wallets for applications that need to handle payments or traffic management. Through the wallet integration, your application can:- Initiate CC transfers between parties
- Create payment requests tied to application workflows (e.g., license renewals)
- Check wallet balances
LicenseRenewalRequest contract implements the Splice AllocationRequest interface, which the wallet system detects and processes as a payment.
For more on how CC and traffic work, see Canton Coin and Traffic.
Working Examples
The cn-quickstart repository demonstrates all of these components working together:- Daml contracts in
daml/compiled withdpm build - Java backend in
backend/using generated bindings and PQS - React frontend in
frontend/consuming the backend’s REST API - LocalNet with validators, PQS, JSON API, and wallet services running via Docker Compose
cd quickstart && make setup && make build && make start to see the full stack in action.
Next Steps
- Backend Development — Patterns for using the Ledger API and PQS in a Java backend
- Frontend Development — Building a React frontend against the backend API