Skip to content

Commit 76a23f7

Browse files
committed
break multicodec table into its own file, add a note of how to add new codes
1 parent 6d7f49d commit 76a23f7

File tree

2 files changed

+99
-90
lines changed

2 files changed

+99
-90
lines changed

README.md

Lines changed: 11 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -52,96 +52,17 @@ Multicodec uses "protocol tables" to agree upon the mapping from one multicodec
5252

5353
## Multicodec table
5454

55-
```csv
56-
codec, description, code
57-
58-
miscelaneous
59-
bin, raw binary, 0x55
60-
61-
bases encodings
62-
base1, unary, 0x01
63-
base2, binary (0 and 1), 0x55
64-
base8, octal, 0x07
65-
base10, decimal, 0x09
66-
base16, hexadecimal, 0x
67-
base32, rfc4648, 0x
68-
base32hex, rfc4648, 0x
69-
base58flickr, base58 flicker, 0x
70-
base58btc, base58 bitcoin, 0x
71-
base64, rfc4648, 0x
72-
base64url, rfc4648, 0x
73-
74-
serialization formats
75-
cbor, CBOR, 0x
76-
bson, Binary JSON, 0x
77-
ubjson, Universal Binary JSON, 0x
78-
protobuf, Protocol Buffers, 0x
79-
capnp, Cap-n-Proto, 0x
80-
flatbuf, FlatBuffers, 0x
81-
rlp, recursive length prefix, 0x60
82-
83-
multiformats
84-
multicodec, , 0x30
85-
multihash, , 0x31
86-
multiaddr, , 0x32
87-
multibase, , 0x33
88-
89-
multihashes
90-
sha1, , 0x11
91-
sha2-256, , 0x12
92-
sha2-512, , 0x13
93-
sha3-224, , 0x17
94-
sha3-256, , 0x16
95-
sha3-384, , 0x15
96-
sha3-512, , 0x14
97-
shake-128, , 0x18
98-
shake-256, , 0x19
99-
keccak-224, , 0x1A
100-
keccak-256, , 0x1B
101-
keccak-384, , 0x1C
102-
keccak-512, , 0x1D
103-
Note: keccak has variable output length, instead the number specifies the core length,,
104-
blake2b, , 0x40
105-
blake2s, , 0x41
106-
reserved for apps, appl specific range, 0x4000-0x40f0
107-
108-
multiaddrs
109-
ip4, , 0x04
110-
ip6, , 0x29
111-
tcp, , 0x06
112-
udp, , 0x0111
113-
dccp, , 0x21
114-
sctp, , 0x84
115-
udt, , 0x012D
116-
utp, , 0x012E
117-
ipfs, , 0x2A
118-
http, , 0x01E0
119-
https, , 0x01BB
120-
ws, , 0x01DD
121-
onion, , 0x01BC
122-
123-
archiving formats
124-
tar, , 0x
125-
zip, , 0x
126-
127-
image formats
128-
png, , 0x
129-
jpg, , 0x
130-
131-
video formats
132-
mp4, , 0x
133-
mkv, , 0x
134-
135-
IPLD formats
136-
dag-pb, MerkleDAG protobuf, 0x70
137-
dag-cbor, MerkleDAG cbor, 0x71
138-
eth-block, Ethereum Block (RLP), 0x90
139-
eth-tx, Ethereum Tx (RLP), 0x91
140-
bitcoin-block, Bitcoin Block, 0xb0
141-
bitcoin-tx, Bitcoin Tx, 0xb1
142-
stellar-block, Stellar Block, 0xd0
143-
stellar-tx, Stellar Tx, 0xd1
144-
```
55+
The full table can be found at [table.csv](/table.csv) inside this repo.
56+
57+
### Adding new multicodecs to the table
58+
59+
The process to add a new multicodec to the table is the following:
60+
61+
- 1. Fork this repo
62+
- 2. Update the table with the value you want to add
63+
- 3. Submit a Pull Request
64+
65+
This ["first come, first assign"](https://github.com/multiformats/multicodec/pull/16#issuecomment-260146609) policy is a way to assign codes as they are most needed, without increasing the size of the table (and therefore the size of the multicodecs) too rapidly.
14566

14667
## Implementations
14768

table.csv

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
codec, description, code
2+
3+
miscelaneous,,
4+
bin, raw binary, 0x55
5+
6+
bases encodings,,
7+
base1, unary, 0x01
8+
base2, binary (0 and 1), 0x55
9+
base8, octal, 0x07
10+
base10, decimal, 0x09
11+
base16, hexadecimal, 0x
12+
base32, rfc4648, 0x
13+
base32hex, rfc4648, 0x
14+
base58flickr, base58 flicker, 0x
15+
base58btc, base58 bitcoin, 0x
16+
base64, rfc4648, 0x
17+
base64url, rfc4648, 0x
18+
19+
serialization formats,,
20+
cbor, CBOR, 0x
21+
bson, Binary JSON, 0x
22+
ubjson, Universal Binary JSON, 0x
23+
protobuf, Protocol Buffers, 0x
24+
capnp, Cap-n-Proto, 0x
25+
flatbuf, FlatBuffers, 0x
26+
rlp, recursive length prefix, 0x60
27+
28+
multiformats,,
29+
multicodec, , 0x30
30+
multihash, , 0x31
31+
multiaddr, , 0x32
32+
multibase, , 0x33
33+
34+
multihashes,,
35+
sha1, , 0x11
36+
sha2-256, , 0x12
37+
sha2-512, , 0x13
38+
sha3-224, , 0x17
39+
sha3-256, , 0x16
40+
sha3-384, , 0x15
41+
sha3-512, , 0x14
42+
shake-128, , 0x18
43+
shake-256, , 0x19
44+
keccak-224, , 0x1A
45+
keccak-256, , 0x1B
46+
keccak-384, , 0x1C
47+
keccak-512, , 0x1D
48+
Note: keccak has variable output length. The number specifies the core length,,
49+
blake2b, , 0x40
50+
blake2s, , 0x41
51+
reserved for apps, appl specific range, 0x4000-0x40f0
52+
53+
multiaddrs,,
54+
ip4, , 0x04
55+
ip6, , 0x29
56+
tcp, , 0x06
57+
udp, , 0x0111
58+
dccp, , 0x21
59+
sctp, , 0x84
60+
udt, , 0x012D
61+
utp, , 0x012E
62+
ipfs, , 0x2A
63+
http, , 0x01E0
64+
https, , 0x01BB
65+
ws, , 0x01DD
66+
onion, , 0x01BC
67+
68+
archiving formats,,
69+
tar, , 0x
70+
zip, , 0x
71+
72+
image formats,,
73+
png, , 0x
74+
jpg, , 0x
75+
76+
video formats,,
77+
mp4, , 0x
78+
mkv, , 0x
79+
80+
IPLD formats,,
81+
dag-pb, MerkleDAG protobuf, 0x70
82+
dag-cbor, MerkleDAG cbor, 0x71
83+
eth-block, Ethereum Block (RLP), 0x90
84+
eth-tx, Ethereum Tx (RLP), 0x91
85+
bitcoin-block, Bitcoin Block, 0xb0
86+
bitcoin-tx, Bitcoin Tx, 0xb1
87+
stellar-block, Stellar Block, 0xd0
88+
stellar-tx, Stellar Tx, 0xd1

0 commit comments

Comments
 (0)