@bitgo/wasm-utxo

中文文档
5.29.0发布于 2026/11/01MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 12.3万

WebAssembly wrapper for rust-bitcoin (beta)

原始使用文档
文档目录9 节
  1. Documentation
  2. Status
  3. Zcash Features
  4. Inspect Feature
  5. Rust
  6. TypeScript
  7. Building
  8. Mac
  9. Docker (optional)

wasm-utxo

This project is the successor of the Javascript utxo-lib package.

It provides WASM bindings for the rust-bitcoin and rust-miniscript crates that help verify and co-sign transactions built by the BitGo Wallet Platform API.

Documentation

Status

This project is under active development.

FeatureBitcoinBitcoinCashBitcoinGoldDashDogeLitecoinZcash
Descriptor Wallet: Address Support✅ Complete🚫🚫🚫🚫🚫🚫
Descriptor Wallet: Transaction Support✅ Complete🚫🚫🚫🚫🚫🚫
FixedScript Wallet: Address Generation✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete
FixedScript Wallet: Transaction Support✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete✅ Complete

Zcash Features

Zcash support includes:

  • Network Upgrade Awareness: Automatic consensus branch ID determination based on block height
  • All Network Upgrades: Support for Overwinter, Sapling, Blossom, Heartwood, Canopy, Nu5, Nu6, Nu6_1, Nu6_2, Nu6_3, and Nu7
  • NU7 (ZIP-259): Testnet activation at block 4465026; Mainnet activation at block 3543405 (~2026-11-05, ZIP editors agreed 2026-10-20). Version 4 transactions are invalid under NU7 per ZIP-2003, so a v4 build at or after that height is rejected rather than signed and left unbroadcastable
  • Height-Based API: Preferred createEmpty() method automatically selects correct consensus rules
  • Parity Testing: Validated against zebra-chain for accuracy across all network upgrades

Inspect Feature

The inspect feature adds PSBT and transaction parsing into hierarchical node trees, useful for building tree-view UIs and CLI formatters.

It is behind a Cargo feature flag because it pulls in extra dependencies (serde, serde_json, num-bigint, hex) that are not needed for core wallet operations.

Rust

// Cargo.toml
wasm-utxo = { path = ".", features = ["inspect"] }

// Usage
use wasm_utxo::inspect::{parse_psbt_bytes_with_network, parse_tx_bytes_with_network, Node};

TypeScript

Available as a separate import path, not included in the main @bitgo/wasm-utxo entry:

import { parsePsbtToNode, parseTxToNode, isInspectEnabled } from "@bitgo/wasm-utxo/inspect";

The published npm package includes stub implementations that return isInspectEnabled() === false and throw runtime errors from the parse functions. To get a working build, compile the WASM with --features inspect (see packages/webui/scripts/build-wasm.sh).

Building

Mac

Requires Homebrew LLVM (Apple's Clang doesn't support WASM targets):

brew install llvm
npm run build

Docker (optional)

If you prefer a containerized build environment:

make -f Container.mk build-image
make -f Container.mk build-wasm

版本与发布记录

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

版本发布日期距今
5.29.0latest2026/11/017 天前
5.28.02026/10/309 天前
5.27.12026/10/309 天前
5.27.02026/10/2910 天前
5.26.02026/10/2910 天前
5.25.02026/10/2810 天前

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

@bitgo/wasm-utxo 是什么?

WebAssembly wrapper for rust-bitcoin (beta)

如何安装 @bitgo/wasm-utxo?

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

@bitgo/wasm-utxo 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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