@bitgo/abstract-utxo

中文文档
13.6.4发布于 2026/11/06MITTypeScriptESM + CJS构建来源已验证近 30 天下载 4.3万

BitGo SDK coin library for UTXO base implementation

原始使用文档
文档目录11 节
  1. Overview
  2. Supported Coins
  3. Key Features
  4. Transaction Operations
  5. Wallet Types
  6. Address Management
  7. Recovery Operations
  8. Advanced Features
  9. Development Setup
  10. VSCode Configuration
  11. Running Tests

BitGo abstract-utxo

This module provides the foundational AbstractUtxoCoin class and concrete implementations for Bitcoin and Bitcoin-like UTXO-based cryptocurrencies within the BitGo platform.

Overview

The AbstractUtxoCoin class serves as the base implementation for all UTXO-based coins, providing common functionality for transaction building, signing, verification, and recovery operations. Each supported cryptocurrency extends this class to provide coin-specific behavior while leveraging the shared UTXO infrastructure.

Supported Coins

Concrete implementations are provided in the src/impl/ directory:

  • btc/ - Bitcoin (BTC) and Bitcoin testnet variants
  • bch/ - Bitcoin Cash (BCH)
  • bcha/ - Bitcoin Cash ABC (BCHA)
  • bsv/ - Bitcoin SV (BSV)
  • btg/ - Bitcoin Gold (BTG)
  • ltc/ - Litecoin (LTC)
  • dash/ - Dash (DASH)
  • doge/ - Dogecoin (DOGE)
  • zec/ - Zcash (ZEC)

Key Features

Transaction Operations

  • Building & Signing: Support for both legacy and PSBT transaction formats
  • Multi-signature: 2-of-3 multisig with various script types (P2SH, P2WSH, P2SH-P2WSH, P2TR-MuSig2)
  • Verification: Comprehensive transaction intent verification before signing
  • Explanation: Decode and explain transaction details (inputs, outputs, fees)

Wallet Types

  • Fixed Script Wallets: Traditional HD wallets with deterministic address generation
  • Descriptor Wallets: Modern wallet format using output script descriptors
  • Distributed Custody: Support for enterprise custody configurations

Address Management

  • Address validation and derivation verification
  • Support for multiple address formats (base58, bech32, cashaddr for BCH)
  • Chain/index-based address generation for fixed script wallets

Recovery Operations

  • Backup Key Recovery: Recover funds using backup key when BitGo is unavailable
  • Cross-Chain Recovery: Recover coins sent to wrong chain (e.g., BTC sent to LTC address)
  • V1 Wallet Recovery: Support for legacy V1 wallet recovery

Advanced Features

  • BIP322 message signing support
  • MuSig2 for Taproot multisig
  • Replay protection for chain splits
  • Custom change address handling
  • RBF (Replace-by-Fee) transaction support

Development Setup

VSCode Configuration

For an optimal development experience in VSCode, configure the Mocha Test Explorer with the following settings in .vscode/settings.json:

{
  "mochaExplorer.files": "test/**/*.ts",
  "mochaExplorer.nodeArgv": ["--import", "tsx"],
  "mochaExplorer.logpanel": true
}

This configuration enables:

  • Test Discovery: Automatically finds all TypeScript test files in the test/ directory
  • TypeScript Support: Uses tsx for running TypeScript tests without compilation
  • Log Panel: Displays test output for easier debugging

Running Tests

With the Mocha Test Explorer configured, you can:

  • View and run individual tests or test suites from the VSCode Test Explorer panel
  • Set breakpoints and debug tests directly in the editor
  • Monitor test output in the integrated log panel

版本与发布记录

@bitgo/abstract-utxo 共发布 333 个版本,首次发布于 2022/06/11;过去 12 个月发布了 81 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
13.6.4latest2026/11/062 天前
13.6.32026/11/044 天前
13.6.22026/10/309 天前
13.6.12026/10/2711 天前
13.6.02026/10/2316 天前
13.5.12026/10/2217 天前

其他发布通道:dev → 1.3.0-dev.1,hotfix → 1.2.0-hotfix.1,rc → 1.2.0-rc.32。

关于 @bitgo/abstract-utxo 的常见问题

@bitgo/abstract-utxo 是什么?

BitGo SDK coin library for UTXO base implementation

如何安装 @bitgo/abstract-utxo?

在项目目录运行 npm install @bitgo/abstract-utxo,或使用 pnpm add / yarn add / bun add。

@bitgo/abstract-utxo 支持 TypeScript 吗?

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

@bitgo/abstract-utxo 支持 ESM 还是 CommonJS?

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

@bitgo/abstract-utxo 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bitgo/abstract-utxo 可以商用吗?

@bitgo/abstract-utxo 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bitgo/abstract-utxo 的下载量有多少?

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

@bitgo/abstract-utxo 还在维护吗?

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