Skip to content

Support Bech32 and Bech32m #15

Description

@dipu-bd

Add Bech32 (BIP-173) and Bech32m (BIP-350) for SegWit/Taproot addresses, Lightning invoices, and Nostr npub. Highest crypto value after Base58.

Architecture fit

  • The 8→5-bit regrouping step fits the existing bit engine.
  • The substantial work is the human-readable part (HRP) handling and the BCH checksum (Bech32 constant 1, Bech32m constant 0x2bc830a3), plus the 6-character checksum append/verify.
  • No dev-dep oracle exists → vendor the BIP-173/BIP-350 test vectors (valid + invalid) into the test file.

Specs: BIP-173, BIP-350

Effort: L

Checklist

  • 8→5-bit conversion reusing the engine
  • HRP expansion + BCH checksum (both Bech32 and Bech32m constants)
  • Vendored BIP valid/invalid vectors as known-answer + invalid-input groups
  • Web-safe: verify checksum polymod on node (int semantics)
  • README / CHANGELOG / example / test_integration updated
  • Format / analyze / test (vm + node) green

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions