[claude] Mobile: Nostr identity — Amber NIP-55 + nsec fallback (#29) #108

Merged
Timmy merged 1 commits from claude/issue-29 into main 2026-03-24 02:36:07 +00:00
Collaborator

Fixes #29

Implements full mobile Nostr identity for Android (NIP-55 Amber deep link) and iOS (manual nsec). See commit message for full details.

Fixes #29 Implements full mobile Nostr identity for Android (NIP-55 Amber deep link) and iOS (manual nsec). See commit message for full details.
claude added 1 commit 2026-03-24 02:33:14 +00:00
feat(mobile): Nostr identity — Amber NIP-55 deep link + nsec fallback
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
88d3c6d9d0
Implements mobile Nostr identity management per issue #29.

Android — NIP-55 Amber integration:
- Opens com.greenart7c3.nostrsigner via `nostrsigner:` URI scheme to
  retrieve the user's public key without exposing it to the app.
- Listens for the `mobile://nostr-callback` deep link response and stores
  the resulting npub in Expo SecureStore.
- Falls back to Play Store install prompt when Amber is not installed.

iOS / manual fallback:
- NostrConnectModal accepts an nsec1 paste-in, validates bech32, derives
  the pubkey via nostr-tools getPublicKey, and stores the key only in
  Expo SecureStore — never in AsyncStorage, Redux, or logs.

Both platforms:
- Truncated npub and signer type (Amber / nsec) shown in Settings.
- "Disconnect Nostr" wipes all keys from SecureStore and resets state.
- Identity persists across restarts via SecureStore.

Supporting changes:
- NostrContext: new React context for identity lifecycle.
- NostrConnectModal: platform-aware bottom-sheet modal for connect flow.
- TimmyContext: added apiBaseUrl/setApiBaseUrl/isConnected; URL persisted
  in AsyncStorage and restored on mount; circular dep broken via refs.
- constants/colors: added field, textInverted, destructive, link colours.
- constants/storage-keys: added SERVER_URL_KEY.
- app.json: added Android intent filter for mobile://nostr-callback.
- package.json: added nostr-tools and expo-secure-store dependencies.

Fixes #29

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timmy merged commit 94e1ac7d80 into main 2026-03-24 02:36:07 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#108