Dear all,
I’m new here, sorry for my basic question.
In which way can I put a Time Stamp on a file I add in the network? And in which way can I read metadata (Time, Date, Signature,…) of the Time Stamp tied to that file?
I guess metadata would have to be pushed elsewhere, separately from the file.
Since ipfs is a content-addressable storage platform, it does not differentiate a same file (with content hash QmXXX) pushed on day x than another one pushed on day y.
You can still push your metadata elsewhere, for instance on the dag, as an object containing the file hash and a timestamp, and reference those metadata in your application.
Dear cghislai,
hi and thank for your answer.
Please can you tell me in which way can I push metadata on the dag as an object containing the file hash and a timestamp?
What do you mean when you say “…and reference those metadata in your application…”.
Thanks and sorry but I love IPFS even though I’m not a programmer or developer.
Massimo
@MaxChain To add some content to the dag, refer to the dag api documentation (js: https://github.com/ipfs/js-ipfs#graph). Refer to the general ipfs documentation for a broader view of the ipfs concepts (https://docs.ipfs.io/).
When you add some content to ipfs, its hash is computed. This is the content identifier you use to reference it. Since you want to get metadata along file data, you will have to use the hash of the metadata object rather than the hash of the file content.
Dear Hector,
thanks a lot for your answer.
I have IPFS Cluster and I use it to PIN the CIDs I put in IPFS. Can you provide some documentation about the metadata and in with way is it possible to attach them to a file stored in IPFS?
And it is possible to generate a Timestamp directly in IPFS in order to be sure that a file has been added to IPFS in that date and at that time?
So right now you can add --name to every item that you pin in cluster. The upcoming feature allows you to add any custom “key:value” to it. The information is stored by Cluster.
And it is possible to generate a Timestamp directly in IPFS in order to be sure that a file has been added to IPFS in that date and at that time?
It is not possible at the moment, but timestamps can be faked so adding a timestamp on a custom tag is equivalent to IPFS doing it for you. What I mean is that, regardless of how you do it, you cannot “be sure that a file has been added in a date/time”
@MaxChain
Disclaimer: not an expert. What follows is just an idea.
To forbid putting a date in the future for the file upload, maybe what yo can do is also include an external and public information in this “name” field, (in addition to the timestamp and the hash of the file). For example you can include the hash of the last Tweets of the 100 most popular and active accounts (and links to these accounts), or the hash of the last episode of the 100 most popular podcast on Itunes, or the hash of the latest Ethereum block (careful with orphan blocks), etc.
There is no way anyone can forge that by having control over all these sources, you can easily check the hash and know that it cannot have been generated before these tweets/podcasts/crypto blocks appeared, especially if you combine sources.
A drawback is that your time-stamping mechanism is broken if Twitter goes offline, or the chosen crypto is 51% attacked or the chosen block is orphaned, so be sure to have several acceptable sources for the hash (7 out of 10 sources, for example).
On the other hand, I don’t know how to be sure that the file was published BEFORE a given date. Maybe publish the metadata elsewhere with a timestamping data? (Twitter, blockchain, reddit, …)
If you have a server and use IPFS only for storage, maybe signing these hashes with the server keypair and publish that to IPFS? The thing is that your server would need to check the validity of the hashes, which will not scale, and you can be flooded by a Sybil attack easily…