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

Switch CIDv1 from Base58 to Base32 (js-ipfs) #1995

Closed
@lidel

Description

@lidel

This not about making CIDv1 the default, but a small UX tweak to remove confusion for users who opt-in to CIDv1 and expect Base32 (think IPFS Camp).

Actual move to CIDv1 as the new default is tracked in:

Problem

Right now if someone wants to use CIDv1 they can opt-in via --cid-version 1, but by default they get CIDv1 in Base58:

$ jsipfs add --cid-version 1 guardian.jpg
added zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV guardian.jpg                                                                                                                                                                  

To get the representation we aim for, they need to convert Base58 CIDv1 to Base32 in additional step:

$ jsipfs cid base32 zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV
bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy

OR pass additional --cid-base parameter:

$ jsipfs add --cid-version 1 --cid-base base32 guardian.jpg
added bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy guardian.jpg

The need for the conversion step is not only unnecessary, but harmful to our migration efforts. Users report confusion why CIDv1 produced by js-ipfs can't be used in <cid>.ipfs.dweb.link and why Web UI swaps out the CID.

It is really embarrassing when we need to ask people to use ipfs cid base32 during demos and workshops ("why do i need to convert? isn't base32 the future default for CIDv1?")

Solution

We should switch default representation of CIDv1 from Base58 to Base32 (without making CIDv1 the default itself).

This will ensure that:

  • one can just jsipfs add --cid-version 1 and use the output immediately
    (small change, huge UX improvement)
  • UX win: CIDv1 look the same everywhere
  • our CIDv1 tests can be written against bafy.. CIDs

References

Metadata

Metadata

Assignees

Labels

P2Medium: Good to have, but can wait until someone steps upexp/wizardExtensive knowledge (implications, ramifications) requiredstatus/in-progressIn progress

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions