
Telehash: JSON+UDP+DHT = Freedom - bkudria
http://www.telehash.org/
======
jeremie
It's a little on the young side yet, and I have to prove out some of the
apps/demos of it at scale, but it's coming along very nicely and shows a lot
of promise.

Ultimately it's a public DHT that enables apps to punch through the NATs (to
go direct device-to-device) and talk JSON to each other. It doesn't solve all
the problems you face being distributed, but it's a good start :)

~~~
jamii
Are you aware of <http://libswift.org/> ? The goals are different (swift is
targeted more at bittorrent/multicast) but I think there is a lot of potential
for crossover between the two projects.

------
aston
Jeremie Miller is the guy behind XMPP, so this is coming from somebody who
really knows what he's doing when it comes to protocols.

This type of thing would be cool as a federation mechanism for something like
Google Wave or Diaspora. I think it could also be used as an alternative to
XMPP itself...

~~~
bkudria
I agree with you, but I can see how some might strenuously object - XMPP is
not universally loved.

(Luckily Telehash uses JSON)

~~~
jemfinch
"Luckily"? If the protocol were to catch on, imagine how many terabits of
bandwidth would be wasted by such an unnecessarily verbose and redundant
protocol. Imagine how many CPU-years will be wasted parsing and unparsing the
packets. Imagine how much memory wasted because packets can't be processed as
they come off the wire, but must be buffered in their entirety before they can
be parsed.

This is exactly the sort of thing libraries like Google's Protocol Buffers and
Facebook's Thrift were invented for, both of which are open source.

Optimizing for human readability using netcat just doesn't make sense for
potentially core protocols such as this one.

~~~
zachrose
What's "unparsing?"

(Not being snarky. Genuinely curious.)

~~~
loup-vaillant
That's serializing: when you go from a data structure to a text file. The
exact reverse of "parsing", actually.

------
cwp
Ok, possibly interesting. What's it for? The about page says it's for sending
small bits of JSON around. Why would I want to do that?

~~~
lukeschlather
This wiki page seems a little clearer, though anything prefaced with "My
Understanding" might be a little suspect.

[https://github.com/quartzjer/TeleHash/wiki/My-
Understanding-...](https://github.com/quartzjer/TeleHash/wiki/My-
Understanding-of-the-TeleHash-Protocol)

So my understanding of that is that TeleHash is something of a cross between
BitTorrent and Tor. Theoretically it allows for a totally distributed
Internet. Though it looks like the implementation is rough, so it's hard to
say how well-defined the protocol is.

~~~
Mizza
Not like Tor, nor like BT, really.

It's more like.. Gnutella and JSON?

------
y0ghur7_xxx
This could be combined with <http://www.unhosted.org/> to deliver completely
distributed applications.

------
scrame
UDP does not guarantee connections. I wonder why it was done with this instead
of a reliable multicast protocol (0mq comes to mind).

~~~
dedward
0mq is a library to make network programming easier, not a new protocol
itself.

UDP is being used because this is based on setting up a DHT which requires
small messages that may or may not get through by nature to begin with - not
bulk data transfer - presumably you deal with that at higher layers.

~~~
scrame
0mq is an extension of the standard socket library and does support a reliable
multicast protocol. It adds to sockets, its not just an api to make working
with the existing standards easier.

[http://manpages.ubuntu.com/manpages/maverick/man7/zmq_pgm.7....](http://manpages.ubuntu.com/manpages/maverick/man7/zmq_pgm.7.html)

Though, it looks like it might need more permissions than just using standard
sockets.

------
phuff
Telehash is being proposed and bootstrapped by Jeremie Miller the guy who
originally did XMPP. I think it has some good potential to allow better
decentralized communication between things like mobile devices, etc.

------
Deejahll
"TeleHash is the culmination of years of discussions with many people, and is
being primarily bootstrapped by Jeremie Miller."

This is the same Jeremie Miller who invented the Jabber (XMPP) protocol.

------
Groxx
".see" as a property seems it could get a little annoying in many languages,
given that period - you can't map keys directly. Why "." and not some other
character? I'd think common unary characters should be avoided, as they may
not be unambiguous in language-X, but why periods? And since there are periods
and plusses, why not go hog-wild, and allow "^supercommand", "$(&@^!boom", and
others?

~~~
dochtman
Might be cleaner to separate headers and contents. I.e. {"h": {"ring": 43723},
"c": {"see": ["5.6.7.8:23456","11.22.33.44:11223"]}}. Get h for headers, c for
commands, s for signals and d for data. Gets you a clean separation, no faux
namespacing.

------
brandon
I'd love to see a DHT network with some level of attention to _durability_.

Having played a lot with Kademlia, the biggest bummer was that in practice,
stored resources had a lifetime of about 4 hours max, and that was _when_ the
requester was able to find the node holding your resource. This necessitated
spamming your important resources pretty frequently to a redundant set of
deterministic keys.

------
bobf
It would be interesting to see this used in a non-public fashion, like for
maintaining a distributed MongoDB-like system.

------
senthil_rajasek
This uses UDP with a non-standard port. Personally, I would be wary of poking
a hole in my firewall to make this work.

~~~
brandon
Why, exactly? To your point, it uses UDP on a non-standard port; forwarding
the traffic won't expose any of your existing behind-the-firewall services.

Anyhow, one of the draws of UDP for this stuff is that it's possible to do
clever hole punching so that you don't _have_ to open the port.
<http://en.wikipedia.org/wiki/UDP_hole_punching>

------
pbrumm
I like the idea. Having the data be encrypted would be cool too. A time-to-
live would be nice so that it doesn't grow forever.

Although it sounds like an easy place for virus writers to store plans of
attack. And hard to take down without taking down the whole system which by
design would be very difficult.

------
jaimzob
Looks very cool but are there particular advantages over, say, Scribe over
FreePastry (<http://www.freepastry.org/SCRIBE/default.htm>)? How does routing
efficiency compare?

------
mey
Why couldn't this be done over TCP instead of UDP?

~~~
zacharypinter
Might be for NAT traversal, ala something like:

<http://en.wikipedia.org/wiki/UDP_hole_punching>

One of the wiki pages ([https://github.com/quartzjer/TeleHash/wiki/My-
Understanding-...](https://github.com/quartzjer/TeleHash/wiki/My-
Understanding-of-the-TeleHash-Protocol)) specifically talks about working with
NAT: "Packets can continue to pass through NAT network devices like home
routers"

------
zemanel
first thing i thought when reading this was "distributed twitter"

