I was focused on data:uri only… URL is totally different topics, I’ll do a followup on that soon…
I think IPLD Namespace is best for data:uri. & all this concept initially was for IPLD with dag-cbors to store ENS records and ccip callback signatures off-chain.
Note: This is PoC/draft for feedback… Intro *Tldr: IPLD is linked json/data stored in IPFS. IPLD is InterPlanetary Linked Data, “IPLD is the data model of the content-addressable web. It allows us to treat all hash-linked data structures as subsets of a unified information space, unifying all data models that link data with hashes as instances of IPLD”. It’s one of core features in IPFS clients to store linked json/data as DAG. ENS already supports IPFS and IPNS, supporting IPLD contentha…
so I’d suggest changing 0xf3
from namespace to “ipld” multicodec,
& then add IPLD NS support in ENS contenthash.
we can use that for all types of ipld data including raw data:uri under same NS.
namespace | multicodec | multihash | length | data |
---|---|---|---|---|
0xe2 | 0xf3 | 0x00 | length | data:uri |
IPLD-NS | codec/data-uri | raw/identity | length | data:uri |
0xe20101f3010021646174613a746578742f68746d6c2c3c68746d6c3e68656c6c6f3c2f68746d6c3e
I’m not sure if we can break apart length+ content type before raw data,
or * in other words, IDK if there’s another cidv1.create(…) function with extra input for that len+content/type data+extra encoding info in data uri…
IPLD-NS | codec/data-uri | contenttype | data.length | raw data without data:uri prefix
So at total we’ve 3 options for this…
a) skip CIDv1 to use hex(data:uri…)
b) IPFS-NS with json/raw. we don’t get content/type info, clients/gateways can take a shot at that or use IPFS gatteways as it’s ll backwards compatible with IPFS.
c) IPLD-NS with 0xf3
multicodec for data:uri
…
We’ve to write encoder/decoder for this new multicodec/data-uri
for IPFS/ENS gateways to resolve that content/type+raw data:uri properly. &? do we also need new ENSIP for this? or as fully multiformat/multicodec compatible ns+cidv1 format we get free pass under old ENSIP?