Un-informed ipfs user asks. What cid codec to use for introducing multi-part file?

As far as i understand with cid version one. One can introduce new data-structures.
My intention is to have a cid address which refers to another set of checksums (maybe cid address). Were splits the file into parts. I know bit-torrent had this capability.

It can be useful for download and play videos simultaneously while making sure received data is matches the checksum.

CIDs are just a way to fingerprint a particular sequence of bits. CIDv0 was just the 58btc-encoded SHA-256 hash of these data. CIDv1 will just enable to to pick the hash function and the encoding you like. (IPFS will soon use 32encoding of SHA-256 as a default, but you will be able to use the one you like, really). Basically, CIDv0 was the fingerprint of the right thumb of the data, CIDv1 let you identify the data by any finger.
But it has nothing to do with the datastructure, which is IN the content-addressed bits.

IPFS already transparently splits what you uploads into chunks. I think they are 256KB-long. It is managed under the hood.

For more DAG magic, maybe you can look up IPLD.

IPFS also already checks that received chunks are correct. That’s one of the perks of content addressing.

For streaming videos or playing them while downloading, look at :


https://d.tube/
https://docs.ipfs.io/guides/examples/videos/
… and there is one great video about live streaming to a big audience in the same local network, but I can’t find it again… :confused:

1 Like

Found it!


https://ipfs.infura.io/ipfs/QmWsKvBvXUKaHcHzrUS91XV4k3YjQFdywQ7bY9BZVX4ghk/

My main issue is that I don’t understand what codec means in this context.

IPFS already transparently splits what you uploads into chunks. I think the are 128kB-long (to be confirmed). It is managed under the hood.

This looks interesting. So this is already a solved issue. It might be even a good idea to do it at infrastructure level.

So apparently ipfs’s javascript implementation does read and validates file in chunks. Interesting.

I wrote too fast: part of the data structure is in the CIDv1.

The Codec is the way a structured data is described (if the CIDv1 tells you it is structured and not just a raw binary string).
The codec can be JSON, CBOR (both implemented), XML (to please retired devs), etc.

Not sure what you mean by that. But do look up IPLD, IPFS + DAG, etc.

Same for the go implementation.