Closed aaronshaf closed 4 years ago
You can make a versioned link, dat://{pubkey-or-host}+{revnum}/
- a versioned link is basically a readonly snapshot of a dat in time. is that what you need?
But what prevents the content associated with the revnum from being changed? Is it possible to also add a checksum to ensure version history hasn't been rewritten?
@dhimmel If somebody decides to have diverging history it'll "corrupt" their Dat and they won't be able to write to it or realistically sync with the network.
I think there was some talk of adding a hash to the URL though. Can't find the link offhand.
I think this? https://github.com/mafintosh/dat-link-checksum
Thanks @RangerMauve for the info. I'm new to Dat, so I've got a few more questions. Correct me anywhere I'm wrong.
If somebody decides to have diverging history it'll "corrupt" their Dat and they won't be able to write to it or realistically sync with the network.
My understanding is that appending to a dat requires access to the private key. So the only actors that can create diverging histories are ones with the private key. Let's assume the only person with the private key is the owner / creator.
Rewriting history only "corrupts" the dat in that other nodes may refuse to accept the rewritten history, but only if those nodes have mirrored the public key? Let's assume only the owner is hosting their public key, then they could rewrite history without causing any sort of divergence?
Back to the envisioned use case of the original poster, it could be helpful to be able to link to a specific revision number with a content-derived checksum to ensure integrity.
I think there was some talk of adding a hash to the URL though. I think this? https://github.com/mafintosh/dat-link-checksum
It seems to me that dat-link-checksum
by @mafintosh is for adding a checksum to the public key to ensure it hasn't gotten munged. It doesn't have anything to do with checking the content associated with a specific revision.
Let's assume only the owner is hosting their public key, then they could rewrite history without causing any sort of divergence?
Yes, if nobody has a copy of your data in the world, you can set the data to anything you want
... is for adding a checksum to the public key
Sorry, I got the wrong link. The hash of content thing is called "Strong Links" https://github.com/mafintosh/hypercore-strong-link
@dhimmel See also this old comment (and thread): https://github.com/datprotocol/discussions/issues/7#issuecomment-352868518
also related is @jwerle's work expanding on hypercore-strong-link: dat-deep-link
related #985
Is it possible to link to a Dat version of content that is immutable?