hey,
i have a confusion about IPNS. we use it to find the updated file.
for example ==
we are adding a .txt file on IPFS and make the changes in the same file then the IPFS will we change. we can find the updated file from IPNS by publish the new hash of updated file. we have need to add multiple files do we have to follow the same process repeatedly.
Second query is we want to maintain only files at one IPNS key and want to put some information at another IPNS key can we do this ?
how can we manage the data at IPFS so that we can get data as soon as possible ?
If you publish a directory CID as your IPNS value, people can find files by name in the directory tree: ipns/YOUR_CID/dirA/dirB/file
Hi Zot,
thanks for quick reply could you please share a link from where we i can try all these steps.
This page explains how you can publish content with a secondary key.
To add to what is on that page, once you have the extra key (s) created, you can use the command ipfs key list -l
to see what keys your node has, and the ipns hash to use for that key. The key labeled “self” is automatically generated when you initialize the node and ends up the same place as the ipns hash from ipfs id
.
I was kind of curious about the secondary key part. It seems like the first key used is the peerid key so is there any association between the peerid and the secondary keys? I kind of assumed any secondary keys would be signed by the peer key or are they completely independent? Or perhaps does the init create the peer key and a secondary name key automatically?
Someone more knowledgeable about how the cryptographic keys are generated and managed in IPFS will need to confirm this, but based on my knowledge of the underlying cryptographic primitives, this is what is possible:
IPFS supports two types of cryptographic keys: RSA and ed25519 (an elliptic curve cryptosystem).
Generating an RSA key involves selecting two random prime numbers, and I don’t know of a secure way to generate one key from another, so I am fairly confident that IPFS is not doing RSA key derivation.
Elliptic curve keys do have a secure way of deriving one key from another (multiply both the private and public let by the same number). I suspect that IPFS is not doing key derivation, because that is the easiest implementation.
I think I’ve answered my own question. There is no relationship between the keys used for the PeerID and any other IPNS keys. The only thing unique about it is that it just happens to be used for two things. There is no mechanism to know that a single entity published multiple IPNS records and no general way to associate an IPNS key with a PeerID except where the PeerID happens to be used as the default IPNS signing key. ie. IPNS keys aren’t signed by the PeerID.