在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:multiformats/cid开源软件地址:https://github.com/multiformats/cid开源编程语言:开源软件介绍:CID (Content IDentifier) Specification
Table of Contents
MotivationCID is a format for referencing content in distributed information systems, like IPFS. It leverages content addressing, cryptographic hashing, and self-describing formats. It is the core identifier used by IPFS and IPLD. It uses a multicodec to indicate its version, making it fully self describing. You can read an in-depth discussion on why this format was needed in IPFS here: ipfs/specs#130 (first post reproduced here) What is it?A CID is a self-describing content-addressed identifier. It uses cryptographic hashes to achieve content addressing. It uses several multiformats to achieve flexible self-description, namely multihash for hashes, multicodec for data content types, and multibase to encode the CID itself into strings. Concretely, it's a typed content address: a tuple of How does it work?Current version: CIDv1 A CIDv1 has four parts: <cidv1> ::= <mb><multicodec-cidv1><mc><mh>
# or, expanded:
<cidv1> ::= <multibase-prefix><multicodec-cidv1><multicodec-content-type><multihash-content-address> Where
That's it! Design ConsiderationsCIDs design takes into account many difficult tradeoffs encountered while building IPFS. These are mostly coming from the multiformats project.
Human Readable CIDsIt is advantageous to have a human readable description of a CID, solely for the purposes of debugging and explanation. We can easily transform a CID to a "Human Readable CID" as follows:
Where each sub-component is represented with its own human-readable form:
For example:
See: https://cid.ipfs.io/#zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA VersionsCIDv0CIDv0 is a backwards-compatible version, where:
CIDv1See the section: How does it work?
Decoding AlgorithmTo decode a CID, follow the following algorithm:
ImplementationsFAQ
Please check their repositories: multicodec, multibase, multihash.
We were using base58btc encoded multihashes in IPFS, and then we needed to switch formats to IPLD. We struggled with lots of problems of addressing data with different formats until we created CIDs. You can read the history of this format here: ipfs/specs#130
Yes, kind of! like a file extension, the multicodec identifier establishes the format of the data. Unlike file extensions, these are in the middle of the identifier and not meant to be changed by users. There is also a short table of supported formats.
We are figuring this out at this time. It will likely be a table of formats for secure distributed systems. So far, we want to address: IPFS's original protobuf format, the new IPLD CBOR format, git, bitcoin, and ethereum objects. MaintainersCaptain: @jbenet. ContributeContributions welcome. Please check out the issues. Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to IPLD are subject to the IPFS Code of Conduct. Small note: If editing the README, please conform to the standard-readme specification. LicenseThis repository is only for documents. These are licensed under a CC-BY 3.0 Unported License © 2016 Protocol Labs Inc. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论