-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BIP-173 states that a bech32 string must not exceed 90 characters however BOLT-11 states that the string limit may be exceeded. This puts in a conundrum - we want to support lightning but this crate pretty heavily documents itself as an implementation of BIP-173 and BIP-350. The solution we choose is to enforce the string limit in the segwit modules and types (`SegwitHrpstring`) and in `lib.rs` and non-segwit types (eg, `UncheckedHrpstring`) we enforce a limit of 1023. Enforce string length limits by doing: - Enforce and document a 1023 character string limit when encoding and decoding non-segwit strings. - Enforce and document a 90 character string limit when encoding and decoding segwit strings (addresses). - Document and make explicit that the 1023 limit is a rust-bech32 thing, based on the BCH code design in BIP-173 but is not part of any explicit spec. FTR in `bech32 v0.9.0` no lengths were not enforced.
- Loading branch information
Showing
7 changed files
with
377 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.