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 for automatic implementation of the Bech32 traits
Structs
Type for wrapping Vec data in cases you need to do a convenient
enum variant display derives with
#[display(inner)]
Enums
Errors generated by Bech32 conversion functions (both parsing and
type-specific conversion errors)
Constants
Bech32 HRP used for representation of arbitrary data blobs in their raw
(uncompressed) form
Bech32 HRP used in generic identifiers
Traits
Extracts data representation from a given type which will be part of Bech32
payload
Trait for creating
data1...
Bech32 representation of a given typeTrait for reconstruction type data from
data1...
Bech32 stringTrait that can generate the type from a given Bech32
id1...
valueConvertor which constructs a given type from Bech32 payload data
Constructs type from the provided Bech32 string, or fails with
Error
Trait for creating
data1...
Bech32 representation of a given typeTrait representing given bitcoin hash type as a Bech32
id1...
valueConvertor trait for extracting data from a given type which will be part of
Bech32 payload
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.