multiformats / cid-utils-website

A website for decoding CIDs
https://cid.ipfs.tech/#bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
33 stars 30 forks source link

multibase prefixed CID v0 string should be an error #54

Open olizilla opened 1 year ago

olizilla commented 1 year ago

this should be an error https://cid.ipfs.tech/#zQmTFGZgypZBYozPTF2qqeho5n17MJXSkHRMDhRqmkroAZu

see: https://github.com/multiformats/js-multiformats/issues/240

currently it shows the multibase as "implicit" but it's been explicitly set... and a CID v0 should not have a multibase prefix.

Screenshot 2023-01-17 at 10 46 18
nielses commented 5 days ago

A similar example here: https://cid.ipfs.tech/#BCIQJTNS33T6THRXRAR25ZN5TMMORVNP6JKCOS4EW52632DQPVFWMNGY

It shouldn't show multibase as implicit base58btc as it's explicit base32upper. I don't think it should give an error, though (but a warning would be appropriate), because it's actually used as a filename in IPFS Desktop for Windows.

This will give an error: https://ipfs.io/ipfs/BCIQJTNS33T6THRXRAR25ZN5TMMORVNP6JKCOS4EW52632DQPVFWMNGY

But a valid CID can be found using the CID inspector tool: https://cid.ipfs.tech/#BCIQJTNS33T6THRXRAR25ZN5TMMORVNP6JKCOS4EW52632DQPVFWMNGY

To arrive at a URI that works: https://ipfs.io/ipfs/QmYggNCkVfBSLi6Gi1G1JTwVhd7tGpSF5LtwY4LNq5n7fY or base32 CIDv1 to be more modern: https://ipfs.io/ipfs/bafybeiezwzn5z7jty3yqi5o4w6zwghi2wx7evbhjoclo5pn5byh2s3ggtm

To break down the Qm CID: https://cid.ipfs.tech/#QmYggNCkVfBSLi6Gi1G1JTwVhd7tGpSF5LtwY4LNq5n7fY

The filename in IPFS Desktop: "....ipfs\blocks\NG\CIQJTNS33T6THRXRAR25ZN5TMMORVNP6JKCOS4EW52632DQPVFWMNGY.data"