-
Notifications
You must be signed in to change notification settings - Fork 246
IPIP-499: UnixFS CID Profiles #499
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
8842176
Create ipip-0000.md
mishmosh 4ba68f0
Update and rename ipip-0000.md to ipip-0499.md
mishmosh 6cc64cb
add extra attributes proposed in review
lidel d8b8389
incorporate kubo#10774
lidel 600d1fc
Merge branch 'main' into patch-1
bumblefudge 595588c
Update src/ipips/ipip-0499.md
2color 41f9b86
add daniel as editor
2color 229988f
edit summary and motivation
2color f37e610
edit summary
2color 7a12f0a
edit parameters and design
2color ff69e56
edit user benefit and compatibility
2color 09baf68
refine parameters and introduce a named profile
2color cffade8
Apply suggestions from code review
2color 0402c84
edit based on hector's feedback
2color ec07e30
Apply suggestions from code review
2color f454912
add multibase encoding
2color 9c621ba
address feedback from rvagg
2color c109c1a
Update ipip-0499.md
mishmosh 383f9e3
Update src/ipips/ipip-0499.md
mishmosh e564968
Update src/ipips/ipip-0499.md
mishmosh bbd547f
Update src/ipips/ipip-0499.md
lidel 70514b9
fix typo (the the)
mishmosh 89c9c62
Merge branch 'main' into patch-1
lidel 92352d7
feat(ipip-0499): add chunking algorithm and align profile tables
lidel 9d0d415
fix(ipip-0499): correct kubo legacy profile
lidel a3dc7e2
fix(ipip-0499): document legacy profile filtering behavior
lidel 94a1b79
fix(ipip-0499): note that legacy table includes non-UnixFS implementa…
lidel 7a8d6ab
feat(ipip-0499): add implementation versions to legacy profiles table
lidel a3044d6
fix(ipip-0499): update HAMTDirectory threshold and clean up parameters
lidel 5b19f2b
feat(ipip-0499): document symlink handling in profiles
lidel 3a092a4
fix(ipip-0499): clarify HAMTDirectory threshold calculation methods
lidel 123be3d
fix(ipip-0499): update metadata and add contributors
lidel 263892a
feat(ipip-0499): document HAMTDirectory threshold estimation methods
lidel e2f95dd
chore: bump spec-generator to 1.7.0
lidel b832bcc
feat(ipip-0499): restructure document and rename profiles
lidel d7e81d7
feat(ipip-0499): document efficiency benefits of modern profile param…
lidel 26162e2
Merge branch 'main' into patch-1
lidel 37132f1
feat(ipip-0499): add singularity to divergence table
lidel 0188e10
feat(ipip-0499): add test fixtures section with deterministic CIDs
lidel 273a2d3
fix(ipip-0499): update test fixtures with chunk threshold vectors
lidel c2af85f
refactor(ipip-0499): restructure Motivation section
lidel 8393dc4
Merge branch 'main' into patch-1
mishmosh 59d0583
chore(ipip-0499): mark as ratified
lidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
| # IPIP number should match its pull request number. After you open a PR, | ||
| # please update title and update the filename to `ipip0000`. | ||
| title: "IPIP-0499: CID Profiles" | ||
| date: 2025-04-03 | ||
| ipip: proposal | ||
| editors: | ||
| - name: Michelle Lee | ||
| github: mishmosh | ||
| affiliation: | ||
| name: IPFS Foundation | ||
| relatedIssues: | ||
| - https://discuss.ipfs.tech/t/should-we-profile-cids/18507 | ||
| order: 0499 | ||
| tags: ['ipips'] | ||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| <!--One paragraph explanation of the IPIP.--> | ||
| This proposal introduces profiles for IPFS CIDs. Profiles explicitly define CID version, hash algorithm, chunk size, DAG width, layout, and other parameters. | ||
|
|
||
| ## Motivation | ||
|
|
||
| Currently, CIDs can be generated with a variety of settings and optimizations for chunking, DAG width, and more. This means the same file can yield multiple, different CIDs depending on which tools and settings are used, and it is not possible to reliably reproduce or verify the CID. Profiles offer With profiles, following the same profile will produce identical CIDs for identical content, whic makes verification regardless of implementation. | ||
|
|
||
| ## Detailed design | ||
|
|
||
| We introduce a profile naming system, | ||
|
|
||
| Each profile must specify the following characteristics: | ||
|
|
||
| 1. CID version (currently only CIDv0 or CIDv1) | ||
| 1. Hash algorithm | ||
| 1. UnixFS Chunk algorithm (e.g. size-based or content-based) | ||
| 1. UnixFS directory DAG layout (e.g. balanced, trickle) | ||
| 1. UnixFS file DAG width (max number of links per `File` node) | ||
| 1. UnixFS directory DAG width (max number of links per basic `Directory` node) | ||
| 1. UnixFS HAMT directory DAG threshold (max `Directory` size before switching to `HAMTDirectory`) | ||
| 1. HAMT directory DAG width (max number of fanout links per internal HAMTDirectory node) | ||
| 1. Leaf Envelope (historically `dag-pb`, CIDv1 introduced `raw` leaves) | ||
| 1. Empty directories (informative suggestion) | ||
|
|
||
| Additional profiles can be added at a future date. Profile names may be chosen from the names of any botanical tree with compound leaves. | ||
|
|
||
| This would be specified as a table in (forthcoming UnixFS spec). | ||
|
|
||
| ## Design rationale | ||
|
|
||
| The profile names are chosen to be easy to pronounce. | ||
|
|
||
| Here is a summary table of current (2025-Q2) defaults, thanks to input & clarifications from @2color @achingbrain @lidel: | ||
|
|
||
| | | Helia default | Kubo `legacy-cid-v0` (default) | Storacha default | Kubo `test-cid-v1` | Kubo `test-cid-v1-wide` | DASL | | ||
| |---------------------------------|---------------|-----------------------------------|------------------|--------------------|---------------------------|---------------| | ||
| | CID version | CIDv1 | CIDv0 | CIDv1 | CIDv1 | CIDv1 | CIDv1 | | ||
| | Hash Algo | sha-256 | sha-256 | sha-256 | sha-256 | sha-256 | sha-256 | | ||
| | Chunk size | 1MiB | 256KiB | 1MiB | 1MiB | 1MiB | not specified | | ||
| | Max links `File` node | 1024 | 174 | 1024 | 174 | **1024** | not specified | | ||
| | Max links `Directory` node | ? | 0 | ? | 0 | 0 | ? | | ||
| | Max fanout `HAMTDirectory` node | 256 blocks | 256 blocks | 256 blocks | 256 blocks | **1024** | not specified | | ||
| | `HAMTDirectory` threshold | 256KiB (est) | 256KiB (est:links[name+cid]) | 1000 **links** | 256KiB | **1MiB** | not specified | | ||
| | DAG layout | balanced | balanced | balanced | balanced | balanced | not specified | | ||
| | Leaves | raw | raw | raw | raw | raw | not specified | | ||
| | Empty directories | allowed | allowed | disallowed | allowed | allowed | not specified | | ||
|
2color marked this conversation as resolved.
Outdated
|
||
|
|
||
| See related discussion at https://discuss.ipfs.tech/t/should-we-profile-cids/18507/ | ||
|
|
||
| ### User benefit | ||
|
|
||
| Reliable, deterministic CIDs allow independent verification of content across tools and ipmlementations. | ||
|
2color marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Compatibility | ||
|
|
||
| Implementations will need to (1) make CID generation settings configurable and (2) support user setting of profiles. | ||
|
|
||
| Kubo 0.35 will have [`Import.*` configuration](https://github.com/ipfs/kubo/blob/master/docs/config.md#import) option to control DAG width. | ||
|
|
||
| ### Security | ||
|
|
||
| TODO | ||
|
|
||
| ### Alternatives | ||
|
|
||
| Another approach could be to name profiles based on the key UnixFS/CID parameters, e.g. v1-sha256-balanced-1mib-1024w-raw. This is longer and more convoluted. | ||
|
|
||
|
|
||
| #### Empty directories | ||
|
|
||
| Decision if empty directories should be included is left out of scope. | ||
|
2color marked this conversation as resolved.
Outdated
|
||
|
|
||
| Tools can apply arbitrary filtering before passing filesystem entries | ||
| to be converted into a DAG, thus for 1:1 CID reproducibility one should | ||
| run without any prefilters, or ensure the same prefilters are applied. | ||
|
|
||
| ## Test fixtures | ||
|
lidel marked this conversation as resolved.
|
||
|
|
||
| TODO | ||
|
|
||
| List relevant CIDs. Describe how implementations can use them to determine | ||
| specification compliance. This section can be skipped if IPIP does not deal | ||
| with the way IPFS handles content-addressed data, or the modified specification | ||
| file already includes this information. | ||
|
|
||
| ### Copyright | ||
|
|
||
| Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.