IPNS permissions?

Maybe you guys can point me in the right direction for the correct documentation. I have been looking for days and can’t seem to find what I am looking for as I am a newbie in the blockchain space.

Here is what I am attempting to do. I have a need for the image of an NFT to be updated after being created. From what I understand an NFT is comprised of an image/whatever format file and a metadata file. The image is stored on IPFS and the metadata contains an address pointing at the location of the image file. Normally on IPFS the address is basically the hash value for the file that way there is no need for a unique ID for the record since every hash is already unique because it is the file itself. So you can not change a file, like update it in anyway and keep the same address because the hash value would change and that is the address.

Now I happen to have a need to create an NFT where the image gets changed afterwards. From what I read so far is that I can store the file on IPFS and then setup an IPNS to point to that and that address can stay the same no matter what IPFS file it is point at. So then I can just use the IPNS address in the metadata instead of the IPFS one. So then I can update the IPNS to point at a different image stored on IPFS.

So my questions are as follows.

  1. How do I keep someone else from updating an IPNS address? I can not seem to find anything about security or privileges or any way to limit the updating to just you.
  2. I have also seen references to there being some way to update the metadata of an NFT after creation. Can anyone point me in the right direction if there is a way to do that.
  3. Finally is there a better way to accomplish this?
  1. An IPNS address is derived from a keypair, only the user controlling the private key can update it.

  2. My understanding is NFTs are typically immutable by design, so I’m not sure, sorry.

  3. If you want to use IPFS, but also point to data that’s mutable, then IPNS is the only solution I know of.

I hope this helps somewhat with clarity :slight_smile:.

Thank you very much for the response. Your answers did help clear things up. Especially the confirmation of the use of keypair.

1 Like

Keep in mind that IPNS records have lifetime. So if you lose the key then the NFT would lose it’s content.

You also have to reprovide the IPNS record from time to time.

That’s why it’s not recommended.

1 Like

Correct, currently there’s the w3name service, and I think Fleek has a service too to help keep a record alive. I hope in the future you’ll be able to use multiple services to keep a single IPNS address alive, but I don’t think the spec is quite there yet. Alternatively, this idea looks cool: Self-maintaining IPNS Record Replication · Issue #268 · ipfs/specs · GitHub