Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Verify hashes on each request #397

Closed
aakilfernandes opened this issue Oct 20, 2016 · 4 comments
Closed

Verify hashes on each request #397

aakilfernandes opened this issue Oct 20, 2016 · 4 comments

Comments

@aakilfernandes
Copy link

aakilfernandes commented Oct 20, 2016

My understanding is that after getting a file from a node, there is no additional check to verify the returned file matches the hash. It would be good to hash the file in the client to make sure the file is correct. That way, it would be possible to use untrusted nodes (for example https://ipfs.infura.io)

@aakilfernandes aakilfernandes changed the title Request: Verify ipfs.get by hashing locally Request: Verify ipfs.get by hashing in client Oct 20, 2016
@nycoliver
Copy link

IPFS definitely verifies data from other nodes. See white paper, section 3.5. I think https://github.com/ipfs/go-ipfs/blob/master/exchange/bitswap/message/message.go#L105 is where blocks from peers are checked. Am I misunderstanding your question?

@aakilfernandes
Copy link
Author

aakilfernandes commented Oct 21, 2016

Ipfs nodes don't trust each other, but js-ipfs-api trusts the node. For example if I do

ipfsApi = IpfsApi(host, port)
ipfsApi.get('Qm...')

I'm trusting that the node at host:portis not lying to me. This is fine if we assume the user is using a local node on their machine, however users could be using remote nodes. For example https://infura.io/.

@nycoliver
Copy link

Oh I see. The simplest solution I can think of is to expose ipfs add --only-hash in the js api so you can compare the two hashes.

@daviddias daviddias changed the title Request: Verify ipfs.get by hashing in client Verify hashes on each request Jul 26, 2017
@hacdias
Copy link
Contributor

hacdias commented Apr 30, 2018

onlyHash is supported since #717 so shall we close this @diasdavid?

@hacdias hacdias closed this as completed Apr 30, 2018
@ghost ghost removed the ready label Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants