ipfs-docs icon indicating copy to clipboard operation
ipfs-docs copied to clipboard

Hash collisions not mentioned

Open rmwiseman opened this issue 3 years ago • 4 comments

Whilst I know it's very unlikely for the hash of two different pieces of content to be the same, it is possible, and so we have to assume it will happen at some point. What happens then? Is that handled by IPFS, and if so, how?

rmwiseman avatar Oct 13 '22 10:10 rmwiseman

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additiona round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.tech if you just need general support.

welcome[bot] avatar Oct 13 '22 10:10 welcome[bot]

Theorically, a peer receiving either files matching the asked CID would accept it.

Now, in practice, if you walk around the Earth, and each time you come back at your starting point you take one drop out of the ocean, and then keep walking until you completely empty the ocean one drop at a time, then put a sheet of paper on the ground, put all the water in the ocean and start all over again in order to put another sheet on top of the firstone, and so on and so forth until the pile of paper touch the Sun, and propose a file for each step you took, the probability that you would have found a matching file someday in your almost eternal jouney is abysmally small.

It should be fine.

bertrandfalguiere avatar Oct 13 '22 12:10 bertrandfalguiere

(I heard this story for the number of ways to shuffle a deck of card, which is 52!, which is far smaller than 2^256)

bertrandfalguiere avatar Oct 13 '22 12:10 bertrandfalguiere

Love the analogy! I hadn't realised the probability was quite as low as that!

rmwiseman avatar Oct 13 '22 12:10 rmwiseman