bc3e05c6c6Doc fixes (Daniela Brozzoni)352f95f558[ci] misc fixes (Daniela Brozzoni)2fcf9c4adbMake async esplora futures Send (LLFourn)5dd4ce74cfMore documentation improvements (志宇)ae9b19d84c`bdk` README improvements (志宇)def0c9ed39Add `wallet_esplora_async` example and various fixes (志宇)26ab2e2d6cImplement EsploraExt for Async client (Vladimir Fomene)ab9242d10dReplace current caching solution with Rust Cache (Vladimir Fomene)0aaf420f6dexamples: exit if balance < SEND_AMOUNT (Daniela Brozzoni)47faa881fbFix cargo clippy (Daniela Brozzoni)9d26121dbcImprove stdout output for wallet esplora/electrum examples (志宇)eddd748870Add `wallet_electrum` example (志宇)0505cd7242Remove transaction-based type parameters and traits (志宇)de9457fce6Changed `inflate_update` logic to not depend on `Cow` (志宇)69cf6d7924Use os-specific temp dir for `wallet_esplora` example (志宇)b3836cb308Use hardcoded send amount for `wallet_esplora` example (志宇)b082932268Add the wallet_esplora example (Daniela Brozzoni)d267517dbdNewError implements StdError (fix typo) (Daniela Brozzoni)0c7a0abb19Disable code coverage (Daniela Brozzoni)dfcbafd6b1Use action-rs/toolchain in CI (Daniela Brozzoni)0ba41c5751Make bdk_esplora wasm compatible again (Daniela Brozzoni)a38f63359dMake bdk_file_store use bincode v1 (LLFourn)38ef170ed1Make bdk and bdk_chain work under 1.57.0 (Steve Myers)3a5d727899Update workspace dependencies to be relative paths (Steve Myers)96d932c830Add clippy.toml (Daniela Brozzoni)5708bf0c8cFix docs (Daniela Brozzoni)5acee82496Update rust stable in CI (1.67.0) (Daniela Brozzoni)8c9bcebc71Fix the "repository" field in Cargo.toml (Daniela Brozzoni)c61b3604e1Fix cargo clippy warnings (Daniela Brozzoni)1805bd35c0Fix clippy (Daniela Brozzoni)3f5a78ae3bDisable test-hardware-signer (Daniela Brozzoni)303a1703c9Rust fmt (Daniela Brozzoni)b5559767dbRename the stub wallet examples (LLFourn)2e82cd8c04Use tempfile for file_store tests (LLFourn)c069b0fb41Move everything else over 🎉 (LLFourn)949608ab1fMove bdk_electrum into the bdk repo 🎉 (Daniela Brozzoni)03deafb553Move bdk_file_store into the bdk repo 🎉 (Daniela Brozzoni)37dfa77d9dMove bdk_chain into the bdk repo 🎉 (Daniela Brozzoni)f2188f9dcdMake lib.rs's docs be the README.md (LLFourn)1c970a9295Fix code coverage CI (Daniela Brozzoni)94a084aafdFix doc links (LLFourn)9edbdf54c9[ci] Fix feature flags (LLFourn)20e45b7af0Add back test-hardware-signer feature (LLFourn)6d05598407Remove test-readme-examples (LLFourn)b60820a7b5Remove authors.workspace because older cargo don't like (LLFourn)22bec6d363Delete unused errors (LLFourn)8a6de3aa2dConvert to workspace (LLFourn)fdfc9b9edeDelete unused things (LLFourn)e1eb0253cfMake doctests work (LLFourn)3baf9721ecUse bdk_chain Balance (LLFourn)b310a7afddAdd Wallet::cancel_tx (LLFourn)5985706c1aAdd wallet persistence (LLFourn)57538e53e4Move tests to /tests (LLFourn)a40da9ba6cMake bdk no_std (LLFourn)aab2b12f7abdk_core integration initial commit 🔥 (LLFourn)544c397a38Modified build, clippy and test steps (志宇) Pull request description: We prepare the BDK repo for a major restructuring 🔥. This PR maintains the existing wallet API as much as possible and adds very little. ## Things Done - database modules removed - blockchain gutted but new esplora syncing code added (this will be gone soon hopefully). - minimal API changes. - Many macros removed. - no longer applicable examples removed. - Much conditional compilation removed. Can compile with `--all-features` now. - All wallet tests passing - TestClient moved into its own repo - Example using `esplora` ## APIs changed - wallet no longer has a `sync` method. This is replaced with `apply_wallet_scan`. - address "caching" is gone. You can just change the derivation index with `ensure_derived_up_to` which sets your derivation to at least the argument. Unlike `ensure_addresses_cached` used to do this will alter what getting a new address gives you. - `AddressIndex::Reset` is gone. This thing didn't make much sense and is hard to do with the more sane internals we've established. Changing the derivation index changes what script pubkeys the wallet will search so this is dangerous. We plan to add method like `trim_unused` which lowers the derivation index to the highest unused index. Applications must handle giving out old addresses manually now (which I think is good). ## Unfinished work - [x] esplora example doesn't work for mempool transactions yet (seems like our esplora in testclient doesn't index mempool??). - [x] we need to figure out a way to retrieve and store transaction timestamps (we're currently just setting them to `u64::MAX`). In `bdk_core` we never got around to doing this but it needs to be done. - [x] A few insights we got from doing this PR should be applied to bdk_core first. - [x] doctests not working. ### Notes to the reviewers Try not to review the actual changes. This PR will be forced pushed a bit so it will be likely wasted. I think I did a faithful job of translating the tests. A bit of review here would be helpful. I *do* think it would be good to merge this PR soon into the v1 branch so we have something to work off once unfinished work is done. Checking out the branch and poke around and give feedback would be the most helpful thing. Run the (sort of) working example: ``` cargo run --example esplora --features="bdk_test_client/bitcoind_22_0 bdk_test_client/esplora esplora" ``` ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: * [x] This pull request breaks the existing API * [ ] I'm linking the issue being fixed by this PR (there's too many!) ACKs for top commit: danielabrozzoni: ACKbc3e05c6c6Tree-SHA512: b5fbfd2263bb2a7cbf7b486530e639683775209bea944b266efd9c0447fb632295f7f5ddbd2e8d79796338415eaca26f1876617c2b66523485167b22e75e449e
The Bitcoin Dev Kit
BDK
A modern, lightweight, descriptor-based wallet library written in Rust!
Project Homepage | Documentation
About
The bdk libraries aims to provide well engineered and reviewed components for Bitcoin based applications.
It is built upon the excellent rust-bitcoin and rust-miniscript crates.
⚠ The Bitcoin Dev Kit developers are in the process of releasing a
v1.0which is a fundamental re-write of how the library works. See for some background on this project: https://bitcoindevkit.org/blog/road-to-bdk-1/ (ignore the timeline 😁) For a release timeline see thebdk_core_stagingrepo where a lot of the component work is being done. The plan is that everything in thebdk_core_stagingrepo will be moved into thecratesdirectory here.
Architecture
The project is split up into several crates in the /crates directory:
bdk: Contains the central high levelWallettype that is built from the low-level mechanisms provided by the other componentschain: Tools for storing and indexing chain datafile_store: A (experimental) persistence backend for storing chain data in a single file.esplora: Extends theesplora-clientcrate with methods to fetch chain data from an esplora HTTP server in the form that [bdk_chain] andWalletcan consume.electrum: Extends theelectrum-clientcrate with methods to fetch chain data from an electrum server in the form that [bdk_chain] andWalletcan consume.
Fully working examples of how to use these components are in /example-crates