{"id":16192208,"url":"https://github.com/cretz/tor-dht-poc","last_synced_at":"2025-03-19T03:31:06.063Z","repository":{"id":57504419,"uuid":"139121940","full_name":"cretz/tor-dht-poc","owner":"cretz","description":"Anonymous DHT Accessible from Executable or Tor-Enabled Browser","archived":false,"fork":false,"pushed_at":"2018-08-22T18:19:42.000Z","size":48,"stargazers_count":53,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-28T15:11:54.647Z","etag":null,"topics":["ipfs","tor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cretz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-29T08:18:59.000Z","updated_at":"2025-01-23T05:12:00.000Z","dependencies_parsed_at":"2022-08-30T03:40:56.153Z","dependency_job_id":null,"html_url":"https://github.com/cretz/tor-dht-poc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cretz%2Ftor-dht-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cretz%2Ftor-dht-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cretz%2Ftor-dht-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cretz%2Ftor-dht-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cretz","download_url":"https://codeload.github.com/cretz/tor-dht-poc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965719,"owners_count":20375920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipfs","tor"],"created_at":"2024-10-10T08:09:18.544Z","updated_at":"2025-03-19T03:31:05.769Z","avatar_url":"https://github.com/cretz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tor DHT PoC\n\nThis is a proof of concept to show that we can advertise onion services in Go and discover them in Go or JS.\n\n**Goals**\n\n* In Go, all network interaction over Tor\n  * Use existing tested DHT code (e.g. BT mainline or IPFS)\n  * Broadcast different onion addresses for a key\n  * Discover different onion addresses for a key\n* In browser (all network interaction doesn't have to be in Tor since it will run in Tor Browser, so no WebRTC)\n  * Use existing tested DHT code (e.g. BT mainline or IPFS)\n  * Discover different onion addresses for a key\n\nProbably choosing IPFS here due to WebTorrent's requirement on WebRTC which Tor Browser doesn't implement.\n\n**Results**\n\n* Go - SUCCESS!! See the [go-tor-dht-poc/](go-tor-dht-poc)'s README.md for details\n* JS - SUCCESS!! See the [js-tor-dht-poc/](js-tor-dht-poc)'s README.md for details\n\n**Usage Quick Overview**\n\nOk, so now that we have success in both places, we can show a quick overview of how to use it. This assumes that\n`GOPATH` is set with this repo properly checked out in it and that latest stable versions of Go, Tor, and nodejs/npm are\ninstalled and on the `PATH`.\n\nIn this test, we create 5 nodes, say that 2 of them provide a certain type of service, and in both the Tor browser and\nGo command line, we determine those 2 from the DHT starting with any of the 5 addresses. All over Tor and anonymous.\n\nFirst, provide the 5 nodes. Build and run the executable to create the DHT and \"provide\" the services:\n\n    go build \u0026\u0026 go-tor-dht-poc provide\n\nThis will take a sec to build the DHT. The output (sans some Tor warnings):\n\n    2018/07/10 16:54:32 Created peer #1: gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x\n    2018/07/10 16:54:49 Created peer #2: vn5sgarqtdmzl27cnbrsfchkmrwm5erjb6jtmcwqras6qmhpmf6mahqd:52519/QmY9tHQMGUVg7xBnLiKGN81J9DCrns5KS4jK8wn8CwqHym\n    2018/07/10 16:55:11 Created peer #3: my4f2m3yggnnpoeacjgwie5gc5yxeshzgvu5eukx7lodwgmwf2ek52yd:52523/QmRLFFGsVv6uq1WbHhZjA2gknRUwQTyLGdiTAs344egWp8\n    2018/07/10 16:55:25 Created peer #4: q2fdsiu7eyoj42iii5o44rnrhxncnljexu6zncw44bpdk3udoveyi6ad:52528/QmNQanzjr862heY5ndTuMQPhbEa8GfyniVk6dhkoGXb5MS\n    2018/07/10 16:55:35 Created peer #5: lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG\n    2018/07/10 16:55:35 Providing key on the first one (gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x)\n    2018/07/10 16:55:37 Providing key on the last one (lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG)\n    2018/07/10 16:55:42 Press enter to quit...\n\nSo the 5 nodes were created and we are marking #1 and #5 as \"providers\". Now, we can connect to this DHT through any of\nthe nodes and find that #1 and #5 are the providers. With this running, in a new console issue a \"find\" and provide,\nsay, peer #2's address (don't need to build, already did above):\n\n    go-tor-dht-poc find vn5sgarqtdmzl27cnbrsfchkmrwm5erjb6jtmcwqras6qmhpmf6mahqd:52519/QmY9tHQMGUVg7xBnLiKGN81J9DCrns5KS4jK8wn8CwqHym\n\nAfter a sec, here's the output:\n\n    2018/07/10 16:58:17 Found data ID on gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x\n    2018/07/10 16:58:17 Found data ID on lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG\n\nNow let's connect to this DHT from the Tor browser and find them that way. With the DHT \"provide\" still running,\nnavigate to `js-tor-dht-poc`. Run `npm install` to install dependencies and to prepare `index.js` for use at\n`public/index.js`, run `npm run browserify`. This makes a fairly large JS file that our page uses. Now, to start the web\nserver, build and run the executable via:\n\n    go build \u0026\u0026 js-tor-dht-poc\n\nThe output will be something like:\n\n    Open Tor browser and navigate to http://n6ls3ltbmoyv2ucblvwz7skjg6mmajt6zfi33skwbhanomgexye6r5ad.onion\n    Press enter to exit\n\nNow take that address and open it in the Tor browser (it may take a bit for the large JS file to load). Now take any\npeer address, say, peer #4 this time and put it in the text box and click `Find Providers. The result after a some time\nshould be similar to:\n\n    Found 2 peers\n    gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd.onion:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x\n    lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd.onion:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG\n\nYay, you have an anonymous DHT that can be joined by other programs and have pieces discovered via other programs or via\na Tor-enabled browser.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcretz%2Ftor-dht-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcretz%2Ftor-dht-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcretz%2Ftor-dht-poc/lists"}