{"id":13669812,"url":"https://github.com/bitcoindevkit/bdk-cli","last_synced_at":"2025-04-05T01:08:29.445Z","repository":{"id":37834959,"uuid":"322135848","full_name":"bitcoindevkit/bdk-cli","owner":"bitcoindevkit","description":"A CLI wallet library and REPL tool to demo and test the BDK library ","archived":false,"fork":false,"pushed_at":"2024-03-23T04:11:22.000Z","size":643,"stargazers_count":117,"open_issues_count":24,"forks_count":72,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T00:10:06.234Z","etag":null,"topics":["cli","repl","rust","wallet"],"latest_commit_sha":null,"homepage":"","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/bitcoindevkit.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}},"created_at":"2020-12-17T00:26:00.000Z","updated_at":"2025-03-16T00:29:49.000Z","dependencies_parsed_at":"2024-01-14T16:14:49.591Z","dependency_job_id":"9d8a4649-036a-4ca3-acbc-0f6ad6d094ae","html_url":"https://github.com/bitcoindevkit/bdk-cli","commit_stats":{"total_commits":312,"total_committers":20,"mean_commits":15.6,"dds":0.6314102564102564,"last_synced_commit":"eef97addff77cd575d6f74786c00400cb26636ed"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoindevkit%2Fbdk-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoindevkit%2Fbdk-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoindevkit%2Fbdk-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoindevkit%2Fbdk-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcoindevkit","download_url":"https://codeload.github.com/bitcoindevkit/bdk-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271532,"owners_count":20911587,"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":["cli","repl","rust","wallet"],"created_at":"2024-08-02T09:00:22.875Z","updated_at":"2025-04-05T01:08:29.425Z","avatar_url":"https://github.com/bitcoindevkit.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eBDK-CLI\u003c/h1\u003e\n\n  \u003cimg src=\"https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png\" width=\"220\" /\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eA Command-line Bitcoin Wallet App in pure rust using BDK\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://crates.io/crates/bdk-cli\"\u003e\u003cimg alt=\"Crate Info\" src=\"https://img.shields.io/crates/v/bdk-cli.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/bitcoindevkit/bdk-cli/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://github.com/bitcoindevkit/bdk-cli/actions?query=workflow%3ACI\"\u003e\u003cimg alt=\"CI Status\" src=\"https://github.com/bitcoindevkit/bdk-cli/workflows/CI/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/bitcoindevkit/bdk-cli\"\u003e\u003cimg src=\"https://codecov.io/gh/bitcoindevkit/bdk-cli/branch/master/graph/badge.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/bdk-cli\"\u003e\u003cimg alt=\"API Docs\" src=\"https://img.shields.io/badge/docs.rs-bdk_cli-green\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html\"\u003e\u003cimg alt=\"Rustc Version 1.57.0+\" src=\"https://img.shields.io/badge/rustc-1.57.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  \u003ch4\u003e\n    \u003ca href=\"https://bitcoindevkit.org\"\u003eProject Homepage\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://docs.rs/bdk-cli\"\u003eDocumentation\u003c/a\u003e\n  \u003c/h4\u003e\n\u003c/div\u003e\n\n\n## About\n\nThis project provides a command-line Bitcoin wallet application using the latest [BDK APIs](https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html). This might look tiny and innocent, but by harnessing the power of BDK it provides a powerful generic descriptor based command line wallet tool.\nAnd yes, it can do Taproot!!\n\nThis crate can be used for the following purposes:\n - Instantly create a miniscript based wallet and connect to your backend of choice (Electrum, Esplora, Core RPC, etc) and quickly play around with your own complex bitcoin scripting workflow. With one or many wallets, connected with one or many backends.\n - The `tests/integration.rs` module is used to document high level complex workflows between BDK and different Bitcoin infrastructure systems, like Core, Electrum and Lightning(soon TM).\n - (Planned) Expose the basic command handler via `wasm` to integrate `bdk-cli` functionality natively into the web platform. See also the [playground](https://bitcoindevkit.org/bdk-cli/playground/) page.\n\nIf you are considering using BDK in your own wallet project bdk-cli is a nice playground to get started with. It allows easy testnet and regtest wallet operations, to try out what's possible with descriptors, miniscript, and BDK APIs. For more information on BDK refer to the [website](https://bitcoindevkit.org/) and the [rust docs](https://docs.rs/bdk/latest/bdk/index.html)\n\nbdk-cli can be compiled with different features to suit your experimental needs.\n  - Database Options\n     - `key-value-db` : Sets the wallet database to a `sled` db.\n     - `sqlite-db` : Sets the wallet database to a `sqlite3` db.\n  - Blockchain Options\n     - `rpc` : Connects the wallet to bitcoin core via RPC.\n     - `electrum` : Connects the wallet to an electrum server.\n     - `esplora-ureq` or `esplora-reqwest` : Connects the wallet to an esplora server synchronously or asynchronously.\n  - Extra Utility Tools\n     - `repl` : use bdk-cli as a [REPL](https://codewith.mu/en/tutorials/1.0/repl) shell (useful for quick manual testing of wallet operations).\n     - `compiler` : opens up bdk-cli policy compiler commands.\n     - `verify` : uses `bitcoinconsensus` to verify transactions at every `sync` call of the wallet.\n     - `reserves` : opens up bdk-cli **Proof of Reserves** operation commands using the [bdk-reserves plugin](https://github.com/bitcoindevkit/bdk-reserves). (requires the `electrum` feature)\n   - Automated Node Backend\n     - `regtest-bitcoin` : Auto deploys a regtest `bitcoind` node, connects the wallet, and exposes core rpc commands via `bdk-cli node` subcommands.\n     - `regtest-electrum` : Auto deploys `electrsd` and connected `bitcoind` nodes, exposes core rpc commands via `bdk-cli node` and provides a wallet connected to the local `electrsd`.\n    \nThe `default` feature set is `repl` and `sqlite-db`. With the `default` features, `bdk-cli` can be used as an **air-gapped** wallet, and can do everything that doesn't require a network connection.\n\n\n## Install bdk-cli\n### From source\nTo install a dev version of `bdk-cli` from a local git repo with the `electrum` blockchain client enabled:\n\n```shell\ncd \u003cbdk-cli git repo directory\u003e\ncargo install --path . --features electrum\nbdk-cli help # to verify it worked\n```\n\nIf no blockchain client feature is enabled online wallet commands `sync` and `broadcast` will be \ndisabled. To enable these commands a blockchain client feature such as `electrum` or another \nblockchain client feature must be enabled. Below is an example of how to run the `bdk-cli` binary with\nthe `esplora-ureq` blockchain client feature.\n\n```shell\nRUST_LOG=debug cargo run --features esplora-ureq -- wallet --descriptor \"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)\" sync\n```\n\nAt most one blockchain feature can be enabled, available blockchain client features are:\n`electrum`, `esplora-ureq` (blocking), `esplora-reqwest` (async) and `rpc`.\n\n### From crates.io\nYou can install the binary for the latest tag of `bdk-cli` with online wallet features \ndirectly from [crates.io](https://crates.io/crates/bdk-cli) with a command as below:\n```sh\ncargo install bdk-cli --features electrum\n```\n\n### bdk-cli bin usage examples\n\nTo get usage information for the `bdk-cli` binary use the below command which returns a list of\navailable wallet options and commands:\n\n```shell\ncargo run\n```\n\nTo sync a wallet to the default electrum server:\n\n```shell\ncargo run --features electrum -- wallet --descriptor \"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)\" sync\n```\n\nTo sync a wallet to a Bitcoin Core node (assuming a regtest node at 127.0.0.1:18443) using the core rpc:\n\n```shell\ncargo run --features rpc -- --network regtest wallet --node 127.0.0.1:18443 --descriptor \"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)\" sync\n```\n\nTo get a wallet balance with customized logging:\n\n```shell\nRUST_LOG=debug,sled=info,rustls=info cargo run -- wallet --descriptor \"wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)\" get_balance\n```\n\nTo generate a new extended master key, suitable for use in a descriptor:\n\n```shell\ncargo run -- key generate\n```\n\n## Minimum Supported Rust Version (MSRV)\n\nThis library should always compile with any valid combination of features on Rust **1.57.0**.\n\nTo build with the MSRV you will need to pin the below dependency versions:\n\n```shell\n# log 0.4.19 has MSRV 1.60.0\ncargo update -p log --precise 0.4.18\n# required for sqlite, hashlink 0.8.2 has MSRV 1.61.0\ncargo update -p hashlink --precise 0.8.0\n# tempfile 3.7.x has MSRV 1.63.0\ncargo update -p tempfile --precise 3.6.0\ncargo update -p base64ct --precise 1.5.3\n# cc 1.0.82 is throwing error with rust 1.57.0, \"error[E0599]: no method named `retain_mut`...\"\ncargo update -p cc --precise 1.0.81\n# tokio 0.30.0 has MSRV 1.63.0\ncargo update -p tokio --precise 1.29.1\n# flate2 1.0.27 has MSRV 1.63.0+\ncargo update -p flate2 --precise 1.0.26\n```\n\n## Resources\nDocs: [bitcoindevkit.org CLI Section](https://bitcoindevkit.org/bdk-cli/installation/)  \nEpisode on the _Bitcoin Developers Show_: [Youtube](https://www.youtube.com/watch?v=-Q8OD8NCEe4)  \nVideo Tutorials: [Youtube Playlist](https://www.youtube.com/playlist?list=PLmyfVqsSelG3jSobvpY3GoNKDtAumsrg3)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoindevkit%2Fbdk-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcoindevkit%2Fbdk-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoindevkit%2Fbdk-cli/lists"}