This IPIP establishes a 128-byte maximum digest size limit for identity CIDs (multihash code 0x00
) in UnixFS contexts to prevent abuse and clarify appropriate usage boundaries.
Identity CIDs are unique in that they inline data directly into the CID itself rather than hashing it. Without clear limits, this creates several problems:
Resource Exhaustion: Poorly written clients could encode large payloads as identity CIDs and propagate them through the network, consuming bandwidth and resources without providing value.
Security Vulnerabilities: Identity CIDs provide no integrity verification and are vulnerable to bit flips. Large identity CIDs amplify this risk.
Unclear Boundaries: The ecosystem lacks clear guidelines on when identity CIDs are appropriate, leading to potential misuse.
CIDs as Data Containers: Without limits, identity CIDs could embed arbitrary amounts of data, effectively turning CIDs from content addresses into data containers.
As discussed in ipfs/boxo#1018, the community consensus is that large identity CIDs are problematic and a reasonable limit is needed.
This IPIP adds a new section to the UnixFS specification documenting the 128-byte digest size limit for identity CIDs:
Add new section "Identity CID Size Limit" that specifies:
0x00
) are experimental and limited to 128-byte digest sizeAdd invalid test case for a 129-byte identity CID that implementations MUST reject.
The 128-byte limit was chosen based on several factors:
Alignment with Existing Constraints: The limit matches DefaultMaxDigestSize
already used for cryptographic hashes in the ecosystem. 128 bytes is a sensible limit that accommodates the digest sizes of the longest popular hash functions (e.g., SHA-512 produces 64-byte digests), while preventing unbounded growth.
Community Consensus: Key maintainers expressed support for this limit:
Practical Usage: 128 bytes is sufficient for legitimate use cases (small inline data) while preventing abuse.
Implementation Precedent: This limit has been implemented in:
Identity CIDs have always been marked as experimental, and this change does not impact users who used default settings in software like Kubo or Helia, which never produced identity CIDs by default.
This is a breaking change only for any existing identity CIDs with digest sizes exceeding 128 bytes. However:
Implementations upgrading to support this IPIP will need to:
This change improves security by:
Several alternatives were considered:
bafkqbaabijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbeeqscijbee
bafkqbaibifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqkbifaucqi
Copyright and related rights waived via CC0.
We gratefully acknowledge the following individuals for their valuable contributions, ranging from minor suggestions to major insights, which have shaped and improved this specification.