githubEdit

CBTC API Reference

👥 Audience: App Developers integrating CBTC programmatically via the Canton Ledger API.

⚠️ API Stability Notice: All endpoints and interfaces are subject to change without notice. There is no formal versioning policy today. Breaking changes are communicated via #cbtc-ecosystem and the site changelog.


CBTC SDK Reference: cbtc-lib (Rust)

For most integrations, we recommend using cbtc-lib (Rust) rather than raw API calls:

💡 Note: cbtc-lib recently underwent a major restructure (December 2025). If you were using an earlier version, you will need to update your imports. See the cleanup PRarrow-up-right for migration details.


Overview: Canton Ledger API for CBTC Operations

All CBTC operations (minting, burning, transferring wrapped Bitcoin) are performed through the Canton Ledger API (also called the JSON Ledger API). There is no separate "CBTC API." You interact with CBTC by exercising choices on Daml smart contracts running on your Canton participant node.

Base URL: https://<your-participant-host>/v2/

Authentication: Bearer token (JWT) from your OIDC provider. See the Authentication Guide.

Content-Type: application/json for all requests.


Prerequisites

Before calling any CBTC API:

  1. Canton participant node running and connected to the network

  2. CBTC DAR files installed on your participant — download from GitHubarrow-up-right

  3. Valid JWT from your OIDC provider (Keycloak officially supported)

  4. Party ID allocated on your participant


Canton Ledger API Endpoints

For full endpoint documentation covering the Canton Ledger API (including all endpoints used by CBTC operations), refer to the official Canton documentation:

Canton JSON Ledger API Documentation →arrow-up-right


CBTC Instrument ID Management: Devnet, Testnet, and Mainnet

CBTC uses the Canton Token Standard. To interact with CBTC programmatically, you need the correct Instrument ID for your target network.

⚠️ Instrument IDs differ across networks (devnet, testnet, mainnet). Always fetch the latest from the metadata URL rather than hardcoding.

Devnet

Metadata: Viewarrow-up-right

Testnet

Metadata: Viewarrow-up-right

Mainnet

Metadata: Viewarrow-up-right

Token Standard API Reference: Canton Token Standard Docsarrow-up-right

💡 Polling pattern: Instrument IDs can change due to network dynamics (e.g., DAR upgrades). Query the metadata URL periodically rather than hardcoding values. There is currently no push notification for ID changes — this is a known gap.


Rate Limits

There are no BitSafe-imposed rate limits on the Canton Ledger API. However:

  • Canton network throughput: Transfers take a few seconds each. Approximately 500 transfers per 10-minute period is near the current practical limit.

  • Your participant node: Performance depends on your infrastructure. Monitor node resource usage under load.


API Error Handling for CBTC Operations

Error
Cause
Resolution

401 Unauthorized

Invalid or expired JWT

Re-authenticate with your OIDC provider

404 Not Found

Contract ID no longer active

Re-query for current contract IDs

409 Conflict

Duplicate command ID

Use a unique commandId per request

UTXO limit exceeded

Too many UTXOs for a party (max 10)

Consolidate UTXOs using cbtc-lib


Last updated