bip93: reject HRPs longer than 83 characters - #33
BenWestgate wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 605131826a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
aNACK This really belongs in bech32_decode actually as it applies to all bech32-like encodings due to limits on needing to decode the HRP to know codex32 is being used and memory issues. Also why was this closed? |
PR #33's recorded head became unreachable when this branch was rebuilt, which left the pull request unable to reopen. This merge makes the old commits reachable again without changing any file: the tree is identical to the current branch, and the superseded approach (the 83-character check in bip93.py, and the test that bypassed bech32_decode) stays superseded.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d1e43e759
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4d1e43e to
d8eebe7
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@claude review this PR |
|
Addressed the aNACK at the current head ( |
BenWestgate
left a comment
There was a problem hiding this comment.
AI-generated review (Claude), posted at the maintainer's request.
ACK e49d23f, one nit.
- The 83-char limit sits at the separator in
bech32_decode, so every parse path gets it.CorrectionContextis covered too. - Draft vectors match
01374bf; the only later commit on that branch (87d096b) is a changelog entry.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
197f7b2 to
e49d23f
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
3499c1f to
e49d23f
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Current-head recheck after the rollback: |
|
Release-gate follow-up: the last provenance-comment nit is resolved at |
|
Release-gate concept recheck: the 83-character HRP limit is the intended generalized-BIP93 contract, not a stale pre-generalization limit. BenWestgate/bips PR #2 currently specifies the HRP “as specified in BIP-0173,” and the review discussion explicitly notes “now that HRP is limited to 83 characters.” All #33 review threads are resolved at |
|
Release-gate semantic recheck: the 83-character HRP limit is still the correct generalized-BIP93 contract, not a conflict with the long-checksum 1023-symbol period. BenWestgate/bips PR #2 says the human-readable part is “as specified in BIP-0173,” while the 93/96–1023 limits apply to the expanded codeword (HRP expansion + data), not to HRP length itself. The PR’s 83/84 boundary vectors and |
Reject human-readable parts longer than 83 characters at the generic Bech32 decoding boundary and in correction contexts. Keep checksum-period coverage at the checksum layer so it does not depend on invalid Bech32 HRPs. Fixes #32.
Name BenWestgate/bips PR #2 as the source of the generalized-HRP draft vectors. No vector data or parser behavior changes.
07024bd to
6be7136
Compare
|
Sequencing note: current head |
That is the correct behavior. Bech32-like parsing requires 83 character maximum for the HRP. |
BenWestgate
left a comment
There was a problem hiding this comment.
AI-generated review, posted at the maintainer's request.
ACK 6be7136.
Fixes #32.
BIP-93 specifies a generalized human-readable part using the BIP-173 grammar, including the 1–83 character HRP limit. Enforce that limit in
bech32_decode, where Bech32-like strings cross the decoding boundary, and reject overlong public correction-context HRPs as well.The regression coverage uses the generalized-HRP draft vectors from BenWestgate/bips PR #2 @
01374bf: the valid 83-character HRP, invalid 84-character HRP, generalized-HRP share/recovery vectors, expanded-codeword 94/95 gap cases, and lowercase-HRP checksum rule. The obsolete >83-character frozen vectors were removed rather than repurposed as checksum-layer tests.Current head
6be71368is four focused commits and is mergeable againstreviewability-v1. The full GitHub Python-package matrix is green, and all inline review threads are resolved.Disclosure: AI tools were used while developing and reviewing this change, per
docs/developer/AI_POLICY.md.