{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/3388","repository_url":"https://api.github.com/repos/syncthing/syncthing","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/3388/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/3388/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/3388/events","html_url":"https://github.com/syncthing/syncthing/issues/3388","id":163784509,"number":3388,"title":"Use decentralized discovery (DHT)","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/syncthing/syncthing/labels/enhancement","name":"enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/syncthing/syncthing/milestones/11","html_url":"https://github.com/syncthing/syncthing/milestones/Unplanned%20(Contributions%20Welcome)","labels_url":"https://api.github.com/repos/syncthing/syncthing/milestones/11/labels","id":1479707,"number":11,"title":"Unplanned (Contributions Welcome)","description":"Issues that no-one is currently working on or has the intention to work on anytime soon. We welcome any and all help with resolving these issues.","creator":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"open_issues":151,"closed_issues":42,"state":"open","created_at":"2016-01-01T11:33:57Z","updated_at":"2016-07-05T07:06:46Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-07-05T07:06:46Z","updated_at":"2016-07-07T17:34:54Z","closed_at":null,"body":"It's probably time to investigate decentralizing discovery. Doing so would reduce our infrastructure burden and reduce centralized knowledge of the network. In a DHT we want to be able to look up the contact details for a given device ID. We want to publish our own contact details into the DHT. We don't necessarily want to make it simple for a passive observer to map the entire network, so it would be nice if the contact details were encrypted. I suggest that we could use a key-value database laid out like:\r\n\r\nKey: SHA256(device ID)\r\n\r\nValue: The contact details, in protobuf format, encrypted using the device ID as a shared secret.\r\n\r\nGiven that I know the device ID I'm looking for, I can then hash it and look it up, and decrypt the answer. For other nodes in the network, the data is mostly gibberish as you need to know the device ID it represents to be able to interpret it and reversing the SHA256(device ID) to an actual device ID is not feasible.\r\n\r\nAs far as an actual implementation goes I've surveyed the Go ecosystem to try to find a suitable DHT package. So far I've not really succeeded. Here are the ones I've looked at and some notes on them; it would be lovely if someone did find or develop a good package for this.\r\n\r\n- https://github.com/nictuku/dht seems to be the best candidate, but a partial implementation - only supports looking up nodes for an \"info hash\", not storing or retrieving actual values? maybe could be built upon\r\n- https://github.com/fastfn/dendrite looks like a full implementation and may be usable, though annoying dependencies (0MQ transport), may require some rewriting\r\n- https://github.com/distributed/malus toy project, last commit 6 years ago\r\n- https://github.com/cfromknecht/kademlia partial implementation, uses TCP?\r\n- https://github.com/worldveil/peerchat student project, abandoned?, no license\r\n- https://github.com/zhujun1980/dhtrobot looks sort of promising, need to get past the chinese docs\r\n- https://github.com/gr0gmint/godht incomplete, abandoned\r\n- https://github.com/chuckha/dht partial implementation, TCP based\r\n- https://github.com/Hermes/ghord bare bones, maybe usable as a base for something\r\n- https://github.com/benjojo/NorthStar the authors themselves hate this code\r\n- https://godoc.org/github.com/r-medina/gmaj partial, lots of TODOs\r\n\r\nIf anyone wants to pick this up and run with it, please do so, and announce yourself in the comments below :)"},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/231151139","html_url":"https://github.com/syncthing/syncthing/issues/3388#issuecomment-231151139","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/3388","id":231151139,"user":{"login":"cdhowie","id":354641,"avatar_url":"https://avatars.githubusercontent.com/u/354641?v=3","gravatar_id":"","url":"https://api.github.com/users/cdhowie","html_url":"https://github.com/cdhowie","followers_url":"https://api.github.com/users/cdhowie/followers","following_url":"https://api.github.com/users/cdhowie/following{/other_user}","gists_url":"https://api.github.com/users/cdhowie/gists{/gist_id}","starred_url":"https://api.github.com/users/cdhowie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdhowie/subscriptions","organizations_url":"https://api.github.com/users/cdhowie/orgs","repos_url":"https://api.github.com/users/cdhowie/repos","events_url":"https://api.github.com/users/cdhowie/events{/privacy}","received_events_url":"https://api.github.com/users/cdhowie/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T17:34:54Z","updated_at":"2016-07-07T17:34:54Z","body":"> The \"store garbage\" attack is much more worrying to me.\r\n\r\nA realization I just had is that any kind of verification mechanism put in place to avoid a garbage attack would have to incorporate a timestamp, or it would be susceptible to a replay attack, where a previous (valid) value is stored under the same key.  For mobile clients that are constantly changing IPs, this could prevent any nodes from connecting to them."}}
{"actor":{"display_login":"cdhowie"}}