Wallet, ElectrumExt and Esplora{Async}Ext with redesigned structures.
75f8b81d58Update documentation (志宇)cff92111d5[wallet_redesign] Clean up and document address methods (志宇)a7668a2f3e[wallet_redesign] Modified `insert_tx` to use lowest checkpoint (志宇)ac80829caaRename fields of `tx_graph::Additions` (Shourya742)1c3cbefa4d[chain_redesign] Remove old structures (志宇)5860704b2dImplement redesigned versions of `EsploraExt` and `EsploraAsyncExt` (志宇)2952341e52Update the `wallet_electrum` example (志宇)78a7920ba3`bdk_electrum` API improvements and simplifications (志宇)92709d03ceVarious tweaks to code arrangement and documentation (志宇)50425e979bIntroduce `keychain::LocalChangeSet` (志宇)a78967e51b[example-cli] simplify new address logic (LLFourn)6a1ac7f80a[examples_redesign] Implemented `example_electrum` (志宇)f55974a64b[examples_redesign] Introduce `example_cli` package (志宇)2e3cee4bd0[electrum_redesign] Introduce redesigned `ElectrumExt` (志宇)7261669c09Add `last_seen` to the the `ConfirmationTime::Unconfirmed` variant (志宇)aba88130d9[wallet_redesign] Move the majority of `Update` to `bdk_chain` (志宇)e69fccb15f[wallet_redesign] Update `Wallet` with redesigned structures (志宇) Pull request description: ### Description Closes #938 * Update `Wallet` to use redesigned structures. * Update `bdk_electrum::ElectrumExt` to produce updates for redesigned structures. * Update `bdk_esplora::EsploraExt` and `bdk_esplora::EsploraAsyncExt` to produce updates for redesigned structures. * Added `example-crates/example_cli` library for implementing examples with redesigned structures. * Added `example-crate/example_electrum` which is an electrum CLI wallet using the redesigned structures. * Updated `example-crate/{wallet_electrum|wallet_esplora|wallet_esplora_async}` examples to use redesigned structures. * Remove all old structures. ### Notes to the reviewers ~These changes bump our `all-features` MSRV to `1.60.0` because of the introduction of `bdk_esplora`. As long as the `bdk_chain` and `bdk_wallet` crates hit a MSRV of `1.48.0`, it will be fine (this work is done in #987).~ No longer needed due to #993 ~I had to comment out the examples that use `Wallet` with our chain sources. Once we update the helper-packages for those chain sources, we can also update the examples.~ Possible future improvements for `ElectrumExt`: * Remove requirement to retry obtaining ALL data after reorg is detected. Transactions can be anchored to a lower block (not block tip), and an `assume_final_depth` value can be used. * The logic to finalize an update with confirmation time can be improved during reorgs to not require returning an error. * Use the subscription model of electrum, as intended by the API. ### Changelog notice ### 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 #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: LLFourn: ACK75f8b81d58danielabrozzoni: Partial ACK75f8b81d58- the Wallet code looks good to me, I don't have a good enough understanding of the esplora/electrum code to confidently ACK it. Tree-SHA512: d1d2b79e3c28fbe826044a8b5ef9b122c2dcfc0d371f24cc4aac7f286500b587c2dc3b06ca6461c8721adbc29f56ca41e7566eace560b0a9c541604e6a225c61
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