I doubt there are many Metamask users here, but this is cool nonetheless.
The Metamask announcement was very light on details, but it looks like they used BDK's WebAssembly version.
From BDK's github:
Thebdk-wasmlibrary aims at providing access to the excellent BitcoinDevKit to JS and Node environments (and eventually any device supporting WebAssembly). It specializes in compiling BDK on the wasm32-unknown-unknown target and usewasm-bindgento create TypeScript bindings.This repo handles the packaging and publishing of thebdk-wallet-web(for browsers) andbdk-wallet-node(for Node.js) NPM packages, usingwasm-pack.This library offers all the desired functionality to build a Bitcoin wallet out of the box:
- UTXO management
- Coin selection
- Wallet upates by syncing and scanning the chain data
- Bitcoin descriptors for flexibility in the definition of spending conditions. Supports all address types from legacy to Taproot.
- State update and persistence
- Transaction creation, signing and broadcasting
- Dynamic addresses and much more
For a lightweight library providing stateless utility functions, seebitcoinjs.