Skip to main content
Sovran allows users to claim memorable Lightning addresses like username@npubx.cash or username@sovran.money that are permanently linked to their Nostr pubkey.

Available Domains

Sovran supports two Lightning address domains:
Both domains are managed by the npub.cash service, which maps Lightning addresses to Nostr pubkeys.

Username Requirements

  • Minimum length: 3 characters
  • Allowed characters: Lowercase letters (a-z), numbers (0-9), underscores (_)
  • No spaces or special characters
  • Case-insensitive: All usernames stored as lowercase

Claim Username Screen

The main UI is in app/claimUsername.tsx:

Screen Components

Username Input

Domain Selector

Availability Checking

Username availability is checked in real-time across all domains:

Debounced Checking

NIP-98 HTTP Authentication

Claiming a username requires proving ownership of your Nostr pubkey using NIP-98:

Example NIP-98 Event

This proves:
  • ✅ You control the private key for the pubkey
  • ✅ The request was made recently (via created_at)
  • ✅ The request is for a specific URL and method

Claiming Process

When the user clicks “Continue”:

Local Server Flow

  1. Generate NIP-98 auth: Sign an event proving pubkey ownership
  2. Open local URL: Pass auth to Sovran’s local server at localhost:8080
  3. Server forwards: Local server proxies the request to npub.cash API
  4. Username claimed: npub.cash links username to pubkey
The local server pattern allows the mobile app to make authenticated API calls without exposing the private key to third parties.

Preview Section

Once a username is available, show a preview:

Integration with npub.cash

API Endpoint

Request Body:
Response:

Verification

npub.cash verifies the NIP-98 auth event:
  1. Extract event: Decode base64, parse JSON
  2. Verify signature: Check event signature matches pubkey
  3. Check URL: Ensure u tag matches request URL
  4. Check method: Ensure method tag matches request method
  5. Check timestamp: Reject old events (> 60 seconds)
If all checks pass, the username is claimed and linked to the pubkey.

Lightning Address Resolution

Once claimed, the Lightning address resolves via LNURL-pay:
Returns:
The nostrPubkey field links the Lightning address back to the user’s Nostr identity.

Profile Integration

Claimed Lightning addresses appear in user profiles:
Users can:
  • Display the address in their profile
  • Receive payments via Lightning
  • Share the address as a QR code

Best Practices

Security Considerations

NIP-98 Auth Security

  • Short-lived events: Events expire after 60 seconds
  • URL binding: Auth is only valid for specific URL
  • Method binding: Auth is only valid for specific HTTP method
  • Signature verification: Proves pubkey ownership

Private Key Protection

  • Never send privateKey over network: Only send signed events
  • Use local server: Proxy requests through localhost:8080
  • Validate before signing: Check URL and method before signing

Username Squatting Prevention

npub.cash may implement:
  • Reputation requirements: Require minimum follower count or reputation score
  • Payment requirements: Charge a small fee to claim premium usernames
  • Time delays: Prevent rapid claiming/releasing

Guidelines Display

When no username is entered, show guidelines:

Identity & Keys

NIP-06 key derivation for NIP-98 signing

User Profiles

Display claimed Lightning addresses in profiles

Lightning Payments

Send/receive payments to Lightning addresses

NIP-98 Spec

Official NIP-98 specification