From 85b4d5fd91e4d3a5bca16261aba9b6bc47b6ba05 Mon Sep 17 00:00:00 2001 From: idk Date: Thu, 8 Nov 2018 03:40:42 -0500 Subject: [PATCH 1/4] added onionv3 and garlic multicodecs to csv --- table.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/table.csv b/table.csv index 620cbeb5..54d573ff 100644 --- a/table.csv +++ b/table.csv @@ -404,6 +404,9 @@ https, , 0x01BB quic, , 0x01CC ws, , 0x01DD onion, , 0x01BC +onion3, , 0x01BD +garlict, , 0x01CA +garlicu, , 0x01CB p2p-circuit, , 0x0122 archiving formats,, From 2391af9de8aa754d8930eba57b504278931b2cb7 Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 5 Apr 2019 16:40:20 -0400 Subject: [PATCH 2/4] Further describe i2p addresses --- table.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.csv b/table.csv index 9ab3e372..cd0c4bfe 100644 --- a/table.csv +++ b/table.csv @@ -86,8 +86,8 @@ ipfs, multiaddr, 0x01A5, libp2p (deprecat https, multiaddr, 0x01BB, onion, multiaddr, 0x01BC, onion3, multiaddr, 0x01BD, -garlic64, multiaddr, 0x01BE, I2P base64 -garlic32, multiaddr, 0x01BF, I2P base32 +garlic64, multiaddr, 0x01BE, I2P base64 (raw public key) +garlic32, multiaddr, 0x01BF, I2P base32 (hashed public key) quic, multiaddr, 0x01CC, ws, multiaddr, 0x01DD, wss, multiaddr, 0x01DE, From 26ad9ab722418ccd9e94d8c823db578f16c9452f Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 5 Apr 2019 17:12:15 -0400 Subject: [PATCH 3/4] Briefly describe other type of b32 --- table.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table.csv b/table.csv index cd0c4bfe..4b76f40c 100644 --- a/table.csv +++ b/table.csv @@ -87,7 +87,7 @@ https, multiaddr, 0x01BB, onion, multiaddr, 0x01BC, onion3, multiaddr, 0x01BD, garlic64, multiaddr, 0x01BE, I2P base64 (raw public key) -garlic32, multiaddr, 0x01BF, I2P base32 (hashed public key) +garlic32, multiaddr, 0x01BF, I2P base32 (hashed public key or encoded public key/checksum+optional secret) quic, multiaddr, 0x01CC, ws, multiaddr, 0x01DD, wss, multiaddr, 0x01DE, From e2df1de14198842144cf058805211fcede22aeb1 Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Sun, 21 Apr 2019 23:05:19 +0200 Subject: [PATCH 4/4] Normalize hexadecimal syntax of codes --- table.csv | 42 +++++++++++++++++++++--------------------- validate.py | 5 +++-- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/table.csv b/table.csv index 4b76f40c..51d6ace9 100644 --- a/table.csv +++ b/table.csv @@ -1,5 +1,5 @@ name, tag, code, description -identity, multihash, 0x0, raw binary +identity, multihash, 0x00, raw binary ip4, multiaddr, 0x04, tcp, multiaddr, 0x06, sha1, multihash, 0x11, @@ -11,16 +11,16 @@ 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, +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. +ip6zone, multiaddr, 0x2a, +path, namespace, 0x2f, Namespace for string paths. Corresponds to `/` in ASCII. multicodec, multiformat, 0x30, multihash, multiformat, 0x31, multiaddr, multiformat, 0x32, @@ -78,21 +78,21 @@ 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, +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 (raw public key) -garlic32, multiaddr, 0x01BF, I2P base32 (hashed public key or encoded public key/checksum+optional secret) -quic, multiaddr, 0x01CC, -ws, multiaddr, 0x01DD, -wss, multiaddr, 0x01DE, -p2p-websocket-star, multiaddr, 0x01DF, -http, multiaddr, 0x01E0, +p2p, multiaddr, 0x01a5, libp2p +ipfs, multiaddr, 0x01a5, libp2p (deprecated) +https, multiaddr, 0x01bb, +onion, multiaddr, 0x01bc, +onion3, multiaddr, 0x01bd, +garlic64, multiaddr, 0x01be, I2P base64 (raw public key) +garlic32, multiaddr, 0x01bf, I2P base32 (hashed public key or encoded public key/checksum+optional secret) +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, diff --git a/validate.py b/validate.py index 06752f1e..5ce1782c 100755 --- a/validate.py +++ b/validate.py @@ -2,6 +2,7 @@ import csv import sys +import re # We have some duplicates ALIAS_TABLE = [ @@ -39,8 +40,8 @@ class CheckError(Exception): 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}'") + if not re.match(r"^0x([0-9a-f][0-9a-f])+$", code): + raise CheckError(f"code for '{name}' does not look like a byte sequence: '{code}'") # Parse the code try: