-
Notifications
You must be signed in to change notification settings - Fork 2
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
How does this work for video authentication? #16
Comments
I would separate these two cases out. If the video is large and all you want is to make it verifiable, then I would not split it at all. I would just use the BLAKE3 and call it a day. If you need to split the video because of delivery constraints (like you want to stream it as DASH) then you should split it and yes I think it's possible to agree on a metadata wrapper that describes the split (so it's reproducible). I think that dCBOR42+CAR is all you need for that, along with an agreed metadata vocabulary. |
We should confirm this, but I remember some domain experts saying it's typical to want to archive multiple versions of the same media, such as high-res, low-res, and raw. |
How many layers of indirection/wrapping are tolerable? The "status quo" way of doing this would be a CAR file for the "folder" of the various "equivalent" files, and a "content credential" for each containing metadata, plus the DASL and/or chunked CID. I'm tempted to imagine a richer CAR file or richer content credential before mushing them into one credential-containing CAR file. It's also worth nothing that content credentials currently use a UCAN-y syntax for expressing "data equivalence" (these two CIDs point to the same bytes) but not "content equivalence" (this is the same 34 seconds of footage encoded two different ways or at 2 different resolutions). For the latter, a distance hash like ISCC might be needed. It bears mention that ISCC is already a concrete data model for metadata with proximate content equivalence built in, while we're collecting prior art/building-block options. |
In this instance, how are the individual DASH video chunks addressed and encoded? Just binary with a raw BLAKE3 hash (which can easily packed into a CAR) and then linked from the dCBOR42 metadata objects? |
Yes that would be my expectation for files like
For DASH and HLS (e.g.
The directory can contain different bit rates, for example:
Based on the current spec, how would I represent this directory of files? I assume a Blake3 hash of each file (i.e. |
The best option is IMHO dCBOR42 metadata. It's not specified yet but I'm working on a metadata spec that I think would work for you. Here's my thinking, it would be great to hear if you think that's right or not: Not DirectoriesI don't think that directories are the right mechanism. That's how you would store them on a file system but we're dealing with URLs and resources, FS abstractions get weird very fast. So the metadata would me more something like:
This makes pathing trivial (it's just a look up) and it avoids indirection through multiple directories. It corresponds a lot better to how resources work on the web. This is the model used in tiles, it's adapted to "this is a container of a bunch of related but content-addressed things" cases. HTTP MetadataThe
Magic?One thing I don't know is if these metadata objects should have a way of distinguishing them from other dCBOR42 content or if duck typing is enough. We could have them have a field like |
That's an interesting idea. Would the metadata also be hashed and addressed by CID? |
@2color Likely. Either by being part of root CID, or a separate CID referenced from root CID. In both cases, metadata is part of data, and impacts final root CID. @darobin some late night thoughts on "directories in dCBOR42", happy to brainstorm more if useful: Not DirectoriesI really like the general abstraction of "not directories" being a dCBOR map from tiles-style "opaque string paths" to Tag42 CIDs: /index.html: tag42-cid
/player.js: tag42-cid
/manifest.m3u8: tag42-cid
/hi/001-hi.ts: tag42-cid
/hi/002-hi.ts: tag42-cid
/low/001-low.ts: tag42-cid
/low/002-low.ts: tag42-cid When processing request for As for metadata, we probably want to be careful to not bring overly complex schemas and syntax into this (learning from IPLD adoption/interop), and perhaps not leak HTTP-only metadata into something that aims to be simpler alternative to UnixFS directory. Personally like idea of extremely simplified CBOR mode where HTTP gateways allow for following every opaque string that directly points at CIDTag42, and metadata object is optional: /file: tag42-cid || metadata-object HTTP MetadataIf useful, including HTTP headers in metadata was previously requested/discussed in ipfs/specs#257 (comment). At the time the idea was to use separate With that lens:
ps. On DASH / HLSRepresenting video as DASH/HLS is effectively doing custom chunking in userland. It does not solve "cid reproducibility". It is the same as UnixFS with custom chunker – you need both file and tools to get to the same CID, file alone is not enough. Still, it is a nice way of dealing with big files until DASL addresses how to seek in a 4GiB video :P |
This thread is heading towards files/directories and I am reminded a little of our attempts to land UnixFSv2. It's probably worth looking through old issues on the original repo and the IPLD specs repo to see what was once important. Some thoughts, not all coherent: CBORI think we like CBOR because it's simple and schema-free like JSON but also concise on the wire and gives us niceties like embedded That said we don't really use CBOR, we use DAG-CBOR which is a subset of CBOR that makes the encoding deterministic (which you want, otherwise you get different It's not perfect - DAG-CBOR says you have to encode a number in it's smallest representation but then the original number type is erased, so if you encode a
One of the CBOR tags that DAG-CBOR explicitly doesn't use is FWIW Protocol Buffers does not suffer from this problem, and has the advantage of not encoding object key literals so the message sizes are smaller still. I think pb has a bad name with this crowd having been associated with the leaky abstraction/best decision at the time Mono-codec CIDsI think having everything be DAG-CBOR would be good for future use-cases we haven't thought of, but structures produced for those use-cases won't necessarily be backwards compatible (for example different file/dir layout object shapes or metadata fields in general, etc), especially if we punt conventions on directories/sharding/chunking/etc to userland. Part of the joy of the CID codec field is that it tells us how to interpret the block data, if we have only DAG-CBOR that's great for extensibility and flexibility but we push the problem into userland and suddenly it's everyone's problem. That's not to say we can't combine the two - Embedding HTTP HeadersThis is interesting. Some thoughts:
Since we can add arbitrary fields to DAG-CBOR I'm guessing we wouldn't want to just blurt the headers into an HTTP response, so we'd need to do some processing anyway, either via schema validation or userland/application level. Metadata+file data vs embedded dataIf I had some file data with some metadata, I could embed it in one structure like: {
"name": "foo.txt",
"contents": "aGVsbG8gd29ybGQ="
} Or I could decorate a {
"name": "foo.txt",
"contents": CID("bafyfoo..")
} This makes the content block de-dupable but at the cost of more wantlist entries and network requests. In the past this was too high a price to pay. I don't know if it still is now we have things like CAR files and bitswap sessions. DirectoriesI like the simplicity of: {
"resources": {
"/manifest.m3u8": tag42-cid || metadata-object
"/hi/001-hi.ts": tag42-cid || metadata-object
"/hi/002-hi.ts": tag42-cid || metadata-object
"/low/001-low.ts": tag42-cid || metadata-object
"/low/002-low.ts": tag42-cid || metadata-object
}
} ..but I don't know how I would represent Wikipedia with this, or someone's flat directory with 5m NFTs all with absurdly long filenames. Perhaps something like: {
"resources": CID("bafy-DASL-HAMT")
} |
Just chatted with Adin about this today, actually, I think it makes sense to have (at least as an extension, not a requirement for all RASL/DASL/MASL implementations to be able to parse) a non-flat structure for, as you say, huge maps that need something more efficient than seeking, and if we're already making a non-flat manifest option, maybe one that interops with or onramps to bitswap/amino/etc deserves a little extra consideration? |
@benhylau from Starling Labs & @eqtylab mentioned this use case in a video call in September:
@darobin thinks video and other large files can be done with a folder structure where the first block contains metadata (not only metadata about the ingested file, but any pre-processing steps specific to video or other unique formats).
@benhylau Does that work? Do we need more details?
The text was updated successfully, but these errors were encountered: