{"id":22836608,"url":"https://github.com/metamask/bdk-wasm","last_synced_at":"2025-04-24T03:23:09.135Z","repository":{"id":261294482,"uuid":"883694408","full_name":"MetaMask/bdk-wasm","owner":"MetaMask","description":"The Bitcoin Dev Kit for Browsers and Node","archived":false,"fork":false,"pushed_at":"2025-04-07T15:28:51.000Z","size":207,"stargazers_count":23,"open_issues_count":5,"forks_count":8,"subscribers_count":43,"default_branch":"main","last_synced_at":"2025-04-07T16:40:45.213Z","etag":null,"topics":["bdk","bitcoin","descriptors","js","node","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://bitcoindevkit.org/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MetaMask.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":"metamask","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-11-05T12:16:00.000Z","updated_at":"2025-04-07T15:28:56.000Z","dependencies_parsed_at":"2024-11-20T19:22:16.562Z","dependency_job_id":"ae4027ea-da20-4433-a13e-b8b3afb78781","html_url":"https://github.com/MetaMask/bdk-wasm","commit_stats":null,"previous_names":["darioanongba/bdk-wasm","metamask/bdk-wasm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Fbdk-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Fbdk-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Fbdk-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Fbdk-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MetaMask","download_url":"https://codeload.github.com/MetaMask/bdk-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250553015,"owners_count":21449324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdk","bitcoin","descriptors","js","node","wasm","webassembly"],"created_at":"2024-12-12T23:11:50.821Z","updated_at":"2025-04-24T03:23:09.118Z","avatar_url":"https://github.com/MetaMask.png","language":"Rust","funding_links":["https://opencollective.com/metamask"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eThe Bitcoin Dev Kit: WebAssembly\u003c/h1\u003e\n\n  \u003cimg src=\"./static/bdk.png\" width=\"220\" /\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eThe Bitcoin Dev Kit for Browsers, Node, and React Native\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"\"\u003e\u003cimg alt=\"NPM Package\" src=\"https://img.shields.io/npm/v/bitcoindevkit.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/MetaMask/bdk-wasm/blob/master/LICENSE\"\u003e\u003cimg alt=\"MIT or Apache-2.0 Licensed\" src=\"https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html\"\u003e\u003cimg alt=\"Rustc Version 1.73.0+\" src=\"https://img.shields.io/badge/rustc-1.73.0%2B-lightgrey.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://discord.gg/d7NkDKm\"\u003e\u003cimg alt=\"Chat on Discord\" src=\"https://img.shields.io/discord/753336465005608961?logo=discord\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c/div\u003e\n\n## About\n\nThe `bdk-wasm` library aims at providing access to the excellent [BitcoinDevKit](https://github.com/bitcoindevkit/bdk) to JS and Node environments (and eventually any device supporting WebAssembly).\nIt specializes in compiling BDK on the `wasm32-unknown-unknown` target and use [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) to create TypeScript bindings.\n\nThis repo handles the packaging and publishing of the `bitcoindevkit` NPM package, using `wasm-pack`.\n\nThis library offers all the desired functionality to build a Bitcoin wallet out of the box:\n\n- UTXO management\n- Coin selection\n- Wallet upates by syncing and scanning the chain data\n- Bitcoin descriptors for flexibility in the definition of spending conditions. Supports all address types from legacy to Taproot.\n- State update and persistence\n- Transaction creation, signing and broadcasting\n- Dynamic addresses\n- and much more\n\nFor a lightweight library providing stateless utility functions, see [`bitcoinjs`](https://github.com/bitcoinjs/bitcoinjs-lib).\n\n## Browser Usage\n\n```sh\nyarn add bitcoindevkit\n```\n\n## Notes on WASM Specific Considerations\n\n\u003e [!WARNING]\n\u003e There are several limitations to using BDK in WASM. Basically any functionality that requires the OS standard library is not directly available in WASM. However, there are viable workarounds documented below. Some key limitations include:\n\u003e\n\u003e - No access to the file system\n\u003e - Network access is limited to http(s)\n\n### WASM Considerations Overview\n\n#### No access to the file system\n\nWith no direct access to the file system, persistence cannot be handled by BDK directly. Instead, an in memory wallet must be used in the WASM environment, and the data must be exported using `wallet.take_staged()`. This will export the changeset for the updates to the wallet state, which must then be merged with current wallet state in JS (will depend on your persistence strategy). The persisted `ChangeSet` can be passed to `wallet.load()` to recover the wallet.\n\n#### Network access is limited to http(s)\n\nThis essentially means the library only supports [Esplora](https://github.com/blockstream/esplora/blob/master/API.md) as blockchain client. Both RPC and Electrum clients require sockets and will not work for BDK in a WASM environment out of the box.\n\n## Development Environment\n\n### Requirements\n\n- Install [Rust](https://www.rust-lang.org/tools/install)\n- Install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)\n\n#### MacOS special requirement\n\nRefers to [this section](./DEVELOPMENT.md#build-on-macos).\n\n### Build with `wasm-pack build`\n\n\u003e [!IMPORTANT]\n\u003e You need the `wasm32-unknown-unknown` toolchain to be installed:\n\u003e\n\u003e ```sh\n\u003e rustup target add wasm32-unknown-unknown\n\u003e ```\n\n```sh\nwasm-pack build\n```\n\n\u003e Choose your desired features when building: `--features \"esplora\"`\n\n### Test in Headless Browsers with `wasm-pack test`\n\n```sh\nwasm-pack test --headless --firefox\n```\n\n\u003e Works with `--firefox`, `--chrome` or `--safari`.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetamask%2Fbdk-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetamask%2Fbdk-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetamask%2Fbdk-wasm/lists"}