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§
- AsBech32
Payload - Extracts data representation from a given type which will be part of Bech32 payload
- Bech32
Data String - Trait for creating
data1...Bech32 representation of a given type - From
Bech32 Data Str - Trait for reconstruction type data from
data1...Bech32 string - From
Bech32 IdStr - Trait that can generate the type from a given Bech32
id1...value - From
Bech32 Payload - Convertor which constructs a given type from Bech32 payload data
- From
Bech32 Str - Constructs type from the provided Bech32 string, or fails with
Error - ToBech32
Data String - Trait for creating
data1...Bech32 representation of a given type - ToBech32
IdString - Trait representing given bitcoin hash type as a Bech32
id1...value - ToBech32
Payload - Convertor trait for extracting data from a given type which will be part of Bech32 payload
- ToBech32
String - 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.