Who decides what hashing algorithms IPFS allows?

There’s an issue raised in the ipfs/docs repo regarding documentation on CIDs. Essentially:

  1. What type of hashing algorithm does IPFS use?
  2. Is there any kind of future-proofing for the hash type?
  3. Who decides what hash types IPFS uses?

The first two answers are below, but the third is open for discussion here.


  1. What type of hashing algorithm does IPFS use?

IPFS uses sha-256 by default, but there is support for a bunch of other algorithms. The Mulithash project represents the work for this.

  1. Is there any kind of future-proofing for the hash type?

This is already covered mainly by the first question. Juan did a presentation explaining the steps IPFS is taking to make sure that the project doesn’t go the way of the dodo.

  1. Who decides what hash types IPFS uses?

The answer to this question isn’t obvious right now. It’d be cool to open up the discussion and figure out how we’re dealing with this.

Who decides what hash types IPFS uses?

You do - you can specify --hash when using ipfs add to use a different hashing function.

https://docs.ipfs.io/reference/api/cli/#ipfs-add

Note that because IPFS finds content by multihash, using a different hashing algorithm from the default will restrict the number of peers the content can be retrieved from. This is because other peers that actually do have that same content will be identifying it by a different hash.

1 Like

currently we have a list of supported hash algoritms. I think that the question is related to know who is going to decide which other hash algorithms IPFS will support. Or I am wrong and the hash functions are already pluggable?

I don’t think there’s a formal process for deciding which hash functions are available right now, but Multiformats and IPFS are both open source projects so adding support for a hashing function is just a PR away. If the lead maintainers and community agree it’ll likely be accepted.

Yeah, I think the main point of the who decides question was who are the people in charge of making the decision to implement a particular hash function. So since Multiformat is open-source, the answer to the question is the community (via a GitHub issue/PR).

“via GitHub issue/PR” not sound like a centralized approach?
Why not implement a plaggable hash function? An hash function that can be activated with a public key? We need to think also about the privacy and ownership of the file content.