Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds Bech32 and Bech32m encoding/decoding operations as specified in BIP-0173 and BIP-0350. These encodings are widely used for Bitcoin SegWit/Taproot addresses, Lightning Network invoices, Nostr keys, and other cryptocurrency applications.
New Operations
Features
Use Cases
Technical Details
Files Changed
src/core/lib/Bech32.mjs- NEW - Core Bech32/Bech32m library implementationsrc/core/operations/ToBech32.mjs- NEW - Encode operationsrc/core/operations/FromBech32.mjs- NEW - Decode operationsrc/core/config/Categories.json- Added operations to Data format categorytests/operations/tests/Bech32.mjs- NEW - Test suite (60 test cases)tests/operations/index.mjs- Registered test moduleTesting
Test Vectors
Includes official test vectors from:
Test 1: Bitcoin Mainnet SegWit v0 (P2WPKH)
Test 2: Bitcoin Testnet SegWit v0 (P2WSH)
Test 3: Witness v1 (64-byte program)
https://slowli.github.io/bech32-buffer/
References