From bf8824efbc91c3a6267473eac7b22fac320214d1 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 9 Dec 2016 13:37:49 +0100 Subject: [PATCH 1/7] Add blake range codes Blake2s and Blake2b have different initial vectors states for different lengths, this means that for each chosen output length it looks like completely different hash function. This proposal allocated 64 values for Blake2b and 32 values for Blake2s as those are the ranges the outputs can be chosen from. The codes will require 3 bytes to write down as varints. --- table.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.csv b/table.csv index 2a8ee27..7bac319 100644 --- a/table.csv +++ b/table.csv @@ -46,8 +46,8 @@ keccak-256, , 0x1B keccak-384, , 0x1C keccak-512, , 0x1D ,, Note: keccak has variable output length. The number specifies the core length -blake2b, , 0x40 -blake2s, , 0x41 +blake2b-lenX, , 0xb201-0xb240 +blake2s-lenX, , 0xb241-0xb260 reserved for apps, appl specific range, 0x4000-0x40f0 multiaddrs,, From a9dfcedabbcf5afe5e5239151889bae126a9020e Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 10 Dec 2016 21:19:58 +0100 Subject: [PATCH 2/7] Add more explenation and fix naming --- table.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.csv b/table.csv index 7bac319..1e5ccdb 100644 --- a/table.csv +++ b/table.csv @@ -46,8 +46,8 @@ keccak-256, , 0x1B keccak-384, , 0x1C keccak-512, , 0x1D ,, Note: keccak has variable output length. The number specifies the core length -blake2b-lenX, , 0xb201-0xb240 -blake2s-lenX, , 0xb241-0xb260 +blake2b-X,X is length in bits, can take values from 8 to 512 in 8 bit increments,0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512) +blake2s-X,X is length in bits, can take values from 8 to 256 in 8 bit increments,0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256) reserved for apps, appl specific range, 0x4000-0x40f0 multiaddrs,, From a20aff156284bbcc243fed72c07d7df0c5464afc Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 10 Dec 2016 21:20:46 +0100 Subject: [PATCH 3/7] Fix columns --- table.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.csv b/table.csv index 1e5ccdb..6628853 100644 --- a/table.csv +++ b/table.csv @@ -46,8 +46,8 @@ keccak-256, , 0x1B keccak-384, , 0x1C keccak-512, , 0x1D ,, Note: keccak has variable output length. The number specifies the core length -blake2b-X,X is length in bits, can take values from 8 to 512 in 8 bit increments,0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512) -blake2s-X,X is length in bits, can take values from 8 to 256 in 8 bit increments,0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256) +blake2b-X,X is length in bits, can take values from 8 to 512 in 8 bit increments,"0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512)" +blake2s-X,X is length in bits, can take values from 8 to 256 in 8 bit increments,"0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256)" reserved for apps, appl specific range, 0x4000-0x40f0 multiaddrs,, From db2d536940ba89c210d9dc543c3348d0d4cfbac4 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 10 Dec 2016 21:21:47 +0100 Subject: [PATCH 4/7] Fix columns once again --- table.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/table.csv b/table.csv index 6628853..8bab9a9 100644 --- a/table.csv +++ b/table.csv @@ -46,8 +46,8 @@ keccak-256, , 0x1B keccak-384, , 0x1C keccak-512, , 0x1D ,, Note: keccak has variable output length. The number specifies the core length -blake2b-X,X is length in bits, can take values from 8 to 512 in 8 bit increments,"0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512)" -blake2s-X,X is length in bits, can take values from 8 to 256 in 8 bit increments,"0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256)" +blake2b-X,"X is length in bits, can take values from 8 to 512 in 8 bit increments","0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512)" +blake2s-X,"X is length in bits, can take values from 8 to 256 in 8 bit increments","0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256)" reserved for apps, appl specific range, 0x4000-0x40f0 multiaddrs,, From b8404b3e2ae62811fed09cf28eb04bbc16d70613 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sun, 11 Dec 2016 12:49:38 +0100 Subject: [PATCH 5/7] Change blake codes to specify all of them --- table.csv | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 3 deletions(-) diff --git a/table.csv b/table.csv index 8bab9a9..03080c1 100644 --- a/table.csv +++ b/table.csv @@ -46,9 +46,102 @@ keccak-256, , 0x1B keccak-384, , 0x1C keccak-512, , 0x1D ,, Note: keccak has variable output length. The number specifies the core length -blake2b-X,"X is length in bits, can take values from 8 to 512 in 8 bit increments","0xb201-0xb240 (0xb201 - blake2b-8, 0xb240 - blake2b-512)" -blake2s-X,"X is length in bits, can take values from 8 to 256 in 8 bit increments","0xb241-0xb260 (0xb241 - blake2s-8, 0xb260 - blake2b-256)" -reserved for apps, appl specific range, 0x4000-0x40f0 +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 multiaddrs,, ip4, , 0x04 From eda4e2e08ad4029058c95206cddc27d6c0e4bbfe Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 23 Dec 2016 13:22:29 -0800 Subject: [PATCH 6/7] Add eth-objects Here are the Ethereum objects as I have mapped them so far. While there are only two underlying structures (RLP and Eth-(Secure-)Trie), they interpret the format of the leaf values based on context, which is lost when resolving at the IPLD level. I sketched out some versions that used fewer IPLD formats by employing some cleverness in the path naming conventions. (see here https://github.com/MetaMask/metamask-plugin/issues/719#issuecomment-267528294). The consensus was to be explicit instead of clever, thusly the list of objects as I've proposed. I'd additionally like to reserve 0x99-0x9f for additional Ethereum objects I may have missed or may be introduced when Ethereum milestone Metropolis is released. --- table.csv | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/table.csv b/table.csv index 03080c1..b87146d 100644 --- a/table.csv +++ b/table.csv @@ -171,11 +171,20 @@ mp4, , 0x mkv, , 0x IPLD formats,, -dag-pb, MerkleDAG protobuf, 0x70 -dag-cbor, MerkleDAG cbor, 0x71 -eth-block, Ethereum Block (RLP), 0x90 -eth-tx, Ethereum Tx (RLP), 0x91 -bitcoin-block, Bitcoin Block, 0xb0 -bitcoin-tx, Bitcoin Tx, 0xb1 -stellar-block, Stellar Block, 0xd0 -stellar-tx, Stellar Tx, 0xd1 +dag-pb, MerkleDAG protobuf, 0x70 +dag-cbor, MerkleDAG cbor, 0x71 + +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 +stellar-block, Stellar Block, 0xd0 +stellar-tx, Stellar Tx, 0xd1 From 2b1bf14821d4ec69fdf7aca517fc9dd5aee31a37 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Tue, 27 Dec 2016 14:27:39 -0500 Subject: [PATCH 7/7] Edited README - Fixed https issue in links - Added standard-readme badge - Changed descrption by capitalizing Compact and changing on GitHub - Fixed edit link to point to the table - Added note about readme to contribute - Added CC license to license section - Added year and Protocol Labs to MIT code license --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b340884..904480d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # multicodec [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) -[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](http://github.com/multiformats/multiformats) -[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats) +[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs) +[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) -> compact self-describing codecs. Save space by using predefined multicodec tables. +> Compact self-describing codecs. Save space by using predefined multicodec tables. ## Table of Contents @@ -68,7 +69,7 @@ This ["first come, first assign"](https://github.com/multiformats/multicodec/pul - [go](https://github.com/multiformats/go-multicodec/) - [JavaScript](https://github.com/multiformats/js-multicodec) -- [Add yours today!](https://github.com/multiformats/multicodec/edit/master/multicodec.md) +- [Add yours today!](https://github.com/multiformats/multicodec/edit/master/table.csv) ## Multicodec Path, also known as [`multistream`](https://github.com/multiformats/multistream) @@ -108,6 +109,8 @@ Contributions welcome. Please check out [the issues](https://github.com/multifor Check out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification. + ## License -[MIT](LICENSE) +This repository is only for documents. All of these are licensed under the [CC-BY-SA 3.0](https://ipfs.io/ipfs/QmVreNvKsQmQZ83T86cWSjPu2vR3yZHGPm5jnxFuunEB9u) license © 2016 Protocol Labs Inc. Any code is under a [MIT](LICENSE) © 2016 Protocol Labs Inc.