@canton-network/core-signing-bitgo

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

Wallet Gateway signing driver for BitGo

原始使用文档
文档目录6 节
  1. How it works
  2. Credentials
  3. Wallet Gateway configuration
  4. Transaction state lifecycle
  5. Restart resilience
  6. Development

BitGo Signing Driver

A driver for signing and retrieving Canton transactions using the BitGo TSS MPC custodial wallet API, implementing the SigningDriverInterface from @canton-network/core-signing-lib.

How it works

BitGo signs Canton transactions asynchronously via its MPC TSS protocol:

  1. Key creation — a BitGo custodial wallet is created per Canton party (POST /api/v2/{coin}/wallet). The returned Key carries the BitGo wallet ID as id (stable routing identifier) and the Ed25519 public key derived from the wallet keychain at m/0 as publicKey (used for Canton party allocation and fingerprint generation).
  2. Sign request — the Canton transaction is submitted as a message signing request (POST /api/v2/wallet/{walletId}/msgrequests) and returns a txRequestId immediately with status pending.
  3. Polling — the wallet gateway polls getTransaction(txRequestId) until status === 'signed'. The Ed25519 signature and Canton signer fingerprint are extracted from the signed txRequest response.

Credentials

  1. Sign in to BitGo (or BitGo Test for testnet).
  2. Create a Long-Lived Access Token in User Settings → Developer Options → Access Tokens. Select the scopes your use case requires (at minimum: wallet management and transaction signing).
  3. Note your Enterprise ID from Settings → Enterprise. This is required for wallet creation.

Wallet Gateway configuration

Configure non-secret values in the Wallet Gateway config. Listing bitgo under signingProviders opts the provider in:

Gateway config fieldRequiredDescription
signingProviders.bitgo.baseUrlNoAPI base URL. Defaults to https://app.bitgo.com (prod). Use https://app.bitgo-test.com for testnet.
signingProviders.bitgo.enterpriseIdNoBitGo enterprise ID. Required for createKey. Enables restart-safe getTransaction fallback via the enterprise txrequests endpoint.
signingProviders.bitgo.coinNoCanton coin identifier. Auto-detected: tcanton for bitgo-test.com URLs, canton for everything else (prod, proxies, custom URLs).
signingProviders.bitgo.accessTokenEnvNoName of the environment variable that holds the access token. Defaults to BITGO_ACCESS_TOKEN. The token value stays in the environment.

If signingProviders is omitted, the Wallet Gateway uses legacy discovery and reads BITGO_ACCESS_TOKEN, BITGO_API_URL, BITGO_ENTERPRISE_ID, and BITGO_COIN from the environment. Non-secret variables are ignored once signingProviders is present.

Transaction state lifecycle

BitGo signing is asynchronous — the MPC TSS protocol requires multiple internal rounds before a signature is produced. The driver maps BitGo states to Canton SigningStatus:

BitGo stateCanton statusNotes
initialized, pendingApproval, pendingDelivery, pendingUserSignature, pendingUserCommitment, pendingUserRShare, pendingUserGShare, readyToSendpendingMPC rounds in progress
messages[0].state === 'signed'signedMessage-level state takes precedence — signing is complete even if txRequest is still pendingDelivery
delivered, signedsigned
canceled, rejectedrejected
failedfailed

Restart resilience

The driver maintains in-memory caches for fast lookups (txRequestId → walletId, publicKey ↔ walletId). If the process restarts, these caches are empty. Transactions are recovered via the BitGo enterprise txrequests endpoint (requires BITGO_ENTERPRISE_ID). Public keys are resolved on demand per wallet via the BitGo wallet and keychain endpoints when not in cache.

Development

pnpm build                                                   # compile
pnpm nx test @canton-network/core-signing-bitgo              # run tests
pnpm nx test @canton-network/core-signing-bitgo -c coverage  # with coverage report

版本与发布记录

@canton-network/core-signing-bitgo 共发布 10 个版本,首次发布于 2026/09/02;过去 12 个月发布了 10 个版本。

版本发布日期距今
1.7.0latest2026/11/063 天前
1.6.02026/10/2911 天前
1.2.1-backport.3bugfix2026/10/2614 天前
1.5.02026/10/2317 天前
1.4.02026/10/1228 天前
1.2.1-backport.12026/10/031 个月前

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

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

Wallet Gateway signing driver for BitGo

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

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

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

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

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

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

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

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

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

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

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

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