I did not want to invent something new. I like to stick with existing standards.
So some history:
In the beginning the idea was to try using Bonjour, because it is standardized and serverless, over the Yggdrasil network.
For that I wrote a small utility. I would add my peer to a config file, and it would poke that IP’s bonjour port from time to time. I know, very ugly. If the port responded, it would force Avahi (local MDNS server) to believe there’s such contact and it has such IP address. Then Bonjour would sort of work over Yggdrasil.
But that was a very bad solution. We could not set statuses (away, for example), we could not exchange files, because Bonjour shares them by using local IPs. Overall it was a dirty hack and we realized Bonjour relies on MDNS too much for us to be useful over a mesh network.
So this idea was put aside.
Then I “forked” Bonjour plugin. Well, it does not build outside of Pidgin tree, so first I had to make it to build.
Then gradually I was taking whatever XMPP standars are there for streams, messaging, avatars, notifications, status updates (we also have “do not disturb”, which Bonjour lacks), file transfers, and make it all work but without servers.
It took some time, and I am very thankful for support, inspiration and testing to folks in Yggdrasil muc.
So we have a purple plugin now which works.
Since when using Yggdrasil you are exposed to whole Yggdrasil network, people tend to use firewalls. Users could whitelist one port for Barev, but file transfers in Bonjour implementation would choose random ports. So I have adapted it to use a dedicated port range, that could be unlisted.