Skip to content

fix: fallback to public relays for Nostr profile resolution - #3603

Open
sethforprivacy wants to merge 1 commit into
devfrom
fix/nostr-fallback-relays
Open

fix: fallback to public relays for Nostr profile resolution#3603
sethforprivacy wants to merge 1 commit into
devfrom
fix/nostr-fallback-relays

Conversation

@sethforprivacy

Copy link
Copy Markdown
Contributor

Summary

Nostr (NIP-05) address resolution in the send screen now falls back to
well-known public relays when the author's NIP-05 relay hints are missing or
none of them serve the profile metadata (kind 0), and resolves as long as a
single relay has the profile.

  • queryProfile no longer rejects NIP-05 profiles whose nostr.json has no
    relays map (e.g. cakewallet@cakewallet.com and monero@monero.com
    both verified live to have a names entry and no relays entry, so they
    could never resolve before).
  • Author relays are still tried first; fallbacks are queried in parallel and
    the first hit wins (bounded by the existing 3s relay timeout, replacing a
    sequential worst case of N×3s).
  • Fallback set chosen from a measured sweep (kind-0 metadata coverage for 11
    popular profiles): relay.nos.social (fastest, 10/11), nos.lol (9/11),
    offchain.pub (7/11); relay.primal.net covers only Primal-app profiles,
    so it is last. Removed the obsolete domain-matching relay flow.

Test plan

  • New unit test for the fallback list:
    test/core/address_resolver/nostr/nostr_api_test.dart (all tests passed
    locally on flutter 3.47.2).
  • Manual: paste vik@monero.com in the XMR send screen → should resolve to
    the Monero address in the profile.
  • Note: the full flutter test / analyzer cannot run in a bare checkout
    (pubspec.yaml is generated; see scripts/linux/app_config.sh), so CI's
    Linux container (flutter 3.41.9) is authoritative for the rest of the
    suite.

- queryProfile no longer rejects NIP-05 profiles without relay hints
- processRelays queries author relays + well-known public relays in
  parallel, returning as soon as one relay serves kind-0 metadata
- fallback set: relay.nos.social, nos.lol, offchain.pub, relay.damus.io,
  relay.nostr.band, purplepag.es, relay.primal.net (measured coverage)
- add unit test for fallback relay list
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