# Why not just a DHT of who has which file?

**URL:** <https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934>\
**Category:** Help\
**Created:** [April 15, 2021, 2:57pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934 "2021-04-15T14:57:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 2:57pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/1 "2021-04-15T14:57:09Z")

</div>

wouldn’t it reduce the size of DHT if instead of chunks we maintained a hash of files and who has them , and then the node that needs that file could ask for a chunk of that file from those who have it .  
this will avoid the problem of data duplication that IPFS currently has .  
what is the point in giving each chunk of a file a separate identity ?

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 3:08pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/2 "2021-04-15T15:08:32Z")

</div>

like right now , for each file IPFS demands an extra space bigger than the file itself to store the chunks of the file . wouldn’t it make more sense if IPFS just took the hash and path of that file and advertise it on the network instead of making a duplicate bigger than the initial data .

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 3:10pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/3 "2021-04-15T15:10:08Z")

</div>

or even better , we could tell IPFS whatever file is put in this specific path , automatically hash it and tell the network that you have it . and provide nth chunk anytime another node asks for an nth chunk .  
without dissecting the poor file and storing it in a dissected state .  
that forces the OS to reconstruct the main file from the chunks every time we need that file and adds extra work .

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [April 15, 2021, 3:17pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/4 "2021-04-15T15:17:22Z")

</div>

Chunking allows you to potentially deduplicate portions of a file. It also allows you to retrieve different blocks from different nodes. There was a previous discussion of ideas for resolving files be the complete file hash rather than the merkel root.

If you just ask for the nth chunk you have no way of verifying that the entire is correct until you’ve collected all the chunks and no way of knowing which chunk is corrupt

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 3:19pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/5 "2021-04-15T15:19:02Z")

</div>

how often two files have identical blocks ?  
the mathematical chance is one over 2 to the power of 256000 .

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 3:35pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/7 "2021-04-15T15:35:04Z")

</div>

ahh you’re right , we need to know which chunk is corrupt . instead of flushing the entire 10GB file and redownload it again .

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 5:03pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/8 "2021-04-15T17:03:04Z")

</div>

but is it necessary to store the data and the metadata combined ?  
couldn’t we just store the hash of the nth chunk in the IPFS engine and the data itself in the file ?

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [April 15, 2021, 5:48pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/9 "2021-04-15T17:48:36Z")

</div>

I think the —raw-leaves option might be somewhat analogous to what you’re talking about or at least the filestore which requires the raw leaves option.

One nice thing about storing them combined is you don’t need a separate mechanism for sharing the metadata than you do for the data. Metadata is just data afterafterall.

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 7:02pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/10 "2021-04-15T19:02:00Z")

</div>

so IPFS tries to impose a new unified approach to data , instead of respecting the old order and trying to maintain a harmony with it .

---

<div class="post-metadata">

**Author:** ![zacharywhitley](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/zacharywhitley/32/2670_2.png) [@zacharywhitley](https://discuss.ipfs.tech/u/zacharywhitley)\
**Post date:** [April 15, 2021, 7:06pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/11 "2021-04-15T19:06:09Z")

</div>

Relax, this is IPFS not Anakin Skywalker.

---

<div class="post-metadata">

**Author:** ![bellbird](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@bellbird](https://discuss.ipfs.tech/u/bellbird)\
**Post date:** [April 15, 2021, 7:12pm UTC](https://discuss.ipfs.tech/t/why-not-just-a-dht-of-who-has-which-file/10934/12 "2021-04-15T19:12:03Z")

</div>

come on , don’t try to be humble , this is IPFS .  
IPFS is packed with ambition even in its name .
