-
Notifications
You must be signed in to change notification settings - Fork 865
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
Adding a file/folder from disk should use CIDv1 by default. #2361
Comments
Thanks for submitting the issue @MicahZoltu, sounds like a great enhancement. Can you please also detail on:
Under what scenarios is this CIDv0 not handled? Also, sounds like you have good context on what's happening, would you like to create a PR for this issue? |
Websites that use local storage/cookies should always use CIDv1 so they get sandboxed by the browser by subdomain. See the big red box on http://docs.ipfs.tech.ipns.localhost:8080/how-to/address-ipfs-on-web/#subdomain-gateway for additional details. Also worth noting that http://docs.ipfs.tech.ipns.localhost:8080/concepts/content-addressing/#cid-versions suggests using CIDv1 if anytime you aren't sure (e.g., a reasonable default). I have a good handle on the problem/security considerations, but I have never looked at the IPFS desktop codebase so fixing it would be quite challenging for me. 😢 I don't mind getting mentioned on a PR to review, or I'm happy to answer any questions one might have about the situation. Presumably the API equivalent of |
Now that #2402 landed, I think the only remaining surface in IPFS Desktop is the root CID of MFS itself. By default, it is CIDv0, but IPFS Desktop could upgrade it with $ ipfs files stat /
QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn
Size: 0
CumulativeSize: 4
ChildBlocks: 0
Type: directory
$ ipfs files chcid --cid-version 1 /
$ ipfs files stat /
bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354
Size: 0
CumulativeSize: 4
ChildBlocks: 0
Type: directory Once upgraded, changing MFS will always produce CIDv1 root. I think we could do it during startup – check if CID is v0, and if so, upgrade tov v1. |
Im down with updating it to cidv1, but need to look further into gotchas and edge-cases. Is there a tracking issue for kubo to default to cidv1? |
Switching MFS root to CIDv1 should not have any gotchas. Newly created dirs will be CIDv1, that is all. @SgtPooki Kubo issue for switching to CIDv1 is ipfs/kubo#4143, but tldr
|
Is this a button that could be added to the UI on a shorter timeline than changing the default? As an IPFS Desktop user, I don't even know how to get to an IPFS command line on a host with only IPFS Desktop installed, and I would like to be able to recommend this solution to people who don't know how to use a command prompt. |
@lidel if this were to be prioritized, does this task list look good?
Is there something I'm missing? |
@whizzzkid sounds about right for ipfs-desktop itself. Changing this for everyone in webui is tricky, as will impact Kubo, which is still CIDv0, and we don't want those users to have different CIDs on CLI and webui. I think we could make this smart and not hardcode cid version used during import via webui, but base it on the CID version of the MFS root (can be checked via If user's MFS is CIDv1, it is safe to apply the same to files that will be imported there. |
I want to change the standard to CIDv1 in ipfs-desktop windows. "Import": { Can someone confirm please |
@agmap in order to make ipfs-desktop default to CID v1 we would need to make some code changes in ipfs-desktop and ipfs-webui |
Is your feature request related to a problem? Please describe.
I added a folder containing a website to IPFS via IPFS Desktop UI and it only presents me with the CIDv0 hash, not the CIDv1 hash. Since subdomain hosting is strongly recommended for any website, I now need to go convert this to CIDv1 before I can use it. When I copy CID via the UI, it just gives me CIDv0.
Describe the solution you'd like
Make it so when I add a file/folder from disk it associates it with a CIDV1 hash by default.
Describe alternatives you've considered
Additional context
Short term solution may be to just add something in the UI to convert. As it is I spend 5 minutes searching the internet for an online converter tool, fail repeatedly, eventually find some instructions on StackOverflow describing how to convert from CIDv1 to CIDv0, then spin up a docker container for Kubo and run the command. This is, of course, a ridiculous workflow.
The text was updated successfully, but these errors were encountered: