Categories
Blog

Tor support in scuttlebot

For the past year I have spent some time on a distributed system called scuttlebot. Scuttlebot using gossipping to distribute message and is a true decentralized system. What is interesting is that the applications built on this platform shares the same decentralized thinking. There is a twitter/facebook clone and a github clone. In git-ssb-web you can do the normal fork/pull request workflow or you can use the web of trust built into scuttlebot to allow multiple people to write to the same repo, so you get the best of both subversion and git. I have built an entity database inspired by CQRS on top of scuttlebot, that handles writes and reads separately and  allows one to reason about concurrent writes to objects in a way that minimizes conflicts in 170 lines of javascript.

My latest contribution to the project is to add tor support. Meaning that the gossiping works in hostile network environments and you get location transparency for free. Tor seems like a perfect fit for scuttlebot and allows for censorship resistant distributed systems to be built. The following is a small guide for settings up a scuttlebot node (or pub in their terminology) on tor.

Configure tor to expose a hidden service on external port 8888 to
8008 locally (/etc/tor/torrc):

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 8888 127.0.0.1:8008

Then setup sbot to use the onion address:

sbot server –host <YOURONIONADDR>.onion –port 8008

Thats it!

Please note that scuttlebot will make connections to non-tor nodes, so if you don’t want to expose your pubs ip and only have it communicate over tor, you need to pass it a –tor-only flag as well. The latest 9.4 is needed for this to work.

You can join my existing pub with the following invite code:

sbot invite.accept 355ij5sv346bpih2.onion:8888:@lbocEWqF2Fg6WMYLgmfYvqJlMfL7hiqVAV6ANjHWNw8=.ed25519~t7UhT15nIaDoWbdTZHVg4HJ1VHcmtl/FOplSyQfn03E=