|
5 | 5 | parent: concepts
|
6 | 6 | ---
|
7 | 7 |
|
8 |
| -A *content identifier* is a value that addresses a single piece of content in IPFS. It is mainly a cryptographic hash of the content, but is encoded as a [multihash](https://github.com/multiformats/multihash) and [multicodec](https://github.com/multiformats/multicodec). (Note: older CIDs have a different design — see [version 0](#version-0) below.) |
| 8 | +A *content identifier*, or CID, is a label used for addressing content in IPFS. Any correctly-formed CID identifies a specific piece of content, based on that content's cryptographic hash - a different piece of content will have a different hash and will produce different CID's. |
9 | 9 |
|
10 |
| -<!-- TODO: explain more of the details of how CID v1 is composed here. --> |
| 10 | +Any CID can take a few different forms, each easy for humans and/or software to decode. Any specific CID can be transformed to other equivalent CID representations (for example, using different base, CID version or codec). |
11 | 11 |
|
12 |
| -You can read up on the details in the [CID spec](https://github.com/ipld/cid). You might also want to check out the [CID inspector](http://cid-utils.ipfs.team/#zb2rhiVd5G2DSpnbYtty8NhYHeDvNkPxjSqA7YbDPuhdihj9L) for an interactive breakdown of CIDs. |
| 12 | +CID v1 and later are comprised of some leading identifiers making it easy to identify which representation is used, along with the content-hash itself. In v1 and later, these include a multibase identifier, [multicodec](https://github.com/multiformats/multicodec) identifier, and CID version-identifier: |
| 13 | + |
| 14 | + * The multibase identifier specifies the encoding being used for the CID |
| 15 | + * The CID identifer indicates which version of CID is encoded |
| 16 | + * The multicodec identifier indicates the format of the target content - it helps people and software to know how to interpret that content after the content is fetched |
| 17 | + |
| 18 | +These leading identifiers provide support for different formats to be used in future versions. Older CIDs have a different design that omits these identifiers — see [version 0](#version-0) below. |
| 19 | + |
| 20 | +Using the first few bytes of the CID, the CID can easily be interpreted; the content can be fetched from IPFS, then decoded with the correct codec. For more details, check out the [CID specification](https://github.com/ipld/cid). It includes a [decoding algorithm](https://github.com/ipld/cid/blob/ef1b2002394b15b1e6c26c30545fd485f2c4c138/README.md#decoding-algorithm) and links to existing software implementations for decoding CID's. |
| 21 | + |
| 22 | +You might also want to check out the [CID inspector](http://cid-utils.ipfs.team/#zb2rhiVd5G2DSpnbYtty8NhYHeDvNkPxjSqA7YbDPuhdihj9L) for an interactive breakdown of differently-formatted CIDs. |
13 | 23 |
|
14 | 24 | ## Version 1
|
15 | 25 |
|
16 | 26 | Version 1 is the latest version of CID. It is used by default for `files` ([MFS](/concepts/mfs)) and `object` operations.
|
17 | 27 |
|
18 | 28 | ## Version 0
|
19 | 29 |
|
20 |
| -When IPFS was first designed, we used base 58-encoded multihashes as the content identifiers. (This is simpler, but much less flexible than newer CIDs.) It is still used by default when adding files and blocks to IPFS, so you should generally try to support them. |
| 30 | +When IPFS was first designed, we specified the consistent use of base 58-encoded multihashes as the content identifiers. While this is s simpler, it is also much less flexible than newer CIDs. CIDv0 is still used by default when adding files and blocks to IPFS, so you should generally try to support them. |
21 | 31 |
|
22 |
| -The CID specification includes a [decoding algorithm](https://github.com/ipld/cid/blob/ef1b2002394b15b1e6c26c30545fd485f2c4c138/README.md#decoding-algorithm) you can use to distinguish CID v0 from newer versions. |
| 32 | +There is a [decoding algorithm](https://github.com/ipld/cid/blob/ef1b2002394b15b1e6c26c30545fd485f2c4c138/README.md#decoding-algorithm) that shows how you can distinguish CID v0 from newer versions. |
0 commit comments