Skip to content

feat: add virtual-addresses TIP-1022 demo app#788

Draft
decofe wants to merge 8 commits intomainfrom
rusowsky/virtual-addresses-demo
Draft

feat: add virtual-addresses TIP-1022 demo app#788
decofe wants to merge 8 commits intomainfrom
rusowsky/virtual-addresses-demo

Conversation

@decofe
Copy link
Copy Markdown
Member

@decofe decofe commented Mar 26, 2026

Interactive demo for TIP-1022 virtual addresses on Tempo. Three views:

Intro (landing)

TIP-1022 docs page — motivation, address layout, protocol flow, key properties, and security considerations. Navigable via the "Virtual Addresses" title or "TIP-1022" badge in the navbar.

Registry

Mine a salt, register as a virtual-address master, derive deposit addresses, and test transfers.

  • Multi-threaded WASM salt miner (hash-wasm) using Web Workers
  • Manual address input or wallet connect (EIP-6963 auto-discovery)
  • Auto-funds connected wallet with PathUSD on connect

Walkthrough

Animated visual walkthrough of the full TIP-1022 flow with real on-chain transactions:

  • Exchange Panel → registers as a virtual-address master
  • Protocol Panel → TIP-1022 registry + TIP-20 precompile with animated flow dots
  • Sender Panel → sends PathUSD to a virtual address, shows color-coded address anatomy
  • Zustand state machine with configurable speed (0.1x–2x)
  • GuideOverlay with spotlight walkthrough (intro tour + post-demo "how it works")
  • framer-motion for all animations

Flow

Register master → derive virtual address → send to virtual → protocol resolves → master receives

Shows the two-hop Transfer events (sender→virtual, virtual→master), balance changes, and the anatomy of the virtual address format (color-coded masterId/magic/userTag).

Uses hash-based routing (#intro, #registry, #walkthrough) — all nav links support right-click "Open in new tab" and browser back/forward.

Architecture

See the full README for architecture diagram and key addresses.

Running locally

Requires a local Tempo node with TIP-1022 (T3 hardfork) enabled:

# 1. Clone and checkout the tip-1022 branch from the tempo repo
cd /path/to/tempo
git fetch origin pull/3286/head:tip-1022
git checkout tip-1022

# 2. Start local Tempo node
cd scripts
rm -rf data logs
just tempo-dev-up

# 3. Start the app (from tempo-apps root)
pnpm install
pnpm --filter virtual-addresses dev
# → http://localhost:3002

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2026

Bundle Size Report

Metric Size Δ Change
Total 4.1 MB -674.5 KB (-13.8%)
Gzip 1.2 MB -110.4 KB (-8.3%)
Brotli 1.0 MB -88.8 KB (-7.7%)
Chunk changes (>1KB)
Chunk Change
assets/KeyManager.js (removed) -477.4 KB
assets/QueryBuilder.js (removed) -423.4 KB
assets/router.js -303.0 KB
assets/wagmi.config.js -166.8 KB
assets/_hash.js -128.9 KB
assets/BaseTanStackRouterDevtoolsPanel-Bmws3ikM.js (removed) -99.5 KB
assets/Intro.js (removed) -66.0 KB
assets/createSsrRpc.js (removed) -43.8 KB
assets/isAddressEqual.js -32.5 KB
assets/path.js (removed) -30.6 KB
assets/FloatingTanStackRouterDevtools-B7vy70jP.js (removed) -24.4 KB
assets/_layout.js -21.4 KB
assets/stringify.js (removed) -19.7 KB
assets/Hash.js -16.4 KB
assets/address.js -14.1 KB
assets/getAction.js -13.0 KB
assets/base.js (removed) -12.8 KB
assets/utils.js -10.1 KB
assets/token.server.js (removed) -9.8 KB
assets/Address.js -9.7 KB
...and 36 more

Compared against main branch (baseline from 2/4/2026, 5:13:51 PM)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2026

Cloudflare Deployments

App Environment Status Preview
explorer devnet [OK] Deployed View Preview
explorer mainnet [OK] Deployed View Preview
explorer testnet [OK] Deployed View Preview
fee-payer devnet [OK] Deployed View Preview
fee-payer moderato [OK] Deployed View Preview
fee-payer privy [OK] Deployed View Preview
og - [OK] Deployed View Preview
tokenlist - [OK] Deployed View Preview

@0xrusowsky 0xrusowsky marked this pull request as draft March 26, 2026 18:37
0xrusowsky and others added 7 commits March 26, 2026 22:07
- Split app into Registry (salt miner) and Walkthrough Demo tabs
- Registry: manual address input, multi-threaded WASM miner (hash-wasm),
  wallet connect via EIP-6963 auto-discovery
- Walkthrough: animated TIP-1022 flow with Exchange/Protocol/Sender panels,
  zustand state machine, framer-motion animations, GuideOverlay spotlight
- Server: Hono API routes for demo register/transfer/balance with
  pre-mined salt for anvil account 0, idempotent registration
- Add zustand, framer-motion, hash-wasm dependencies

Amp-Thread-ID: https://ampcode.com/threads/T-019d2b87-dec9-7156-8823-bb58c11aa9ce
- Switch to tempoLocalnet (chain 1337) for local TIP-1022 dev
- Client-side RPC via demo-client.ts (bypasses workerd sandbox)
- Vite /rpc proxy to avoid CORS (localhost:3002 → localhost:8545)
- Auto-fund connected wallet with PathUSD on connect
- Tempo tx type 0x76 for all writeContract calls
- Idempotent getMaster check handles empty/zero responses
- Error banner in walkthrough with actual error messages
- Allowlist anvil test keys in gitleaks config
- README with full setup instructions

Amp-Thread-ID: https://ampcode.com/threads/T-019d2b87-dec9-7156-8823-bb58c11aa9ce
- Switch from tempoLocalnet to tempoDevnet chain
- Rewrite demo-client.ts to call server API endpoints instead of direct
  RPC with hardcoded anvil keys
- Set devnet RPC URL (rpc.devnet.tempoxyz.dev) in wrangler.json
- Remove vite localhost:8545 proxy (no longer needed)
- Update explorer links to devnet
- Simplify README — no local node prerequisite

Co-Authored-By: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d8d05-929c-7583-a71e-8633eca06597
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.

2 participants