I've seen the new nip17::extract_relay_list and nip17::extract_owned_relay_list functions to parse kind 10050 events, nice. Newbie question: why is it necessary to enable the "gossip" option to be able to have NIP17 relay list support in nostr-sdk ?

Reply to this note

Please Login to reply.

Discussion

Yeah what does it even have to do with gossip

Kind 10050 is for DMs, kind 10002 for the other stuff. But both have the same aim. So IMO both have to be under the `gossip` option.

Because the NIP17 relay list have to be auto discovered and some relays to be automatically added to the pool.

By default nothing is auto discovered and no relay is automatically added to the pool.

Thank you !

When gossip is enabled it automatically checks kind 3 and adds for example a contact's DM relays to the pool? In that case are those relays treated any different from others in the pool? Like they should be writeable only for posting private DM's targeted at the contact they were added for, right?

It doesn't check the kind 3 but the filters or the events.

Extract the author/s and the p tags from filters/events and request the kind 10002/10050 (if not already cached or if expired).

Yes, every relay have some flags (the RelayServiceFlags). These define what a relay can do. For example, the automatically added (the gossip ones) will have the `GOSSIP` flag.