Skip to content

bip93: Reject human-readable parts longer than 83 characters #32

Description

@BenWestgate

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gate: adversarial reviewResolve, merge, or explicitly defer before the next full adversarial review.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions