Skip to content

example(bdk_wallet): add BIP-329 wallet labels example using bip329 crate#414

Open
Leeyah-123 wants to merge 1 commit intobitcoindevkit:masterfrom
Leeyah-123:example/bip329-labels
Open

example(bdk_wallet): add BIP-329 wallet labels example using bip329 crate#414
Leeyah-123 wants to merge 1 commit intobitcoindevkit:masterfrom
Leeyah-123:example/bip329-labels

Conversation

@Leeyah-123
Copy link

Description

Adds examples/bip329_labels.rs demonstrating how to use bdk_wallet together with the bip329 crate to annotate wallet items with human-readable labels in the BIP-329 JSONL format.

The example covers:

  • Creating a wallet from a BIP-39 mnemonic
  • Labelling revealed addresses (AddressRecord) with BIP-84 keypath context
  • Labelling transactions (TransactionRecord) — enriched with fee and net flow
    from wallet.calculate_fee / wallet.sent_and_received after a sync
  • Labelling UTXOs (OutputRecord) with spendable coin-control hints
  • Exporting labels to a JSONL file (Labels::export_to_file)
  • Reloading and querying efficiently with Labels::into_string_map
  • Updating labels in-place (retain + push) and streaming to stdout via
    Labels::export_to_writer

Replaces #383.

Changelog notice

  • example(bdk_wallet): add BIP-329 labels example using the bip329 crate

Checklists

All Submissions:

New Features:

  • I've added docs for the new feature

@Leeyah-123
Copy link
Author

@ValuedMammal I was assigned this, but the previous PR closed automatically when I renamed the branch.

@ValuedMammal ValuedMammal added the documentation Improvements or additions to documentation label Mar 24, 2026
@ValuedMammal
Copy link
Collaborator

Thanks I'll take a look at it and continue researching a potential labels feature in bdk_wallet, though I would note that this looks similar to the existing #222 and we probably don't need both.

@Leeyah-123
Copy link
Author

Thanks I'll take a look at it and continue researching a potential labels feature in bdk_wallet, though I would note that this looks similar to the existing #222 and we probably don't need both.

Thanks a lot!
Yes, I'm aware of the existence of that PR, I'm tackling this also as a challenge I was given in BOSS 2026.

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.

2 participants