
Orbit – Distributed, serverless, peer-to-peer chat application on IPFS - niklasbuschmann
https://github.com/haadcode/orbit
======
notwhiteknight
Interesting. Can someone explain how IPFS works? Is it like Tor? I don't have
any interest in running some sort of distributed content farm that might place
CP on my computer. Even if the chance of that happening is 0.00001%.

~~~
badsock
The best one-liner I've heard: it's like one giant git repo that's inside of
one giant bittorrent.

My (imperfect) understanding is that it runs like a market: you temporarily
store and forward blocks (<1MB) that are considered "valuable" (i.e. popular)
in exchange for people forwarding you the blocks that you want. So there's a
cache at each node where popular blocks are held - which I'm sure you can keep
in RAM if you want. So while it's possible that content you don't want might
pass through your IPFS node, it's pretty ephemeral.

In general, I don't think IPFS is a great place to do naughty things - it's
not big on anonymity, and since blocks drop off the network if they're not
being actively requested, to keep something up there you have to store it
permanently _somewhere_, which is going to be traceable to the same degree
that running a webserver is.

~~~
kirushik
As far as my understanding goes (and I've spent a day discussing it with IPFS
authors in person this September), IPFS doesn't store or forward anything you
haven't explicitly requested. So you participate only in sharing things you're
aware of (and bad things are rather easy to remove from that cache) — and
that's a deliberate design decision.

Things in local IPFS cache can indeed be "garbage-collected" (and there's a
CLI command to trigger GC manually) — but IPFS daemon has a concept of
_pinning_, and pinned IPFS nodes won't be collected, and will remain stored
(and being shared) as as the pinning goes.

------
marknadal
The browser demo does seem to be working, however it seems very slow?
Beautiful interface though! One of the best I've seen yet.

What is going on underneath? Are you guys using WebSocket or WebRTC? The
reason I ask is because I wrote an interactive coding tutorial for building a
distributed chat app (
[http://gun.js.org/converse.html](http://gun.js.org/converse.html) ), and it
uses WebSockets to communicate with a federated relay peer server. I'm hoping
to add WebRTC support but I'm curious what you guys are doing. Like, IPFS
doesn't have pub/sub support right? So did you add this?

~~~
diggan
The version deployed at orbit.libp2p.io is using orbit-db which is using redis
to do pubsub right now. However, pubsub is being worked on and exists in for
example go-ipfs#master right now under a feature flag. Run `ipfs pubsub
--help` after build from source to try it out. It's also being worked on
getting into js-ipfs.

------
haadcode
Developer of Orbit here. Great to hear all the feedback, thank you!

Most questions have been already answered, but to clarify:

Orbit indeed uses IPFS pubsub ([https://github.com/ipfs/go-
ipfs/pull/3202](https://github.com/ipfs/go-ipfs/pull/3202)) for real-time
message propagation, no servers are involved. In addition, it uses orbit-db
([https://github.com/haadcode/orbit-db](https://github.com/haadcode/orbit-db))
- a distributed database on IPFS - for the message history, so the messages
are not ephemeral and the channel history can always be retrieved. This is a
really nice property and allows Orbit to work in "disconnected" or split
networks, as well as offline.

Orbit has been a testbed for IPFS applications and orbit-db came out of that
work, enabling various types of distributed, p2p applications and use cases:
comment systems, votes/likes/starring systems (with counters), feeds, etc. And
now with IPFS pubsub, we're finally at a point of being completely serverless
and distributed which is hugely exciting and opens so many doors for future
work!

I recently gave a talk at Devcon2 about Orbit and developing distributed real-
time applications ([https://ethereumfoundation.org/devcon/?session=orbit-
distrib...](https://ethereumfoundation.org/devcon/?session=orbit-distributed-
real-time-web3-apps-with-ipfs-and-ethereum)) and while the videos of the talk
are not out yet (afaik coming very soon!), there's the uncut video of the talk
here
[http://v.youku.com/v_show/id_XMTc1NjU1NzEyNA==.html?firsttim...](http://v.youku.com/v_show/id_XMTc1NjU1NzEyNA==.html?firsttime=5172)
if you're interested to learn more. Video of the demo I showed in the talk is
here [https://ethereumfoundation.org/devcon/wp-
content/uploads/201...](https://ethereumfoundation.org/devcon/wp-
content/uploads/2016/10/Orbit_demo.mov).

I'll be hanging out on #ipfs in Orbit if you're interested to try it out. Note
that the Electron app and the web version at orbit.libp2p.io don't talk to
each other atm (we're working on this), so I would highly recommend to try out
the Electron app.

While you're at it, try drag & dropping files and folders to a channel, that's
one of the coolest feature of Orbit atm imo :)

We're actively developing Orbit and making a push in the next few months, if
you're interested to take part in the design and development, or would like to
develop your own apps using the same tech, join us on Github
[https://github.com/haadcode/orbit/issues](https://github.com/haadcode/orbit/issues).

Thanks for the comments everyone, much appreciated!

------
fiatjaf
This is a perfect non-use-case for IPFS: ephemeral messages in a chat
application.

~~~
alpb
What makes it ephemeral? Does not IPFS store all objects forever?

~~~
fiatjaf
My point is that chat messages are meant to be ephemeral, so it was a waste to
store them in IPFS and hash them and make them identifiable by a unique
useless hash in the entire world forever.

But since I posted the comment I realized that this is actually a cool feature
for a chat app to have.

~~~
adrianratnapala
When I choose to use a chat application, of my reasons to use it is so that
there is an accessible record of the thing.

More concerning to me is with IPFS is privacy. I would want to encrypt it so
that only my chat partner and I could read it. But then would it be
interesting in enough to live for long on the network?

~~~
computerphage
IPFS isn't in the business of providing storage for free to users. If you want
it stored forever you should pin it or use a service that does the same. Just
because the name is permanent doesn't mean the data is unless it's in demand
from someone.

~~~
fiatjaf
The name is misleading, you must concede.

~~~
computerphage
What?

The name of a piece of data is cryptographically secure. It _is_ permanent,
but the data that is being named doesn't have to continue to exist on a hard
drive just because its name exists.

------
drdre2001
Is there a list of some active channels I can join?

------
botw
I like ipfs this name. but what does ip in ipfs stand for?

~~~
didip
interplanetary

------
crudbug
Does IPFS provide HTTP adaptor ?

~~~
lgierth
Yes there's an HTTP-to-IPFS gateway included in go-ipfs. It's what backs
[https://ipfs.io](https://ipfs.io), for example.

------
dwills
Another false headline. "serverless"? Nope. A redis server must be running.

~~~
aleken
I imagine an IPFS chat software could store it's necessary information in...
IPFS. So why involve redis?

~~~
kefka
Because IPFS only does distributed _storage_. It has no processing power or
logic to handle data transformations.

Now, one avenue to handle that is js-ipfs. In order to update things like IPNS
records, you need the private key of the node you're trying to change.
Interestingly enough, and machine with the pub/priv key can submit an IPNS
change.

So effectively, you could have a shared repo like Usenet, where everyone has
the pub/priv key and pushes updates via js-ipfs. Although, I could imagine
easily how that could get super-heavy.

_________________________

Another idea I had, was to build something akin to AWS lambda, except using
Tor Hidden Services, and Erlang. It would be effectively a private computation
cloud. The reason for the HS is so each machine, regardless of their location,
could always talk with each other, using Erlang's built--in networking
support. (I am using non-standard applications of Tor Hidden Services - read
more what I'm doing here: [https://hackaday.io/project/12985-multisite-
homeofficehacker...](https://hackaday.io/project/12985-multisite-
homeofficehackerspace-automation) )

~~~
mirimir
That's very cool! Have you looked at OnionCat? I've managed a global LizardFS
cluster on a PeerVPN network, overlayed on OnionCat IPv6. Latency is too high
for erasure coding or XOR goals, but chunk-replication mode works reliably.

