You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,28 @@ Each multicodec is marked with a status:
46
46
47
47
NOTE: Just because a codec is marked draft, don't assume that it can be re-assigned. Check to see if it ever gained wide adoption and, if so, mark it as permanent.
48
48
49
+
### Tag Categories
50
+
51
+
Each multicodec entry in the table.csv has a "tag" column that helps categorize the entry type. When adding a new multicodec, it's important to assign the correct tag. Here are descriptions of the most common tags:
52
+
53
+
***multihash**: Entries for cryptographic hash functions as described in [multihash](https://github.com/multiformats/multihash). Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, addressing size and encoding considerations.
54
+
55
+
***hash**: Non-cryptographic hash functions, which are not suitable for content addressing systems but may have other uses. As noted in the [multihash documentation](https://github.com/multiformats/multihash#non-cryptographic-hash-functions), these have specialized use-cases where identifying non-cryptographic hash functions by multihash may be desirable.
56
+
57
+
***key**: Cryptographic key types, including public and private keys for various cryptographic algorithms.
58
+
59
+
***multiaddr**: Network address formats as defined in [multiaddr](https://github.com/multiformats/multiaddr). Multiaddr aims to make network addresses future-proof, composable, and efficient.
60
+
61
+
***ipld**: [InterPlanetary Linked Data](https://ipld.io/) formats. These codecs are suitable for use as a codec in a [CID](https://github.com/multiformats/cid) and will deserialize linked data that may contain links to other data.
62
+
63
+
***serialization**: Similar to "ipld" but does not materialize links. For example, JSON and CBOR have the "serialization" tag, while DAG-JSON and DAG-CBOR have the "ipld" tag because they handle links.
64
+
65
+
***varsig**: Signature formats as described in [varsig](https://github.com/ChainAgnostic/varsig). Varsig is a multiformat for describing signatures over IPLD data and raw bytes in a way that preserves information about the payload and canonicalization information.
66
+
67
+
***namespace**: Namespace identifiers for various protocols and systems.
68
+
69
+
Selecting the appropriate tag helps maintain organization in the table and provides context for how a codec is expected to be used.
70
+
49
71
### Adding new multicodecs to the table
50
72
51
73
The process to add a new multicodec to the table is the following:
@@ -62,7 +84,7 @@ This ["first come, first assign"](https://github.com/multiformats/multicodec/pul
62
84
63
85
The first 127 bits are encoded as a single-byte varint, hence they are reserved for the most widely used multicodecs. So if you are adding your own codec to the table, you most likely would want to ask for a codec bigger than `0x80`.
64
86
65
-
Codec names should be easily convertible to constants in common programming languages using basic transformation rules (e.g. upper-case, conversion of `-` to `_`, etc.). Therefore they should contain alphanumeric characters, with the first character being alphabetic. The primary delimiter for multi-part names should be `-`, with `_` reserved for cases where a secondary delimiter is required. For example: `bls12_381-g1-pub` contains 3 parts: `bls_381`, `g1` and `pub`, where `bls_381` is "BLS 381" which is not commonly written as "BLS381" and therefore requires a secondary separator.
87
+
Codec names should be easily convertible to constants in common programming languages using basic transformation rules (e.g. upper-case, conversion of `-` to `_`, etc.). Therefore they should contain alphanumeric characters, with the first character being alphabetic. The primary delimiter for multi-part names should be `-`, with `_` reserved for cases where a secondary delimiter is required. For example: `bls12_381-g1-pub` contains 3 parts: `bls12_381`, `g1` and `pub`, where `bls12_381` is "BLS12 381" which is not commonly written as "BLS12381" and therefore requires a secondary separator.
66
88
67
89
The `validate.py` script can be used to validate the table once it's edited.
68
90
@@ -77,7 +99,15 @@ The `validate.py` script can be used to validate the table once it's edited.
@@ -112,7 +142,7 @@ You can still find the table in [multibase.csv](https://github.com/multiformats/
112
142
113
143
> Can I use multicodec for my own purpose?
114
144
115
-
Sure, you can use multicodec whenever you have the need for self-identifiable data. Just prefix your own data with the corresponding varint encodec multicodec.
145
+
Sure, you can use multicodec whenever you have the need for self-identifiable data. Just prefix your own data with the corresponding varint encoded multicodec.
0 commit comments