Duplicates and IPFS

I am working on storing identity details on IPFS. This is part of the internet of identity market which is emerging.

It strikes me though that IPFS does not prevent people accidentally adding duplicates. Does IPFS throw an error if someone tries to add a duplicate?

No, it doesn’t raise an error when you add duplicate content. If I add identical copies of a file or some data to IPFS twice, IPFS just returns the same hash twice. It does not store the file twice, nor does it raise an error.

If you are building a system where people need to be able to claim some sort of identifier or namespace, preventing others from using that identifier or namespace, you need to handle that on your side. One option is to use IPNS. Another popular option is to put the info on a blockchain like ethereum.

You should also follow the discussion threads about CRDTs. That is a related topic.