You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CEP-17 lets clients dynamically discover which relays a server uses by fetching kind:10002 events (NIP-65). Instead of hardcoding relay URLs, a client only needs the server's pubkey and can resolve operational relays automatically.
Server-side publishing is already done (PRs #77, #78). This issue tracks the remaining client-side discovery work.
Summary
CEP-17 lets clients dynamically discover which relays a server uses by fetching
kind:10002events (NIP-65). Instead of hardcoding relay URLs, a client only needs the server's pubkey and can resolve operational relays automatically.Server-side publishing is already done (PRs #77, #78). This issue tracks the remaining client-side discovery work.
Spec:
contextvm-docs/src/content/docs/spec/ceps/cep-17.mdTS SDK reference:
server-relay-discovery.ts,relay-resolution.ts,server-identity.tsServer-side publishing (done)
RELAY_LIST_METADATA_KIND = 10002constantDEFAULT_BOOTSTRAP_RELAY_URLS(6 hardcoded bootstrap relays)tags::RELAY = "r"tag constantpublish_relay_list()onAnnouncementManager(kind 10002 with["r", url]tags)get_advertised_relay_urls()/get_discoverability_publish_relay_urls()with dedupis_local_relay_url()helperrelay_list_urls,bootstrap_relay_urls,publish_relay_list,profile_metadatapublish_profile_metadata()(kind 0)is_announced_server)PR 1: Identity parsing, relay list fetching, and selection
Standalone building blocks, all independently testable. No transport wiring yet.
RelayPoolTrait extension:
fetch_events(filters, timeout)toRelayPoolTraitRelayPoolimpl vianostr-sdk Client::fetch_events()MockRelayPoolimpl with internal event buffer +inject_event()helperServer identity parsing (
server_identity.rs):parse_server_identity()accepting hex, npub, nprofilehinted_relay_urlsonNostrClientTransportPublicKey::from_hex()withparse_server_identity()in constructorsRelay list fetching and selection (
server_relay_discovery.rs):RelayListEntrytype (url+ optionalmarker)select_operational_relay_urls(): prefer unmarked, fall back to read+write union, deduplicatefetch_server_relay_list(): temporary pool, kind 10002 filter, pick latest bycreated_at, extractrtagsTests (~16):
PR 2: Multi-stage relay resolution + transport integration
Wires PR 1 into a resolution pipeline and integrates into
start().Config additions:
discovery_relay_urlsandfallback_operational_relay_urlsonNostrClientTransportConfigdiscovery_relay_urlstoDEFAULT_BOOTSTRAP_RELAY_URLSrelay_urlsfromvec!["wss://relay.damus.io"]tovec![]Relay resolution (
relay_resolution.rs):RelayResolutionConfigstructconnect_fallback_operational_relays(): probe with temporary pool, return URLs or emptyresolve_operational_relays()with full priority chain:tokio::select!Transport integration:
resolve_operational_relays()instart()beforeconnect()Tests (~13):
Docs:
README.mdCEP-17 status