Crate lnpbp_bech32

Crate lnpbp_bech32 

Source
Expand description

Library implementing LNPBP-14 standard: Bech32 encoding for client-side-validated data.

Types that need to have data1... and z1... bech 32 implementation according to LNPBP-14 must implement ToBech32Payload and FromBech32Payload traits.

Bech32 id1... representation is provided automatically only for hash types implementing bitcoin_hashes::Hash trait

Re-exports§

pub use strategies::Strategy;

Modules§

strategies
Strategies for automatic implementation of the Bech32 traits

Structs§

Blob
Type for wrapping Vec data in cases you need to do a convenient enum variant display derives with #[display(inner)]

Enums§

Error
Errors generated by Bech32 conversion functions (both parsing and type-specific conversion errors)

Constants§

HRP_DATA
Bech32 HRP used for representation of arbitrary data blobs in their raw (uncompressed) form
HRP_ID
Bech32 HRP used in generic identifiers

Traits§

AsBech32Payload
Extracts data representation from a given type which will be part of Bech32 payload
Bech32DataString
Trait for creating data1... Bech32 representation of a given type
FromBech32DataStr
Trait for reconstruction type data from data1... Bech32 string
FromBech32IdStr
Trait that can generate the type from a given Bech32 id1... value
FromBech32Payload
Convertor which constructs a given type from Bech32 payload data
FromBech32Str
Constructs type from the provided Bech32 string, or fails with Error
ToBech32DataString
Trait for creating data1... Bech32 representation of a given type
ToBech32IdString
Trait representing given bitcoin hash type as a Bech32 id1... value
ToBech32Payload
Convertor trait for extracting data from a given type which will be part of Bech32 payload
ToBech32String
Creates Bech32 string with appropriate type data representation. Depending on the specific type, this may be id-string, data-string, z-string or other type of HRP.