Skip to content

docs: add TIP-1023 address format page and convert docs to tempo1 addresses#123

Open
dankrad wants to merge 7 commits intomainfrom
docs/tip-1023-tempo-address-format
Open

docs: add TIP-1023 address format page and convert docs to tempo1 addresses#123
dankrad wants to merge 7 commits intomainfrom
docs/tip-1023-tempo-address-format

Conversation

@dankrad
Copy link
Contributor

@dankrad dankrad commented Mar 2, 2026

Summary

  • Adds a dedicated Address Format page (/protocol/addresses) with an interactive bech32m converter tool that lets users convert between 0x and tempo1 addresses and demonstrates substitution error detection
  • Adds a self-contained bech32m TypeScript library (src/lib/bech32m.ts) with encodeTempoAddress, decodeTempoAddress, and validateTempoAddress exports
  • Migrates user-facing 0x addresses across 20 docs pages to the new tempo1 bech32m format, including address tables (predeployed contracts, faucet, token lists), protocol spec deployment addresses (DEX, FeeManager, TIP20Factory, TIP403Registry, AccountKeychain), guide prose references, and SDK examples

Code examples in Solidity, Rust, Go, and CLI commands remain as 0x since the EVM operates on hex addresses at the protocol level.

Companion to tempoxyz/tempo#2925 (TIP-1023 specification).

Test plan

  • vite build succeeds
  • Verify /protocol/addresses page renders with working converter (Convert + Error Detection tabs)
  • Verify /protocol/tips index auto-discovers TIP-1023 once docs: add TIP-1023 Tempo Address Format tempo#2925 merges
  • Spot-check tempo1 addresses in predeployed contracts, faucet, and spec pages
  • Confirm code examples (Solidity, Rust, Go, cast CLI) still show 0x format

Made with Cursor

…resses

Adds documentation for the Tempo Address Format (TIP-1023) with an
interactive bech32m converter tool, and migrates user-facing 0x addresses
throughout the docs to the new tempo1 bech32m format.

- Add bech32m encode/decode/validate library (src/lib/bech32m.ts)
- Add interactive AddressConverter component with conversion and
  substitution error detection demo
- Add dedicated /protocol/addresses page with converter, format
  overview, and links to TIP-1023 spec
- Convert address tables (predeployed contracts, faucet, token lists)
  to tempo1 format
- Convert deployment addresses in protocol specs (DEX, FeeManager,
  TIP20Factory, TIP403Registry, AccountKeychain) to tempo1
- Convert token address references in guides and SDK examples to tempo1
- Update sidebar to include Address Format page

Code examples using Solidity/Rust/Go and low-level protocol byte values
are intentionally left as 0x since the EVM operates on hex addresses.

Companion to tempoxyz/tempo#2925

Made-with: Cursor
@vercel
Copy link

vercel bot commented Mar 2, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 3, 2026 5:42pm
tempo-docs Ready Ready Preview, Comment Mar 3, 2026 5:42pm

Request Review

Add a dedicated step for displaying and accepting tempo1 addresses,
with code examples for encode/decode and a link to display
recommendations. Also adds it to the pre-launch checklist and
learning resources.

Made-with: Cursor
Replace the string-comparison-based substitution demo with actual BCH
error correction that recovers corrupted addresses with no knowledge of
the original:

- Add correctTempoAddress() to bech32m.ts that performs brute-force
  BCH decoding: 1-error search (1,280 candidates) then 2-error search
  (~800K candidates)
- Redesign Error Correction tab to show recovered address, error
  positions, and corrected characters
- Presets for 1, 2, 3, and 5 errors demonstrate the boundary between
  correctable (1-2) and detection-only (3+)
- Update addresses.mdx to document correction capabilities

Made-with: Cursor
Port Pieter Wuille's algebraic GF(1024) syndrome decoder from sipa/bech32.
Error positions are now found via syndrome computation + GF(1024) log/exp
tables, then values are corrected by targeted search at known positions only.

Performance: 1-error 0.8ms (was ~50ms), 2-error 6ms (was ~3s), 3+ errors
detected instantly (was ~3s scanning before giving up).

Made-with: Cursor
The markdown code fence gave the example a Vocs-generated copy button
that copied the address with spaces, contradicting the text saying
copy must use the canonical form. Switch to a plain <p> so there is
no copy affordance on the display-only example.

Made-with: Cursor
- Replace non-null assertions with optional chaining / nullish coalescing
- Add htmlFor/id associations for label+input pairs
- Use span for output label (no associated input)
- Auto-format per Biome rules

Made-with: Cursor
Comment on lines +81 to +103
## JavaScript / TypeScript Usage

The `src/lib/bech32m.ts` module provides encode, decode, and validate functions:

```typescript
import {
encodeTempoAddress,
decodeTempoAddress,
validateTempoAddress,
} from './lib/bech32m'

// 0x → tempo1
const tempo = encodeTempoAddress('0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28')
// → "tempo1qp6z6dwvvc6vq5efyk3ms39une6etu4a9qtj2kk0"

// tempo1 → 0x
const hex = decodeTempoAddress('tempo1qp6z6dwvvc6vq5efyk3ms39une6etu4a9qtj2kk0')
// → "0x742d35cc6634c0532925a3b844bc9e7595f2bd28"

// Validate without throwing
const result = validateTempoAddress('tempo1qp6z6dwvvc6vq5efyk3ms39une6etu4a9qtj2kkq')
// → { valid: false, error: "Invalid checksum — address is corrupted" }
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tempo features an enshrined decentralized exchange (DEX) designed specifically for trading between stablecoins of the same underlying asset (e.g., USDC to USDT). The exchange provides optimal pricing for cross-stablecoin payments while minimizing chain load from excessive market activity.

The exchange operates as a singleton precompiled contract at address `0xdec0000000000000000000000000000000000000`. It maintains an orderbook with separate queues for each price tick, using price-time priority for order matching.
The exchange operates as a singleton precompiled contract at address `tempo1qr0vqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqvml629`. It maintains an orderbook with separate queues for each price tick, using price-time priority for order matching.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the precompiles to this format (across all pages) adds a lot of friction for anyone calling this in solidity, i'm not sure if exempting precompiles makes sense?

@jenpaff jenpaff requested a review from Copilot March 5, 2026 14:41
@jenpaff jenpaff requested review from jxom, onbjerg and tmm and removed request for Copilot March 5, 2026 14:42
@jenpaff jenpaff requested a review from samczsun March 5, 2026 14:42
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.

3 participants