# @bitgo/wasm-utxo

> WebAssembly wrapper for rust-bitcoin (beta)

Latest version **5.30.0** (published 2026-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bitgo/wasm-utxo
pnpm add @bitgo/wasm-utxo
yarn add @bitgo/wasm-utxo
bun add @bitgo/wasm-utxo
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; large bundle.

## Facts

| | |
|---|---|
| Version | 5.30.0 |
| Published | 2026-11-18 |
| First published | 2025-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 12.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 14 |
| Maintainers | louib-bitgo, bitgobot |

## Links

- npm: https://www.npmjs.com/package/@bitgo/wasm-utxo
- Repository: https://github.com/BitGo/BitGoWASM
- Homepage: https://github.com/BitGo/BitGoWASM#readme
- Issues: https://github.com/BitGo/BitGoWASM/issues
- npm.io page: https://npm.io/package/@bitgo/wasm-utxo

## Recent versions

- 5.30.0 (latest) — 2026-11-18
- 5.29.0 — 2026-11-01
- 5.28.0 — 2026-10-30
- 5.27.1 — 2026-10-29
- 5.27.0 — 2026-10-28
- 5.26.0 — 2026-10-28
- 5.25.0 — 2026-10-28
- 5.24.0 — 2026-10-28
- 5.23.0 — 2026-10-28
- 5.22.0 — 2026-10-27
- 5.21.0 — 2026-10-23
- 5.20.0 — 2026-10-23
- 5.19.0 — 2026-10-23
- 5.18.0 — 2026-10-22
- 5.17.0 — 2026-10-22
- … 121 more at https://npm.io/package/@bitgo/wasm-utxo/versions

## README

# 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

- **[`../../CONVENTIONS.md`](../../CONVENTIONS.md)** - Repository-wide API and structured-error conventions
- **[`src/wasm-bindgen.md`](src/wasm-bindgen.md)** - Guide for creating WASM bindings using the namespace pattern
- **[`js/README.md`](js/README.md)** - TypeScript wrapper layer architecture and best practices
- **[`cli/README.md`](cli/README.md)** - Command-line interface for address and PSBT operations

## Status

This project is under active development.

| Feature                                 | Bitcoin     | BitcoinCash | BitcoinGold | Dash        | Doge        | Litecoin    | Zcash       |
| --------------------------------------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- |
| 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

```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:

```typescript
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`](../webui/scripts/build-wasm.sh)).

## Building

### Mac

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

```bash
brew install llvm
npm run build
```

### Docker (optional)

If you prefer a containerized build environment:

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

---
_Source: https://npm.io/package/@bitgo/wasm-utxo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
