Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
677d2f8
Initial commit
bitgobot Jul 11, 2024
abc6db1
Add initial version of wasm-miniscript package
OttoAllmendinger Jul 12, 2024
0c97521
Merge pull request #1 from BitGo/BTC-1317.init
rushilbg Jul 16, 2024
edcd4c6
refactor: move build output to dist/ directory
OttoAllmendinger Jul 16, 2024
119937d
Merge pull request #2 from BitGo/BTC-1317.add-dist-dir
rushilbg Jul 16, 2024
35b6f92
feat: add typescript as a dependency
rushilbg Jul 16, 2024
f7ddac8
Merge pull request #3 from BitGo/ts
rushilbg Jul 16, 2024
1d6d5e4
feat: add CODEOWNERS file
OttoAllmendinger Jul 16, 2024
d32d382
Merge pull request #4 from BitGo/BTC-1317.add-codeowners
rushilbg Jul 16, 2024
67d7504
feat: add Dockerfile and Makefile
rushilbg Jul 16, 2024
fc4d49f
docs: update README
rushilbg Jul 16, 2024
a928903
Merge pull request #5 from BitGo/docker-backup
rushilbg Jul 16, 2024
927f2a5
feat: add `all` target and some clean up commands
rushilbg Jul 16, 2024
fa83e8d
Merge pull request #6 from BitGo/make
rushilbg Jul 16, 2024
636d87d
chore: add .prettierrc.yaml
OttoAllmendinger Jul 16, 2024
3c603e6
Merge pull request #7 from BitGo/BTC-1317.prettier
OttoAllmendinger Jul 16, 2024
d5b41bc
feat: improve wrapper structs
OttoAllmendinger Jul 16, 2024
935b1ee
Merge pull request #8 from BitGo/BTC-1317.update-wasm-wrappers
OttoAllmendinger Jul 17, 2024
de5b62f
feat: add a `publish.yml` for publishing packages to npmjs
rushilbg Jul 24, 2024
656ece8
Merge pull request #10 from BitGo/package
OttoAllmendinger Jul 25, 2024
4865c61
feat: add `dist/browser/wasm` files to be packaged via npm
rushilbg Jul 26, 2024
274fc72
ci: switch to dtolnay/rust-toolchain
louib Jul 30, 2024
40420c7
Merge pull request #14 from BitGo/bump-to-maintained-actions
lcovar Jul 31, 2024
157e36f
ci: fix publish workflow trigger
louib Jul 30, 2024
7696a7a
Merge pull request #13 from BitGo/fix-publish-workflow
lcovar Aug 1, 2024
634aa82
chore: set public access
ericcrosson-bitgo Jul 26, 2024
91fd0ff
chore: configure repository in package manifest
ericcrosson-bitgo Jul 26, 2024
2e99081
chore: add registry to publishConfig
ericcrosson-bitgo Jul 26, 2024
da6dd40
chore: fix package.json style
louib Aug 1, 2024
212dd39
Merge pull request #12 from BitGo/chore-set-public-access
ericcrosson-bitgo Aug 6, 2024
ef7da0c
ci: remove email from npm config
louib Jul 30, 2024
39b2929
Merge pull request #15 from BitGo/remove-email-npm-conf
lzjluzijie Aug 6, 2024
5ccb6da
feat: remove git checkout from publish.yml
rushilbg Aug 6, 2024
8813af5
Merge pull request #16 from BitGo/publish
rushilbg Aug 6, 2024
6d304b0
Merge pull request #11 from BitGo/pack
rushilbg Aug 7, 2024
1c8b11f
feat: remove tag/commit signing for now while publishing packages
rushilbg Aug 7, 2024
10b5525
Merge pull request #17 from BitGo/publish
rushilbg Aug 7, 2024
5a8e2e2
chore: add `--no-push` flag to lerna publish
rushilbg Aug 7, 2024
9c9634a
Merge pull request #18 from BitGo/publish
rushilbg Aug 7, 2024
d44dd5b
feat: expose `script_pubkey` function within `WrapDescriptor`
rushilbg Aug 7, 2024
95d934d
Merge pull request #19 from BitGo/output-script
rushilbg Aug 8, 2024
01be32f
feat: use tags for semantic releases
louib Aug 8, 2024
e7ab68a
Merge pull request #20 from BitGo/automate-releases
lcovar Aug 8, 2024
b6e7c11
feat: re-enable lerna publish pushes
louib Aug 8, 2024
64c6faf
Merge pull request #21 from BitGo/re-enable-push
lcovar Aug 8, 2024
d40fdeb
fix: disable lerna git operations
louib Aug 9, 2024
bda6eb0
Merge pull request #22 from BitGo/disable_git_operations
lcovar Aug 9, 2024
2c64763
fix: remove version of package.json
louib Aug 9, 2024
f6b2fc4
Merge pull request #23 from BitGo/remove-version-from-package-json
lcovar Aug 9, 2024
477ae38
feat: migrate to npm workspaces
louib Aug 9, 2024
d6ed101
Merge pull request #24 from BitGo/migrate-to-npm-workspaces
lcovar Aug 9, 2024
e3c8269
fix: use makefile for build:wasm
OttoAllmendinger Aug 12, 2024
bc8dd67
Merge pull request #25 from BitGo/BTC-1372.fix-npm-pack
OttoAllmendinger Aug 12, 2024
675ee10
fix: typo in README.md
OttoAllmendinger Aug 12, 2024
5c8682b
Merge pull request #26 from BitGo/BTC-1372.fix-npm-pack.2
rushilbg Aug 12, 2024
119332e
refactor: split miniscript and descriptor into separate files
OttoAllmendinger Aug 13, 2024
164c351
Merge pull request #27 from BitGo/BTC-1348.psbt.splitfiles
OttoAllmendinger Aug 13, 2024
b545831
fix: use JsError instead of JsValue for errors
OttoAllmendinger Aug 13, 2024
3eeb5d4
Merge pull request #28 from BitGo/BTC-1348.psbt.fixerr
OttoAllmendinger Aug 14, 2024
f634783
feat: add package wasm-miniscript-ui
OttoAllmendinger Aug 14, 2024
f4e2dd1
feat: show wasm size after build
OttoAllmendinger Aug 14, 2024
2a7bc35
Merge pull request #29 from BitGo/webui
lcovar Aug 16, 2024
c52c3cd
chore(deps): bump miniscript in /packages/wasm-miniscript
dependabot[bot] Aug 19, 2024
e9b1098
Merge pull request #33 from BitGo/dependabot/cargo/packages/wasm-mini…
OttoAllmendinger Aug 21, 2024
417b8d9
chore: remove no-std feature from wasm-miniscript
OttoAllmendinger Aug 21, 2024
99ce7fb
Merge pull request #30 from BitGo/show-wasm-sizes
OttoAllmendinger Aug 21, 2024
d7a0d08
fix: use correct version of wasm-miniscript in ui
OttoAllmendinger Aug 21, 2024
9b792a7
refactor: use static methods for miniscript and descriptor
OttoAllmendinger Aug 14, 2024
a97dcd3
Merge pull request #34 from BitGo/rm-nostd
OttoAllmendinger Aug 21, 2024
5f95fef
Merge pull request #35 from BitGo/use-static-methods
OttoAllmendinger Aug 21, 2024
2a1417f
feat: add fixedScriptToDescriptor with tests
OttoAllmendinger Aug 21, 2024
28dfaf3
feat: wrap PSBT type
OttoAllmendinger Aug 13, 2024
616ad89
Merge pull request #36 from BitGo/BTC-1348.add-fixedScriptToDescriptors
OttoAllmendinger Aug 21, 2024
7153476
Merge pull request #37 from BitGo/BTC-1348.psbt.add-wrappsbt
OttoAllmendinger Aug 21, 2024
843c6de
refactor: move descriptor utility functions to a separate file
OttoAllmendinger Aug 22, 2024
4e71de8
feat: wrap update_input_with_descriptor
OttoAllmendinger Aug 21, 2024
8ddb49c
Merge pull request #38 from BitGo/BTC-1348.psbt.add-updateinput
OttoAllmendinger Aug 22, 2024
c882b42
chore: remove unsued error module
OttoAllmendinger Aug 27, 2024
ddbeeb8
Merge pull request #39 from BitGo/BTC-1459.remove-wraperror
OttoAllmendinger Aug 27, 2024
ebe709c
fix: remove unnecessary call toPsbtWithPrevOutOnly
OttoAllmendinger Aug 27, 2024
4fc72ab
feat: wrap Psbt `finalize_mut()` method
OttoAllmendinger Aug 27, 2024
713ca46
Merge pull request #40 from BitGo/BTC-1459.add-psbt-finalize
OttoAllmendinger Aug 27, 2024
541d698
chore(deps-dev): bump webpack from 5.93.0 to 5.94.0
dependabot[bot] Aug 31, 2024
c29ebb4
feat: wrap maxWeightToSatisfy
OttoAllmendinger Sep 5, 2024
eb0966b
Merge pull request #41 from BitGo/dependabot/npm_and_yarn/webpack-5.94.0
OttoAllmendinger Sep 5, 2024
ca40ccc
Merge pull request #42 from BitGo/BTC-1460.wrap-maxweight
OttoAllmendinger Sep 5, 2024
2fddb00
feat: add tests for maxWeightToSatisfy
OttoAllmendinger Sep 17, 2024
2f2b137
Merge pull request #43 from BitGo/BTC-1460.extend-tests
OttoAllmendinger Sep 17, 2024
baa90b9
feat: add descType method to WrapDescriptor
OttoAllmendinger Sep 19, 2024
ffe0e55
feat: add getScriptPubKeyLength function in test
OttoAllmendinger Sep 19, 2024
a8b0ad1
Merge pull request #44 from BitGo/BTC-1451.add-descType
OttoAllmendinger Sep 19, 2024
fdb0bc4
feat: apply cargo fmt
OttoAllmendinger Sep 19, 2024
83a984f
feat: enforce rust formatting in wasm-miniscript
OttoAllmendinger Sep 19, 2024
742af21
feat: install cargo-fmt in CI
OttoAllmendinger Sep 19, 2024
5f5aa92
Merge pull request #45 from BitGo/BTC-1451.add-descType.format
OttoAllmendinger Sep 19, 2024
2788a62
refactor: move psbt util functions to separate file
OttoAllmendinger Oct 2, 2024
445fd1b
feat: add updateInputWithDescriptor util
OttoAllmendinger Oct 2, 2024
d8b182b
feat: add finalizePsbt util
OttoAllmendinger Oct 2, 2024
e8b4e5e
feat: add updateOutputWithDescriptor to WrapPsbt
OttoAllmendinger Oct 24, 2024
f4c5db2
feat: add tests for updateOutputWithDescriptor
OttoAllmendinger Oct 24, 2024
8520223
fixup! feat: add updateOutputWithDescriptor to WrapPsbt
OttoAllmendinger Oct 24, 2024
d165f66
Merge pull request #47 from BitGo/BTC-1451.add-updateoutputwithdescri…
OttoAllmendinger Oct 25, 2024
be19bf8
feat: add beta releases
OttoAllmendinger Oct 30, 2024
16695f2
Merge pull request #48 from BitGo/BTC-1584.add-beta-releases
OttoAllmendinger Oct 30, 2024
63b274d
chore: move release configuration to .releaserc.json
OttoAllmendinger Oct 30, 2024
542a28f
feat(wasm-miniscript): bump version for testing
OttoAllmendinger Oct 30, 2024
a4018fe
fix: remove workaround for test case 56 and 57
OttoAllmendinger Oct 30, 2024
f6d0330
feat: add op_drop to wasm-miniscript
OttoAllmendinger Sep 23, 2024
574de10
fix: pass descriptor by reference in update_*_with_descriptor
OttoAllmendinger Jan 14, 2025
8cd9e06
Merge pull request #49 from BitGo/BTC-1743.fix-wrap-psbt
OttoAllmendinger Jan 14, 2025
197f927
chore: move release configuration to .releaserc.json
OttoAllmendinger Oct 30, 2024
45b15a3
chore: bump miniscript dependency from 12.2.0 to 12.3.0
OttoAllmendinger Feb 11, 2025
02d179a
Merge pull request #51 from BitGo/BTC-1829.bump-miniscript-12.3
OttoAllmendinger Feb 11, 2025
b86dd45
feat: add AST dump utility for descriptor tests
OttoAllmendinger Feb 11, 2025
6cf9ffb
feat: add support for taproot descriptors
OttoAllmendinger Feb 11, 2025
ca1c430
fix: change taproot descriptor output format to array
OttoAllmendinger Feb 11, 2025
3c3d34c
Merge pull request #50 from BitGo/BTC-1829.fix-taproot
OttoAllmendinger Feb 11, 2025
9c649f9
feat: update wasm-miniscript to use latest dependencies
OttoAllmendinger Feb 12, 2025
4052f22
fix: strip release binary to make webpack happy
OttoAllmendinger Feb 12, 2025
071a8d7
fix: add browser wasm file to sideEffects
OttoAllmendinger Feb 12, 2025
cb3d3e2
fix: include test dir in tsconfig
OttoAllmendinger Feb 12, 2025
1cb85c1
Merge pull request #53 from BitGo/BTC-1829.check-test-dir
OttoAllmendinger Feb 12, 2025
9dce961
feat: add formatNode utility for descriptor and miniscript ASTs
OttoAllmendinger Feb 12, 2025
bf46a94
fix: convert RelLockTime to numeric value in serialization
OttoAllmendinger Feb 12, 2025
3f87455
Merge pull request #52 from BitGo/BTC-1829.formatNode
OttoAllmendinger Feb 12, 2025
b8f2dbc
Merge remote-tracking branch 'origin/master' into beta
OttoAllmendinger Feb 13, 2025
f2cc1ba
fix: fixture 2.json
OttoAllmendinger Feb 12, 2025
fed1761
feat: add support for Drop node in AST
OttoAllmendinger Feb 13, 2025
daa3067
feat: support taproot tree nodes in descriptor AST
OttoAllmendinger Feb 13, 2025
d35f530
ci: configure rust caching and deterministic wasm builds
OttoAllmendinger Feb 18, 2025
5b7e493
build: optimize wasm with bulk memory support
OttoAllmendinger Feb 18, 2025
ae600dd
feat(psbt): add signWithXprv method
OttoAllmendinger Feb 18, 2025
cef432f
feat(descriptor): convert descriptor templates to AST format
OttoAllmendinger Feb 18, 2025
ee0cb87
refactor(test): rename psbt test files to clarify fixed script handling
OttoAllmendinger Feb 18, 2025
feccc88
feat(core): add descriptor-based PSBT test utils and fixtures
OttoAllmendinger Feb 18, 2025
75b303d
feat(core): add PSBT signing with private key buffers
OttoAllmendinger Feb 18, 2025
d90247e
ci: update wasm tools install and add build info
OttoAllmendinger Feb 18, 2025
a4916eb
chore: update elliptic to v6.6.1 in package-lock.json
OttoAllmendinger Feb 19, 2025
9db2f5f
feat: add conditional derivation for wildcard descriptors
OttoAllmendinger Feb 21, 2025
72be5ac
feat(miniscript): remove unnecessary test for xpriv key handling
OttoAllmendinger Feb 21, 2025
f19e2de
feat(miniscript): allow plain EC key singing for taproot descriptors
OttoAllmendinger Feb 21, 2025
5d2b3c5
feat: merge master into beta
OttoAllmendinger Feb 13, 2025
33456b8
feat(miniscript): add custom error type for wasm-miniscript
OttoAllmendinger Feb 26, 2025
0eb287f
feat(miniscript): add auto-detection of descriptor type
OttoAllmendinger Feb 26, 2025
d3ffa1b
Merge branch 'beta'
OttoAllmendinger Oct 20, 2025
d7dff92
feat(wasm-miniscript): fix import ordering and code formatting
OttoAllmendinger Oct 20, 2025
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
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: wasm-miniscript

on:
push:
branches:
- master
pull_request:
branches:
- master
- rel/**

workflow_dispatch:

jobs:
unit-test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "packages/wasm-miniscript"
cache-on-failure: true

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install wasm tools
run: |
rustup component add rustfmt
cargo install wasm-pack --version 0.13.1
cargo install wasm-opt --version 0.116.1

- name: Build Info
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "rustc $(rustc --version)"
echo "wasm-pack $(wasm-pack --version)"
echo "wasm-opt $(wasm-opt --version)"
git --version
echo "base ref $GITHUB_BASE_REF"
echo "head ref $GITHUB_HEAD_REF"

- name: Fetch Base Ref
run: |
git fetch origin $GITHUB_BASE_REF

- name: Install Packages
run: npm ci --workspaces --include-workspace-root

- name: test
run: npx --version

- name: build packages
run: npm --workspaces run build

- name: Check Source Code Formatting
run: npm run check-fmt

- name: Unit Test
run: npm --workspaces test
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Publish @wasm-miniscript
on:
push:
branches:
- master
- beta

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly

- name: Install wasm tools
run: |
rustup component add rustfmt
cargo install wasm-pack --version 0.13.1
cargo install wasm-opt --version 0.116.1

- name: Build Info
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "rustc $(rustc --version)"
echo "wasm-pack $(wasm-pack --version)"
echo "wasm-opt $(wasm-opt --version)"
git --version
echo "base ref $GITHUB_BASE_REF"
echo "head ref $GITHUB_HEAD_REF"

- name: Build Info
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "rust $(rustup --version)"
git --version

- name: Configure NPM
run: |
echo "workspaces-update = false" >> .npmrc
echo "@bitgo:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:always-auth=true" >> .npmrc

- name: Install Packages
run: npm ci --workspaces --include-workspace-root

- name: build packages
run: npm --workspaces run build

- name: Unit Test
run: npm --workspaces test

- name: Release
run: npx multi-semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.idea/
*.iml
*.tsbuildinfo
3 changes: 3 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# force trailing comma
trailingComma: all
printWidth: 100
14 changes: 14 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"branches": [
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm"
]
}
6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# BitGoJS code owners and first officers will automatically be requested for review whenever a pull request touches the files they own.
# Each line is a file pattern followed by one or more owners.
# Order is important. The last matching pattern has the most precedence.

# These owners and first officers will be the default owners for everything in the repo.
* @BitGo/btc-team
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# BitGoWASM
WebAssembly SDK components for BitGo
# wasm-miniscript

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.

# WebUI playground

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

# Dependencies

- [Rust](https://www.rust-lang.org/) nightly
- [wasm-pack](https://rustwasm.github.io/wasm-pack/) (install with `cargo install wasm-pack`)
- [NodeJS](https://nodejs.org/en/)

# Packages

## packages/wasm-miniscript

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

### 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-miniscript
make -f Container.mk build-image
make -f Container.mk build-wasm
```
Loading