https://github.com/ipld/cid-cbor
Spec for Content Identifiers (CIDs) in CBOR for IANA CBOR Tag registry
https://github.com/ipld/cid-cbor
Last synced: 10 months ago
JSON representation
Spec for Content Identifiers (CIDs) in CBOR for IANA CBOR Tag registry
- Host: GitHub
- URL: https://github.com/ipld/cid-cbor
- Owner: ipld
- Created: 2019-08-20T09:54:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-01T07:33:01.000Z (about 1 year ago)
- Last Synced: 2025-05-01T08:29:41.558Z (about 1 year ago)
- Homepage: https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml
- Size: 2.93 KB
- Stars: 6
- Watchers: 19
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
IPLD content identifiers (CIDs) in CBOR
=======================================
This document registers a tag for serializing IPLD content identifiers (CIDs) in Concise Binary Object Representation ([CBOR]).
Tag: 42
Data item: byte string
Semantics: IPLD content identifier
Created: 2019-08-20
Introduction
------------
[CID] 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].
Syntax
---------
An IPLD content identifier in CBOR has tag 42 and is encoded as a byte string (major type 2). The CID is encoded in its binary representation (base256) and MUST be prepended by the identity [Multibase] prefix (a null-byte).
Example
-------
This CID `bafyreie74tgmnxqwojhtumgh5dzfj46gi4mynlfr7dmm7duwzyvnpw7h7m` is encoded as base32. When encoded as CBOR it will be converted to its (base256) binary representation. In this example it also has the identify Multibase prefix: `00017112209fe4ccc6de16724f3a30c7e8f254f3c6471986acb1f8d8cf8e96ce2ad7dbe7fb`. The binary text is then stored with tag 42:
D8 2A # tag(42)
58 25 # bytes(37)
00017112209FE4CCC6DE16724F3A30C7E8F254F3C6471986ACB1F8D8CF8E96CE2AD7DBE7FB
Author
------
Volker Mische <[volker@protocol.ai](mailto:volker@protocol.ai)>
[CBOR]: https://tools.ietf.org/html/rfc7049
[CID]: https://github.com/ipld/cid
[IPFS]: https://ipfs.io/
[content addressing]: https://en.wikipedia.org/wiki/Content-addressable_storage
[cryptographic hashing]: https://simple.wikipedia.org/wiki/Cryptographic_hash_function
[self-describing formats]: https://github.com/multiformats/multiformats
[IPLD]: https://ipld.io
[Multibase]: https://github.com/multiformats/multibase