Why is ipfs url different now?

I have recently upgraded to the latest version and I noticed now a hash number is first followed by ipfs.localhost:8080/.

For example before the URL looked like http://localhost:8080/ipfs/Qm...

Now the URL looks like <hash>.ipfs.localhost:8080

The two questions I have are:

  1. What is this new hash? It doesn’t match the CID I get from ipfs on the command line which starts with Qm.

  2. Why does the URL now look like a subdomain starting with this new hash?

The changes you observe are based on https://github.com/ipfs/specs/issues/247#issuecomment-614742033

The answer to question #2 is best described here: https://github.com/ipfs/go-ipfs/issues/5982#issue-408601450. That is: by giving each “root cid” a subdomain on its own, you can serve a webapp that is properly secured client-side (by the browser itself).

URLs are case-insensitive, so the original base58 Qm… stuff is a no-go. This is why the different base for the CID encoding. The power of multiformats allows this to be the very same CID, for instance these are all the same thing:


You can play with converting your own cid’s via:
ipfs cid format -v 1 -b <chosenbase> <cid>

to get a list of supported encoding bases:
ipfs cid bases


Thank you for the links and explanation. This clears up so much. So just so I understand this. The reason the new CID begin with ba is because it is hashed with sha256 and base32 encoded?

The decompositions of

can be seen here ( in the same order ):

You could also check out the insanely awesome https://proto.school/#/anatomy-of-a-cid

1 Like