Gossipsub peer discovery

Hi! I’ve read the gossipsub documentation and the source code of the js implementation. If I understand right when I send a message to a topic, it will be sent only to the KNOWN peers that are subscribed to the topic. So, if peer A subscribes to ‘test’ topic, and peer B also subscribes to ‘test’ topic (and no other peer is subscribed to ‘test’ topic), but peer A doesn’t know peer B then if A sends a message to the ‘test’ topic, peer B will never get it. Theoretically, it is possible that peers will be organized into big bubbles that are connected through the ‘test’ topic, but that are separated, and never will communicate with each other. Is it right?

If yes, it would be an easy way to solve it, if DHT would store the peer addresses to the topic in the same way as DHT store peer addresses for IPFS CIDs. In this case, peers could easily find other peers in the topic that would prevent the organization of these ‘separated bubbles’.

there are several ways to do peer discovery in order to bootstrap connectivity, explicitly left outside the scope of the protocol. And yes, using the DHT is one option.

Thank you for the answer. If I would use DHT, what should I use for the key to prevent collision with the IPFS CID-s? Is there any standard format (ex.: /pubsub/[topic name]) of these DHT keys?

A hash of that would be fine.