OCP Canton SDK
Architecture
How OCP contracts are designed, what they store, and how this SDK talks to them.
The contracts
The SDK talks to a set of smart contracts that run on the Canton Network — a privacy-enabled blockchain built for financial institutions. Unlike most blockchains, Canton keeps data private to the parties involved in each transaction. Your cap table is only visible to the parties you authorize.
The contracts are written in DAML, a language designed specifically for financial agreements on distributed ledgers. Every write goes through them; every read comes from them.
Both the contracts and this SDK are open source:
- open-captable-protocol-daml — the contract source
- ocp-canton-sdk — this SDK
What the contracts model
The contracts follow the Open Cap Table Format (OCF) standard — the same schema this SDK returns in every response.
Every cap table starts with the OCP Factory — a shared on-chain contract (one per Canton deployment) that registers an issuer party and issues an IssuerAuthorization. From there, buildCreate creates the Issuer and CapTable together in one transaction. After that, all entity changes flow through a single on-chain choice called UpdateCapTable, which validates the whole batch and applies it atomically.
The OCP Factory is deployed once per Canton network. On mainnet and devnet it’s already there. For custom deployments, use
createFactoryfrom the SDK.
How the SDK fits in
The SDK is a TypeScript layer that handles the translation between your code and the contracts.
When you read: OcpClient fetches contract data from Canton and converts it into typed OCF objects — consistent field names, clear object_type values, no Canton-specific shapes leaking into your app.
When you write: the SDK assembles the right transaction commands (including batch updates for UpdateCapTable) and submits them through canton-node-sdk.
Custom factory: By default the SDK resolves the OCP Factory from a bundled network config (mainnet and devnet). For localnet or any other deployment, pass factory: { contractId, templateId } to new OcpClient(...).
Ready to start? Quickstart