Skip to content

Latest commit

History

1,323 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Wallet

A TypeScript framework for building wallet integrations on the Canton Network. It provides the Wallet Gateway (server and browser extension), the dApp SDK, the Wallet SDK, and a set of shared core modules.

Architecture

┌─────────────┐ dApp API (CIP-103) ┌──────────────────┐ Ledger API ┌──────────────────┐
│ Your dApp │ ◄────────────────────────► │ Wallet Gateway │ ◄─────────────────► │ Canton Validator │
│ (dApp SDK) │ (HTTP / postMessage) │ │ │ │
└─────────────┘ │ ┌────────────┐ │ Signing └──────────────────┘
│ │ │ User API │ │
│ User interactions │ │ User UI │ │ ┌──────────────────┐
└──────────────────────────────────►│ └────────────┘ │ ◄──►│ Signing Provider │
(User UI / User API) │ │ │ (Participant, │
└──────────────────┘ │ Fireblocks, …) │
└──────────────────┘
  • dApp → Wallet Gateway: dApps use the dApp SDK to call the dApp API.
  • User → Wallet Gateway: Users manage wallets and approve transactions via the User UI.
  • Wallet Gateway → Canton / Signing: The Gateway authenticates to validator Ledger APIs and forwards signing requests to the configured signing provider.

dApp API (CIP-103)

The dApp API is a JSON-RPC 2.0 interface specified by CIP-103. It defines how dApps communicate with wallet providers on the Canton Network. Key methods include:

The dApp SDK (@canton-network/dapp-sdk) implements this protocol and adds a higher-level API, multi-transport support, and an EIP-1193-style provider via getConnectedProvider() after connect().

Wallet SDK

The Wallet SDK (@canton-network/wallet-sdk) is a TypeScript SDK for wallet providers and exchanges integrating directly with the Canton Network. Unlike the dApp SDK (which talks to a Wallet Gateway), the Wallet SDK operates at a lower level — authenticating to synchronizers, allocating parties with external keypairs, reading active contracts, and signing and submitting transactions.

Key capabilities:

  • Authenticate and connect to a Canton synchronizer
  • Allocate parties with an external keypair
  • Read active contracts on the ledger
  • Decode and validate prepared transactions
  • Sign and submit transactions via the Ledger API
  • Integrate with the Token Standard

See the Wallet SDK README and the integration guide for usage details.

Project Structure

Wallet Gateway

Two implementations of the Wallet Gateway, both exposing the same dApp API and User API:

PackagePathDescription
@canton-network/wallet-gateway-remotewallet-gateway/remoteServer-side implementation over HTTP (Express.js). Connects to SQL stores and external signing providers.
@canton-network/wallet-gateway-extensionwallet-gateway/extension[NOT IMPLEMENTED YET] Client-side implementation as a Manifest V3 browser extension. Uses browser storage for persistence and in-browser signing.

SDKs

PackagePathDescription
@canton-network/dapp-sdksdk/dapp-sdkBrowser SDK for dApp development. Implements the CIP-103 dApp API with multi-transport support (HTTP, postMessage).
@canton-network/wallet-sdksdk/wallet-sdkSDK for wallet providers and exchanges to integrate with Canton and the Token Standard.

Core Modules

Shared libraries used by the Wallet Gateway, SDKs, and signing providers:

PackagePathDescription
Store
core-wallet-storecore/wallet-storeStore interface for wallets, sessions, networks, IDPs, and transactions
core-wallet-store-sqlcore/wallet-store-sqlSQL implementation (SQLite / PostgreSQL) via Kysely
core-wallet-store-inmemorycore/wallet-store-inmemoryIn-memory implementation for testing and development
Signing
core-signing-libcore/signing-libCore library and interfaces for signing driver implementations
core-signing-store-sqlcore/signing-store-sqlSQL persistence for signing keys and transactions
core-signing-internalcore/signing-internalInternal (wallet-kernel) signing driver using Ed25519
core-signing-participantcore/signing-participantCanton participant-managed signing driver
core-signing-fireblockscore/signing-fireblocksFireblocks signing driver integration
core-signing-blockdaemoncore/signing-blockdaemonBlockdaemon signing driver integration
core-signing-securosyscore/signing-securosysSecurosys TSB signing driver integration
RPC & Transport
core-typescore/typesShared types and transport-agnostic parsers
core-rpc-transportcore/rpc-transportRPC transport implementations
core-rpc-errorscore/rpc-errorsStandardized JSON-RPC error types
core-rpc-generatorcore/rpc-generatorCode generator for JSON-RPC interfaces
Auth & Ledger
core-wallet-authcore/wallet-authAuthentication middleware and user management (JWT, OAuth)
core-ledger-clientcore/ledger-clientTypeScript Canton Ledger API client (generated from OpenAPI)
core-ledger-client-typescore/ledger-client-typesType definitions for the Ledger API client
UI & Clients
core-wallet-ui-componentscore/wallet-ui-componentsReusable Lit web components for wallet UIs
core-wallet-user-rpc-clientcore/wallet-user-rpc-clientGenerated RPC client for the User API
core-wallet-dapp-rpc-clientcore/wallet-dapp-rpc-clientGenerated RPC client for the dApp API
Splice
core-splice-clientcore/splice-clientClient for Splice network services
core-splice-providercore/splice-providerSplice network provider integration
core-token-standardcore/token-standardCanton Token Standard implementation

Examples

PathDescription
examples/pingMinimal dApp demonstrating connect, prepare, and execute flows
examples/portfolioPortfolio dApp showcasing account listing and transaction history

Documentation

PathDescription
docs/dapp-buildingdApp building guide (dApp SDK, Wallet Gateway)
docs/wallet-integration-guideStep-by-step integration guide with code examples
docs/CONTRIBUTING.mdContribution guidelines
docs/GLOSSARY.mdTerminology reference

Getting Started

Prerequisites

  • Node.js 20+
  • Yarn 4 (Corepack)
  • A running Canton participant node (or use the included local setup)

Quick Start

# Install dependencies
yarn install
# Build everything
yarn build:all
# Start all services (Wallet Gateway, mock OAuth, Example dApps, etc.)
yarn start:all
# Start a local Canton Participant Node
yarn start:canton

Active processes can be monitored with:

yarn pm2 list

To stop everything:

yarn stop:all

Running the Browser Extension

TBD.

Contributing

For information about contributing, please refer to the Contributing Guide.

License

Apache-2.0

About

dApp SDK / Wallet SDK / Wallet Gateway

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages