Skip to content

feat: switch TempoAddress to bech32m (BIP-350)#181

Open
jxom wants to merge 2 commits intomainfrom
jxom/tempo-address-bech32m
Open

feat: switch TempoAddress to bech32m (BIP-350)#181
jxom wants to merge 2 commits intomainfrom
jxom/tempo-address-bech32m

Conversation

@jxom
Copy link
Member

@jxom jxom commented Feb 27, 2026

Summary

Switch TempoAddress encoding from custom double-SHA256 checksum to standard bech32m (BIP-350) checksum per TIP-XXXX spec.

Details

  • Added Bech32m module implementing BIP-350 encode/decode with BCH polymod checksum (constant 0x2bc830a3)
  • Replaced double-SHA256 checksum in TempoAddress.format/TempoAddress.parse with Bech32m.encode/Bech32m.decode
  • HRP (tempo/tempoz) is now included in the checksum computation — swapping prefixes invalidates the address
  • Removed Hash dependency from TempoAddress
  • Test vectors match TIP-XXXX spec

Modules Touched

  • Bech32m: Bech32m
  • Tempo Addresses: TempoAddress

- Add Bech32m module with encode/decode using BCH checksum (constant 0x2bc830a3)
- Replace double-SHA256 checksum in TempoAddress with bech32m checksum
- HRP included in checksum: swapping tempo/tempoz invalidates address
- Test vectors match TIP-XXXX spec

Amp-Thread-ID: https://ampcode.com/threads/T-019c9c5b-e584-7609-8a5b-ae0acf5fd603
Co-authored-by: Amp <amp@ampcode.com>
@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ox Ready Ready Preview, Comment Feb 27, 2026 8:00pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/ox@181

commit: 0687a46

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