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

Migration towards base32 CIDv1 #5358

Open
4 of 8 tasks
kevina opened this issue Aug 9, 2018 · 15 comments
Open
4 of 8 tasks

Migration towards base32 CIDv1 #5358

kevina opened this issue Aug 9, 2018 · 15 comments
Labels
topic/cidv1b32 Topic cidv1b32 topic/meta Topic meta

Comments

@kevina
Copy link
Contributor

kevina commented Aug 9, 2018

This issue is to form a migration plan to base32 CIDv1 specific to go-ipfs. It is separate from #4143 which was more of a discussion or https://github.com/ipfs/ipfs/issues/337 which is more of a meta issue for all of go-ipfs, js-ipfs, and ipfs-companion.

Phase 1

Phase 2 -- full migration.

cc @whyrusleeping @Stebalien @lidel @magik6k @kyledrake.

@kevina kevina added the topic/cidv1b32 Topic cidv1b32 label Aug 9, 2018
@kevina kevina self-assigned this Aug 9, 2018
@kyledrake
Copy link

This is great, thank you for setting this up. LMK if you need anything from me.

@kevina
Copy link
Contributor Author

kevina commented Aug 13, 2018

Issues that I currently need feedback on from the core developers:

@hsanjuan
Copy link
Contributor

(subscribing)

@kevina kevina added the topic/meta Topic meta label Nov 7, 2018
@daviddias
Copy link
Member

(subscribing)

@alanshaw
Copy link
Member

alanshaw commented Feb 5, 2019

Kind request 🙏 - there's a button on the right you can press to subscribe - commenting "(subscribing)" sends me and everyone else mentioned or participating a notification.

@lidel
Copy link
Member

lidel commented Mar 3, 2019

Some relevant updates from Golang Core Dev Team Weekly Sync 2019-02-11:

Base32/CIDv1

[..]

@eingenito - Need to consider next steps and who/when this can be picked up.
@Stebalien indicates that the next work to be done is converting the blockstore to use raw multihashes (Issue, WIP). This is a complicated task that needs some context for whoever picks it up.

Q: What's the relative priority of this task compared to others on this list?
A: Most important next milestone is storing/fetching [raw] multihashes in the DHT in libp2p.

@DonaldTsang
Copy link

Idea: Use https://github.com/kstenerud/safe-encoding as a better alternative for safe encoding

@Stebalien
Copy link
Member

On technical merits alone, those encoding schemes look superior (and the order-preserving property looks quite nice). Unfortunately,

  1. We're far enough into this switch that changing the default will require a pretty strong motivation.
  2. The motivation for Base32 is wide (often built-in) language support.

@lidel
Copy link
Member

lidel commented May 13, 2019

Discussion that lead us to picking Base32 as the new default can be found in #4143 (comment):

[..] chose RFC because it's a standard, it's been around a while, nginx-misc-module supports it, and it probably has the widest support across all programming languages.

The only reason I would chose the RFC one is because it is a standard and more likely to have an implementation available as part of the language.

@DonaldTsang encodings you linked look really interesting.
I believe picking RFC one is still a good choice when it comes to being the new default, but we surely can add order-preserving ones as alternative encodings. Thank you for opening multiformats/multibase#51, let's discuss them there.

@danimesq
Copy link

danimesq commented Jan 9, 2021

Important:

what is the workaround to get the base32 hash of an file?

via: #7852

@lidel
Copy link
Member

lidel commented Jan 9, 2021

@DaniellMesquita you can convert any CID to CIDv1 in Base32 via:

ipfs cid base32 <cidv0>

You can also make a request to a subdomain gateway, eg. https://dweb.link/ipfs/<cid>, and you will be redirected to a subdomain with DNS-safe base32 or base36 CID:

https://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnRhttps://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi.ipfs.dweb.link/

@danimesq
Copy link

@lidel, ok, but how to get the base32/CIDv1 of an local file like in ipfs add -q --only-hash? Using pipelines with both commands?

@danimesq
Copy link

Ok, the pipelines command to get the CIDv1 of an file is: ipfs add -q --only-hash <file.extension> | ipfs cid base32

@hsanjuan
Copy link
Contributor

ipfs add --cid=version=1 should default to base32 output.

@danimesq
Copy link

@hsanjuan, this command isn't compatible with the purpose of only getting the CID of an given file, instead of adding it to IPFS.

lidel told me before that the flag to get CIDv1/base32 is --cid-version 1 probably instead of the --cid=version=1 you're mentioning.

Then, maybe ipfs add -q --cid-version 1 --only-hash is the command to just get the CIDv1 of an file.

@lidel, So, its ipfs add -q --cid-version 1 --only-hash?

Is it bad to produce an different merkletree/DAG? Then, how to keep compatibility?

via: #7852 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/cidv1b32 Topic cidv1b32 topic/meta Topic meta
Projects
None yet
Development

No branches or pull requests

9 participants