You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6aba330 fix: gracefully handle `reveal_to_target` (valued mammal)
741f2ae test: persist indexed script pubkeys (valued mammal)
db25555 deps!: Update `bdk_chain` to 0.23.0 (valued mammal)
Pull request description:
### Description
The PR updates bdk_chain to 0.23.0. Additionally we introduce the ability to persist derived SPKs indexed by descriptor ID and derivation index.
The `CreateParams::use_spk_cache` method enables or disables a persistent cache for script pubkeys (SPKs) derived by the wallet. When enabled, the wallet will store and reuse previously derived SPKs, avoiding redundant derivation on subsequent loads.
When a wallet has many revealed addresses (i.e., many derived SPKs), loading the wallet can become slow if every address must be re-derived from scratch.
By enabling the SPK cache:
- **On wallet creation:** The wallet will persistently store each derived SPK as addresses are revealed.
- **On wallet load:** If `use_spk_cache` is also set in the corresponding `LoadParams`, the wallet will load the cached SPKs directly from storage, skipping the need to re-derive them from the descriptor. This can dramatically reduce load times for wallets with hundreds or thousands of revealed addresses, as the expensive crypto operations are avoided.
**Caveat:**
Both creation and loading must have `use_spk_cache(true)` set for the cache to be used. If not, the wallet will fall back to deriving SPKs as usual.
fixes#246fixes#237
### Changelog notice
#### Added
- `CreateParams::use_spk_cache`
- `LoadParams::use_spk_cache`
#### Changed
- bump bdk_chain to 0.23.0
- **Note:** This change extends the wallet `ChangeSet` type by adding `first_seen` to the tx_graph member, and adding `spk_cache` to the indexer.
### 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 +nightly fmt` and `cargo clippy` before committing
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
* [x] This pull request breaks the existing API
* [x] I'm linking the issue being fixed by this PR
ACKs for top commit:
notmandatory:
ACK 6aba330
Tree-SHA512: dd4d657e61836d12da388f233dcf463638da457fd1c982d13ee469dfdf8df77f3351a6edaa300156755217427da8296db03d2161c7baf3cb71cf5626b355680a
0 commit comments