Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: wasm-miniscript
name: Build and Test wasm-utxo

on:
push:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "packages/wasm-miniscript"
workspaces: "packages/wasm-utxo"
cache-on-failure: true

- name: Setup node ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish @wasm-miniscript
name: Publish @bitgo/wasm-utxo
on:
push:
branches:
Expand Down
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# wasm-miniscript
# BitGoWASM

This is a wrapper around the [rust-miniscript](https://github.com/rust-bitcoin/rust-miniscript) crate that is compiled
to WebAssembly. It allows you to use Miniscript in NodeJS and in the browser.
This repo is the home of BitGo's WASM libraries.

# WebUI playground

Go to https://bitgo.github.io/wasm-miniscript to see a live demo of the wasm-miniscript library in action.

# Dependencies

Expand All @@ -15,17 +11,17 @@ Go to https://bitgo.github.io/wasm-miniscript to see a live demo of the wasm-min

# Packages

## packages/wasm-miniscript

This contains the core library that is compiled to WebAssembly.
It is a wrapper around the `rust-miniscript` crate.
## wasm-utxo

This is a wrapper around the
[rust-bitcoin](https://github.com/rust-bitcoin/rust-miniscript) and
[rust-miniscript](https://github.com/rust-bitcoin/rust-miniscript) crates that is
compiled to WebAssembly.

### wasm-utxo-web

### Building
A live playground for the wasm-utxo crate.

If your system has problems with `wasm-pack` (Mac M1), you can use the `Container.mk` Makefile to build the wasm files:
Go to https://bitgo.github.io/wasm-utxo to see a live demo of the wasm-utxo library in action. *WIP*

```bash
cd packages/wasm-miniscript
make -f Container.mk build-image
make -f Container.mk build-wasm
```
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/BitGo/wasm-miniscript.git"
"url": "git+https://github.com/BitGo/BitGoWASM.git"
},
"scripts": {
"check-fmt": "npm run --workspaces check-fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@bitgo/wasm-miniscript-ui",
"name": "@bitgo/wasm-utxo-ui",
"version": "0.1.0",
"description": "Web frontend for wasm-miniscript",
"description": "Web frontend for wasm-utxo",
"repository": {
"type": "git",
"url": "https://github.com/BitGo/wasm-miniscript.git"
"url": "git+https://github.com/BitGo/BitGoWASM.git"
},
"license": "MIT",
"author": "BitGo Inc.",
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@bitgo/utxo-lib": "^10.1.0",
"@bitgo/wasm-miniscript": "0.0.0-semantic-release-managed",
"@bitgo/wasm-utxo": "0.0.0-semantic-release-managed",
"assert": "^2.1.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as utxolib from "@bitgo/utxo-lib";
import { Descriptor, Miniscript, ScriptContext } from "@bitgo/wasm-miniscript";
import { Descriptor, Miniscript, ScriptContext } from "@bitgo/wasm-utxo";

import "./style.css";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as t from "io-ts";
import { Descriptor, Miniscript } from "@bitgo/wasm-miniscript";
import { Descriptor, Miniscript } from "@bitgo/wasm-utxo";
import { fromHex, toHex } from "./hex";
import { ScriptContext } from "./codec";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"exclude": ["node_modules"],
"references": [
{
"path": "../wasm-miniscript"
"path": "../wasm-utxo"
}
]
}
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "wasm-miniscript"
name = "wasm-utxo"
version = "0.1.0"
edition = "2021"

Expand All @@ -17,4 +17,4 @@ base64 = "0.22.1"
[profile.release]
# this is required to make webpack happy
# https://github.com/webpack/webpack/issues/15566#issuecomment-2558347645
strip = true
strip = true
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions packages/wasm-utxo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.

## 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 | 🏗️ In Progress | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO |
| FixedScript Wallet: Transaction Support | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO | ⏳ TODO |

## Building

If your system has problems with `wasm-pack` (Mac M1), you can use the `Container.mk` Makefile to build the wasm files:

```bash
cd packages/wasm-utxo
make -f Container.mk build-image
make -f Container.mk build-wasm
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as wasm from "./wasm/wasm_miniscript";
import * as wasm from "./wasm/wasm_utxo";

// we need to access the wasm module here, otherwise webpack gets all weird
// and forgets to include it in the bundle
Expand All @@ -12,7 +12,7 @@ export type SignPsbtResult = {
[inputIndex: number]: [pubkey: string][];
};

declare module "./wasm/wasm_miniscript" {
declare module "./wasm/wasm_utxo" {
interface WrapDescriptor {
/** These are not the same types of nodes as in the ast module */
node(): unknown;
Expand All @@ -39,8 +39,8 @@ declare module "./wasm/wasm_miniscript" {
}
}

export { WrapDescriptor as Descriptor } from "./wasm/wasm_miniscript";
export { WrapMiniscript as Miniscript } from "./wasm/wasm_miniscript";
export { WrapPsbt as Psbt } from "./wasm/wasm_miniscript";
export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo";
export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo";
export { WrapPsbt as Psbt } from "./wasm/wasm_utxo";

export * as ast from "./ast";
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "@bitgo/wasm-miniscript",
"description": "WebAssembly wrapper for rust-miniscript (beta)",
"name": "@bitgo/wasm-utxo",
"description": "WebAssembly wrapper for rust-bitcoin (beta)",
"version": "0.0.0-semantic-release-managed",
"lint-staged": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/BitGo/wasm-miniscript.git"
"url": "git+https://github.com/BitGo/BitGoWASM"
},
"files": [
"dist/*/js/wasm/wasm_miniscript.d.ts",
"dist/*/js/wasm/wasm_miniscript.js",
"dist/*/js/wasm/wasm_miniscript_bg.js",
"dist/*/js/wasm/wasm_miniscript_bg.wasm",
"dist/*/js/wasm/wasm_miniscript_bg.wasm.d.ts",
"dist/*/js/wasm/wasm_utxo.d.ts",
"dist/*/js/wasm/wasm_utxo.js",
"dist/*/js/wasm/wasm_utxo_bg.js",
"dist/*/js/wasm/wasm_utxo_bg.wasm",
"dist/*/js/wasm/wasm_utxo_bg.wasm.d.ts",
"dist/*/js/ast/*",
"dist/*/js/index.*"
],
"main": "dist/node/js/index.js",
"types": "dist/node/js/index.d.ts",
"sideEffects": [
"./dist/node/js/wasm/wasm_miniscript.js",
"./dist/browser/js/wasm/wasm_miniscript.js"
"./dist/node/js/wasm/wasm_utxo.js",
"./dist/browser/js/wasm/wasm_utxo.js"
],
"browser": {
"./dist/node/js/index.js": "./dist/browser/js/index.js"
Expand Down
File renamed without changes.
File renamed without changes.