Note: If CID bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
is CIDv2, then please ignore this question.
Greetings!
I am reading an article about IPFS and I have downloaded this file bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
.
Because this CID refers to a single file, I have expected it to represent the hash of the file itself, yet the CID hash and the checksum of the file differ, provided that this is CIDv1.
$ ipfs get bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
Saving file(s) to bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
155.88 KiB / 155.88 KiB [=============================================================] 100.00% 0s
$ sha1sum bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
4effb299ca044c1efa1279038b33454dd91a8024 bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
$ sha256sum bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
1abced61e25c1ddcd5e52e1f7171e7f352293eaf52344713f07dd0f707ca717e bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy
If this CID is CIDv1, then why are the hashes differ?
References:
- What's IPFS and how it compares to BitTorrent - Daniel Norman
- An IPFS guide for newbies? - #3 by danieln
- ipfs://bafkreia2xtwwdys4dxonlzjod5yxdz7tkiut5l2sgrdrh4d52d3qpstrpy