{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/2387","repository_url":"https://api.github.com/repos/ipfs/go-ipfs","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/2387/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/2387/comments","events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/2387/events","html_url":"https://github.com/ipfs/go-ipfs/issues/2387","id":135393163,"number":2387,"title":"Can I use IPFS DHT to store arbitrary key-value pairs?","user":{"login":"sivachandran","id":292921,"avatar_url":"https://avatars.githubusercontent.com/u/292921?v=3","gravatar_id":"","url":"https://api.github.com/users/sivachandran","html_url":"https://github.com/sivachandran","followers_url":"https://api.github.com/users/sivachandran/followers","following_url":"https://api.github.com/users/sivachandran/following{/other_user}","gists_url":"https://api.github.com/users/sivachandran/gists{/gist_id}","starred_url":"https://api.github.com/users/sivachandran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivachandran/subscriptions","organizations_url":"https://api.github.com/users/sivachandran/orgs","repos_url":"https://api.github.com/users/sivachandran/repos","events_url":"https://api.github.com/users/sivachandran/events{/privacy}","received_events_url":"https://api.github.com/users/sivachandran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-22T11:42:15Z","updated_at":"2016-03-06T21:25:35Z","closed_at":null,"body":"I basically want to store key-value pairs in the distributed network and later retrieve value for a specific key. A related topic is already discussed here https://github.com/ipfs/notes/issues/4 but I am not sure about the current implementation status of it.\r\n\r\nI understand IPFS stores the hash to object/block mapping in DHT using this package https://github.com/ipfs/go-ipfs/blob/master/routing/dht/dht.go. So I am wondering whether I can use the same DHT package to store my own key-value pairs.  But my keys won't be hash of the value that I store in the DHT. As this is contrary to how IPFS uses the DHT I am not sure whether I can do this or will it create any problem in how IPFS functions.\r\n\r\nSo can someone tell me whether I can use the IPFS DHT to store arbitrary key-value pairs or is there a better way to do.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments/193000402","html_url":"https://github.com/ipfs/go-ipfs/issues/2387#issuecomment-193000402","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/2387","id":193000402,"user":{"login":"ianopolous","id":179418,"avatar_url":"https://avatars.githubusercontent.com/u/179418?v=3","gravatar_id":"","url":"https://api.github.com/users/ianopolous","html_url":"https://github.com/ianopolous","followers_url":"https://api.github.com/users/ianopolous/followers","following_url":"https://api.github.com/users/ianopolous/following{/other_user}","gists_url":"https://api.github.com/users/ianopolous/gists{/gist_id}","starred_url":"https://api.github.com/users/ianopolous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianopolous/subscriptions","organizations_url":"https://api.github.com/users/ianopolous/orgs","repos_url":"https://api.github.com/users/ianopolous/repos","events_url":"https://api.github.com/users/ianopolous/events{/privacy}","received_events_url":"https://api.github.com/users/ianopolous/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T21:25:35Z","updated_at":"2016-03-06T21:25:35Z","body":"You could use a content-addressed btree. I implemented one at: https://github.com/ianopolous/merkle-btree\r\nOr there's a version specifically adapted to IPFS (using the Java HTTP API) at: https://github.com/ianopolous/Peergos/tree/master/src/peergos/server/merklebtree\r\n\r\nThen you just need to pin the root of the btree."}}