-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 to base36 by default in all text output (overriding ipfs/go-ipfs/issues/4143 ) #7357
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There is a performance penalty, but this is mostly about UX.
I wonder, perhaps there is UX next-positive in having different defaults (and canonical representation in subdomains) for mutable and immutable identifiers:
This would make it easy to eyeball identifiers ( Any downsides?
I wish that was the case :-) Unfortunately the default text representation of CID needs to be case-insensitive for pragmatic reasons, some of them are:
|
This comment has been minimized.
This comment has been minimized.
@RubenKelevra the limitation here is that IPFS uses CIDv0/CIDv1 spec, and adding checksum would mean creating CIDv2. I think its worth discussing, but as you noticed its out of scope here, so please fill an issue in https://github.com/multiformats/cid 🙏 |
Well, people will start assuming that |
Apart from performance and en/decoder-complexity, |
To clarify, I wouldn't consider the ability to distinguish between CIDs and peer IDs based on encoding a feature. I'm slightly leaning towards base36 everywhere:
The goal is:
|
Maybe soon there will be other keys that need another 2 bytes? Others have avoided the 63-char limit by allowing a dot: and code complexity is still a concern to me, because it makes alternative implementations harder and thereby reduces ipfs adoption: |
TLDR: @Stebalien has accurately stated the goal, @bmwiedemann's solution is explored in #7318 and has serious problems for important use cases.
Yes, and we'll likely have to deal with that at some point, however the "just use a dot" suggestion is not as simple as you are advertising. Take a look at #7318 for more context and feel free to add any suggestions there if you have some ideas. Hopefully we can work to ensure that we don't have to deal with this problem "soon" and that by then some of the issues in #7318 will become manageable. Potentially we could even sidestep DNS name restrictions entirely by relying more heavily on an IPFS protocol handler instead just using a DNS name. In the meanwhile we'd like to handle #6916 while still supporting resolution in subdomains. While we could do that by using base 36 in some places (e.g. subdomains) and base 32 in other places, this proposal is advocating for consistently outputting base 36. |
@bmwiedemann I contributed a scaffold b36/b58 encoder here as a "oneliner" : bmwiedemann/perl-ipfs@83cb86c#r39496064
We are now painfully aware about the hard limit for user-visible things being 40 bytes, and are going to aggressively design to not go over this in the future (case in point: the current situation was the result of an oversight). |
Dropping a reference for when there is a decision on this: one of the main spots to fixup would be https://github.com/ipfs/go-ipfs/blob/79d571f272d640f0d4164f6f9d94c5fb44983822/core/corehttp/hostname.go#L381-L396 |
@aschmahmann @lidel seems to me we will never do this in go-ipfs. I will close this later today unless you think there's more to talk about. |
@ribasushi closing this sgtm |
Now that base36 support is landing into go-ipfs for unrelated reasons I would like to resurrect my pitch from 3 years ago to default to
base36
rendering as opposed tobase32
. The internals of go-ipfs operate over binary CIDs so the proposed change is strictly concerned with "UX".Let me know your thoughts!
✅ Pros
sufficiently long payload
sufficient1y long payload
bafkqagttovtgm2ldnfsw45dmpeqgy33om4qhaylznrxwczak
bafkqagttovtgm2ldnfsw45brpeqgy33om4qhaylznrxwczak
kumq0v1xsl33xy9ospzfmf6uuibi0jxtdsrmhovipx6o0a
kumq0v1xsl33xy9ospzfmbp3zrpszmf3tbmvd50ou83pje
1 + ceil( (4+blocksize) * log(256) / log(base32-or-36) )
❌ Cons
bafy...
, another switch would create further confusion( 1 * 1000 * 1000 * 1000 ) / 2672 = 374251
b36 CIDs in 1 second ):The text was updated successfully, but these errors were encountered: