Skip to content
← Documentation

Canton Design Patterns

20 short patterns for the questions CCPEDIA sees most: error diagnosis, version upgrade planning, party allocation, token transfers, validator ops, governance, dev fund proposal craft.

Ledger fundamentals

Allocate a party safely

Problem. On a fresh Canton install the JSON Ledger API rejects submissions because no party has been allocated.

Solution. Call `/v1/parties/allocate` with a `partyIdHint` you control. Re-using the hint is idempotent; the participant returns the existing identifier.

curl -X POST $LEDGER/v1/parties/allocate \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"identifierHint": "alice", "displayName": "Alice"}'

Pick between JSON Ledger API and gRPC Ledger API

Problem. Developers default to gRPC out of habit even when a browser-facing dApp would prefer JSON.

Solution. For browser/Node clients use JSON Ledger API v2 (simpler auth, streaming via SSE). For backend/services with tight latency use the gRPC API. Both expose the same domain model.

Tooling

Verify a CLI tool isn't deprecated before suggesting it

Problem. AI agents keep recommending `daml-assistant` / `daml start` long after they were retired by DPM.

Solution. Always call CCPEDIA's `check_deprecation` MCP tool before printing an install command. It returns DEPRECATED / CURRENT / NOT_FOUND with the replacement.

Don't import @daml/ledger or @daml/react

Problem. Stale tutorials still point to retired npm packages.

Solution. Use the current DA tooling exposed via `dpm codegen-js` (TS bindings) and the @canton-network/dapp-sdk for CIP-0103 wallet transport. Run `list_deprecations` to scan for any other names you might still be using.

Versioning

Pre-flight an SDK upgrade

Problem. Splice/Canton ship every 1–2 weeks; teams discover breaking changes only after CI breaks.

Solution. Run `get_breaking_changes(from, to)` against the target tags before bumping — it joins the GitHub release notes with forum activity in the post-release window so you see both the announced and observed regressions.

Confirm you're on the current Canton + Splice

Problem. Curated KBs and tutorials lag the live release feed by weeks.

Solution. `get_current_versions` joins github_releases tags with validator-announce mailing-list posts. Cross-check static KBs against this before trusting them.

Debugging

Resolve a gRPC error code

Problem. You hit a Canton gRPC error like `UNAVAILABLE` or `TOPOLOGY_TOO_MANY_PENDING_TOPOLOGY_TRANSACTIONS` with no obvious cause.

Solution. Paste the full status into `diagnose_error` — the tool extracts distinctive tokens (incl. underscore-split parts) and searches forum_fts + github_items for prior resolutions.

// MCP call
diagnose_error({ error_text: "TOPOLOGY_TOO_MANY_PENDING_TOPOLOGY_TRANSACTIONS at submitPartyOnboardingTransaction" })

Diagnose a Canton bug right after a Splice cut

Problem. New Canton errors right after a Splice tag often turn out to be Splice-side, not Canton-side.

Solution. Pull `get_recent_deployments()` to see the freshest releases, then `get_breaking_changes(from, to)` against the relevant pair. Forum activity in the +14d window is usually the smoking gun.

Token Standard

Implement a CIP-0056 token transfer

Problem. Custom transfer choices duplicate logic that the standard already covers.

Solution. Use the Canton Token Standard (CIP-0056) reference flows: `Transfer`, `TransferIntent`, `TransferReceipt`. Build new tokens by extending the standard, not replacing it.

Governance

Check whether you can build on a CIP today

Problem. CIPs sit in different states (Draft, In Review, Approved, Final) and may declare `Requires:` blockers that haven't shipped.

Solution. Call `detect_cip_dependency_chain(cip_id)` — returns the full prerequisite chain with each prerequisite's current status. ✓ = Final/Approved; ✗ = still blocking.

Track all conversations about a CIP across surfaces

Problem. A live CIP debate happens in cip-discuss mailing + forum + GitHub at once; following one is partial.

Solution. `get_cip_citations(cip_number)` returns per-source backlinks with per-message granularity — including individual mailing messages, forum posts, GitHub items, blog posts, and videos.

SV operations

Plan around the next MainNet upgrade window

Problem. Ops teams hit traffic freezes / topology freezes / synchronizer upgrades by surprise.

Solution. Subscribe to the SV calendar via `get_upcoming_operations(days)` or query `get_sv_schedule(environment="MainNet")`. The calendar is synced from sv-cal.canton.foundation every 12 hours.

Bootstrap a new validator without re-reading the docs end-to-end

Problem. Validator onboarding has many moving parts (topology, traffic balance, ValidatorLicense, sequencer).

Solution. Run `get_started_guide(background="enterprise")` for the structured path, then `get_sv_schedule(environment="DevNet")` to plan around the next upgrade. Cross-check `get_kb_drift()` so you're reading current values.

Dev Fund

Confirm nobody is already building it

Problem. Dev Fund inbox routinely receives near-duplicate proposals (LocalNet tooling, validator runbooks, wallet abstractions).

Solution. Run `detect_builder_overlap(idea)` before drafting. Returns scored matches across 410+ proposals AND 458 ecosystem projects.

Self-grade a Dev Fund proposal draft

Problem. Approval depends on milestone clarity, named deliverables, scope realism — easy to miss in a first draft.

Solution. `proposal_success_predictor(draft_text)` walks a ten-point checklist (milestones, deliverables, sources, length, Apache 2.0…) and scores the draft. Aim for ≥80%.

Community

Find someone who already solved this

Problem. The right Canton-side expert for "topology" or "wallet kernel" isn't obvious from forum username alone.

Solution. `find_expert(topic)` ranks authors by topic-relevant + total volume. Top forum posters skew toward DA engineering staff who maintain the affected component.

Search Canton mailing lists, not just the forum

Problem. Foundation governance and many SV ops discussions never make it to the forum — they live on lists.canton.network.

Solution. `search_mailing_list(query, group?)` indexes cip-discuss, cip-vote, cip-announce, grants-discuss, validator-announce and globalSyncForum. Pass `group="cip-vote"` to drill into formal votes.

Find adjacent projects to partner with

Problem. Builders working on adjacent capabilities (e.g. a wallet + a DEX + a bridge) rarely discover each other.

Solution. `find_collaboration_opportunities(project)` returns ecosystem_projects with overlapping tags/category. Use it once at proposal-time and again at design-time.

Daml

Find working Daml code by topic

Problem. Forum threads contain working code but Google rarely surfaces them.

Solution. `find_code_examples(topic)` returns forum threads with embedded `<pre>`/`<code>` blocks matching the topic. Faster than reading the spec when you need a sketch.

Public goods

Help keep the Foundation MCP KB current

Problem. The curated Foundation knowledge-base.json drifts behind live releases — and the maintainer can't scan everything themselves.

Solution. CCPEDIA runs `get_kb_drift` daily, then auto-opens PRs to canton-network-devs/Build-on-Canton-MCP with the corrections. Anyone can run `scripts/generate-drift-pr.ts --dry-run` to preview what would be submitted.