@canton-network/core-signing-dfns

中文文档
0.14.4发布于 2026/11/06Apache-2.0TypeScriptESM + CJS近 30 天下载 2100

Dfns signing driver for Canton Network Wallet Gateway

原始使用文档
文档目录10 节
  1. Installation
  2. Usage
  3. Initialization
  4. Features
  5. Integration
  6. Configuration
  7. DfnsCredentials
  8. Wallet Gateway Configuration
  9. Canton Network Support
  10. License

@canton-network/core-signing-dfns

This package provides a signing driver for integrating the Wallet Gateway with Dfns. It implements the SigningDriverInterface defined in @canton-network/core-signing-lib, allowing the Wallet Gateway to manage keys and sign transactions using Dfns's infrastructure.

Installation

This package is part of the Wallet Gateway monorepo and is typically installed as a workspace dependency.

pnpm add @canton-network/core-signing-dfns

Usage

The DfnsSigningDriver is designed to be used within the Wallet Gateway's signing architecture. It requires a configuration object containing Dfns organization details and credentials.

Initialization

import DfnsSigningDriver, {
    DfnsConfig,
    DfnsCredentials,
} from '@canton-network/core-signing-dfns'

const credentials: DfnsCredentials = {
    credId: 'your-credential-id',
    privateKey: 'your-private-key',
    authToken: 'your-auth-token',
}

const config: DfnsConfig = {
    orgId: 'your-dfns-org-id',
    baseUrl: 'https://api.dfns.io', // Dfns API URL
    credentials,
}

const driver = new DfnsSigningDriver(config)

Features

Dfns is used as a sign-only provider: the driver creates ed25519 keys and produces hash signatures, while topology submission and ledger interaction happen on the Wallet Gateway against its configured validator (bring-your-own-validator).

  • Key Management:
    • createKey: Creates a new ed25519 key in Dfns.
    • getKeys: Lists active Canton-compatible (EdDSA / ed25519) keys.
  • Signing:
    • signTransaction: Submits a hash signing request to Dfns for the resolved key. Returns immediately with a signature id; signature bytes are fetched via getTransaction once Dfns reports the request as Signed.
  • Signature Status:
    • getTransaction: Retrieves the status and signature for a previously submitted signing request.
    • getTransactions: Retrieves multiple signatures filtered by id or public key.
  • Configuration:
    • getConfiguration / setConfiguration.

Integration

This driver is intended to be registered with the SigningController in the Wallet Gateway, which manages multiple signing providers.

// Example integration (conceptual)
import { SigningController } from '@canton-network/core-signing-internal' // or similar

const signingController = new SigningController()
signingController.registerDriver(driver)

Configuration

The driver accepts a DfnsConfig object:

PropertyTypeRequiredDescription
orgIdstringYesYour Dfns organization ID.
baseUrlstringYesThe base URL for the Dfns API (e.g., https://api.dfns.io).
credentialsDfnsCredentialsYesCredentials used to authenticate with Dfns.

DfnsCredentials

Dfns uses two-layer authentication: a long-lived service account JWT plus per-request signing with a private key.

PropertyTypeDescription
credIdstringID of the Dfns credential registered against the service account.
privateKeystringPEM-encoded private key paired with credId. Signs every sensitive Dfns API request as a U2F-style second factor. Configured once; not derived from authToken.
authTokenstringLong-lived service account bearer JWT issued by the Dfns dashboard. Does not auto-expire and is not regenerated from privateKey/credId; rotate by issuing a new token in the dashboard.

Wallet Gateway Configuration

When running the Wallet Gateway (Remote), listing dfns under signingProviders opts the provider in. Configure the non-secret values in the Gateway config:

  • signingProviders.dfns.orgId: Your Dfns organization ID.
  • signingProviders.dfns.baseUrl: The base URL for the Dfns API. Defaults to https://api.dfns.io.
  • signingProviders.dfns.credId: The default credential ID for Dfns API authentication.
  • signingProviders.dfns.privateKeyEnv: Name of the environment variable that holds the service account private key. Defaults to DFNS_PRIVATE_KEY.
  • signingProviders.dfns.authTokenEnv: Name of the environment variable that holds the service account auth token. Defaults to DFNS_AUTH_TOKEN.

Secret values stay in those environment variables and are never stored in the config file.

If signingProviders is omitted, DFNS_PRIVATE_KEY, DFNS_AUTH_TOKEN, DFNS_ORG_ID, DFNS_CRED_ID, and DFNS_BASE_URL are read from the environment. Non-secret variables are ignored once signingProviders is present.

Example usage:

{
    "signingProviders": {
        "dfns": {
            "orgId": "your-org-id",
            "baseUrl": "https://api.dfns.io",
            "credId": "your-cred-id",
            "privateKeyEnv": "DFNS_PRIVATE_KEY",
            "authTokenEnv": "DFNS_AUTH_TOKEN"
        }
    }
}

Canton Network Support

Keys are created with scheme: EdDSA and curve: ed25519. The driver lists and resolves only Active ed25519 keys. The Wallet Gateway is responsible for binding keys to a specific Canton network via its own party allocation flow.

License

Apache-2.0

版本与发布记录

@canton-network/core-signing-dfns 共发布 26 个版本,首次发布于 2026/05/05;过去 12 个月发布了 26 个版本。

版本发布日期距今
0.14.4latest2026/11/063 天前
0.14.32026/10/2911 天前
0.13.1-backport.3bugfix2026/10/2614 天前
0.14.22026/10/2317 天前
0.14.12026/10/1228 天前
0.13.1-backport.12026/10/031 个月前

关于 @canton-network/core-signing-dfns 的常见问题

@canton-network/core-signing-dfns 是什么?

Dfns signing driver for Canton Network Wallet Gateway

如何安装 @canton-network/core-signing-dfns?

在项目目录运行 npm install @canton-network/core-signing-dfns,或使用 pnpm add / yarn add / bun add。

@canton-network/core-signing-dfns 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@canton-network/core-signing-dfns 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@canton-network/core-signing-dfns 可以商用吗?

@canton-network/core-signing-dfns 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@canton-network/core-signing-dfns 的下载量有多少?

根据 npm 官方下载统计,@canton-network/core-signing-dfns 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,100 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@canton-network/core-signing-dfns 还在维护吗?

最新版本 0.14.4 发布于 2026/11/06(3 天前);至今共发布 26 个版本,其中过去 12 个月发布了 26 个;首次发布于 2026/05/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。