Choosing relay decision making

Delta Chat version

2.64

I’ve seen that in the latest update:

  • Improve auto-selection of relay for sending messages

Does someone know how it works now? I’m very curious to understant how it works.

In short, during account creation we add one relay from the list of candidates that answers first, then add 2 more relays from the list of candidates randomly.
The list of candidates is: the hard-coded list of default relays (~15 of them), plus relays from the invite link.

I’d expect this to change further in the next months, but here is the current code. The main thing are comments.

A side question as I was just poking in dc.db for something completely unrelated – I notice on my stored keypair it has the account address of the original relay which the keypair was created.

What happens to your keypair if you leave that relay or it goes offline, is there a mechanism which updates that column with a new address? What’s the secret sauce here… does that address “matter” or is it sort of dead weight the way a SSH key comment is?

that may for chinese users (like me). the gfw banned nine.testrun relay, and all the relays on the chatmail.at , to solve that problem, the deltachat (2.62 later) will thoose other relays at random. this version made it better. that’s all i know

and u can have a try: creat an account(profile) on v2.59 or earlier, you will find that the relay is nine.testrun, but if u use v2.62 or later to creat a new account, that will be changed to others

Sorry, may be the title was not clear enough, I was referring to the decision making when a message is sent, as says in the changelog I’ve copypasted.

But I liked to know how it’s done during the profile creation! Thanks

the deltachat (2.62 later) will thoose other relays at random. this version made it better. that’s all i know

From what I read above from WofWca, the newest concept is when you invite someone and they create a new account, the process now takes the relays the person who invited them uses, pings the fastest one and adds it first, then adds the others as backup. It reads that DC will now mirror the relay settings from an invite. Seems really cool!

Logistically, this could enable your friend network to maintain completely unlisted relays (even use the IP address relay method) which propagates solely via the invite network. Presumably if that relay gets blocked, the friend network kind of routes around it by sharing a new one.

Future idea: allow a friend network to dynamically move relays; meaning, if one contact adds a relay and ticks an option “broadcast to contacts”, those contacts could automatically (opt-in) create accounts on that new relay and add it. (same with removal, one person “broadcasts” the change and others follow it) It would require a level of trust in the friend group of course, there are design hurdles to overcome in the idea. :slight_smile:

Downside: one observed group member (by a police type force) could seize their mobile and compromise the relay network. I think this risk already exists, though - but if that device pushed out a new, compromised, MITM relay it’s really bad. So gotta have safeguards somehow.

If you encounter any issues or would like to use servers not listed on chatmail.at, please write to me here: Message privately on Delta Chat

There was a topic about not doing this. Anti-censor relays distribution [don't automatically add your contacts' relays].

nod good thread, definitely - if implemented - want a toggle to disable that feature for folks who need it disabled.

Maybe I’m a bit askew in my thinking, but relays are easily discoverable by a bad actor in two ways in a compromised network:

  • The compromised device has DC contacts which have all their relays connected; for a contact I chatted with about a year ago (another relay sysop) I can tell their current relay network easily, as I receive broadcast updates from them
  • Put a relay online and use it to communicate with this network, the relay will handle revealing all the remote endpoints it needs to talk to for message delivery. I look at journalctl -e regularly and see the network chatter neatly logged

I’ve mulled over these thoughts over time and there are more ways to get into the social network once any one group member is compromised by the authorities and their data (device) seized. The DC clients and relays map the entire network they see for you all by themselves. Any relay operator can trace your social network if you use them.

My English isn’t very good, so I asked GPT to help me translate this.

Thanks, punkero! I really appreciate your ideas and the effort to make relay sharing more flexible.

One possible weakness, though, is that while users can often find ways to circumvent censorship, whether through relays or proxy servers, censors can also discover those methods. So relying on hidden or shared relays and proxies may not be a perfect solution.

And a big thank you to the developers for taking Chinese users into consideration. It really means a lot to see you thinking about the challenges we face!