# BIP329

Crate Info Apache-2.0 Licensed CI Status Docs

A library for working with [BIP329 labels](https://github.com/bitcoin/bips/blob/master/bip-00329.mediawiki). - The main data structure is the [`Labels`](https://docs.rs/bip329/latest/bip329/struct.Labels.html) struct, which is a list of [`Label`](https://docs.rs/bip329/latest/bip329/enum.Label.html) structs. - The [`Label`](https://docs.rs/bip329/latest/bip329/enum.Label.html) enum containing all the different types of labels. - The [`Labels`](https://docs.rs/bip329/latest/bip329/struct.Labels.html) struct can be imported/exported to/from a JSONL file. - Supports encryption and decryption using the [`encryption`](https://docs.rs/bip329/latest/bip329/encryption/) module. - Supports the [`uniffi`](https://github.com/mozilla/uniffi-rs) feature, for easy integration with other languages. #### Example Import: ```rust use bip329::Labels; let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap(); ``` #### Example Export: ```rust use bip329::Labels; // Create a Labels struct let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap(); // Create a JSONL string let jsonl = labels.export().unwrap(); ``` #### Example encryption: ```rust use bip329::{Labels, encryption::EncryptedLabels}; let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap(); let encrypted = EncryptedLabels::encrypt(&labels, "passphrase").unwrap(); let decrypted: Labels = encrypted.decrypt("passphrase").unwrap(); ```