Skip to main content

Crate bip329

Crate bip329 

Source
Expand description

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();

Modules§

error
Example encryption (requires the encryption feature):
from

Structs§

AddressRecord
An address label.
ExtendedPublicKeyRecord
An extended public key label.
InputRecord
An input label.
Labels
A list of labels.
OutputRecord
An output label.
OutputSpendableField
Presence and JSON representation of an output spendable field
ParsedLabels
A parsed BIP329 label set with metadata that is lost by Labels
PublicKeyRecord
A public key label.
TransactionRecord
A transaction label.

Enums§

Label
The main data structure for BIP329 labels.
LabelRef
An enum representing all possible Label::ref_
SpendableFieldValue
The parsed JSON representation of an output spendable field