bip329

Crates.iobip329
lib.rsbip329
version0.1.1
sourcesrc
created_at2024-07-28 20:07:17.788072
updated_at2024-07-28 20:50:52.431917
descriptionA library for working with BIP329 labels
homepagehttps://github.com/bitcoinppl/bip329
repositoryhttps://github.com/bitcoinppl/bip329
max_upload_size
id1318211
size50,300
Praveen Perera (praveenperera)

documentation

https://docs.rs/bip329

README

BIP329

Crate Info Apache-2.0 Licensed CI Status Docs

A library for working with BIP329 labels.

  • The main data structure is the Labels struct, which is a list of Label structs.
  • The Label enum containing all the different types of labels.
  • The Labels struct can be imported/exported to/from a JSONL file.
  • Supports encryption and decryption using the encryption module.
  • Supports the uniffi feature, for easy integration with other languages.

Example Import:

use bip329::Labels;

let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap();

Example Export:

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:

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();
Commit count: 0

cargo fmt