Skip to content

fix: enforce bech32 address case rules#4

Open
newmattock wants to merge 1 commit into
BitgesellOfficial:masterfrom
newmattock:fix-reject-mixed-case-bech32
Open

fix: enforce bech32 address case rules#4
newmattock wants to merge 1 commit into
BitgesellOfficial:masterfrom
newmattock:fix-reject-mixed-case-bech32

Conversation

@newmattock
Copy link
Copy Markdown

@newmattock newmattock commented May 25, 2026

Summary:
Enforce Bech32/SegWit address case rules in pybgl address validation.

Related bounty or issue:
BitgesellOfficial/bitgesell#81

What changed:

  • Accepts valid all-uppercase Bech32 addresses by matching the HRP case-insensitively before validation.
  • Keeps rejecting mixed-case Bech32 addresses before checksum normalization.
  • Allows digits in uppercase Bech32 payloads while still checking the uppercase Bech32 charset.
  • Adds regression tests for uppercase acceptance and mixed-case rejection.
  • Wires the focused regression into the existing top-level tests.py runner.

Validation:

  • python3 -m unittest pybgl.test.bech32_address_validation
  • python3 tests.py
  • git diff --check

Notes:
This is separate from pybgl#3 and does not touch packaging/build behavior.

@newmattock newmattock force-pushed the fix-reject-mixed-case-bech32 branch from 8cb2b8f to 04d5ad7 Compare May 25, 2026 18:48
@newmattock newmattock changed the title fix: reject mixed-case bech32 addresses fix: enforce bech32 address case rules May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant