BIP-0173 limits the human-readable part to 1-83 US-ASCII characters in [33-126]. bech32_decode/codex32_decode don't enforce the 83-character upper bound today — only the overall 1024-character string limit and the checksum's own 93/1023 expanded-length limits apply, so an HRP longer than 83 characters (with a short enough data part) is currently accepted.
Found while cross-checking test vectors for the codex32 HRP-generalization work (bitcoin/bips#2040 successor): an 84-character HRP with an otherwise-valid checksum is accepted by parse_codex32, e.g.
a84characterlongcodex32keyexpressionhrpwiththedigit1andexcludedcharsbioandmorefiller10keysscn7tlttnvefxewy
should be rejected.
BIP-0173 limits the human-readable part to 1-83 US-ASCII characters in [33-126].
bech32_decode/codex32_decodedon't enforce the 83-character upper bound today — only the overall 1024-character string limit and the checksum's own 93/1023 expanded-length limits apply, so an HRP longer than 83 characters (with a short enough data part) is currently accepted.Found while cross-checking test vectors for the codex32 HRP-generalization work (bitcoin/bips#2040 successor): an 84-character HRP with an otherwise-valid checksum is accepted by
parse_codex32, e.g.should be rejected.