# How to assign a timestamp to reflect the date & time a file was uploaded in IPFS?

**URL:** <https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032>\
**Category:** Help\
**Created:** [May 24, 2024, 5:11am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032 "2024-05-24T05:11:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![legalmartin](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@legalmartin](https://discuss.ipfs.tech/u/legalmartin)\
**Post date:** [May 24, 2024, 5:11am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032/1 "2024-05-24T05:11:10Z")

</div>

As such, the IPFS assigns a unique CID to each file uploaded on the network, but does not provide a timestamp for the uploads. How can such a timestamp be obtained in a trustless manner and without exposing the content of the file?

---

<div class="post-metadata">

**Author:** ![Jorropo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jorropo/32/3230_2.png) [@Jorropo](https://discuss.ipfs.tech/u/Jorropo)\
**Post date:** [May 24, 2024, 6:10am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032/2 "2024-05-24T06:10:05Z")

</div>

Within the constraint you gave the only solution is to use a consensus algorithm that provides trustless timing.  
For example publish the CID on ethereum, bitcoin, filecoin, …

If you have many CIDs it is common to use a merkle-tree datastructure to compact ∞ hashes into 1 cryptographic hash you need to post on chain.

---

<div class="post-metadata">

**Author:** ![legalmartin](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@legalmartin](https://discuss.ipfs.tech/u/legalmartin)\
**Post date:** [May 24, 2024, 6:24am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032/3 "2024-05-24T06:24:15Z")

</div>

Thanks Jorropo - I was thinking of using a third-party timestamp provider (such as **[OpenTimesStamps](https://opentimestamps.org/)**) instead of creating my own on-chain solution.

---

<div class="post-metadata">

**Author:** ![Jorropo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jorropo/32/3230_2.png) [@Jorropo](https://discuss.ipfs.tech/u/Jorropo)\
**Post date:** [May 24, 2024, 6:30am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032/4 "2024-05-24T06:30:36Z")

</div>

After looking at the page you sent, OpenTimesStamps is a service that collects your attestations, pack them in a merkle-tree and post them on the Bitcoin chain. So it does seems to fit what I suggested.

I don’t know about it tho, and can’t recommend it either way.

---

<div class="post-metadata">

**Author:** ![legalmartin](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@legalmartin](https://discuss.ipfs.tech/u/legalmartin)\
**Post date:** [May 24, 2024, 6:34am UTC](https://discuss.ipfs.tech/t/how-to-assign-a-timestamp-to-reflect-the-date-time-a-file-was-uploaded-in-ipfs/18032/5 "2024-05-24T06:34:24Z")

</div>

Thank you so much Jorropo!
