But you should have a look at
Gnutella for Users - Gnufu to see how Gnutella works so you can think about designing a useful chat protocol.
Phex already has a rudimentary chat function, so you'd only have to do the user tracking to get chat working.
A good place to start might be the download mesh, for example by keeping track of the friends of your friends, so they don't have to do a search, but simply ask the friends who still have the same IP for the addresses of the others (and tell them their new address).