How does IPNS interact with the DHT?

From @raptortech-js on Tue Dec 06 2016 21:52:22 GMT+0000 (UTC)

It’s my understanding that you can use IPNS to publish a mutable value linked to your public key, e.g. with https://github.com/whyrusleeping/ipns-pub or the standard cli client. I believe that this key/value pair is distributed directly on the DHT. However, I’ve also seen some references to this pair only being available for 12 or 24 hours after your node was last online. This doesn’t mesh with my understanding of how DHTs work, where every single key/value pair on the network will be stored by multiple nodes (based on the key’s closeness to the node ID). It also really doesn’t seem to mesh with the stated goals of a permanent web, where content should be available long after the site layout has changed and/or the servers are offline. I’ve also seen a couple references to some IPRS project in the works that’s supposed to help with this, but I’m not sure what that is.

Copied from original issue: https://github.com/ipfs/faq/issues/209

From @raptortech-js on Wed Dec 07 2016 03:53:04 GMT+0000 (UTC)

Ok so it looks like the DHT that IPFS is basically a standard DHT, but the DHT clients will drop key-value pairs that are 12-48 hours old (I guess depending on implementation?) and that’s why you have to keep re-publishing IPNS messages. My guess is that the same mechanism handles messages from nodes saying they have a certain block.

This is an aspect of IPNS that really worries me - the republishing.

My assumption is that the MAJORITY of apps built on IPFS will end up having more mutable than immutable content, and that means that IPNS links are going to end up inside other content (which can itself be immutable.) BUT that won’t work if IPNS links aren’t persistent, and if they require republishing then in effect the node that publishes the content has to remain online to keep republishing the names.

1 Like

This is handled in the latest release of go-ipfs.

1 Like

But you should occasionally check to see if your IPNS links are still resolving. If you don’t run your daemon long enough over the course of a day, e.g. only for an hour or so, or don’t even run it over a long period of time, then the IPNS addresses will not be updated (republished). Happened to me at least once with v0.4.10.

This, by the way, is something that might need to be addressed; as I understand, the deadline for republishing is 24 hours, i.e. you can’t publish with ipfs name publish --key=MyKey --lifetime=50000h /ipfs/<hash>, right? So when you’re away on vacation, your IPNS address will stop resolving after 24 hours. So maybe we need options like 14d for 14 days, or 2M for two months. (?)

1 Like