Is there a realtime chatting API?

Realtime messaging is what we take for granted on the internet, but we’ve learned about the flaws of the centralized architectures used to implement this functionality. So I’m wondering, whether Safe Network (SN) is capable of providing the same service (w/o the flaws)?

I heard quite some time ago that SN would have (realtime) communication, in addition to the existing data storage/management capabilities, but I’m not sure what was exactly meant by “communication”, and as a newbie, I’m unable to find such APIs in the code, e.g. something that allows one to send a text directly to a user by their ID on SN (would this be “SafeID”?).

I did briefly check if there were existing examples/demos on the forum, and I’m aware of Patter. Without going through them thoroughly (e.g. I don’t know React), I could only get a very rough idea, but it seems to me that, so far, the demos are implementing communication or chatting via data storage and retrieval, basically. E.g. the receiver has to periodically fetch the data, after the sender puts the data on SN, is that right? Again because I’m new to all this, I’d appreciate it if you guys could correct any of my misunderstandings here.

Although I don’t know anything about the technical aspects of distributed, realtime messaging, I think the “UX” we would want is something more intuitive than the current approach (which in a sense seems to only “emulate” chatting via sort of “publishing”, with access control). Conceptually, we would prefer something more straightforward, like sending a text over SN to some destination ID, where the receiver just “gets it” without having to actively retrieve it periodically. I guess another way to put it is, can SN “push” messages to a specific set of targets? (I know I’m probably abusing the terms. But I guess that’s the point, please correct me.)


Hey @treslumen,

That’s pretty accurate for how things stand, yep. There’s been a few apps doing (eg as well as patter. Right now there’s no push messaging, but such a thing would definitely be desirable.

So the short answer to your question is “no”.

We have some basic “push” patterns for command (PUT) errors, so the possibility is there. And while we have no specific plan right now (that i’m aware of) for implementing this soon. This has been touched What’s needed is to get into the details to see exactly how such subscription to data changes would work and how that would impact the network.


Thanks @joshuef for the response. So would such subscription involve establishing a persistent connection between the client and the network? What I’m imagining is some kind of channel that the client listens to, but perhaps that’s just client-server talk, and SN’s way of push messaging will be very different?

1 Like

There were also some WebRTC demos before that just used the network for peer discovery. That was very long ago though


Honestly I’m not entirely sure what we’ll end up with yet.

The network could be imagined as one big server. The client curently establishes a two way connection and can be fed errors etc as long as it’s connected. That already exists, so it’d be a question of how messaging on data changes proliferate I think. But aye, that’s all a bit down the road for now

1 Like

Arguably the very first SAFE app was real time chatting - or as I think I called it at the time " A very convoluted form of IRC"

I wish I had kept the screenshots but I distinctly remember cutting and pasting long strings into the command line along with a small text payload. I talked briefly with folks in the NY area and perhaps Salt Lake City - there was def three of us flung around some messages for a few minutes.
This may even have been in pre-rust days 2015?
Does anyone else remember this?

EDIT It was 2015 or before. Cant find my original message but this refers

1 Like