# Why has same sub cids but not same root cid?

**URL:** <https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810>\
**Category:** Help\
**Tags:** js-ipfs, ipld, go-ipfs, files\
**Created:** [August 4, 2020, 3:41pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810 "2020-08-04T15:41:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluelovers](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/bluelovers/32/3610_2.png) [@bluelovers](https://discuss.ipfs.tech/u/bluelovers)\
**Post date:** [August 4, 2020, 3:41pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/1 "2020-08-04T15:41:46Z")

</div>

[https://explore.ipld.io/#/explore/QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn](https://explore.ipld.io/#/explore/QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn)

[https://explore.ipld.io/#/explore/QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu](https://explore.ipld.io/#/explore/QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/a/ac036fdb1b814a79e54430428528d373c5a76f5e.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/8/8688985d45b32228a16ca7932841f9f258f32b34.png)

---

<div class="post-metadata">

**Author:** ![adin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/adin/32/2679_2.png) [@adin](https://discuss.ipfs.tech/u/adin)\
**Post date:** [August 4, 2020, 3:49pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/2 "2020-08-04T15:49:54Z")

</div>

@bluelovers I can’t get access to `QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn` to see what it looks like. However, the hashes will be different if the names of the files are different. I can’t see the full name of the php file, but if it ends with some different characters that will change the hash.

Edit: @bluelovers I took a look at those objects and the difference is that the “size” field reported for each of those two blocks is different.

For UnixFS (which is the format you’re currently working with): In order to help with programs that want to estimate “how big” a given file/directory is without actually downloading it the parent directory contains a reference to the size of the file referenced by CID. For some reason it appears that your files are being reported as having different sizes.

QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu:

- hof.zip : size 20010278
- php… : size 23016923

QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn:

- hof.zip : size 20015062
- php… : size 23022389

How did you create these UnixFS objects?

---

<div class="post-metadata">

**Author:** ![bluelovers](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/bluelovers/32/3610_2.png) [@bluelovers](https://discuss.ipfs.tech/u/bluelovers)\
**Post date:** [August 4, 2020, 5:22pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/3 "2020-08-04T17:22:09Z")

</div>

> [@adin](#):
>
> @bluelovers I can’t get access to `QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn` to see what it looks like.

need use ipfs desktop or something else

i don’t know why [ipfs.io](http://ipfs.io) can access, but [ipld.io](http://ipld.io) can’t  
[/ipfs/QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn/](https://ipfs.io/ipfs/QmdvbTgdaoqYV2rmh6raYT5pWZ7Lujhz73M6xtaRcC5xXn)  
[https://ipfs.io/ipfs/QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu](https://ipfs.io/ipfs/QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu)

> [@adin](#):
>
> I can’t see the full name of the php file, but if it ends with some different characters that will change the hash.

full name is same

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/9/96f03aa3aa1fff2063428586a1c59ef6683b7349.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/3/3d567f1e920f715a086183099c6a8e8666978f94.png)

* * *

> [@adin](#):
>
> How did you create these UnixFS objects?

one is by ipfs desktop  
one is by [https://share.ipfs.io](https://share.ipfs.io)

file is same file in local pc

---

<div class="post-metadata">

**Author:** ![adin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/adin/32/2679_2.png) [@adin](https://discuss.ipfs.tech/u/adin)\
**Post date:** [August 4, 2020, 6:04pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/4 "2020-08-04T18:04:46Z")

</div>

Thanks. It looks like for some reason go-ipfs and share determine the files to be different sizes.

---

<div class="post-metadata">

**Author:** ![bluelovers](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/bluelovers/32/3610_2.png) [@bluelovers](https://discuss.ipfs.tech/u/bluelovers)\
**Post date:** [August 4, 2020, 7:11pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/5 "2020-08-04T19:11:23Z")

</div>

> <https://github.com/ipfs/js-ipfs/issues/3209>
>
> Version:
> 
> Platform:
> 
> Subsystem:
> 
> Severity:
> Description:
> https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/3
> Steps to reproduce the error:
> upload file by ipds-desktop and https://share.ipfs.io/

---

<div class="post-metadata">

**Author:** ![ipfsme](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/ipfsme/32/3907_2.png) [@ipfsme](https://discuss.ipfs.tech/u/ipfsme)\
**Post date:** [August 7, 2020, 9:04pm UTC](https://discuss.ipfs.tech/t/why-has-same-sub-cids-but-not-same-root-cid/8810/6 "2020-08-07T21:04:52Z")

</div>

Both sets of files show exactly the same size on my end.

- `cmp` shows zero differences in binary content.
- `cksum` shows no difference in content.

However, the files listed under `QmbHK4rKG1p87DTnemXrhh9QSxZk6xBCSHg5E985MEH1Zu` seem to be missing their last modified date information. It’s set to the start of UNIX Epoch.

As a test, I created 2 simple text files, copied them, modified the “last modified” date to the start of Epoch and added both sets of directories. However, I got back the same CIDS for each set.

So, I can’t duplicate your problem. And I don’t seem to have the same problem as @

I’m using V 0.6.0
