Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants