Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

feat: produce CIDv1 #13

Merged
merged 1 commit into from
Mar 22, 2021
Merged

feat: produce CIDv1 #13

merged 1 commit into from
Mar 22, 2021

Conversation

lidel
Copy link
Contributor

@lidel lidel commented Mar 19, 2021

This PR ensures produced CIDs are more deterministic and future-proof.

Rationale

We should avoid CIDv0 in blockchain contexts because it means people can cut corners and code against Multihash spec instead of CID spec.

Producing CIDv1 removes ambiguity and ensures people write things in a future-proof way.
Also, UX is better:

@yusefnapora I also included hashAlg to be immune from changes to the default behavior of ipfs add, but feel free to remove it if you feel its an overkill.

This ensures produced CIDs are more deterministic and future-proof.
Producing CIDv1 ensures the text representation looks the same on
subdomain gateways and in browser address bar.
@yusefnapora
Copy link
Owner

Thanks @lidel, I agree that we should totally do this 👍

@yusefnapora yusefnapora merged commit 8f3ec59 into yusefnapora:master Mar 22, 2021
@lidel lidel deleted the feat/cidv1 branch March 24, 2021 17:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants