diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..50c2cb4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +sudo: false + +language: python + +python: + - "3.6" + +script: + - python validate.py diff --git a/README.md b/README.md index dc6cfc4..595b050 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ## Protocol Description - How does the protocol work? -`multicodec` is a _self-describing multiformat_, it wraps other formats with a tiny bit of self-description. A multicodec identifier may either be a varint (in a byte string) or a symbol (in a text string). +`multicodec` is a _self-describing multiformat_, it wraps other formats with a tiny bit of self-description. A multicodec identifier is a varint. A chunk of data identified by multicodec will look like this: @@ -48,12 +48,11 @@ It is worth noting that multicodec works very well in conjunction with [multihas ## MulticodecProtocol Tables -Multicodec uses "protocol tables" to agree upon the mapping from one multicodec code. These tables can be application specific, though -- like [with](https://github.com/multiformats/multihash) [other](https://github.com/multiformats/multibase) [multiformats](https://github.com/multiformats/multiaddr) -- we will keep a globally agreed upon table with common protocols and formats. +Multicodec uses "protocol tables" to agree upon the mapping from one multicodec code. These tables can be application specific, though -- like [with](https://github.com/multiformats/multihash) other [multiformats](https://github.com/multiformats/multiaddr) -- we will keep a globally agreed upon table with common protocols and formats. ## Multicodec table -The full table can be found at [table.csv](/table.csv) inside this repo. Codes -prefixed with `0x` are varint multicodecs and all others are symbolic. +The full table can be found at [table.csv](/table.csv) inside this repo. There's also a sortable [viewer](https://ipfs.io/ipfs/QmXec1jjwzxWJoNbxQF5KffL8q6hFXm9QwUGaa3wKGk6dT/#title=Multicodecs&src=https://raw.githubusercontent.com/multiformats/multicodec/master/table.csv). ### Adding new multicodecs to the table @@ -71,6 +70,8 @@ This ["first come, first assign"](https://github.com/multiformats/multicodec/pul - [JavaScript](https://github.com/multiformats/js-multicodec) - [Python](https://github.com/multiformats/py-multicodec) - [Haskell](https://github.com/multiformats/haskell-multicodec) +- [Elixir](https://github.com/nocursor/ex-multicodec) +- [Scala](https://github.com/fluency03/scala-multicodec) - [Add yours today!](https://github.com/multiformats/multicodec/edit/master/table.csv) ## Multicodec Path, also known as [`multistream`](https://github.com/multiformats/multistream) @@ -81,17 +82,13 @@ In order to enable self descriptive data formats or streams that can be dynamica ## FAQ -> **Q. I have questions on multicodec, not listed here.** - -That's not a question. But, have you checked the proper [multicodec FAQ](./README.md#faq)? Maybe your question is answered there. This FAQ is only specifically for multicodec. - > **Q. Why?** Because [multistream](https://github.com/multiformats/multistream) is too long for identifiers. We needed something shorter. > **Q. Why varints?** -So that we have no limitation on protocols. Implementation note: you do not need to implement varints until the standard multicodec table has more than 127 functions. +So that we have no limitation on protocols. > **Q. What kind of varints?** @@ -101,15 +98,11 @@ An Most Significant Bit unsigned varint, as defined by the [multiformats/unsigne Yes, but we already have to agree on what protocols themselves are, so this is not so hard. The table even leaves some room for custom protocol paths, or you can use your own tables. The standard table is only for common things. -> **Q. Why distinguish between bytes and text?** +> **Q. Where did multibase go?** -For completeness, we consider -[multibase](https://github.com/multiformats/multibase) prefixes to be -multicodecs. However multibase prefixes occur in *text*, and are therefore *symbols*. They may (or may not) have some underlying binary representation but that changes based on the text encoding used. +For a period of time, the multibase prefixes lived in this table. However, multibase prefixes are *symbols* that may map to *multiple* underlying byte representations (that may overlap with byte sequences used for other multicodecs). Including them in a table for binary/byte identifiers lead to more confusion than it solved. -## Maintainers - -Captain: [@jbenet](https://github.com/jbenet). +You can still find the table in [multibase.csv](https://github.com/multiformats/multibase/blob/master/multibase.csv). ## Contribute diff --git a/table.csv b/table.csv index 54d573f..9ab3e37 100644 --- a/table.csv +++ b/table.csv @@ -1,458 +1,422 @@ -codec, description, code - -miscellaneous,, -raw, raw binary, 0x55 - -bases encodings,, -identity, raw binary, NUL -base1, unary, "1" -base2, binary (0 and 1), "0" -base8, octal, "7" -base10, decimal, "9" -base16, hexadecimal, "f" -base16-upper, hexadecimal, "F" -base32, rfc4648, "b" -base32-upper, rfc4648, "B" -base32pad, rfc4648, "c" -base32pad-upper, rfc4648, "C" -base32hex, rfc4648, "v" -base32hex-upper, rfc4648, "V" -base32hexpad, rfc4648, "t" -base32hexpad-upper, rfc4648, "T" -base58flickr, base58 flicker, "Z" -base58btc, base58 bitcoin, "z" -base64, rfc4648, "m" -base64pad, rfc4648, "M" -base64url, rfc4648, "u" -base64urlpad, rfc4648, "U" - -serialization formats,, -cbor, CBOR, 0x51 -bson, Binary JSON, 0x -ubjson, Universal Binary JSON, 0x -protobuf, Protocol Buffers, 0x50 -capnp, Cap-n-Proto, 0x -flatbuf, FlatBuffers, 0x -rlp, recursive length prefix, 0x60 -msgpack, MessagePack, 0x -binc, Binc, 0x -bencode, bencode, 0x63 - -multiformats,, -multicodec, , 0x30 -multihash, , 0x31 -multiaddr, , 0x32 -multibase, , 0x33 - -multihashes,, -identity, raw binary, 0x0 -md4, , 0xd4 -md5, , 0xd5 -sha1, , 0x11 -sha2-256, , 0x12 -sha2-512, , 0x13 -dbl-sha2-256, , 0x56 -sha3-224, , 0x17 -sha3-256, , 0x16 -sha3-384, , 0x15 -sha3-512, , 0x14 -shake-128, , 0x18 -shake-256, , 0x19 -keccak-224,keccak has variable output length. The number specifies the core length,0x1A -keccak-256, , 0x1B -keccak-384, , 0x1C -keccak-512, , 0x1D -murmur3, , 0x22 -x11, , 0x1100 - -blake2b-8,Blake2b consists of 64 output lengths that give different hashes,0xb201 -blake2b-16,,0xb202 -blake2b-24,,0xb203 -blake2b-32,,0xb204 -blake2b-40,,0xb205 -blake2b-48,,0xb206 -blake2b-56,,0xb207 -blake2b-64,,0xb208 -blake2b-72,,0xb209 -blake2b-80,,0xb20a -blake2b-88,,0xb20b -blake2b-96,,0xb20c -blake2b-104,,0xb20d -blake2b-112,,0xb20e -blake2b-120,,0xb20f -blake2b-128,,0xb210 -blake2b-136,,0xb211 -blake2b-144,,0xb212 -blake2b-152,,0xb213 -blake2b-160,,0xb214 -blake2b-168,,0xb215 -blake2b-176,,0xb216 -blake2b-184,,0xb217 -blake2b-192,,0xb218 -blake2b-200,,0xb219 -blake2b-208,,0xb21a -blake2b-216,,0xb21b -blake2b-224,,0xb21c -blake2b-232,,0xb21d -blake2b-240,,0xb21e -blake2b-248,,0xb21f -blake2b-256,,0xb220 -blake2b-264,,0xb221 -blake2b-272,,0xb222 -blake2b-280,,0xb223 -blake2b-288,,0xb224 -blake2b-296,,0xb225 -blake2b-304,,0xb226 -blake2b-312,,0xb227 -blake2b-320,,0xb228 -blake2b-328,,0xb229 -blake2b-336,,0xb22a -blake2b-344,,0xb22b -blake2b-352,,0xb22c -blake2b-360,,0xb22d -blake2b-368,,0xb22e -blake2b-376,,0xb22f -blake2b-384,,0xb230 -blake2b-392,,0xb231 -blake2b-400,,0xb232 -blake2b-408,,0xb233 -blake2b-416,,0xb234 -blake2b-424,,0xb235 -blake2b-432,,0xb236 -blake2b-440,,0xb237 -blake2b-448,,0xb238 -blake2b-456,,0xb239 -blake2b-464,,0xb23a -blake2b-472,,0xb23b -blake2b-480,,0xb23c -blake2b-488,,0xb23d -blake2b-496,,0xb23e -blake2b-504,,0xb23f -blake2b-512,,0xb240 -blake2s-8,Blake2s consists of 32 output lengths that give different hashes,0xb241 -blake2s-16,,0xb242 -blake2s-24,,0xb243 -blake2s-32,,0xb244 -blake2s-40,,0xb245 -blake2s-48,,0xb246 -blake2s-56,,0xb247 -blake2s-64,,0xb248 -blake2s-72,,0xb249 -blake2s-80,,0xb24a -blake2s-88,,0xb24b -blake2s-96,,0xb24c -blake2s-104,,0xb24d -blake2s-112,,0xb24e -blake2s-120,,0xb24f -blake2s-128,,0xb250 -blake2s-136,,0xb251 -blake2s-144,,0xb252 -blake2s-152,,0xb253 -blake2s-160,,0xb254 -blake2s-168,,0xb255 -blake2s-176,,0xb256 -blake2s-184,,0xb257 -blake2s-192,,0xb258 -blake2s-200,,0xb259 -blake2s-208,,0xb25a -blake2s-216,,0xb25b -blake2s-224,,0xb25c -blake2s-232,,0xb25d -blake2s-240,,0xb25e -blake2s-248,,0xb25f -blake2s-256,,0xb260 - -skein256-8,Skein256 consists of 32 output lengths that give different hashes,0xb301 -skein256-16,,0xb302 -skein256-24,,0xb303 -skein256-32,,0xb304 -skein256-40,,0xb305 -skein256-48,,0xb306 -skein256-56,,0xb307 -skein256-64,,0xb308 -skein256-72,,0xb309 -skein256-80,,0xb30a -skein256-88,,0xb30b -skein256-96,,0xb30c -skein256-104,,0xb30d -skein256-112,,0xb30e -skein256-120,,0xb30f -skein256-128,,0xb310 -skein256-136,,0xb311 -skein256-144,,0xb312 -skein256-152,,0xb313 -skein256-160,,0xb314 -skein256-168,,0xb315 -skein256-176,,0xb316 -skein256-184,,0xb317 -skein256-192,,0xb318 -skein256-200,,0xb319 -skein256-208,,0xb31a -skein256-216,,0xb31b -skein256-224,,0xb31c -skein256-232,,0xb31d -skein256-240,,0xb31e -skein256-248,,0xb31f -skein256-256,,0xb320 -skein512-8,Skein512 consists of 64 output lengths that give different hashes,0xb321 -skein512-16,,0xb322 -skein512-24,,0xb323 -skein512-32,,0xb324 -skein512-40,,0xb325 -skein512-48,,0xb326 -skein512-56,,0xb327 -skein512-64,,0xb328 -skein512-72,,0xb329 -skein512-80,,0xb32a -skein512-88,,0xb32b -skein512-96,,0xb32c -skein512-104,,0xb32d -skein512-112,,0xb32e -skein512-120,,0xb32f -skein512-128,,0xb330 -skein512-136,,0xb331 -skein512-144,,0xb332 -skein512-152,,0xb333 -skein512-160,,0xb334 -skein512-168,,0xb335 -skein512-176,,0xb336 -skein512-184,,0xb337 -skein512-192,,0xb338 -skein512-200,,0xb339 -skein512-208,,0xb33a -skein512-216,,0xb33b -skein512-224,,0xb33c -skein512-232,,0xb33d -skein512-240,,0xb33e -skein512-248,,0xb33f -skein512-256,,0xb340 -skein512-264,,0xb341 -skein512-272,,0xb342 -skein512-280,,0xb343 -skein512-288,,0xb344 -skein512-296,,0xb345 -skein512-304,,0xb346 -skein512-312,,0xb347 -skein512-320,,0xb348 -skein512-328,,0xb349 -skein512-336,,0xb34a -skein512-344,,0xb34b -skein512-352,,0xb34c -skein512-360,,0xb34d -skein512-368,,0xb34e -skein512-376,,0xb34f -skein512-384,,0xb350 -skein512-392,,0xb351 -skein512-400,,0xb352 -skein512-408,,0xb353 -skein512-416,,0xb354 -skein512-424,,0xb355 -skein512-432,,0xb356 -skein512-440,,0xb357 -skein512-448,,0xb358 -skein512-456,,0xb359 -skein512-464,,0xb35a -skein512-472,,0xb35b -skein512-480,,0xb35c -skein512-488,,0xb35d -skein512-496,,0xb35e -skein512-504,,0xb35f -skein512-512,,0xb360 -skein1024-8,Skein1024 consists of 128 output lengths that give different hashes,0xb361 -skein1024-16,,0xb362 -skein1024-24,,0xb363 -skein1024-32,,0xb364 -skein1024-40,,0xb365 -skein1024-48,,0xb366 -skein1024-56,,0xb367 -skein1024-64,,0xb368 -skein1024-72,,0xb369 -skein1024-80,,0xb36a -skein1024-88,,0xb36b -skein1024-96,,0xb36c -skein1024-104,,0xb36d -skein1024-112,,0xb36e -skein1024-120,,0xb36f -skein1024-128,,0xb370 -skein1024-136,,0xb371 -skein1024-144,,0xb372 -skein1024-152,,0xb373 -skein1024-160,,0xb374 -skein1024-168,,0xb375 -skein1024-176,,0xb376 -skein1024-184,,0xb377 -skein1024-192,,0xb378 -skein1024-200,,0xb379 -skein1024-208,,0xb37a -skein1024-216,,0xb37b -skein1024-224,,0xb37c -skein1024-232,,0xb37d -skein1024-240,,0xb37e -skein1024-248,,0xb37f -skein1024-256,,0xb380 -skein1024-264,,0xb381 -skein1024-272,,0xb382 -skein1024-280,,0xb383 -skein1024-288,,0xb384 -skein1024-296,,0xb385 -skein1024-304,,0xb386 -skein1024-312,,0xb387 -skein1024-320,,0xb388 -skein1024-328,,0xb389 -skein1024-336,,0xb38a -skein1024-344,,0xb38b -skein1024-352,,0xb38c -skein1024-360,,0xb38d -skein1024-368,,0xb38e -skein1024-376,,0xb38f -skein1024-384,,0xb390 -skein1024-392,,0xb391 -skein1024-400,,0xb392 -skein1024-408,,0xb393 -skein1024-416,,0xb394 -skein1024-424,,0xb395 -skein1024-432,,0xb396 -skein1024-440,,0xb397 -skein1024-448,,0xb398 -skein1024-456,,0xb399 -skein1024-464,,0xb39a -skein1024-472,,0xb39b -skein1024-480,,0xb39c -skein1024-488,,0xb39d -skein1024-496,,0xb39e -skein1024-504,,0xb39f -skein1024-512,,0xb3a0 -skein1024-520,,0xb3a1 -skein1024-528,,0xb3a2 -skein1024-536,,0xb3a3 -skein1024-544,,0xb3a4 -skein1024-552,,0xb3a5 -skein1024-560,,0xb3a6 -skein1024-568,,0xb3a7 -skein1024-576,,0xb3a8 -skein1024-584,,0xb3a9 -skein1024-592,,0xb3aa -skein1024-600,,0xb3ab -skein1024-608,,0xb3ac -skein1024-616,,0xb3ad -skein1024-624,,0xb3ae -skein1024-632,,0xb3af -skein1024-640,,0xb3b0 -skein1024-648,,0xb3b1 -skein1024-656,,0xb3b2 -skein1024-664,,0xb3b3 -skein1024-672,,0xb3b4 -skein1024-680,,0xb3b5 -skein1024-688,,0xb3b6 -skein1024-696,,0xb3b7 -skein1024-704,,0xb3b8 -skein1024-712,,0xb3b9 -skein1024-720,,0xb3ba -skein1024-728,,0xb3bb -skein1024-736,,0xb3bc -skein1024-744,,0xb3bd -skein1024-752,,0xb3be -skein1024-760,,0xb3bf -skein1024-768,,0xb3c0 -skein1024-776,,0xb3c1 -skein1024-784,,0xb3c2 -skein1024-792,,0xb3c3 -skein1024-800,,0xb3c4 -skein1024-808,,0xb3c5 -skein1024-816,,0xb3c6 -skein1024-824,,0xb3c7 -skein1024-832,,0xb3c8 -skein1024-840,,0xb3c9 -skein1024-848,,0xb3ca -skein1024-856,,0xb3cb -skein1024-864,,0xb3cc -skein1024-872,,0xb3cd -skein1024-880,,0xb3ce -skein1024-888,,0xb3cf -skein1024-896,,0xb3d0 -skein1024-904,,0xb3d1 -skein1024-912,,0xb3d2 -skein1024-920,,0xb3d3 -skein1024-928,,0xb3d4 -skein1024-936,,0xb3d5 -skein1024-944,,0xb3d6 -skein1024-952,,0xb3d7 -skein1024-960,,0xb3d8 -skein1024-968,,0xb3d9 -skein1024-976,,0xb3da -skein1024-984,,0xb3db -skein1024-992,,0xb3dc -skein1024-1000,,0xb3dd -skein1024-1008,,0xb3de -skein1024-1016,,0xb3df -skein1024-1024,,0xb3e0 - - -multiaddrs,, -ip4, , 0x04 -ip6, , 0x29 -ip6zone, , 0x2A -tcp, , 0x06 -udp, , 0x0111 -dccp, , 0x21 -sctp, , 0x84 -udt, , 0x012D -utp, , 0x012E -ipfs, , 0x01A5 -http, , 0x01E0 -https, , 0x01BB -quic, , 0x01CC -ws, , 0x01DD -onion, , 0x01BC -onion3, , 0x01BD -garlict, , 0x01CA -garlicu, , 0x01CB -p2p-circuit, , 0x0122 - -archiving formats,, -tar, , 0x -zip, , 0x - -image formats,, -png, , 0x -jpg, , 0x - -video formats,, -mp4, , 0x -mkv, , 0x - -IPLD formats,, -dag-pb, MerkleDAG protobuf, 0x70 -dag-cbor, MerkleDAG cbor, 0x71 -dag-json, MerkleDAG json, 0x129 - -git-raw, Raw Git object, 0x78 - -eth-block, Ethereum Block (RLP), 0x90 -eth-block-list, Ethereum Block List (RLP), 0x91 -eth-tx-trie, Ethereum Transaction Trie (Eth-Trie), 0x92 -eth-tx, Ethereum Transaction (RLP), 0x93 -eth-tx-receipt-trie, Ethereum Transaction Receipt Trie (Eth-Trie), 0x94 -eth-tx-receipt, Ethereum Transaction Receipt (RLP), 0x95 -eth-state-trie, Ethereum State Trie (Eth-Secure-Trie), 0x96 -eth-account-snapshot, Ethereum Account Snapshot (RLP), 0x97 -eth-storage-trie, Ethereum Contract Storage Trie (Eth-Secure-Trie), 0x98 - -bitcoin-block, Bitcoin Block, 0xb0 -bitcoin-tx, Bitcoin Tx, 0xb1 - -zcash-block, Zcash Block, 0xc0 -zcash-tx, Zcash Tx, 0xc1 - -stellar-block, Stellar Block, 0xd0 -stellar-tx, Stellar Tx, 0xd1 - -decred-block, Decred Block, 0xe0 -decred-tx, Decred Tx, 0xe1 - -dash-block, Dash Block, 0xf0 -dash-tx, Dash Tx, 0xf1 - -torrent-info, Torrent file info field (bencoded), 0x7b -torrent-file, Torrent file (bencoded), 0x7c -ed25519-pub, Ed25519 public key, 0xed +name, tag, code, description +identity, multihash, 0x0, raw binary +ip4, multiaddr, 0x04, +tcp, multiaddr, 0x06, +sha1, multihash, 0x11, +sha2-256, multihash, 0x12, +sha2-512, multihash, 0x13, +sha3-512, multihash, 0x14, +sha3-384, multihash, 0x15, +sha3-256, multihash, 0x16, +sha3-224, multihash, 0x17, +shake-128, multihash, 0x18, +shake-256, multihash, 0x19, +keccak-224, multihash, 0x1A, keccak has variable output length. The number specifies the core length +keccak-256, multihash, 0x1B, +keccak-384, multihash, 0x1C, +keccak-512, multihash, 0x1D, +dccp, multiaddr, 0x21, +murmur3-128, multihash, 0x22, +murmur3-32, multihash, 0x23, +ip6, multiaddr, 0x29, +ip6zone, multiaddr, 0x2A, +path, namespace, 0x2F, Namespace for string paths. Corresponds to `/` in ASCII. +multicodec, multiformat, 0x30, +multihash, multiformat, 0x31, +multiaddr, multiformat, 0x32, +multibase, multiformat, 0x33, +dns, multiaddr, 0x35, +dns4, multiaddr, 0x36, +dns6, multiaddr, 0x37, +dnsaddr, multiaddr, 0x38, +protobuf, serialization, 0x50, Protocol Buffers +cbor, serialization, 0x51, CBOR +raw, ipld, 0x55, raw binary +dbl-sha2-256, multihash, 0x56, +rlp, serialization, 0x60, recursive length prefix +bencode, serialization, 0x63, bencode +dag-pb, ipld, 0x70, MerkleDAG protobuf +dag-cbor, ipld, 0x71, MerkleDAG cbor +git-raw, ipld, 0x78, Raw Git object +torrent-info, ipld, 0x7b, Torrent file info field (bencoded) +torrent-file, ipld, 0x7c, Torrent file (bencoded) +leofcoin-block, ipld, 0x81, Leofcoin Block +leofcoin-tx, ipld, 0x82, Leofcoin Transaction +leofcoin-pr, ipld, 0x83, Leofcoin Peer Reputation +sctp, multiaddr, 0x84, +eth-block, ipld, 0x90, Ethereum Block (RLP) +eth-block-list, ipld, 0x91, Ethereum Block List (RLP) +eth-tx-trie, ipld, 0x92, Ethereum Transaction Trie (Eth-Trie) +eth-tx, ipld, 0x93, Ethereum Transaction (RLP) +eth-tx-receipt-trie, ipld, 0x94, Ethereum Transaction Receipt Trie (Eth-Trie) +eth-tx-receipt, ipld, 0x95, Ethereum Transaction Receipt (RLP) +eth-state-trie, ipld, 0x96, Ethereum State Trie (Eth-Secure-Trie) +eth-account-snapshot, ipld, 0x97, Ethereum Account Snapshot (RLP) +eth-storage-trie, ipld, 0x98, Ethereum Contract Storage Trie (Eth-Secure-Trie) +bitcoin-block, ipld, 0xb0, Bitcoin Block +bitcoin-tx, ipld, 0xb1, Bitcoin Tx +zcash-block, ipld, 0xc0, Zcash Block +zcash-tx, ipld, 0xc1, Zcash Tx +stellar-block, ipld, 0xd0, Stellar Block +stellar-tx, ipld, 0xd1, Stellar Tx +md4, multihash, 0xd4, +md5, multihash, 0xd5, +bmt, multihash, 0xd6, Binary Merkle Tree Hash +decred-block, ipld, 0xe0, Decred Block +decred-tx, ipld, 0xe1, Decred Tx +ipld-ns, namespace, 0xe2, IPLD path +ipfs-ns, namespace, 0xe3, IPFS path +swarm-ns, namespace, 0xe4, Swarm path +ed25519-pub, key, 0xed, Ed25519 public key +dash-block, ipld, 0xf0, Dash Block +dash-tx, ipld, 0xf1, Dash Tx +swarm-manifest, ipld, 0xfa, Swarm Manifest +swarm-feed, ipld, 0xfb, Swarm Feed +udp, multiaddr, 0x0111, +p2p-webrtc-star, multiaddr, 0x0113, +p2p-webrtc-direct, multiaddr, 0x0114, +p2p-stardust, multiaddr, 0x0115, +p2p-circuit, multiaddr, 0x0122, +dag-json, ipld, 0x0129, MerkleDAG json +udt, multiaddr, 0x012D, +utp, multiaddr, 0x012E, +unix, multiaddr, 0x0190, +p2p, multiaddr, 0x01A5, libp2p +ipfs, multiaddr, 0x01A5, libp2p (deprecated) +https, multiaddr, 0x01BB, +onion, multiaddr, 0x01BC, +onion3, multiaddr, 0x01BD, +garlic64, multiaddr, 0x01BE, I2P base64 +garlic32, multiaddr, 0x01BF, I2P base32 +quic, multiaddr, 0x01CC, +ws, multiaddr, 0x01DD, +wss, multiaddr, 0x01DE, +p2p-websocket-star, multiaddr, 0x01DF, +http, multiaddr, 0x01E0, +x11, multihash, 0x1100, +blake2b-8, multihash, 0xb201, Blake2b consists of 64 output lengths that give different hashes +blake2b-16, multihash, 0xb202, +blake2b-24, multihash, 0xb203, +blake2b-32, multihash, 0xb204, +blake2b-40, multihash, 0xb205, +blake2b-48, multihash, 0xb206, +blake2b-56, multihash, 0xb207, +blake2b-64, multihash, 0xb208, +blake2b-72, multihash, 0xb209, +blake2b-80, multihash, 0xb20a, +blake2b-88, multihash, 0xb20b, +blake2b-96, multihash, 0xb20c, +blake2b-104, multihash, 0xb20d, +blake2b-112, multihash, 0xb20e, +blake2b-120, multihash, 0xb20f, +blake2b-128, multihash, 0xb210, +blake2b-136, multihash, 0xb211, +blake2b-144, multihash, 0xb212, +blake2b-152, multihash, 0xb213, +blake2b-160, multihash, 0xb214, +blake2b-168, multihash, 0xb215, +blake2b-176, multihash, 0xb216, +blake2b-184, multihash, 0xb217, +blake2b-192, multihash, 0xb218, +blake2b-200, multihash, 0xb219, +blake2b-208, multihash, 0xb21a, +blake2b-216, multihash, 0xb21b, +blake2b-224, multihash, 0xb21c, +blake2b-232, multihash, 0xb21d, +blake2b-240, multihash, 0xb21e, +blake2b-248, multihash, 0xb21f, +blake2b-256, multihash, 0xb220, +blake2b-264, multihash, 0xb221, +blake2b-272, multihash, 0xb222, +blake2b-280, multihash, 0xb223, +blake2b-288, multihash, 0xb224, +blake2b-296, multihash, 0xb225, +blake2b-304, multihash, 0xb226, +blake2b-312, multihash, 0xb227, +blake2b-320, multihash, 0xb228, +blake2b-328, multihash, 0xb229, +blake2b-336, multihash, 0xb22a, +blake2b-344, multihash, 0xb22b, +blake2b-352, multihash, 0xb22c, +blake2b-360, multihash, 0xb22d, +blake2b-368, multihash, 0xb22e, +blake2b-376, multihash, 0xb22f, +blake2b-384, multihash, 0xb230, +blake2b-392, multihash, 0xb231, +blake2b-400, multihash, 0xb232, +blake2b-408, multihash, 0xb233, +blake2b-416, multihash, 0xb234, +blake2b-424, multihash, 0xb235, +blake2b-432, multihash, 0xb236, +blake2b-440, multihash, 0xb237, +blake2b-448, multihash, 0xb238, +blake2b-456, multihash, 0xb239, +blake2b-464, multihash, 0xb23a, +blake2b-472, multihash, 0xb23b, +blake2b-480, multihash, 0xb23c, +blake2b-488, multihash, 0xb23d, +blake2b-496, multihash, 0xb23e, +blake2b-504, multihash, 0xb23f, +blake2b-512, multihash, 0xb240, +blake2s-8, multihash, 0xb241, Blake2s consists of 32 output lengths that give different hashes +blake2s-16, multihash, 0xb242, +blake2s-24, multihash, 0xb243, +blake2s-32, multihash, 0xb244, +blake2s-40, multihash, 0xb245, +blake2s-48, multihash, 0xb246, +blake2s-56, multihash, 0xb247, +blake2s-64, multihash, 0xb248, +blake2s-72, multihash, 0xb249, +blake2s-80, multihash, 0xb24a, +blake2s-88, multihash, 0xb24b, +blake2s-96, multihash, 0xb24c, +blake2s-104, multihash, 0xb24d, +blake2s-112, multihash, 0xb24e, +blake2s-120, multihash, 0xb24f, +blake2s-128, multihash, 0xb250, +blake2s-136, multihash, 0xb251, +blake2s-144, multihash, 0xb252, +blake2s-152, multihash, 0xb253, +blake2s-160, multihash, 0xb254, +blake2s-168, multihash, 0xb255, +blake2s-176, multihash, 0xb256, +blake2s-184, multihash, 0xb257, +blake2s-192, multihash, 0xb258, +blake2s-200, multihash, 0xb259, +blake2s-208, multihash, 0xb25a, +blake2s-216, multihash, 0xb25b, +blake2s-224, multihash, 0xb25c, +blake2s-232, multihash, 0xb25d, +blake2s-240, multihash, 0xb25e, +blake2s-248, multihash, 0xb25f, +blake2s-256, multihash, 0xb260, +skein256-8, multihash, 0xb301, Skein256 consists of 32 output lengths that give different hashes +skein256-16, multihash, 0xb302, +skein256-24, multihash, 0xb303, +skein256-32, multihash, 0xb304, +skein256-40, multihash, 0xb305, +skein256-48, multihash, 0xb306, +skein256-56, multihash, 0xb307, +skein256-64, multihash, 0xb308, +skein256-72, multihash, 0xb309, +skein256-80, multihash, 0xb30a, +skein256-88, multihash, 0xb30b, +skein256-96, multihash, 0xb30c, +skein256-104, multihash, 0xb30d, +skein256-112, multihash, 0xb30e, +skein256-120, multihash, 0xb30f, +skein256-128, multihash, 0xb310, +skein256-136, multihash, 0xb311, +skein256-144, multihash, 0xb312, +skein256-152, multihash, 0xb313, +skein256-160, multihash, 0xb314, +skein256-168, multihash, 0xb315, +skein256-176, multihash, 0xb316, +skein256-184, multihash, 0xb317, +skein256-192, multihash, 0xb318, +skein256-200, multihash, 0xb319, +skein256-208, multihash, 0xb31a, +skein256-216, multihash, 0xb31b, +skein256-224, multihash, 0xb31c, +skein256-232, multihash, 0xb31d, +skein256-240, multihash, 0xb31e, +skein256-248, multihash, 0xb31f, +skein256-256, multihash, 0xb320, +skein512-8, multihash, 0xb321, Skein512 consists of 64 output lengths that give different hashes +skein512-16, multihash, 0xb322, +skein512-24, multihash, 0xb323, +skein512-32, multihash, 0xb324, +skein512-40, multihash, 0xb325, +skein512-48, multihash, 0xb326, +skein512-56, multihash, 0xb327, +skein512-64, multihash, 0xb328, +skein512-72, multihash, 0xb329, +skein512-80, multihash, 0xb32a, +skein512-88, multihash, 0xb32b, +skein512-96, multihash, 0xb32c, +skein512-104, multihash, 0xb32d, +skein512-112, multihash, 0xb32e, +skein512-120, multihash, 0xb32f, +skein512-128, multihash, 0xb330, +skein512-136, multihash, 0xb331, +skein512-144, multihash, 0xb332, +skein512-152, multihash, 0xb333, +skein512-160, multihash, 0xb334, +skein512-168, multihash, 0xb335, +skein512-176, multihash, 0xb336, +skein512-184, multihash, 0xb337, +skein512-192, multihash, 0xb338, +skein512-200, multihash, 0xb339, +skein512-208, multihash, 0xb33a, +skein512-216, multihash, 0xb33b, +skein512-224, multihash, 0xb33c, +skein512-232, multihash, 0xb33d, +skein512-240, multihash, 0xb33e, +skein512-248, multihash, 0xb33f, +skein512-256, multihash, 0xb340, +skein512-264, multihash, 0xb341, +skein512-272, multihash, 0xb342, +skein512-280, multihash, 0xb343, +skein512-288, multihash, 0xb344, +skein512-296, multihash, 0xb345, +skein512-304, multihash, 0xb346, +skein512-312, multihash, 0xb347, +skein512-320, multihash, 0xb348, +skein512-328, multihash, 0xb349, +skein512-336, multihash, 0xb34a, +skein512-344, multihash, 0xb34b, +skein512-352, multihash, 0xb34c, +skein512-360, multihash, 0xb34d, +skein512-368, multihash, 0xb34e, +skein512-376, multihash, 0xb34f, +skein512-384, multihash, 0xb350, +skein512-392, multihash, 0xb351, +skein512-400, multihash, 0xb352, +skein512-408, multihash, 0xb353, +skein512-416, multihash, 0xb354, +skein512-424, multihash, 0xb355, +skein512-432, multihash, 0xb356, +skein512-440, multihash, 0xb357, +skein512-448, multihash, 0xb358, +skein512-456, multihash, 0xb359, +skein512-464, multihash, 0xb35a, +skein512-472, multihash, 0xb35b, +skein512-480, multihash, 0xb35c, +skein512-488, multihash, 0xb35d, +skein512-496, multihash, 0xb35e, +skein512-504, multihash, 0xb35f, +skein512-512, multihash, 0xb360, +skein1024-8, multihash, 0xb361, Skein1024 consists of 128 output lengths that give different hashes +skein1024-16, multihash, 0xb362, +skein1024-24, multihash, 0xb363, +skein1024-32, multihash, 0xb364, +skein1024-40, multihash, 0xb365, +skein1024-48, multihash, 0xb366, +skein1024-56, multihash, 0xb367, +skein1024-64, multihash, 0xb368, +skein1024-72, multihash, 0xb369, +skein1024-80, multihash, 0xb36a, +skein1024-88, multihash, 0xb36b, +skein1024-96, multihash, 0xb36c, +skein1024-104, multihash, 0xb36d, +skein1024-112, multihash, 0xb36e, +skein1024-120, multihash, 0xb36f, +skein1024-128, multihash, 0xb370, +skein1024-136, multihash, 0xb371, +skein1024-144, multihash, 0xb372, +skein1024-152, multihash, 0xb373, +skein1024-160, multihash, 0xb374, +skein1024-168, multihash, 0xb375, +skein1024-176, multihash, 0xb376, +skein1024-184, multihash, 0xb377, +skein1024-192, multihash, 0xb378, +skein1024-200, multihash, 0xb379, +skein1024-208, multihash, 0xb37a, +skein1024-216, multihash, 0xb37b, +skein1024-224, multihash, 0xb37c, +skein1024-232, multihash, 0xb37d, +skein1024-240, multihash, 0xb37e, +skein1024-248, multihash, 0xb37f, +skein1024-256, multihash, 0xb380, +skein1024-264, multihash, 0xb381, +skein1024-272, multihash, 0xb382, +skein1024-280, multihash, 0xb383, +skein1024-288, multihash, 0xb384, +skein1024-296, multihash, 0xb385, +skein1024-304, multihash, 0xb386, +skein1024-312, multihash, 0xb387, +skein1024-320, multihash, 0xb388, +skein1024-328, multihash, 0xb389, +skein1024-336, multihash, 0xb38a, +skein1024-344, multihash, 0xb38b, +skein1024-352, multihash, 0xb38c, +skein1024-360, multihash, 0xb38d, +skein1024-368, multihash, 0xb38e, +skein1024-376, multihash, 0xb38f, +skein1024-384, multihash, 0xb390, +skein1024-392, multihash, 0xb391, +skein1024-400, multihash, 0xb392, +skein1024-408, multihash, 0xb393, +skein1024-416, multihash, 0xb394, +skein1024-424, multihash, 0xb395, +skein1024-432, multihash, 0xb396, +skein1024-440, multihash, 0xb397, +skein1024-448, multihash, 0xb398, +skein1024-456, multihash, 0xb399, +skein1024-464, multihash, 0xb39a, +skein1024-472, multihash, 0xb39b, +skein1024-480, multihash, 0xb39c, +skein1024-488, multihash, 0xb39d, +skein1024-496, multihash, 0xb39e, +skein1024-504, multihash, 0xb39f, +skein1024-512, multihash, 0xb3a0, +skein1024-520, multihash, 0xb3a1, +skein1024-528, multihash, 0xb3a2, +skein1024-536, multihash, 0xb3a3, +skein1024-544, multihash, 0xb3a4, +skein1024-552, multihash, 0xb3a5, +skein1024-560, multihash, 0xb3a6, +skein1024-568, multihash, 0xb3a7, +skein1024-576, multihash, 0xb3a8, +skein1024-584, multihash, 0xb3a9, +skein1024-592, multihash, 0xb3aa, +skein1024-600, multihash, 0xb3ab, +skein1024-608, multihash, 0xb3ac, +skein1024-616, multihash, 0xb3ad, +skein1024-624, multihash, 0xb3ae, +skein1024-632, multihash, 0xb3af, +skein1024-640, multihash, 0xb3b0, +skein1024-648, multihash, 0xb3b1, +skein1024-656, multihash, 0xb3b2, +skein1024-664, multihash, 0xb3b3, +skein1024-672, multihash, 0xb3b4, +skein1024-680, multihash, 0xb3b5, +skein1024-688, multihash, 0xb3b6, +skein1024-696, multihash, 0xb3b7, +skein1024-704, multihash, 0xb3b8, +skein1024-712, multihash, 0xb3b9, +skein1024-720, multihash, 0xb3ba, +skein1024-728, multihash, 0xb3bb, +skein1024-736, multihash, 0xb3bc, +skein1024-744, multihash, 0xb3bd, +skein1024-752, multihash, 0xb3be, +skein1024-760, multihash, 0xb3bf, +skein1024-768, multihash, 0xb3c0, +skein1024-776, multihash, 0xb3c1, +skein1024-784, multihash, 0xb3c2, +skein1024-792, multihash, 0xb3c3, +skein1024-800, multihash, 0xb3c4, +skein1024-808, multihash, 0xb3c5, +skein1024-816, multihash, 0xb3c6, +skein1024-824, multihash, 0xb3c7, +skein1024-832, multihash, 0xb3c8, +skein1024-840, multihash, 0xb3c9, +skein1024-848, multihash, 0xb3ca, +skein1024-856, multihash, 0xb3cb, +skein1024-864, multihash, 0xb3cc, +skein1024-872, multihash, 0xb3cd, +skein1024-880, multihash, 0xb3ce, +skein1024-888, multihash, 0xb3cf, +skein1024-896, multihash, 0xb3d0, +skein1024-904, multihash, 0xb3d1, +skein1024-912, multihash, 0xb3d2, +skein1024-920, multihash, 0xb3d3, +skein1024-928, multihash, 0xb3d4, +skein1024-936, multihash, 0xb3d5, +skein1024-944, multihash, 0xb3d6, +skein1024-952, multihash, 0xb3d7, +skein1024-960, multihash, 0xb3d8, +skein1024-968, multihash, 0xb3d9, +skein1024-976, multihash, 0xb3da, +skein1024-984, multihash, 0xb3db, +skein1024-992, multihash, 0xb3dc, +skein1024-1000, multihash, 0xb3dd, +skein1024-1008, multihash, 0xb3de, +skein1024-1016, multihash, 0xb3df, +skein1024-1024, multihash, 0xb3e0, +holochain-adr-v0, holochain, 0x807124, Holochain v0 address + 8 R-S (63 x Base-32) +holochain-adr-v1, holochain, 0x817124, Holochain v1 address + 8 R-S (63 x Base-32) +holochain-key-v0, holochain, 0x947124, Holochain v0 public key + 8 R-S (63 x Base-32) +holochain-key-v1, holochain, 0x957124, Holochain v1 public key + 8 R-S (63 x Base-32) +holochain-sig-v0, holochain, 0xa27124, Holochain v0 signature + 8 R-S (63 x Base-32) +holochain-sig-v1, holochain, 0xa37124, Holochain v1 signature + 8 R-S (63 x Base-32) diff --git a/validate.py b/validate.py new file mode 100755 index 0000000..06752f1 --- /dev/null +++ b/validate.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +import csv +import sys + +# We have some duplicates +ALIAS_TABLE = [ + {"ipfs", "p2p"}, +] + +def check(fname='table.csv'): + class CheckError(Exception): + pass + + aliases = {} + for nameset in ALIAS_TABLE: + for name in nameset: + aliases[name] = nameset + + success = True + with open(fname) as table: + tablereader = csv.reader(table, skipinitialspace=True) + codes = {} + names = {} + for line, row in enumerate(tablereader): + # Skip the header + if line == 0: + continue + + try: + # Check for invalid rows + if len(row) != 4: + raise CheckError(f"expected 4 items, got {len(row)}") + + [name, _, code, _] = row + + # Check for a name + if not name: + raise CheckError(f"empty protocol name for code '{code}'") + + # Check code format + if not code.startswith("0x"): + raise CheckError(f"code for '{name}' doesn't start with 0x: '{code}'") + + # Parse the code + try: + code = int(code, 16) + except Exception as e: + raise CheckError(f"failed to parse code '{code}' for '{name}': {e}") + + # Finally, check for duplicates + + if name in names: + raise CheckError(f"found duplicate {name}: {code} and {names[name]}") + else: + names[name] = code + + if code in codes: + dup = codes[code] + if name in aliases: + if dup in aliases[name]: + # Skip aliased names + continue + raise CheckError( + f"found duplicate for code {hex(code)} " + f"for '{codes[code]}' and '{name}'" + ) + else: + codes[code] = name + except CheckError as e: + success = False + print(f"row {line}: {e}", file=sys.stderr) + + return success + +if __name__ == "__main__": + if not check(): + sys.exit(1)