This is a conceptual question around IPFS protocol. I’ve read the DHT document from
ipfs.tech and a high-level run-down of what I got from it is as follows:
(1) the hash of the record key we’re looking for indicates which nodes are likely to store a provider record for that data and
(2) a peer can traverse the peer graph efficiently (due to the skiplist-like routing table and the peer ordering with sha256(peerID) taken as integer) and therefore ask the right nodes for the provider records.
This makes sense as long as hash(record key) is stored at around nodes with hash(peerID) being close to hash(record key). Please correct if my understanding so far is inaccurate.
Now the provider record PUT procedure in the ipfs.tech doc is:
- Do a standard lookup for the
Kclosest peers to
- Put the provider record at those K closest peers, and also store it ourselves.
- Currently, you are only allowed to put a provider record for yourself. Alice cannot advertise that Bob has content.
Why would would the node store the provider record itself - the original node that’s doing this may be far distance to the nodes where the data should be? Shouldn’t just the nodes whose hash(peerID) is in proximity of the data hash store the provider record? How are other nodes supposed to benefit from the fact that some random node in the network also has a provider record for that data hash?