Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CIDv1 from Base58 to Base32 (go-ipfs) #6220

Closed
lidel opened this issue Apr 15, 2019 · 2 comments · Fixed by #6300
Closed

Switch CIDv1 from Base58 to Base32 (go-ipfs) #6220

lidel opened this issue Apr 15, 2019 · 2 comments · Fixed by #6300
Assignees
Labels

Comments

@lidel
Copy link
Member

lidel commented Apr 15, 2019

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:

$ ipfs 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:

$ ipfs cid base32 zb2rhk6GMPQF3hfzwXTaNYFLKomMeC6UXdUt6jZKPpeVirLtV
bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy

The need for the conversion step is not only unnecessary, but harmful to our migration efforts. Users report confusion why CIDv1 produced by go-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 ipfs 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

@lidel lidel changed the title Switch CIDv1 from Base58 to Base32 Switch CIDv1 from Base58 to Base32 (go-ipfs) Apr 15, 2019
@Stebalien
Copy link
Member

You can currently pass the --cid-base flag to specify the default CID base. You can also pass --upgrade-cidv0-in-output flag to auto-upgrade cidv0 to cidv1.

@lidel
Copy link
Member Author

lidel commented Apr 15, 2019

Correct. The change suggested here is that user should not need to pass anything to get Base32 if they already opted-in to CIDv1 via --cid-version 1, and everywhere CIDv1 is returned to the user, use Base32 instead of Base58

Stebalien added a commit that referenced this issue May 6, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@ghost ghost assigned Stebalien May 6, 2019
@ghost ghost added the status/in-progress In progress label May 6, 2019
Stebalien added a commit that referenced this issue May 7, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien added a commit that referenced this issue May 7, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien added a commit that referenced this issue May 7, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien added a commit that referenced this issue May 7, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien added a commit that referenced this issue May 13, 2019
fixes #6220

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
gfanton added a commit to berty/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
gfanton added a commit to berty/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
gfanton added a commit to berty/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
gfanton added a commit to gfanton/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
gfanton added a commit to gfanton/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
gfanton added a commit to gfanton/go-ipfs-log that referenced this issue Jun 12, 2019
go-cid@0.0.2 use base32 by default (ipfs/kubo#6220)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants