Skip to content

Comments

example: add an example using the BIP329 crate with bdk_wallet#222

Open
Musab1258 wants to merge 8 commits intobitcoindevkit:masterfrom
Musab1258:example/BIP329-example-using-bitcoinppl/bip329-library
Open

example: add an example using the BIP329 crate with bdk_wallet#222
Musab1258 wants to merge 8 commits intobitcoindevkit:masterfrom
Musab1258:example/BIP329-example-using-bitcoinppl/bip329-library

Conversation

@Musab1258
Copy link
Contributor

Description

This PR adds a new example file, bip329_example.rs, that demonstrates how to manage BIP-329 wallet labels when using bdk_wallet.

This fixes issue #168 by using @praveenperera's bip329 crate rather than integrating label storage directly into the core bdk_wallet. This follows the feedback I received from @notmandatory on the issue.

The example shows how to:

  • Create an in-memory bdk_wallet::Wallet.
  • Load/Save labels from/to a separate JSON Lines (.jsonl) file using the bip329 crate.
  • Build a lookup map to correlate wallet items (addresses, txids, outpoints) with their labels.
  • Demonstrate basic addition/updating of labels in memory and saving them back to the file.
  • Uses tempfile to avoid leaving artifacts after running.

Notes to the reviewers

  • This example requires the keys-bip39 feature to generate the mnemonic and descriptors used.

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@coveralls
Copy link

coveralls commented Apr 29, 2025

Pull Request Test Coverage Report for Build 14772973936

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 86.525%

Totals Coverage Status
Change from base Build 14270666930: 0.0%
Covered Lines: 7269
Relevant Lines: 8401

💛 - Coveralls

@ValuedMammal ValuedMammal added the documentation Improvements or additions to documentation label Feb 18, 2026
@ValuedMammal ValuedMammal mentioned this pull request Feb 19, 2026
9 tasks
@Musab1258 Musab1258 force-pushed the example/BIP329-example-using-bitcoinppl/bip329-library branch from 7be28d4 to 8f424e2 Compare February 19, 2026 13:23
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.99%. Comparing base (c1f052e) to head (43636fb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #222   +/-   ##
=======================================
  Coverage   86.99%   86.99%           
=======================================
  Files          25       25           
  Lines        8860     8860           
=======================================
  Hits         7708     7708           
  Misses       1152     1152           
Flag Coverage Δ
rust 86.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Musab1258
Copy link
Contributor Author

@ValuedMammal, I have resolved the merge conflicts and made the example compatible with the new bdk_wallet API changes.

@ValuedMammal ValuedMammal self-requested a review February 19, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants