diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..000bb2c --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,22 @@ +name: Rust + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml index 872daf4..4edeba7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,29 @@ [package] name = "multicodec" -description = "implementing the multicodec spec" -version = "0.1.0" -authors = ["Benjamin Kampmann "] +version = "1.0.10" +edition = "2021" +authors = ["Benjamin Kampmann ", "Dave Grantham "] +description = "Implementation of the Multicodec specification" +repository = "https://github.com/cryptidtech/rust-multicodec" license = "MIT OR Apache-2.0" -repository = "https://github.com/gnunicorn/rust-multicodec" -readme = "Readme.md" +readme = "README.md" keywords = ["multiformats", "multicodec", "serde"] -[badges] -travis-ci = { repository = "gnunicorn/rust-multicodec", branch = "master"} +[features] +default = ["serde"] [dependencies] -unsigned-varint = "0.2" -failure = "0.1" +multitrait = { version = "1.0", git="https://github.com/cryptidtech/multitrait.git" } +serde = { version = "1.0", default-features = false, optional = true, features = ['serde_derive'] } +thiserror = "1.0" + +[dev-dependencies] +serde_cbor = "0.11" +serde_json = "1.0" +serde_test = "1.0" + +[build-dependencies] +convert_case = "0.6" +csv = "1.3" serde = "1.0" +serde_derive = "1.0" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b966e01 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Cryptid Technologies, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e7f2725 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +[![](https://img.shields.io/badge/made%20by-Cryptid%20Technologies-gold.svg?style=flat-square)][CRYPTID] +[![](https://img.shields.io/badge/project-provenance-purple.svg?style=flat-square)][PROVENANCE] +[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)][MULTIFORMATS] +![](https://github.com/cryptidtech/multicodec/actions/workflows/rust.yml/badge.svg) + +# Multicodec + +Rust implementation of the [multicodec specs][MULTICODEC]. + +[CRYPTID]: https://cryptid.tech/ +[PROVENANCE]: https://github.com/cryptidtech/provenance-specifications/ +[MULTIFORMATS]: https://github.com/multiformats/multiformats/ +[MULTICODEC]: https://github.com/multiformats/multicodec diff --git a/Readme.md b/Readme.md deleted file mode 100644 index c586610..0000000 --- a/Readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# Multicodec in Rust - -[![](https://img.shields.io/travis/gnunicorn/rust-multicodec/master.svg?style=flat-square)](https://travis-ci.org/gnunicorn/rust-multicodec) ![](https://img.shields.io/crates/l/multicodec.svg?style=flat-square) [![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) - -> rust implementation of the [multicodec specs](https://github.com/multiformats/multicodec) - - - -## ToDo's - - -### Coding - - - [ ] automatic deserialisation through external serdes (JSON, CBOR, ...) - - [ ] Integrate with Multihash & Multiaddr - - [ ] no-std/Wasm-support - -### Mgmnt - - [x] Github setup - - [x] Publish on crates.io - - [ ] Add proper License Files - - [x] Activate travis-ci \ No newline at end of file diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..8349b68 --- /dev/null +++ b/build.rs @@ -0,0 +1,48 @@ +#![allow(dead_code)] +use convert_case::{Case, Converter}; +use serde_derive::Deserialize; +use std::{fs::File, io::Write, path::PathBuf}; + +#[derive(Debug, Deserialize)] +struct Record { + name: String, + tag: String, + code: String, + status: String, + description: Option, +} + +fn main() -> Result<(), Box> { + let mut pb = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let mut tpb = pb.clone(); + + // input path + tpb.push("table.csv"); + + // output path + pb.push("src"); + pb.push("table_gen.rs"); + + let inf = File::open(tpb)?; + let mut f = File::create(pb)?; + + let mut rdr = csv::Reader::from_reader(inf); + + let conv = Converter::new().to_case(Case::Pascal); //.set_delim("_"); + + writeln!(f, "build_codec_enum! {{")?; + for row in rdr.deserialize() { + let rec: Record = row?; + writeln!( + f, + "\t{} => ({}, \"{}\"),", + rec.code.trim(), + conv.convert(rec.name.clone()), + rec.name + )?; + } + writeln!(f, "}}")?; + + // generate the code for src/table_gen.rs from the multicodecs .csv file + Ok(()) +} diff --git a/src/codec.rs b/src/codec.rs new file mode 100644 index 0000000..d5a2180 --- /dev/null +++ b/src/codec.rs @@ -0,0 +1,270 @@ +// SPDX-License-Identifier: MIT or Apache-2.0 +//! +#![deny( + trivial_casts, + trivial_numeric_casts, + unused_import_braces, + unused_qualifications +)] +#![allow(missing_docs)] +use crate::Error; +use core::{ + fmt, + hash::{Hash, Hasher}, +}; +use multitrait::{EncodeInto, Null, TryDecodeFrom}; + +macro_rules! build_codec_enum { + {$( $val:expr => ($i:ident, $s:expr), )*} => { + + /// Codecs from the multicodec table + #[allow(non_camel_case_types)] + #[derive(Clone, Copy, Default, Eq, Ord, PartialEq, PartialOrd)] + #[non_exhaustive] + pub enum Codec { + #[default] + $( $i, )* + } + + /// Convert from the canonical string name of the multicodec to the + /// associated enum/value. + impl TryFrom<&str> for Codec { + type Error = Error; + + fn try_from(s: &str) -> Result { + match s { + $( $s => Ok(Codec::$i), )* + _ => Err(Error::InvalidName(s.to_string())), + } + } + } + + /// Convert a Codec into a type that implements AsRef + impl From for &str { + fn from(codec: Codec) -> &'static str { + match codec { + $( Codec::$i => $s, )* + } + } + } + + /// Convert from the value of the multicodec to the associated enum/value. + impl TryFrom for Codec { + type Error = Error; + + fn try_from(v: u64) -> Result { + match v { + $( $val => Ok(Codec::$i), )* + _ => Err(Error::InvalidValue(v)), + } + } + } + + /// Convert a Codec into a u64 + impl From for u64 { + fn from(codec: Codec) -> u64 { + match codec { + $( Codec::$i => $val, )* + } + } + } + + impl Hash for Codec { + fn hash(&self, state: &mut H) { + let v: Vec = self.clone().into(); + v.hash(state); + } + } + + /// Serialize a Codec as a unsigned varint in a Vec + impl From for Vec { + fn from(codec: Codec) -> Vec { + let v: u64 = codec.into(); + v.encode_into() + } + } + + /// Try to deserialized a Codec from an unsigned varint byte slice + impl<'a> TryFrom<&'a [u8]> for Codec { + type Error = Error; + + fn try_from(bytes: &'a [u8]) -> Result { + let (code, _) = u64::try_decode_from(bytes)?; + Codec::try_from(code) + } + } + + /// Try to deserialized a Codec from an unsigned varint byte slice and + /// also return the position in the byte slice after the value + impl<'a> TryDecodeFrom<'a> for Codec { + type Error = Error; + + fn try_decode_from(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), Self::Error> { + let (code, ptr) = u64::try_decode_from(bytes)?; + Ok((Codec::try_from(code)?, ptr)) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: u8) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: u16) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: u32) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: i8) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: i16) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: i32) -> Result { + Codec::try_from(code as u64) + } + } + + impl TryFrom for Codec { + type Error = Error; + + fn try_from(code: i64) -> Result { + Codec::try_from(code as u64) + } + } + + impl fmt::Debug for Codec { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{} (0x{:x})", self.as_str(), self.code()) + } + } + + impl fmt::Display for Codec { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.as_str()) + } + } + + impl Null for Codec { + fn null() -> Self { + Self::default() + } + + fn is_null(&self) -> bool { + *self == Self::null() + } + } + + impl Codec { + /// Get the base code. NOTE: these are NOT varuint encoded + pub fn code(&self) -> u64 { + self.clone().into() + } + + /// Convert a codec to &str + pub fn as_str(&self) -> &str { + self.clone().into() + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_default() { + assert_eq!(Codec::Identity, Codec::default()); + } + + #[test] + fn test_null() { + let c1 = Codec::null(); + assert!(c1.is_null()); + let c2 = Codec::default(); + assert_eq!(c1, c2); + assert!(c2.is_null()); + } + + #[test] + fn test_to_code() { + assert_eq!(0xED, Codec::Ed25519Pub.code()); + } + + #[test] + fn test_from_code() { + assert_eq!(Codec::Ed25519Pub, Codec::try_from(0xED).unwrap()); + } + + #[test] + fn test_into_code() { + assert_eq!(0xED_u64, >::into(Codec::Ed25519Pub)); + } + + #[test] + fn test_to_str() { + assert_eq!("ed25519-pub", Codec::Ed25519Pub.as_str()); + } + + #[test] + fn test_from_str() { + assert_eq!(Codec::Ed25519Pub, Codec::try_from("ed25519-pub").unwrap()); + } + + #[test] + fn test_encode_into() { + let v: Vec = Codec::Ed25519Pub.into(); + assert_eq!(vec![0xED, 0x01], v); + } + + #[test] + fn test_debug_format() { + assert_eq!( + "ed25519-pub (0xed)".to_string(), + format!("{:?}", Codec::Ed25519Pub) + ); + } + + #[test] + #[should_panic] + fn test_invalid_value() { + Codec::try_from(0xDEAD_u64).unwrap(); + } + + #[test] + #[should_panic] + fn test_invalid_name() { + Codec::try_from("move-zig").unwrap(); + } +} + +include!("table_gen.rs"); diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..11cb7e0 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT or Apache-2.0 +/// Errors created by this library +#[derive(Clone, Debug, thiserror::Error)] +#[non_exhaustive] +pub enum Error { + /// Multitrait error + #[error(transparent)] + Multitrait(#[from] multitrait::Error), + /// Invalid codec name + #[error("Invalid multicodec name {0}")] + InvalidName(String), + /// Invalid codec value + #[error("Invalid multicodec value {0}")] + InvalidValue(u64), +} diff --git a/src/lib.rs b/src/lib.rs index 5d0a205..6c2aa8a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,285 +1,29 @@ -extern crate unsigned_varint; -#[macro_use] extern crate failure; -extern crate serde; - - -use unsigned_varint::{decode::u16 as decode_varint, - encode::u16 as encode_varint, - decode::Error as VarintError}; - -use serde::{Serialize, Serializer}; - -#[derive(Debug, Fail)] -pub enum Error { - #[fail(display = "Codec {} unknown", _0)] - InvalidCodec(u16), - #[fail(display = "Can't parse varint: {}", _0)] - VarintFailed(VarintError) - -} - -macro_rules! build_codec_enum { - {$( $val:expr => $var:ident, )*} => { - #[allow(non_camel_case_types)] - #[derive(PartialEq, Eq, Clone, Copy, Debug)] - pub enum Codec { - $( $var, )* - } - - use Codec::*; - - impl Codec { - /// Get the base code. - pub fn code(&self) -> u16 { - match *self { - $( $var => $val, )* - } - } - - /// Convert a code to a base. - pub fn from_code(code: u16) -> Result { - match code { - $( $val => Ok($var), )* - _ => Err(Error::InvalidCodec(code)), - } - } - } - } -} - -// SOURCE: https://github.com/multiformats/multicodec/blob/master/table.csv -build_codec_enum! { - 0x55 => Bin, - // bases encodings - 0x01 => Base1, - 0x07 => Base8, - 0x09 => Base10, - - // serialization formats - 0x51 => Cbor, - 0x50 => Protobuf, - 0x60 => Rlp, - 0x63 => Bencode, - - // multiformats - 0x30 => Multicodec, - 0x31 => Multihash, - 0x32 => Multiaddr, - 0x33 => Multibase, - - // multihashes - 0x11 => Sha1, - 0x12 => Sha2_256, - 0x13 => Sha2_512, - 0x56 => Dbl_Sha2_256, - 0x17 => Sha3_224, - 0x16 => Sha3_256, - 0x15 => Sha3_384, - 0x14 => Sha3_512, - 0x18 => Shake_128, - 0x19 => Shake_256, - 0x1A => Keccak_224, - 0x1B => Keccak_256, - 0x1C => Keccak_384, - 0x1D => Keccak_512, - 0x22 => Murmur3, - 0xb201 => Blake2b_8, - 0xb202 => Blake2b_16, - 0xb203 => Blake2b_24, - 0xb204 => Blake2b_32, - 0xb205 => Blake2b_40, - 0xb206 => Blake2b_48, - 0xb207 => Blake2b_56, - 0xb208 => Blake2b_64, - 0xb209 => Blake2b_72, - 0xb20a => Blake2b_80, - 0xb20b => Blake2b_88, - 0xb20c => Blake2b_96, - 0xb20d => Blake2b_104, - 0xb20e => Blake2b_112, - 0xb20f => Blake2b_120, - 0xb210 => Blake2b_128, - 0xb211 => Blake2b_136, - 0xb212 => Blake2b_144, - 0xb213 => Blake2b_152, - 0xb214 => Blake2b_160, - 0xb215 => Blake2b_168, - 0xb216 => Blake2b_176, - 0xb217 => Blake2b_184, - 0xb218 => Blake2b_192, - 0xb219 => Blake2b_200, - 0xb21a => Blake2b_208, - 0xb21b => Blake2b_216, - 0xb21c => Blake2b_224, - 0xb21d => Blake2b_232, - 0xb21e => Blake2b_240, - 0xb21f => Blake2b_248, - 0xb220 => Blake2b_256, - 0xb221 => Blake2b_264, - 0xb222 => Blake2b_272, - 0xb223 => Blake2b_280, - 0xb224 => Blake2b_288, - 0xb225 => Blake2b_296, - 0xb226 => Blake2b_304, - 0xb227 => Blake2b_312, - 0xb228 => Blake2b_320, - 0xb229 => Blake2b_328, - 0xb22a => Blake2b_336, - 0xb22b => Blake2b_344, - 0xb22c => Blake2b_352, - 0xb22d => Blake2b_360, - 0xb22e => Blake2b_368, - 0xb22f => Blake2b_376, - 0xb230 => Blake2b_384, - 0xb231 => Blake2b_392, - 0xb232 => Blake2b_400, - 0xb233 => Blake2b_408, - 0xb234 => Blake2b_416, - 0xb235 => Blake2b_424, - 0xb236 => Blake2b_432, - 0xb237 => Blake2b_440, - 0xb238 => Blake2b_448, - 0xb239 => Blake2b_456, - 0xb23a => Blake2b_464, - 0xb23b => Blake2b_472, - 0xb23c => Blake2b_480, - 0xb23d => Blake2b_488, - 0xb23e => Blake2b_496, - 0xb23f => Blake2b_504, - 0xb240 => Blake2b_512, - 0xb241 => Blake2s_8, - 0xb242 => Blake2s_16, - 0xb243 => Blake2s_24, - 0xb244 => Blake2s_32, - 0xb245 => Blake2s_40, - 0xb246 => Blake2s_48, - 0xb247 => Blake2s_56, - 0xb248 => Blake2s_64, - 0xb249 => Blake2s_72, - 0xb24a => Blake2s_80, - 0xb24b => Blake2s_88, - 0xb24c => Blake2s_96, - 0xb24d => Blake2s_104, - 0xb24e => Blake2s_112, - 0xb24f => Blake2s_120, - 0xb250 => Blake2s_128, - 0xb251 => Blake2s_136, - 0xb252 => Blake2s_144, - 0xb253 => Blake2s_152, - 0xb254 => Blake2s_160, - 0xb255 => Blake2s_168, - 0xb256 => Blake2s_176, - 0xb257 => Blake2s_184, - 0xb258 => Blake2s_192, - 0xb259 => Blake2s_200, - 0xb25a => Blake2s_208, - 0xb25b => Blake2s_216, - 0xb25c => Blake2s_224, - 0xb25d => Blake2s_232, - 0xb25e => Blake2s_240, - 0xb25f => Blake2s_248, - 0xb260 => Blake2s_256, - - // multiaddrs - 0x04 => Ip4, - 0x29 => Ip6, - 0x06 => Tcp, - 0x0111 => Udp, - 0x21 => Dccp, - 0x84 => Sctp, - 0x012D => Udt, - 0x012E => Utp, - 0x01A5 => Ipfs, - 0x01E0 => Http, - 0x01BB => Https, - 0x01CC => Quic, - 0x01DD => Ws, - 0x01BC => Onion, - 0x0122 => P2p_Circuit, - - // IPLD formats - 0x70 => Dag_Pb, - 0x71 => Dag_Cbor, - - 0x78 => Git_Raw, - - 0x90 => Eth_Block, - 0x91 => Eth_Block_List, - 0x92 => Eth_Tx_Trie, - 0x93 => Eth_Tx, - 0x94 => Eth_Tx_Receipt_Trie, - 0x95 => Eth_Tx_Receipt, - 0x96 => Eth_State_Trie, - 0x97 => Eth_Account_Snapshot, - 0x98 => Eth_Storage_Trie, - - 0xb0 => Bitcoin_Block, - 0xb1 => Bitcoin_Tx, - - 0xc0 => Zcash_Block, - 0xc1 => Zcash_Tx, - - 0xd0 => Stellar_Block, - 0xd1 => Stellar_Tx, - - 0x7b => Torrent_Info, - 0x7c => Torrent_File, - 0xed => Ed25519_Pub, -} - - -#[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub struct MultiCodec<'a> { - codec: Codec, - data: &'a [u8] -} - -impl<'a> MultiCodec<'a> { - /// create a new MultiCodec - pub fn new(codec: Codec, data: &'a [u8]) -> MultiCodec { - MultiCodec { codec, data } - } - /// try to parse a MultiCodec from a packed bytestring - pub fn from(packed: &'a [u8]) -> Result { - let (code, data) = decode_varint(packed).map_err(|e| Error::VarintFailed(e))?; - let codec = Codec::from_code(code)?; - Ok(MultiCodec { codec, data }) - } - - pub fn pack(&self) -> Vec { - let mut buf = [0u8; 3]; - encode_varint(self.codec.code(), &mut buf); - let mut v : Vec = Vec::new(); - for b in &buf { - v.push(*b); - // varint uses first bit to indicate another byte follows, stop if not the case - if *b <= 127 { break } - } - v.extend(self.data); - v - } -} - -impl<'a> Serialize for MultiCodec<'a> { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - serializer.serialize_bytes(&self.pack()) - } -} - - - -#[cfg(test)] -mod tests { - use super::*; - #[test] - fn it_works() { - let codec = MultiCodec::new(Codec::Sha2_256, b"EiC5TSe5k00"); - let packed = codec.pack(); - let redo = MultiCodec::from(&packed).unwrap(); - assert_eq!(packed, "\x12EiC5TSe5k00".as_bytes()); - assert_eq!(redo, codec); - } +// SPDX-License-Identifier: MIT or Apache-2.0 +//! multicodec +#![warn(missing_docs)] +#![deny( + trivial_casts, + trivial_numeric_casts, + unused_import_braces, + unused_qualifications +)] + +/// Errors produced by this library +pub mod error; +pub use error::Error; + +/// Codec enum definition from the table +pub mod codec; +pub use codec::Codec; + +/// Serde serialization +#[cfg(feature = "serde")] +pub mod serde; + +/// ...and in the darkness bind them +pub mod prelude { + pub use super::{codec::*, error::*}; + + // re-exports + pub use multitrait::{EncodeInto, TryDecodeFrom}; } diff --git a/src/serde/de.rs b/src/serde/de.rs new file mode 100644 index 0000000..a3d1c90 --- /dev/null +++ b/src/serde/de.rs @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT or Apache-2.0 +use crate::Codec; +use core::fmt; +use serde::{de, Deserialize, Deserializer}; + +/// Deserialize instances of [`crate::prelude::Codec`] from a varuint encoded +/// byte slice or a u8, u16, u32, or u64 value. +impl<'de> Deserialize<'de> for Codec { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct CodecVisitor; + + impl<'de> de::Visitor<'de> for CodecVisitor { + type Value = Codec; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + write!( + fmt, + "borrowed str, str, String, borrowed byte array, byte buf, bytes, or sequence" + ) + } + + // human readable + + // shortest lifetime + #[inline] + fn visit_borrowed_str(self, s: &'de str) -> Result + where + E: de::Error, + { + Self::Value::try_from(s).map_err(|e| de::Error::custom(e.to_string())) + } + + // longest lifetime + #[inline] + fn visit_str(self, s: &str) -> Result + where + E: de::Error, + { + Self::Value::try_from(s).map_err(|e| de::Error::custom(e.to_string())) + } + + // binary + + // shortest lifetime + #[inline] + fn visit_borrowed_bytes(self, b: &'de [u8]) -> Result + where + E: de::Error, + { + Self::Value::try_from(b).map_err(|e| de::Error::custom(e.to_string())) + } + + // longest lifetime + #[inline] + fn visit_bytes(self, b: &[u8]) -> Result + where + E: de::Error, + { + Self::Value::try_from(b).map_err(|e| de::Error::custom(e.to_string())) + } + + // binary / human readable + + // this typically only happens when there are bytes serialized into + // a human readable format. + #[inline] + fn visit_seq(self, mut seq: S) -> Result + where + S: de::SeqAccess<'de>, + { + let mut v = Vec::new(); + while let Some(b) = seq.next_element()? { + v.push(b); + } + Self::Value::try_from(v.as_slice()) + .map_err(|e| de::Error::custom(e.to_string())) + } + } + + deserializer.deserialize_any(CodecVisitor) + } +} diff --git a/src/serde/mod.rs b/src/serde/mod.rs new file mode 100644 index 0000000..23f91d0 --- /dev/null +++ b/src/serde/mod.rs @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: MIT or Apache-2.0 +//! Serde (de)serialization for [`crate::prelude::Codec`] +mod de; +mod ser; + +#[cfg(test)] +mod tests { + use crate::prelude::Codec; + use multitrait::Null; + use serde::{Deserialize, Serialize}; + use serde_test::{assert_tokens, Configure, Token}; + + #[test] + fn test_serde_binary() { + let c = Codec::Ed25519Pub; + assert_tokens(&c.compact(), &[Token::BorrowedBytes(&[0xED, 0x01])]) + } + + #[test] + fn test_serde_readable() { + let c = Codec::Ed25519Pub; + assert_tokens(&c.readable(), &[Token::BorrowedStr("ed25519-pub")]) + } + + #[test] + fn test_null_serde_compact() { + let c = Codec::null(); + assert_tokens( + &c.compact(), + &[ + Token::BorrowedBytes(&[0x00]) + ] + ); + } + + #[test] + fn test_null_serde_readable() { + let c = Codec::null(); + assert_tokens( + &c.readable(), + &[ + Token::BorrowedStr("identity") + ] + ); + } + + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] + struct Wrapper { + v: Codec, + } + + #[test] + fn test_serde_macros() { + let w1 = Wrapper { + v: Codec::Ed25519Pub, + }; + let b = serde_cbor::to_vec(&w1).unwrap(); + let w2 = serde_cbor::from_slice(b.as_slice()).unwrap(); + assert_eq!(w1, w2); + let s = serde_json::to_string_pretty(&w1).unwrap(); + println!("{}", s); + let w3 = serde_json::from_str(&s).unwrap(); + assert_eq!(w1, w3); + } + + #[test] + fn test_cbor_reader_writer() { + let w1 = Wrapper { + v: Codec::Ed25519Pub, + }; + + let mut b: Vec = Vec::new(); + serde_cbor::to_writer(&mut b, &w1).unwrap(); + let w2: Wrapper = serde_cbor::from_reader(b.as_slice()).unwrap(); + assert_eq!(w1, w2); + } + + #[test] + fn test_json_reader_writer() { + let w1 = Wrapper { + v: Codec::Ed25519Pub, + }; + + let mut b: Vec = Vec::new(); + serde_json::to_writer(&mut b, &w1).unwrap(); + let w2: Wrapper = serde_json::from_reader(b.as_slice()).unwrap(); + assert_eq!(w1, w2); + } +} diff --git a/src/serde/ser.rs b/src/serde/ser.rs new file mode 100644 index 0000000..fd4eeb1 --- /dev/null +++ b/src/serde/ser.rs @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT or Apache-2.0 +use crate::Codec; +use serde::ser; + +/// Serialize instances of [`crate::prelude::Codec`] into varuint encoded bytes +impl ser::Serialize for Codec { + fn serialize(&self, serializer: S) -> Result + where + S: ser::Serializer, + { + if serializer.is_human_readable() { + let s: &str = (*self).into(); + serializer.serialize_str(s) + } else { + let v: Vec = (*self).into(); + serializer.serialize_bytes(v.as_slice()) + } + } +} diff --git a/src/table_gen.rs b/src/table_gen.rs new file mode 100644 index 0000000..b2e73b4 --- /dev/null +++ b/src/table_gen.rs @@ -0,0 +1,573 @@ +build_codec_enum! { + 0x00 => (Identity, "identity"), + 0x01 => (Cidv1, "cidv1"), + 0x02 => (Cidv2, "cidv2"), + 0x03 => (Cidv3, "cidv3"), + 0x04 => (Ip4, "ip4"), + 0x06 => (Tcp, "tcp"), + 0x11 => (Sha1, "sha1"), + 0x12 => (Sha2256, "sha2-256"), + 0x13 => (Sha2512, "sha2-512"), + 0x14 => (Sha3512, "sha3-512"), + 0x15 => (Sha3384, "sha3-384"), + 0x16 => (Sha3256, "sha3-256"), + 0x17 => (Sha3224, "sha3-224"), + 0x18 => (Shake128, "shake-128"), + 0x19 => (Shake256, "shake-256"), + 0x1a => (Keccak224, "keccak-224"), + 0x1b => (Keccak256, "keccak-256"), + 0x1c => (Keccak384, "keccak-384"), + 0x1d => (Keccak512, "keccak-512"), + 0x1e => (Blake3, "blake3"), + 0x20 => (Sha2384, "sha2-384"), + 0x21 => (Dccp, "dccp"), + 0x22 => (Murmur3X6464, "murmur3-x64-64"), + 0x23 => (Murmur332, "murmur3-32"), + 0x29 => (Ip6, "ip6"), + 0x2a => (Ip6Zone, "ip6zone"), + 0x2b => (Ipcidr, "ipcidr"), + 0x2f => (Path, "path"), + 0x30 => (Multicodec, "multicodec"), + 0x31 => (Multihash, "multihash"), + 0x32 => (Multiaddr, "multiaddr"), + 0x33 => (Multibase, "multibase"), + 0x34 => (Varsig, "varsig"), + 0x35 => (Dns, "dns"), + 0x36 => (Dns4, "dns4"), + 0x37 => (Dns6, "dns6"), + 0x38 => (Dnsaddr, "dnsaddr"), + 0x50 => (Protobuf, "protobuf"), + 0x51 => (Cbor, "cbor"), + 0x55 => (Raw, "raw"), + 0x56 => (DblSha2256, "dbl-sha2-256"), + 0x60 => (Rlp, "rlp"), + 0x63 => (Bencode, "bencode"), + 0x70 => (DagPb, "dag-pb"), + 0x71 => (DagCbor, "dag-cbor"), + 0x72 => (Libp2PKey, "libp2p-key"), + 0x78 => (GitRaw, "git-raw"), + 0x7b => (TorrentInfo, "torrent-info"), + 0x7c => (TorrentFile, "torrent-file"), + 0x80 => (Blake3Hashseq, "blake3-hashseq"), + 0x81 => (LeofcoinBlock, "leofcoin-block"), + 0x82 => (LeofcoinTx, "leofcoin-tx"), + 0x83 => (LeofcoinPr, "leofcoin-pr"), + 0x84 => (Sctp, "sctp"), + 0x85 => (DagJose, "dag-jose"), + 0x86 => (DagCose, "dag-cose"), + 0x8c => (Lbry, "lbry"), + 0x90 => (EthBlock, "eth-block"), + 0x91 => (EthBlockList, "eth-block-list"), + 0x92 => (EthTxTrie, "eth-tx-trie"), + 0x93 => (EthTx, "eth-tx"), + 0x94 => (EthTxReceiptTrie, "eth-tx-receipt-trie"), + 0x95 => (EthTxReceipt, "eth-tx-receipt"), + 0x96 => (EthStateTrie, "eth-state-trie"), + 0x97 => (EthAccountSnapshot, "eth-account-snapshot"), + 0x98 => (EthStorageTrie, "eth-storage-trie"), + 0x99 => (EthReceiptLogTrie, "eth-receipt-log-trie"), + 0x9a => (EthReceiptLog, "eth-receipt-log"), + 0xa0 => (Aes128, "aes-128"), + 0xa1 => (Aes192, "aes-192"), + 0xa2 => (Aes256, "aes-256"), + 0xa3 => (Chacha128, "chacha-128"), + 0xa4 => (Chacha256, "chacha-256"), + 0xa5 => (Chacha20Poly1305, "chacha20-poly1305"), + 0xb0 => (BitcoinBlock, "bitcoin-block"), + 0xb1 => (BitcoinTx, "bitcoin-tx"), + 0xb2 => (BitcoinWitnessCommitment, "bitcoin-witness-commitment"), + 0xc0 => (ZcashBlock, "zcash-block"), + 0xc1 => (ZcashTx, "zcash-tx"), + 0xca => (Caip50, "caip-50"), + 0xce => (Streamid, "streamid"), + 0xd0 => (StellarBlock, "stellar-block"), + 0xd1 => (StellarTx, "stellar-tx"), + 0xd4 => (Md4, "md4"), + 0xd5 => (Md5, "md5"), + 0xe0 => (DecredBlock, "decred-block"), + 0xe1 => (DecredTx, "decred-tx"), + 0xe2 => (Ipld, "ipld"), + 0xe3 => (Ipfs, "ipfs"), + 0xe4 => (Swarm, "swarm"), + 0xe5 => (Ipns, "ipns"), + 0xe6 => (Zeronet, "zeronet"), + 0xe7 => (Secp256K1Pub, "secp256k1-pub"), + 0xe8 => (Dnslink, "dnslink"), + 0xea => (Bls12381G1Pub, "bls12_381-g1-pub"), + 0xeb => (Bls12381G2Pub, "bls12_381-g2-pub"), + 0xec => (X25519Pub, "x25519-pub"), + 0xed => (Ed25519Pub, "ed25519-pub"), + 0xee => (Bls12381G1G2Pub, "bls12_381-g1g2-pub"), + 0xef => (Sr25519Pub, "sr25519-pub"), + 0xf0 => (DashBlock, "dash-block"), + 0xf1 => (DashTx, "dash-tx"), + 0xfa => (SwarmManifest, "swarm-manifest"), + 0xfb => (SwarmFeed, "swarm-feed"), + 0xfc => (Beeson, "beeson"), + 0x0111 => (Udp, "udp"), + 0x0113 => (P2PWebrtcStar, "p2p-webrtc-star"), + 0x0114 => (P2PWebrtcDirect, "p2p-webrtc-direct"), + 0x0115 => (P2PStardust, "p2p-stardust"), + 0x0118 => (WebrtcDirect, "webrtc-direct"), + 0x0119 => (Webrtc, "webrtc"), + 0x0122 => (P2PCircuit, "p2p-circuit"), + 0x0129 => (DagJson, "dag-json"), + 0x012d => (Udt, "udt"), + 0x012e => (Utp, "utp"), + 0x0132 => (Crc32, "crc32"), + 0x0164 => (Crc64Ecma, "crc64-ecma"), + 0x0190 => (Unix, "unix"), + 0x0196 => (Thread, "thread"), + 0x01a5 => (P2P, "p2p"), + 0x01bb => (Https, "https"), + 0x01bc => (Onion, "onion"), + 0x01bd => (Onion3, "onion3"), + 0x01be => (Garlic64, "garlic64"), + 0x01bf => (Garlic32, "garlic32"), + 0x01c0 => (Tls, "tls"), + 0x01c1 => (Sni, "sni"), + 0x01c6 => (Noise, "noise"), + 0x01c8 => (Shs, "shs"), + 0x01cc => (Quic, "quic"), + 0x01cd => (QuicV1, "quic-v1"), + 0x01d1 => (Webtransport, "webtransport"), + 0x01d2 => (Certhash, "certhash"), + 0x01dd => (Ws, "ws"), + 0x01de => (Wss, "wss"), + 0x01df => (P2PWebsocketStar, "p2p-websocket-star"), + 0x01e0 => (Http, "http"), + 0x01f0 => (Swhid1Snp, "swhid-1-snp"), + 0x0200 => (Json, "json"), + 0x0201 => (Messagepack, "messagepack"), + 0x0202 => (Car, "car"), + 0x0300 => (IpnsRecord, "ipns-record"), + 0x0301 => (Libp2PPeerRecord, "libp2p-peer-record"), + 0x0302 => (Libp2PRelayRsvp, "libp2p-relay-rsvp"), + 0x0309 => (Memorytransport, "memorytransport"), + 0x0400 => (CarIndexSorted, "car-index-sorted"), + 0x0401 => (CarMultihashIndexSorted, "car-multihash-index-sorted"), + 0x0900 => (TransportBitswap, "transport-bitswap"), + 0x0910 => (TransportGraphsyncFilecoinv1, "transport-graphsync-filecoinv1"), + 0x0920 => (TransportIpfsGatewayHttp, "transport-ipfs-gateway-http"), + 0x0d1d => (Multidid, "multidid"), + 0x1012 => (Sha2256Trunc254Padded, "sha2-256-trunc254-padded"), + 0x1013 => (Sha2224, "sha2-224"), + 0x1014 => (Sha2512224, "sha2-512-224"), + 0x1015 => (Sha2512256, "sha2-512-256"), + 0x1022 => (Murmur3X64128, "murmur3-x64-128"), + 0x1052 => (Ripemd128, "ripemd-128"), + 0x1053 => (Ripemd160, "ripemd-160"), + 0x1054 => (Ripemd256, "ripemd-256"), + 0x1055 => (Ripemd320, "ripemd-320"), + 0x1100 => (X11, "x11"), + 0x1200 => (P256Pub, "p256-pub"), + 0x1201 => (P384Pub, "p384-pub"), + 0x1202 => (P521Pub, "p521-pub"), + 0x1203 => (Ed448Pub, "ed448-pub"), + 0x1204 => (X448Pub, "x448-pub"), + 0x1205 => (RsaPub, "rsa-pub"), + 0x1206 => (Sm2Pub, "sm2-pub"), + 0x1207 => (Vlad, "vlad"), + 0x1208 => (ProvenanceLog, "provenance-log"), + 0x1209 => (ProvenanceLogEntry, "provenance-log-entry"), + 0x120a => (ProvenanceLogScript, "provenance-log-script"), + 0x1239 => (Multisig, "multisig"), + 0x123a => (Multikey, "multikey"), + 0x123b => (Nonce, "nonce"), + 0x1300 => (Ed25519Priv, "ed25519-priv"), + 0x1301 => (Secp256K1Priv, "secp256k1-priv"), + 0x1302 => (X25519Priv, "x25519-priv"), + 0x1303 => (Sr25519Priv, "sr25519-priv"), + 0x1305 => (RsaPriv, "rsa-priv"), + 0x1306 => (P256Priv, "p256-priv"), + 0x1307 => (P384Priv, "p384-priv"), + 0x1308 => (P521Priv, "p521-priv"), + 0x1309 => (Bls12381G1Priv, "bls12_381-g1-priv"), + 0x130a => (Bls12381G2Priv, "bls12_381-g2-priv"), + 0x130b => (Bls12381G1G2Priv, "bls12_381-g1g2-priv"), + 0x130c => (Bls12381G1PubShare, "bls12_381-g1-pub-share"), + 0x130d => (Bls12381G2PubShare, "bls12_381-g2-pub-share"), + 0x130e => (Bls12381G1PrivShare, "bls12_381-g1-priv-share"), + 0x130f => (Bls12381G2PrivShare, "bls12_381-g2-priv-share"), + 0x1a14 => (LamportPub, "lamport-pub"), + 0x1a24 => (LamportPriv, "lamport-priv"), + 0x1a34 => (LamportPrivShare, "lamport-priv-share"), + 0x1a44 => (LamportSig, "lamport-sig"), + 0x1a54 => (LamportSigShare, "lamport-sig-share"), + 0x1d01 => (Kangarootwelve, "kangarootwelve"), + 0x2000 => (AesGcm256, "aes-gcm-256"), + 0x3f42 => (Silverpine, "silverpine"), + 0x534d => (Sm3256, "sm3-256"), + 0x7012 => (Sha256A, "sha256a"), + 0xb201 => (Blake2B8, "blake2b-8"), + 0xb202 => (Blake2B16, "blake2b-16"), + 0xb203 => (Blake2B24, "blake2b-24"), + 0xb204 => (Blake2B32, "blake2b-32"), + 0xb205 => (Blake2B40, "blake2b-40"), + 0xb206 => (Blake2B48, "blake2b-48"), + 0xb207 => (Blake2B56, "blake2b-56"), + 0xb208 => (Blake2B64, "blake2b-64"), + 0xb209 => (Blake2B72, "blake2b-72"), + 0xb20a => (Blake2B80, "blake2b-80"), + 0xb20b => (Blake2B88, "blake2b-88"), + 0xb20c => (Blake2B96, "blake2b-96"), + 0xb20d => (Blake2B104, "blake2b-104"), + 0xb20e => (Blake2B112, "blake2b-112"), + 0xb20f => (Blake2B120, "blake2b-120"), + 0xb210 => (Blake2B128, "blake2b-128"), + 0xb211 => (Blake2B136, "blake2b-136"), + 0xb212 => (Blake2B144, "blake2b-144"), + 0xb213 => (Blake2B152, "blake2b-152"), + 0xb214 => (Blake2B160, "blake2b-160"), + 0xb215 => (Blake2B168, "blake2b-168"), + 0xb216 => (Blake2B176, "blake2b-176"), + 0xb217 => (Blake2B184, "blake2b-184"), + 0xb218 => (Blake2B192, "blake2b-192"), + 0xb219 => (Blake2B200, "blake2b-200"), + 0xb21a => (Blake2B208, "blake2b-208"), + 0xb21b => (Blake2B216, "blake2b-216"), + 0xb21c => (Blake2B224, "blake2b-224"), + 0xb21d => (Blake2B232, "blake2b-232"), + 0xb21e => (Blake2B240, "blake2b-240"), + 0xb21f => (Blake2B248, "blake2b-248"), + 0xb220 => (Blake2B256, "blake2b-256"), + 0xb221 => (Blake2B264, "blake2b-264"), + 0xb222 => (Blake2B272, "blake2b-272"), + 0xb223 => (Blake2B280, "blake2b-280"), + 0xb224 => (Blake2B288, "blake2b-288"), + 0xb225 => (Blake2B296, "blake2b-296"), + 0xb226 => (Blake2B304, "blake2b-304"), + 0xb227 => (Blake2B312, "blake2b-312"), + 0xb228 => (Blake2B320, "blake2b-320"), + 0xb229 => (Blake2B328, "blake2b-328"), + 0xb22a => (Blake2B336, "blake2b-336"), + 0xb22b => (Blake2B344, "blake2b-344"), + 0xb22c => (Blake2B352, "blake2b-352"), + 0xb22d => (Blake2B360, "blake2b-360"), + 0xb22e => (Blake2B368, "blake2b-368"), + 0xb22f => (Blake2B376, "blake2b-376"), + 0xb230 => (Blake2B384, "blake2b-384"), + 0xb231 => (Blake2B392, "blake2b-392"), + 0xb232 => (Blake2B400, "blake2b-400"), + 0xb233 => (Blake2B408, "blake2b-408"), + 0xb234 => (Blake2B416, "blake2b-416"), + 0xb235 => (Blake2B424, "blake2b-424"), + 0xb236 => (Blake2B432, "blake2b-432"), + 0xb237 => (Blake2B440, "blake2b-440"), + 0xb238 => (Blake2B448, "blake2b-448"), + 0xb239 => (Blake2B456, "blake2b-456"), + 0xb23a => (Blake2B464, "blake2b-464"), + 0xb23b => (Blake2B472, "blake2b-472"), + 0xb23c => (Blake2B480, "blake2b-480"), + 0xb23d => (Blake2B488, "blake2b-488"), + 0xb23e => (Blake2B496, "blake2b-496"), + 0xb23f => (Blake2B504, "blake2b-504"), + 0xb240 => (Blake2B512, "blake2b-512"), + 0xb241 => (Blake2S8, "blake2s-8"), + 0xb242 => (Blake2S16, "blake2s-16"), + 0xb243 => (Blake2S24, "blake2s-24"), + 0xb244 => (Blake2S32, "blake2s-32"), + 0xb245 => (Blake2S40, "blake2s-40"), + 0xb246 => (Blake2S48, "blake2s-48"), + 0xb247 => (Blake2S56, "blake2s-56"), + 0xb248 => (Blake2S64, "blake2s-64"), + 0xb249 => (Blake2S72, "blake2s-72"), + 0xb24a => (Blake2S80, "blake2s-80"), + 0xb24b => (Blake2S88, "blake2s-88"), + 0xb24c => (Blake2S96, "blake2s-96"), + 0xb24d => (Blake2S104, "blake2s-104"), + 0xb24e => (Blake2S112, "blake2s-112"), + 0xb24f => (Blake2S120, "blake2s-120"), + 0xb250 => (Blake2S128, "blake2s-128"), + 0xb251 => (Blake2S136, "blake2s-136"), + 0xb252 => (Blake2S144, "blake2s-144"), + 0xb253 => (Blake2S152, "blake2s-152"), + 0xb254 => (Blake2S160, "blake2s-160"), + 0xb255 => (Blake2S168, "blake2s-168"), + 0xb256 => (Blake2S176, "blake2s-176"), + 0xb257 => (Blake2S184, "blake2s-184"), + 0xb258 => (Blake2S192, "blake2s-192"), + 0xb259 => (Blake2S200, "blake2s-200"), + 0xb25a => (Blake2S208, "blake2s-208"), + 0xb25b => (Blake2S216, "blake2s-216"), + 0xb25c => (Blake2S224, "blake2s-224"), + 0xb25d => (Blake2S232, "blake2s-232"), + 0xb25e => (Blake2S240, "blake2s-240"), + 0xb25f => (Blake2S248, "blake2s-248"), + 0xb260 => (Blake2S256, "blake2s-256"), + 0xb301 => (Skein2568, "skein256-8"), + 0xb302 => (Skein25616, "skein256-16"), + 0xb303 => (Skein25624, "skein256-24"), + 0xb304 => (Skein25632, "skein256-32"), + 0xb305 => (Skein25640, "skein256-40"), + 0xb306 => (Skein25648, "skein256-48"), + 0xb307 => (Skein25656, "skein256-56"), + 0xb308 => (Skein25664, "skein256-64"), + 0xb309 => (Skein25672, "skein256-72"), + 0xb30a => (Skein25680, "skein256-80"), + 0xb30b => (Skein25688, "skein256-88"), + 0xb30c => (Skein25696, "skein256-96"), + 0xb30d => (Skein256104, "skein256-104"), + 0xb30e => (Skein256112, "skein256-112"), + 0xb30f => (Skein256120, "skein256-120"), + 0xb310 => (Skein256128, "skein256-128"), + 0xb311 => (Skein256136, "skein256-136"), + 0xb312 => (Skein256144, "skein256-144"), + 0xb313 => (Skein256152, "skein256-152"), + 0xb314 => (Skein256160, "skein256-160"), + 0xb315 => (Skein256168, "skein256-168"), + 0xb316 => (Skein256176, "skein256-176"), + 0xb317 => (Skein256184, "skein256-184"), + 0xb318 => (Skein256192, "skein256-192"), + 0xb319 => (Skein256200, "skein256-200"), + 0xb31a => (Skein256208, "skein256-208"), + 0xb31b => (Skein256216, "skein256-216"), + 0xb31c => (Skein256224, "skein256-224"), + 0xb31d => (Skein256232, "skein256-232"), + 0xb31e => (Skein256240, "skein256-240"), + 0xb31f => (Skein256248, "skein256-248"), + 0xb320 => (Skein256256, "skein256-256"), + 0xb321 => (Skein5128, "skein512-8"), + 0xb322 => (Skein51216, "skein512-16"), + 0xb323 => (Skein51224, "skein512-24"), + 0xb324 => (Skein51232, "skein512-32"), + 0xb325 => (Skein51240, "skein512-40"), + 0xb326 => (Skein51248, "skein512-48"), + 0xb327 => (Skein51256, "skein512-56"), + 0xb328 => (Skein51264, "skein512-64"), + 0xb329 => (Skein51272, "skein512-72"), + 0xb32a => (Skein51280, "skein512-80"), + 0xb32b => (Skein51288, "skein512-88"), + 0xb32c => (Skein51296, "skein512-96"), + 0xb32d => (Skein512104, "skein512-104"), + 0xb32e => (Skein512112, "skein512-112"), + 0xb32f => (Skein512120, "skein512-120"), + 0xb330 => (Skein512128, "skein512-128"), + 0xb331 => (Skein512136, "skein512-136"), + 0xb332 => (Skein512144, "skein512-144"), + 0xb333 => (Skein512152, "skein512-152"), + 0xb334 => (Skein512160, "skein512-160"), + 0xb335 => (Skein512168, "skein512-168"), + 0xb336 => (Skein512176, "skein512-176"), + 0xb337 => (Skein512184, "skein512-184"), + 0xb338 => (Skein512192, "skein512-192"), + 0xb339 => (Skein512200, "skein512-200"), + 0xb33a => (Skein512208, "skein512-208"), + 0xb33b => (Skein512216, "skein512-216"), + 0xb33c => (Skein512224, "skein512-224"), + 0xb33d => (Skein512232, "skein512-232"), + 0xb33e => (Skein512240, "skein512-240"), + 0xb33f => (Skein512248, "skein512-248"), + 0xb340 => (Skein512256, "skein512-256"), + 0xb341 => (Skein512264, "skein512-264"), + 0xb342 => (Skein512272, "skein512-272"), + 0xb343 => (Skein512280, "skein512-280"), + 0xb344 => (Skein512288, "skein512-288"), + 0xb345 => (Skein512296, "skein512-296"), + 0xb346 => (Skein512304, "skein512-304"), + 0xb347 => (Skein512312, "skein512-312"), + 0xb348 => (Skein512320, "skein512-320"), + 0xb349 => (Skein512328, "skein512-328"), + 0xb34a => (Skein512336, "skein512-336"), + 0xb34b => (Skein512344, "skein512-344"), + 0xb34c => (Skein512352, "skein512-352"), + 0xb34d => (Skein512360, "skein512-360"), + 0xb34e => (Skein512368, "skein512-368"), + 0xb34f => (Skein512376, "skein512-376"), + 0xb350 => (Skein512384, "skein512-384"), + 0xb351 => (Skein512392, "skein512-392"), + 0xb352 => (Skein512400, "skein512-400"), + 0xb353 => (Skein512408, "skein512-408"), + 0xb354 => (Skein512416, "skein512-416"), + 0xb355 => (Skein512424, "skein512-424"), + 0xb356 => (Skein512432, "skein512-432"), + 0xb357 => (Skein512440, "skein512-440"), + 0xb358 => (Skein512448, "skein512-448"), + 0xb359 => (Skein512456, "skein512-456"), + 0xb35a => (Skein512464, "skein512-464"), + 0xb35b => (Skein512472, "skein512-472"), + 0xb35c => (Skein512480, "skein512-480"), + 0xb35d => (Skein512488, "skein512-488"), + 0xb35e => (Skein512496, "skein512-496"), + 0xb35f => (Skein512504, "skein512-504"), + 0xb360 => (Skein512512, "skein512-512"), + 0xb361 => (Skein10248, "skein1024-8"), + 0xb362 => (Skein102416, "skein1024-16"), + 0xb363 => (Skein102424, "skein1024-24"), + 0xb364 => (Skein102432, "skein1024-32"), + 0xb365 => (Skein102440, "skein1024-40"), + 0xb366 => (Skein102448, "skein1024-48"), + 0xb367 => (Skein102456, "skein1024-56"), + 0xb368 => (Skein102464, "skein1024-64"), + 0xb369 => (Skein102472, "skein1024-72"), + 0xb36a => (Skein102480, "skein1024-80"), + 0xb36b => (Skein102488, "skein1024-88"), + 0xb36c => (Skein102496, "skein1024-96"), + 0xb36d => (Skein1024104, "skein1024-104"), + 0xb36e => (Skein1024112, "skein1024-112"), + 0xb36f => (Skein1024120, "skein1024-120"), + 0xb370 => (Skein1024128, "skein1024-128"), + 0xb371 => (Skein1024136, "skein1024-136"), + 0xb372 => (Skein1024144, "skein1024-144"), + 0xb373 => (Skein1024152, "skein1024-152"), + 0xb374 => (Skein1024160, "skein1024-160"), + 0xb375 => (Skein1024168, "skein1024-168"), + 0xb376 => (Skein1024176, "skein1024-176"), + 0xb377 => (Skein1024184, "skein1024-184"), + 0xb378 => (Skein1024192, "skein1024-192"), + 0xb379 => (Skein1024200, "skein1024-200"), + 0xb37a => (Skein1024208, "skein1024-208"), + 0xb37b => (Skein1024216, "skein1024-216"), + 0xb37c => (Skein1024224, "skein1024-224"), + 0xb37d => (Skein1024232, "skein1024-232"), + 0xb37e => (Skein1024240, "skein1024-240"), + 0xb37f => (Skein1024248, "skein1024-248"), + 0xb380 => (Skein1024256, "skein1024-256"), + 0xb381 => (Skein1024264, "skein1024-264"), + 0xb382 => (Skein1024272, "skein1024-272"), + 0xb383 => (Skein1024280, "skein1024-280"), + 0xb384 => (Skein1024288, "skein1024-288"), + 0xb385 => (Skein1024296, "skein1024-296"), + 0xb386 => (Skein1024304, "skein1024-304"), + 0xb387 => (Skein1024312, "skein1024-312"), + 0xb388 => (Skein1024320, "skein1024-320"), + 0xb389 => (Skein1024328, "skein1024-328"), + 0xb38a => (Skein1024336, "skein1024-336"), + 0xb38b => (Skein1024344, "skein1024-344"), + 0xb38c => (Skein1024352, "skein1024-352"), + 0xb38d => (Skein1024360, "skein1024-360"), + 0xb38e => (Skein1024368, "skein1024-368"), + 0xb38f => (Skein1024376, "skein1024-376"), + 0xb390 => (Skein1024384, "skein1024-384"), + 0xb391 => (Skein1024392, "skein1024-392"), + 0xb392 => (Skein1024400, "skein1024-400"), + 0xb393 => (Skein1024408, "skein1024-408"), + 0xb394 => (Skein1024416, "skein1024-416"), + 0xb395 => (Skein1024424, "skein1024-424"), + 0xb396 => (Skein1024432, "skein1024-432"), + 0xb397 => (Skein1024440, "skein1024-440"), + 0xb398 => (Skein1024448, "skein1024-448"), + 0xb399 => (Skein1024456, "skein1024-456"), + 0xb39a => (Skein1024464, "skein1024-464"), + 0xb39b => (Skein1024472, "skein1024-472"), + 0xb39c => (Skein1024480, "skein1024-480"), + 0xb39d => (Skein1024488, "skein1024-488"), + 0xb39e => (Skein1024496, "skein1024-496"), + 0xb39f => (Skein1024504, "skein1024-504"), + 0xb3a0 => (Skein1024512, "skein1024-512"), + 0xb3a1 => (Skein1024520, "skein1024-520"), + 0xb3a2 => (Skein1024528, "skein1024-528"), + 0xb3a3 => (Skein1024536, "skein1024-536"), + 0xb3a4 => (Skein1024544, "skein1024-544"), + 0xb3a5 => (Skein1024552, "skein1024-552"), + 0xb3a6 => (Skein1024560, "skein1024-560"), + 0xb3a7 => (Skein1024568, "skein1024-568"), + 0xb3a8 => (Skein1024576, "skein1024-576"), + 0xb3a9 => (Skein1024584, "skein1024-584"), + 0xb3aa => (Skein1024592, "skein1024-592"), + 0xb3ab => (Skein1024600, "skein1024-600"), + 0xb3ac => (Skein1024608, "skein1024-608"), + 0xb3ad => (Skein1024616, "skein1024-616"), + 0xb3ae => (Skein1024624, "skein1024-624"), + 0xb3af => (Skein1024632, "skein1024-632"), + 0xb3b0 => (Skein1024640, "skein1024-640"), + 0xb3b1 => (Skein1024648, "skein1024-648"), + 0xb3b2 => (Skein1024656, "skein1024-656"), + 0xb3b3 => (Skein1024664, "skein1024-664"), + 0xb3b4 => (Skein1024672, "skein1024-672"), + 0xb3b5 => (Skein1024680, "skein1024-680"), + 0xb3b6 => (Skein1024688, "skein1024-688"), + 0xb3b7 => (Skein1024696, "skein1024-696"), + 0xb3b8 => (Skein1024704, "skein1024-704"), + 0xb3b9 => (Skein1024712, "skein1024-712"), + 0xb3ba => (Skein1024720, "skein1024-720"), + 0xb3bb => (Skein1024728, "skein1024-728"), + 0xb3bc => (Skein1024736, "skein1024-736"), + 0xb3bd => (Skein1024744, "skein1024-744"), + 0xb3be => (Skein1024752, "skein1024-752"), + 0xb3bf => (Skein1024760, "skein1024-760"), + 0xb3c0 => (Skein1024768, "skein1024-768"), + 0xb3c1 => (Skein1024776, "skein1024-776"), + 0xb3c2 => (Skein1024784, "skein1024-784"), + 0xb3c3 => (Skein1024792, "skein1024-792"), + 0xb3c4 => (Skein1024800, "skein1024-800"), + 0xb3c5 => (Skein1024808, "skein1024-808"), + 0xb3c6 => (Skein1024816, "skein1024-816"), + 0xb3c7 => (Skein1024824, "skein1024-824"), + 0xb3c8 => (Skein1024832, "skein1024-832"), + 0xb3c9 => (Skein1024840, "skein1024-840"), + 0xb3ca => (Skein1024848, "skein1024-848"), + 0xb3cb => (Skein1024856, "skein1024-856"), + 0xb3cc => (Skein1024864, "skein1024-864"), + 0xb3cd => (Skein1024872, "skein1024-872"), + 0xb3ce => (Skein1024880, "skein1024-880"), + 0xb3cf => (Skein1024888, "skein1024-888"), + 0xb3d0 => (Skein1024896, "skein1024-896"), + 0xb3d1 => (Skein1024904, "skein1024-904"), + 0xb3d2 => (Skein1024912, "skein1024-912"), + 0xb3d3 => (Skein1024920, "skein1024-920"), + 0xb3d4 => (Skein1024928, "skein1024-928"), + 0xb3d5 => (Skein1024936, "skein1024-936"), + 0xb3d6 => (Skein1024944, "skein1024-944"), + 0xb3d7 => (Skein1024952, "skein1024-952"), + 0xb3d8 => (Skein1024960, "skein1024-960"), + 0xb3d9 => (Skein1024968, "skein1024-968"), + 0xb3da => (Skein1024976, "skein1024-976"), + 0xb3db => (Skein1024984, "skein1024-984"), + 0xb3dc => (Skein1024992, "skein1024-992"), + 0xb3dd => (Skein10241000, "skein1024-1000"), + 0xb3de => (Skein10241008, "skein1024-1008"), + 0xb3df => (Skein10241016, "skein1024-1016"), + 0xb3e0 => (Skein10241024, "skein1024-1024"), + 0xb3e1 => (Xxh32, "xxh-32"), + 0xb3e2 => (Xxh64, "xxh-64"), + 0xb3e3 => (Xxh364, "xxh3-64"), + 0xb3e4 => (Xxh3128, "xxh3-128"), + 0xb401 => (PoseidonBls12381A2Fc1, "poseidon-bls12_381-a2-fc1"), + 0xb402 => (PoseidonBls12381A2Fc1Sc, "poseidon-bls12_381-a2-fc1-sc"), + 0xb403 => (Rdfc1, "rdfc-1"), + 0xb501 => (Ssz, "ssz"), + 0xb502 => (SszSha2256Bmt, "ssz-sha2-256-bmt"), + 0xb510 => (Sha2256Chunked, "sha2-256-chunked"), + 0xb601 => (JsonJcs, "json-jcs"), + 0xcc01 => (Iscc, "iscc"), + 0xce11 => (ZeroxcertImprint256, "zeroxcert-imprint-256"), + 0xd000 => (NonstandardSig, "nonstandard-sig"), + 0xd00d => (BcryptPbkdf, "bcrypt-pbkdf"), + 0xd0e7 => (Es256K, "es256k"), + 0xd0ea => (Bls12381G1Sig, "bls12_381-g1-sig"), + 0xd0eb => (Bls12381G2Sig, "bls12_381-g2-sig"), + 0xd0ed => (Eddsa, "eddsa"), + 0xd191 => (Eip191, "eip-191"), + 0xeb51 => (JwkJcsPub, "jwk_jcs-pub"), + 0xf101 => (FilCommitmentUnsealed, "fil-commitment-unsealed"), + 0xf102 => (FilCommitmentSealed, "fil-commitment-sealed"), + 0x706c61 => (Plaintextv2, "plaintextv2"), + 0x807124 => (HolochainAdrV0, "holochain-adr-v0"), + 0x817124 => (HolochainAdrV1, "holochain-adr-v1"), + 0x947124 => (HolochainKeyV0, "holochain-key-v0"), + 0x957124 => (HolochainKeyV1, "holochain-key-v1"), + 0xa27124 => (HolochainSigV0, "holochain-sig-v0"), + 0xa37124 => (HolochainSigV1, "holochain-sig-v1"), + 0xb19910 => (SkynetNs, "skynet-ns"), + 0xb29910 => (ArweaveNs, "arweave-ns"), + 0xb39910 => (SubspaceNs, "subspace-ns"), + 0xb49910 => (KumandraNs, "kumandra-ns"), + 0xd01200 => (Es256, "es256"), + 0xd01201 => (Es284, "es284"), + 0xd01202 => (Es512, "es512"), + 0xd01205 => (Rs256, "rs256"), + 0xd01300 => (Es256KMsig, "es256k-msig"), + 0xd01301 => (Bls12381G1Msig, "bls12_381-g1-msig"), + 0xd01302 => (Bls12381G2Msig, "bls12_381-g2-msig"), + 0xd01303 => (EddsaMsig, "eddsa-msig"), + 0xd01304 => (Bls12381G1ShareMsig, "bls12_381-g1-share-msig"), + 0xd01305 => (Bls12381G2ShareMsig, "bls12_381-g2-share-msig"), + 0xd01306 => (LamportMsig, "lamport-msig"), + 0xd01307 => (LamportShareMsig, "lamport-share-msig"), + 0xd01308 => (Es256Msig, "es256-msig"), + 0xd01309 => (Es384Msig, "es384-msig"), + 0xd0130a => (Es521Msig, "es521-msig"), + 0xd0130b => (Rs256Msig, "rs256-msig"), + 0xd02000 => (Scion, "scion"), +} diff --git a/table.csv b/table.csv new file mode 100644 index 0000000..a290b25 --- /dev/null +++ b/table.csv @@ -0,0 +1,572 @@ +name,tag,code,status,description +identity, multihash, 0x00, permanent, raw binary +cidv1, cid, 0x01, permanent, CIDv1 +cidv2, cid, 0x02, draft, CIDv2 +cidv3, cid, 0x03, draft, CIDv3 +ip4, multiaddr, 0x04, permanent, +tcp, multiaddr, 0x06, permanent, +sha1, multihash, 0x11, permanent, +sha2-256, multihash, 0x12, permanent, +sha2-512, multihash, 0x13, permanent, +sha3-512, multihash, 0x14, permanent, +sha3-384, multihash, 0x15, permanent, +sha3-256, multihash, 0x16, permanent, +sha3-224, multihash, 0x17, permanent, +shake-128, multihash, 0x18, draft, +shake-256, multihash, 0x19, draft, +keccak-224, multihash, 0x1a, draft, keccak has variable output length. The number specifies the core length +keccak-256, multihash, 0x1b, draft, +keccak-384, multihash, 0x1c, draft, +keccak-512, multihash, 0x1d, draft, +blake3, multihash, 0x1e, draft, BLAKE3 has a default 32 byte output length. The maximum length is (2^64)-1 bytes. +sha2-384, multihash, 0x20, permanent, aka SHA-384; as specified by FIPS 180-4. +dccp, multiaddr, 0x21, draft, +murmur3-x64-64, hash, 0x22, permanent, The first 64-bits of a murmur3-x64-128 - used for UnixFS directory sharding. +murmur3-32, hash, 0x23, draft, +ip6, multiaddr, 0x29, permanent, +ip6zone, multiaddr, 0x2a, draft, +ipcidr, multiaddr, 0x2b, draft, CIDR mask for IP addresses +path, namespace, 0x2f, permanent, Namespace for string paths. Corresponds to `/` in ASCII. +multicodec, multiformat, 0x30, draft, +multihash, multiformat, 0x31, draft, +multiaddr, multiformat, 0x32, draft, +multibase, multiformat, 0x33, draft, +varsig, multiformat, 0x34, draft, Variable signature (varsig) multiformat +dns, multiaddr, 0x35, permanent, +dns4, multiaddr, 0x36, permanent, +dns6, multiaddr, 0x37, permanent, +dnsaddr, multiaddr, 0x38, permanent, +protobuf, serialization, 0x50, draft, Protocol Buffers +cbor, ipld, 0x51, permanent, CBOR +raw, ipld, 0x55, permanent, raw binary +dbl-sha2-256, multihash, 0x56, draft, +rlp, serialization, 0x60, draft, recursive length prefix +bencode, serialization, 0x63, draft, bencode +dag-pb, ipld, 0x70, permanent, MerkleDAG protobuf +dag-cbor, ipld, 0x71, permanent, MerkleDAG cbor +libp2p-key, ipld, 0x72, permanent, Libp2p Public Key +git-raw, ipld, 0x78, permanent, Raw Git object +torrent-info, ipld, 0x7b, draft, Torrent file info field (bencoded) +torrent-file, ipld, 0x7c, draft, Torrent file (bencoded) +blake3-hashseq, ipld, 0x80, draft, BLAKE3 hash sequence - per Iroh collections spec +leofcoin-block, ipld, 0x81, draft, Leofcoin Block +leofcoin-tx, ipld, 0x82, draft, Leofcoin Transaction +leofcoin-pr, ipld, 0x83, draft, Leofcoin Peer Reputation +sctp, multiaddr, 0x84, draft, +dag-jose, ipld, 0x85, draft, MerkleDAG JOSE +dag-cose, ipld, 0x86, draft, MerkleDAG COSE +lbry, namespace, 0x8c, draft, LBRY Address +eth-block, ipld, 0x90, permanent, Ethereum Header (RLP) +eth-block-list, ipld, 0x91, permanent, Ethereum Header List (RLP) +eth-tx-trie, ipld, 0x92, permanent, Ethereum Transaction Trie (Eth-Trie) +eth-tx, ipld, 0x93, permanent, Ethereum Transaction (MarshalBinary) +eth-tx-receipt-trie, ipld, 0x94, permanent, Ethereum Transaction Receipt Trie (Eth-Trie) +eth-tx-receipt, ipld, 0x95, permanent, Ethereum Transaction Receipt (MarshalBinary) +eth-state-trie, ipld, 0x96, permanent, Ethereum State Trie (Eth-Secure-Trie) +eth-account-snapshot, ipld, 0x97, permanent, Ethereum Account Snapshot (RLP) +eth-storage-trie, ipld, 0x98, permanent, Ethereum Contract Storage Trie (Eth-Secure-Trie) +eth-receipt-log-trie, ipld, 0x99, draft, Ethereum Transaction Receipt Log Trie (Eth-Trie) +eth-receipt-log, ipld, 0x9a, draft, Ethereum Transaction Receipt Log (RLP) +aes-128, key, 0xa0, draft, 128-bit AES symmetric key +aes-192, key, 0xa1, draft, 192-bit AES symmetric key +aes-256, key, 0xa2, draft, 256-bit AES symmetric key +chacha-128, key, 0xa3, draft, 128-bit ChaCha symmetric key +chacha-256, key, 0xa4, draft, 256-bit ChaCha symmetric key +chacha20-poly1305, multikey, 0xa5, draft, ChaCha20_Poly1305 encryption scheme +bitcoin-block, ipld, 0xb0, permanent, Bitcoin Block +bitcoin-tx, ipld, 0xb1, permanent, Bitcoin Tx +bitcoin-witness-commitment, ipld, 0xb2, permanent, Bitcoin Witness Commitment +zcash-block, ipld, 0xc0, permanent, Zcash Block +zcash-tx, ipld, 0xc1, permanent, Zcash Tx +caip-50, multiformat, 0xca, draft, CAIP-50 multi-chain account id +streamid, namespace, 0xce, draft, Ceramic Stream Id +stellar-block, ipld, 0xd0, draft, Stellar Block +stellar-tx, ipld, 0xd1, draft, Stellar Tx +md4, multihash, 0xd4, draft, +md5, multihash, 0xd5, draft, +decred-block, ipld, 0xe0, draft, Decred Block +decred-tx, ipld, 0xe1, draft, Decred Tx +ipld, namespace, 0xe2, draft, IPLD path +ipfs, namespace, 0xe3, draft, IPFS path +swarm, namespace, 0xe4, draft, Swarm path +ipns, namespace, 0xe5, draft, IPNS path +zeronet, namespace, 0xe6, draft, ZeroNet site address +secp256k1-pub, key, 0xe7, draft, Secp256k1 public key (compressed) +dnslink, namespace, 0xe8, permanent, DNSLink path +bls12_381-g1-pub, key, 0xea, draft, BLS12-381 public key in the G1 field +bls12_381-g2-pub, key, 0xeb, draft, BLS12-381 public key in the G2 field +x25519-pub, key, 0xec, draft, Curve25519 public key +ed25519-pub, key, 0xed, draft, Ed25519 public key +bls12_381-g1g2-pub, key, 0xee, draft, BLS12-381 concatenated public keys in both the G1 and G2 fields +sr25519-pub, key, 0xef, draft, Sr25519 public key +dash-block, ipld, 0xf0, draft, Dash Block +dash-tx, ipld, 0xf1, draft, Dash Tx +swarm-manifest, ipld, 0xfa, draft, Swarm Manifest +swarm-feed, ipld, 0xfb, draft, Swarm Feed +beeson, ipld, 0xfc, draft, Swarm BeeSon +udp, multiaddr, 0x0111, draft, +p2p-webrtc-star, multiaddr, 0x0113, deprecated, Use webrtc or webrtc-direct instead +p2p-webrtc-direct, multiaddr, 0x0114, deprecated, Use webrtc or webrtc-direct instead +p2p-stardust, multiaddr, 0x0115, deprecated, +webrtc-direct, multiaddr, 0x0118, draft, ICE-lite webrtc transport with SDP munging during connection establishment and without use of a STUN server +webrtc, multiaddr, 0x0119, draft, webrtc transport where connection establishment is according to w3c spec +p2p-circuit, multiaddr, 0x0122, permanent, +dag-json, ipld, 0x0129, permanent, MerkleDAG json +udt, multiaddr, 0x012d, draft, +utp, multiaddr, 0x012e, draft, +crc32, hash, 0x0132, draft, CRC-32 non-cryptographic hash algorithm (IEEE 802.3) +crc64-ecma, hash, 0x0164, draft, CRC-64 non-cryptographic hash algorithm (ECMA-182 - Annex B) +unix, multiaddr, 0x0190, permanent, +thread, multiaddr, 0x0196, draft, Textile Thread +p2p, multiaddr, 0x01a5, permanent, libp2p +https, multiaddr, 0x01bb, draft, +onion, multiaddr, 0x01bc, draft, +onion3, multiaddr, 0x01bd, draft, +garlic64, multiaddr, 0x01be, draft, I2P base64 (raw public key) +garlic32, multiaddr, 0x01bf, draft, I2P base32 (hashed public key or encoded public key/checksum+optional secret) +tls, multiaddr, 0x01c0, draft, +sni, multiaddr, 0x01c1, draft, Server Name Indication RFC 6066 ยง 3 +noise, multiaddr, 0x01c6, draft, +shs, multiaddr, 0x01c8, draft, Secure Scuttlebutt - Secret Handshake Stream +quic, multiaddr, 0x01cc, permanent, +quic-v1, multiaddr, 0x01cd, permanent, +webtransport, multiaddr, 0x01d1, draft, +certhash, multiaddr, 0x01d2, draft, TLS certificate's fingerprint as a multihash +ws, multiaddr, 0x01dd, permanent, +wss, multiaddr, 0x01de, permanent, +p2p-websocket-star, multiaddr, 0x01df, permanent, +http, multiaddr, 0x01e0, draft, +swhid-1-snp, ipld, 0x01f0, draft, SoftWare Heritage persistent IDentifier version 1 snapshot +json, ipld, 0x0200, permanent, JSON (UTF-8-encoded) +messagepack, serialization, 0x0201, draft, MessagePack +car, serialization, 0x0202, draft, Content Addressable aRchive (CAR) +ipns-record, serialization, 0x0300, permanent, Signed IPNS Record +libp2p-peer-record, libp2p, 0x0301, permanent, libp2p peer record type +libp2p-relay-rsvp, libp2p, 0x0302, permanent, libp2p relay reservation voucher +memorytransport, libp2p, 0x0309, permanent, in memory transport for self-dialing and testing; arbitrary +car-index-sorted, serialization, 0x0400, draft, CARv2 IndexSorted index format +car-multihash-index-sorted, serialization, 0x0401, draft, CARv2 MultihashIndexSorted index format +transport-bitswap, transport, 0x0900, draft, Bitswap datatransfer +transport-graphsync-filecoinv1, transport, 0x0910, draft, Filecoin graphsync datatransfer +transport-ipfs-gateway-http, transport, 0x0920, draft, HTTP IPFS Gateway trustless datatransfer +multidid, multiformat, 0x0d1d, draft, Compact encoding for Decentralized Identifers +sha2-256-trunc254-padded, multihash, 0x1012, permanent, SHA2-256 with the two most significant bits from the last byte zeroed (as via a mask with 0b00111111) - used for proving trees as in Filecoin +sha2-224, multihash, 0x1013, permanent, aka SHA-224; as specified by FIPS 180-4. +sha2-512-224, multihash, 0x1014, permanent, aka SHA-512/224; as specified by FIPS 180-4. +sha2-512-256, multihash, 0x1015, permanent, aka SHA-512/256; as specified by FIPS 180-4. +murmur3-x64-128, hash, 0x1022, draft, +ripemd-128, multihash, 0x1052, draft, +ripemd-160, multihash, 0x1053, draft, +ripemd-256, multihash, 0x1054, draft, +ripemd-320, multihash, 0x1055, draft, +x11, multihash, 0x1100, draft, +p256-pub, key, 0x1200, draft, P-256 public Key (compressed) +p384-pub, key, 0x1201, draft, P-384 public Key (compressed) +p521-pub, key, 0x1202, draft, P-521 public Key (compressed) +ed448-pub, key, 0x1203, draft, Ed448 public Key +x448-pub, key, 0x1204, draft, X448 public Key +rsa-pub, key, 0x1205, draft, RSA public key. DER-encoded ASN.1 type RSAPublicKey according to IETF RFC 8017 (PKCS #1) +sm2-pub, key, 0x1206, draft, SM2 public key (compressed) +vlad, vlad, 0x1207, draft, Verifiable Long-lived ADdress +provenance-log, serialization, 0x1208, draft, Verifiable and permissioned append-only log +provenance-log-entry, serialization, 0x1209, draft, Verifiable and permissioned append-only log entry +provenance-log-script, serialization, 0x120a, draft, Verifiable and permissioned append-only log script +multisig, multiformat, 0x1239, draft, Digital signature multiformat +multikey, multiformat, 0x123a, draft, Encryption key multiformat +nonce, nonce, 0x123b, draft, Nonce random value +ed25519-priv, key, 0x1300, draft, Ed25519 private key +secp256k1-priv, key, 0x1301, draft, Secp256k1 private key +x25519-priv, key, 0x1302, draft, Curve25519 private key +sr25519-priv, key, 0x1303, draft, Sr25519 private key +rsa-priv, key, 0x1305, draft, RSA private key +p256-priv, key, 0x1306, draft, P-256 private key +p384-priv, key, 0x1307, draft, P-384 private key +p521-priv, key, 0x1308, draft, P-521 private key +bls12_381-g1-priv, key, 0x1309, draft, BLS12-381 G1 private key +bls12_381-g2-priv, key, 0x130a, draft, BLS12-381 G2 private key +bls12_381-g1g2-priv, key, 0x130b, draft, BLS12-381 G1 and G2 private key +bls12_381-g1-pub-share, key, 0x130c, draft, BLS12-381 G1 public key share +bls12_381-g2-pub-share, key, 0x130d, draft, BLS12-381 G2 public key share +bls12_381-g1-priv-share, key, 0x130e, draft, BLS12-381 G1 private key share +bls12_381-g2-priv-share, key, 0x130f, draft, BLS12-381 G2 private key share +lamport-pub, key, 0x1a14, draft, Lamport public key +lamport-priv, key, 0x1a24, draft, Lamport private key +lamport-priv-share, key, 0x1a34, draft, Lamport private key share split with Shamir gf256 +lamport-sig, multisig, 0x1a44, draft, Lamport signature +lamport-sig-share, multisig, 0x1a54, draft, Lamport signature share split with Shamir gf256 +kangarootwelve, multihash, 0x1d01, draft, KangarooTwelve is an extendable-output hash function based on Keccak-p +aes-gcm-256, encryption, 0x2000, draft, AES Galois/Counter Mode with 256-bit key and 12-byte IV +silverpine, multiaddr, 0x3f42, draft, Experimental QUIC over yggdrasil and ironwood routing protocol +sm3-256, multihash, 0x534d, draft, +sha256a, hash, 0x7012, draft, The sum of multiple sha2-256 hashes; as specified by Ceramic CIP-124. +blake2b-8, multihash, 0xb201, draft, Blake2b consists of 64 output lengths that give different hashes +blake2b-16, multihash, 0xb202, draft, +blake2b-24, multihash, 0xb203, draft, +blake2b-32, multihash, 0xb204, draft, +blake2b-40, multihash, 0xb205, draft, +blake2b-48, multihash, 0xb206, draft, +blake2b-56, multihash, 0xb207, draft, +blake2b-64, multihash, 0xb208, draft, +blake2b-72, multihash, 0xb209, draft, +blake2b-80, multihash, 0xb20a, draft, +blake2b-88, multihash, 0xb20b, draft, +blake2b-96, multihash, 0xb20c, draft, +blake2b-104, multihash, 0xb20d, draft, +blake2b-112, multihash, 0xb20e, draft, +blake2b-120, multihash, 0xb20f, draft, +blake2b-128, multihash, 0xb210, draft, +blake2b-136, multihash, 0xb211, draft, +blake2b-144, multihash, 0xb212, draft, +blake2b-152, multihash, 0xb213, draft, +blake2b-160, multihash, 0xb214, draft, +blake2b-168, multihash, 0xb215, draft, +blake2b-176, multihash, 0xb216, draft, +blake2b-184, multihash, 0xb217, draft, +blake2b-192, multihash, 0xb218, draft, +blake2b-200, multihash, 0xb219, draft, +blake2b-208, multihash, 0xb21a, draft, +blake2b-216, multihash, 0xb21b, draft, +blake2b-224, multihash, 0xb21c, draft, +blake2b-232, multihash, 0xb21d, draft, +blake2b-240, multihash, 0xb21e, draft, +blake2b-248, multihash, 0xb21f, draft, +blake2b-256, multihash, 0xb220, permanent, +blake2b-264, multihash, 0xb221, draft, +blake2b-272, multihash, 0xb222, draft, +blake2b-280, multihash, 0xb223, draft, +blake2b-288, multihash, 0xb224, draft, +blake2b-296, multihash, 0xb225, draft, +blake2b-304, multihash, 0xb226, draft, +blake2b-312, multihash, 0xb227, draft, +blake2b-320, multihash, 0xb228, draft, +blake2b-328, multihash, 0xb229, draft, +blake2b-336, multihash, 0xb22a, draft, +blake2b-344, multihash, 0xb22b, draft, +blake2b-352, multihash, 0xb22c, draft, +blake2b-360, multihash, 0xb22d, draft, +blake2b-368, multihash, 0xb22e, draft, +blake2b-376, multihash, 0xb22f, draft, +blake2b-384, multihash, 0xb230, draft, +blake2b-392, multihash, 0xb231, draft, +blake2b-400, multihash, 0xb232, draft, +blake2b-408, multihash, 0xb233, draft, +blake2b-416, multihash, 0xb234, draft, +blake2b-424, multihash, 0xb235, draft, +blake2b-432, multihash, 0xb236, draft, +blake2b-440, multihash, 0xb237, draft, +blake2b-448, multihash, 0xb238, draft, +blake2b-456, multihash, 0xb239, draft, +blake2b-464, multihash, 0xb23a, draft, +blake2b-472, multihash, 0xb23b, draft, +blake2b-480, multihash, 0xb23c, draft, +blake2b-488, multihash, 0xb23d, draft, +blake2b-496, multihash, 0xb23e, draft, +blake2b-504, multihash, 0xb23f, draft, +blake2b-512, multihash, 0xb240, draft, +blake2s-8, multihash, 0xb241, draft, Blake2s consists of 32 output lengths that give different hashes +blake2s-16, multihash, 0xb242, draft, +blake2s-24, multihash, 0xb243, draft, +blake2s-32, multihash, 0xb244, draft, +blake2s-40, multihash, 0xb245, draft, +blake2s-48, multihash, 0xb246, draft, +blake2s-56, multihash, 0xb247, draft, +blake2s-64, multihash, 0xb248, draft, +blake2s-72, multihash, 0xb249, draft, +blake2s-80, multihash, 0xb24a, draft, +blake2s-88, multihash, 0xb24b, draft, +blake2s-96, multihash, 0xb24c, draft, +blake2s-104, multihash, 0xb24d, draft, +blake2s-112, multihash, 0xb24e, draft, +blake2s-120, multihash, 0xb24f, draft, +blake2s-128, multihash, 0xb250, draft, +blake2s-136, multihash, 0xb251, draft, +blake2s-144, multihash, 0xb252, draft, +blake2s-152, multihash, 0xb253, draft, +blake2s-160, multihash, 0xb254, draft, +blake2s-168, multihash, 0xb255, draft, +blake2s-176, multihash, 0xb256, draft, +blake2s-184, multihash, 0xb257, draft, +blake2s-192, multihash, 0xb258, draft, +blake2s-200, multihash, 0xb259, draft, +blake2s-208, multihash, 0xb25a, draft, +blake2s-216, multihash, 0xb25b, draft, +blake2s-224, multihash, 0xb25c, draft, +blake2s-232, multihash, 0xb25d, draft, +blake2s-240, multihash, 0xb25e, draft, +blake2s-248, multihash, 0xb25f, draft, +blake2s-256, multihash, 0xb260, draft, +skein256-8, multihash, 0xb301, draft, Skein256 consists of 32 output lengths that give different hashes +skein256-16, multihash, 0xb302, draft, +skein256-24, multihash, 0xb303, draft, +skein256-32, multihash, 0xb304, draft, +skein256-40, multihash, 0xb305, draft, +skein256-48, multihash, 0xb306, draft, +skein256-56, multihash, 0xb307, draft, +skein256-64, multihash, 0xb308, draft, +skein256-72, multihash, 0xb309, draft, +skein256-80, multihash, 0xb30a, draft, +skein256-88, multihash, 0xb30b, draft, +skein256-96, multihash, 0xb30c, draft, +skein256-104, multihash, 0xb30d, draft, +skein256-112, multihash, 0xb30e, draft, +skein256-120, multihash, 0xb30f, draft, +skein256-128, multihash, 0xb310, draft, +skein256-136, multihash, 0xb311, draft, +skein256-144, multihash, 0xb312, draft, +skein256-152, multihash, 0xb313, draft, +skein256-160, multihash, 0xb314, draft, +skein256-168, multihash, 0xb315, draft, +skein256-176, multihash, 0xb316, draft, +skein256-184, multihash, 0xb317, draft, +skein256-192, multihash, 0xb318, draft, +skein256-200, multihash, 0xb319, draft, +skein256-208, multihash, 0xb31a, draft, +skein256-216, multihash, 0xb31b, draft, +skein256-224, multihash, 0xb31c, draft, +skein256-232, multihash, 0xb31d, draft, +skein256-240, multihash, 0xb31e, draft, +skein256-248, multihash, 0xb31f, draft, +skein256-256, multihash, 0xb320, draft, +skein512-8, multihash, 0xb321, draft, Skein512 consists of 64 output lengths that give different hashes +skein512-16, multihash, 0xb322, draft, +skein512-24, multihash, 0xb323, draft, +skein512-32, multihash, 0xb324, draft, +skein512-40, multihash, 0xb325, draft, +skein512-48, multihash, 0xb326, draft, +skein512-56, multihash, 0xb327, draft, +skein512-64, multihash, 0xb328, draft, +skein512-72, multihash, 0xb329, draft, +skein512-80, multihash, 0xb32a, draft, +skein512-88, multihash, 0xb32b, draft, +skein512-96, multihash, 0xb32c, draft, +skein512-104, multihash, 0xb32d, draft, +skein512-112, multihash, 0xb32e, draft, +skein512-120, multihash, 0xb32f, draft, +skein512-128, multihash, 0xb330, draft, +skein512-136, multihash, 0xb331, draft, +skein512-144, multihash, 0xb332, draft, +skein512-152, multihash, 0xb333, draft, +skein512-160, multihash, 0xb334, draft, +skein512-168, multihash, 0xb335, draft, +skein512-176, multihash, 0xb336, draft, +skein512-184, multihash, 0xb337, draft, +skein512-192, multihash, 0xb338, draft, +skein512-200, multihash, 0xb339, draft, +skein512-208, multihash, 0xb33a, draft, +skein512-216, multihash, 0xb33b, draft, +skein512-224, multihash, 0xb33c, draft, +skein512-232, multihash, 0xb33d, draft, +skein512-240, multihash, 0xb33e, draft, +skein512-248, multihash, 0xb33f, draft, +skein512-256, multihash, 0xb340, draft, +skein512-264, multihash, 0xb341, draft, +skein512-272, multihash, 0xb342, draft, +skein512-280, multihash, 0xb343, draft, +skein512-288, multihash, 0xb344, draft, +skein512-296, multihash, 0xb345, draft, +skein512-304, multihash, 0xb346, draft, +skein512-312, multihash, 0xb347, draft, +skein512-320, multihash, 0xb348, draft, +skein512-328, multihash, 0xb349, draft, +skein512-336, multihash, 0xb34a, draft, +skein512-344, multihash, 0xb34b, draft, +skein512-352, multihash, 0xb34c, draft, +skein512-360, multihash, 0xb34d, draft, +skein512-368, multihash, 0xb34e, draft, +skein512-376, multihash, 0xb34f, draft, +skein512-384, multihash, 0xb350, draft, +skein512-392, multihash, 0xb351, draft, +skein512-400, multihash, 0xb352, draft, +skein512-408, multihash, 0xb353, draft, +skein512-416, multihash, 0xb354, draft, +skein512-424, multihash, 0xb355, draft, +skein512-432, multihash, 0xb356, draft, +skein512-440, multihash, 0xb357, draft, +skein512-448, multihash, 0xb358, draft, +skein512-456, multihash, 0xb359, draft, +skein512-464, multihash, 0xb35a, draft, +skein512-472, multihash, 0xb35b, draft, +skein512-480, multihash, 0xb35c, draft, +skein512-488, multihash, 0xb35d, draft, +skein512-496, multihash, 0xb35e, draft, +skein512-504, multihash, 0xb35f, draft, +skein512-512, multihash, 0xb360, draft, +skein1024-8, multihash, 0xb361, draft, Skein1024 consists of 128 output lengths that give different hashes +skein1024-16, multihash, 0xb362, draft, +skein1024-24, multihash, 0xb363, draft, +skein1024-32, multihash, 0xb364, draft, +skein1024-40, multihash, 0xb365, draft, +skein1024-48, multihash, 0xb366, draft, +skein1024-56, multihash, 0xb367, draft, +skein1024-64, multihash, 0xb368, draft, +skein1024-72, multihash, 0xb369, draft, +skein1024-80, multihash, 0xb36a, draft, +skein1024-88, multihash, 0xb36b, draft, +skein1024-96, multihash, 0xb36c, draft, +skein1024-104, multihash, 0xb36d, draft, +skein1024-112, multihash, 0xb36e, draft, +skein1024-120, multihash, 0xb36f, draft, +skein1024-128, multihash, 0xb370, draft, +skein1024-136, multihash, 0xb371, draft, +skein1024-144, multihash, 0xb372, draft, +skein1024-152, multihash, 0xb373, draft, +skein1024-160, multihash, 0xb374, draft, +skein1024-168, multihash, 0xb375, draft, +skein1024-176, multihash, 0xb376, draft, +skein1024-184, multihash, 0xb377, draft, +skein1024-192, multihash, 0xb378, draft, +skein1024-200, multihash, 0xb379, draft, +skein1024-208, multihash, 0xb37a, draft, +skein1024-216, multihash, 0xb37b, draft, +skein1024-224, multihash, 0xb37c, draft, +skein1024-232, multihash, 0xb37d, draft, +skein1024-240, multihash, 0xb37e, draft, +skein1024-248, multihash, 0xb37f, draft, +skein1024-256, multihash, 0xb380, draft, +skein1024-264, multihash, 0xb381, draft, +skein1024-272, multihash, 0xb382, draft, +skein1024-280, multihash, 0xb383, draft, +skein1024-288, multihash, 0xb384, draft, +skein1024-296, multihash, 0xb385, draft, +skein1024-304, multihash, 0xb386, draft, +skein1024-312, multihash, 0xb387, draft, +skein1024-320, multihash, 0xb388, draft, +skein1024-328, multihash, 0xb389, draft, +skein1024-336, multihash, 0xb38a, draft, +skein1024-344, multihash, 0xb38b, draft, +skein1024-352, multihash, 0xb38c, draft, +skein1024-360, multihash, 0xb38d, draft, +skein1024-368, multihash, 0xb38e, draft, +skein1024-376, multihash, 0xb38f, draft, +skein1024-384, multihash, 0xb390, draft, +skein1024-392, multihash, 0xb391, draft, +skein1024-400, multihash, 0xb392, draft, +skein1024-408, multihash, 0xb393, draft, +skein1024-416, multihash, 0xb394, draft, +skein1024-424, multihash, 0xb395, draft, +skein1024-432, multihash, 0xb396, draft, +skein1024-440, multihash, 0xb397, draft, +skein1024-448, multihash, 0xb398, draft, +skein1024-456, multihash, 0xb399, draft, +skein1024-464, multihash, 0xb39a, draft, +skein1024-472, multihash, 0xb39b, draft, +skein1024-480, multihash, 0xb39c, draft, +skein1024-488, multihash, 0xb39d, draft, +skein1024-496, multihash, 0xb39e, draft, +skein1024-504, multihash, 0xb39f, draft, +skein1024-512, multihash, 0xb3a0, draft, +skein1024-520, multihash, 0xb3a1, draft, +skein1024-528, multihash, 0xb3a2, draft, +skein1024-536, multihash, 0xb3a3, draft, +skein1024-544, multihash, 0xb3a4, draft, +skein1024-552, multihash, 0xb3a5, draft, +skein1024-560, multihash, 0xb3a6, draft, +skein1024-568, multihash, 0xb3a7, draft, +skein1024-576, multihash, 0xb3a8, draft, +skein1024-584, multihash, 0xb3a9, draft, +skein1024-592, multihash, 0xb3aa, draft, +skein1024-600, multihash, 0xb3ab, draft, +skein1024-608, multihash, 0xb3ac, draft, +skein1024-616, multihash, 0xb3ad, draft, +skein1024-624, multihash, 0xb3ae, draft, +skein1024-632, multihash, 0xb3af, draft, +skein1024-640, multihash, 0xb3b0, draft, +skein1024-648, multihash, 0xb3b1, draft, +skein1024-656, multihash, 0xb3b2, draft, +skein1024-664, multihash, 0xb3b3, draft, +skein1024-672, multihash, 0xb3b4, draft, +skein1024-680, multihash, 0xb3b5, draft, +skein1024-688, multihash, 0xb3b6, draft, +skein1024-696, multihash, 0xb3b7, draft, +skein1024-704, multihash, 0xb3b8, draft, +skein1024-712, multihash, 0xb3b9, draft, +skein1024-720, multihash, 0xb3ba, draft, +skein1024-728, multihash, 0xb3bb, draft, +skein1024-736, multihash, 0xb3bc, draft, +skein1024-744, multihash, 0xb3bd, draft, +skein1024-752, multihash, 0xb3be, draft, +skein1024-760, multihash, 0xb3bf, draft, +skein1024-768, multihash, 0xb3c0, draft, +skein1024-776, multihash, 0xb3c1, draft, +skein1024-784, multihash, 0xb3c2, draft, +skein1024-792, multihash, 0xb3c3, draft, +skein1024-800, multihash, 0xb3c4, draft, +skein1024-808, multihash, 0xb3c5, draft, +skein1024-816, multihash, 0xb3c6, draft, +skein1024-824, multihash, 0xb3c7, draft, +skein1024-832, multihash, 0xb3c8, draft, +skein1024-840, multihash, 0xb3c9, draft, +skein1024-848, multihash, 0xb3ca, draft, +skein1024-856, multihash, 0xb3cb, draft, +skein1024-864, multihash, 0xb3cc, draft, +skein1024-872, multihash, 0xb3cd, draft, +skein1024-880, multihash, 0xb3ce, draft, +skein1024-888, multihash, 0xb3cf, draft, +skein1024-896, multihash, 0xb3d0, draft, +skein1024-904, multihash, 0xb3d1, draft, +skein1024-912, multihash, 0xb3d2, draft, +skein1024-920, multihash, 0xb3d3, draft, +skein1024-928, multihash, 0xb3d4, draft, +skein1024-936, multihash, 0xb3d5, draft, +skein1024-944, multihash, 0xb3d6, draft, +skein1024-952, multihash, 0xb3d7, draft, +skein1024-960, multihash, 0xb3d8, draft, +skein1024-968, multihash, 0xb3d9, draft, +skein1024-976, multihash, 0xb3da, draft, +skein1024-984, multihash, 0xb3db, draft, +skein1024-992, multihash, 0xb3dc, draft, +skein1024-1000, multihash, 0xb3dd, draft, +skein1024-1008, multihash, 0xb3de, draft, +skein1024-1016, multihash, 0xb3df, draft, +skein1024-1024, multihash, 0xb3e0, draft, +xxh-32, hash, 0xb3e1, draft, Extremely fast non-cryptographic hash algorithm +xxh-64, hash, 0xb3e2, draft, Extremely fast non-cryptographic hash algorithm +xxh3-64, hash, 0xb3e3, draft, Extremely fast non-cryptographic hash algorithm +xxh3-128, hash, 0xb3e4, draft, Extremely fast non-cryptographic hash algorithm +poseidon-bls12_381-a2-fc1, multihash, 0xb401, permanent, Poseidon using BLS12-381 and arity of 2 with Filecoin parameters +poseidon-bls12_381-a2-fc1-sc, multihash, 0xb402, draft, Poseidon using BLS12-381 and arity of 2 with Filecoin parameters - high-security variant +rdfc-1, ipld, 0xb403, draft, The result of canonicalizing an input according to RDFC-1.0 and then expressing its hash value as a multihash value. +ssz, serialization, 0xb501, draft, SimpleSerialize (SSZ) serialization +ssz-sha2-256-bmt, multihash, 0xb502, draft, SSZ Merkle tree root using SHA2-256 as the hashing function and SSZ serialization for the block binary +sha2-256-chunked, multihash, 0xb510, draft, Hash of concatenated SHA2-256 digests of 8*2^n MiB source chunks; n = ceil(log2(source_size/(10^4 * 8MiB))) +json-jcs, ipld, 0xb601, draft, The result of canonicalizing an input according to JCS - JSON Canonicalisation Scheme (RFC 8785) +iscc, softhash, 0xcc01, draft, ISCC (International Standard Content Code) - similarity preserving hash +zeroxcert-imprint-256, zeroxcert, 0xce11, draft, 0xcert Asset Imprint (root hash) +nonstandard-sig, varsig, 0xd000, deprecated, Namespace for all not yet standard signature algorithms +bcrypt-pbkdf, multihash, 0xd00d, draft, Bcrypt-PBKDF key derivation function +es256k, varsig, 0xd0e7, draft, ES256K Siganture Algorithm (secp256k1) +bls-12381-g1-sig, varsig, 0xd0ea, draft, G1 signature for BLS-12381-G2 +bls-12381-g2-sig, varsig, 0xd0eb, draft, G2 signature for BLS-12381-G1 +eddsa, varsig, 0xd0ed, draft, Edwards-Curve Digital Signature Algorithm +eip-191, varsig, 0xd191, draft, EIP-191 Ethereum Signed Data Standard +jwk_jcs-pub, key, 0xeb51, draft, JSON object containing only the required members of a JWK (RFC 7518 and RFC 7517) representing the public key. Serialisation based on JCS (RFC 8785) +fil-commitment-unsealed, filecoin, 0xf101, permanent, Filecoin piece or sector data commitment merkle node/root (CommP & CommD) +fil-commitment-sealed, filecoin, 0xf102, permanent, Filecoin sector data commitment merkle node/root - sealed and replicated (CommR) +plaintextv2, multiaddr, 0x706c61, draft, +holochain-adr-v0, holochain, 0x807124, draft, Holochain v0 address + 8 R-S (63 x Base-32) +holochain-adr-v1, holochain, 0x817124, draft, Holochain v1 address + 8 R-S (63 x Base-32) +holochain-key-v0, holochain, 0x947124, draft, Holochain v0 public key + 8 R-S (63 x Base-32) +holochain-key-v1, holochain, 0x957124, draft, Holochain v1 public key + 8 R-S (63 x Base-32) +holochain-sig-v0, holochain, 0xa27124, draft, Holochain v0 signature + 8 R-S (63 x Base-32) +holochain-sig-v1, holochain, 0xa37124, draft, Holochain v1 signature + 8 R-S (63 x Base-32) +skynet-ns, namespace, 0xb19910, draft, Skynet Namespace +arweave-ns, namespace, 0xb29910, draft, Arweave Namespace +subspace-ns, namespace, 0xb39910, draft, Subspace Network Namespace +kumandra-ns, namespace, 0xb49910, draft, Kumandra Network Namespace +es256, varsig, 0xd01200, draft, ES256 Signature Algorithm +es284, varsig, 0xd01201, draft, ES384 Signature Algorithm +es512, varsig, 0xd01202, draft, ES512 Signature Algorithm +rs256, varsig, 0xd01205, draft, RS256 Signature Algorithm +es256k-msig, multisig, 0xd01300, draft, ES256K (secp256k1) Signature as Multisig +bls12_381-g1-msig, multisig, 0xd01301, draft, G1 signature for BLS12-381-G2 as Multisig +bls12_381-g2-msig, multisig, 0xd01302, draft, G2 signature for BLS12-381-G1 as Multisig +eddsa-msig, multisig, 0xd01303, draft, Edwards-Curve Digital Signature as Multisig +bls12_381-g1-share-msig, multisig, 0xd01304, draft, G1 threshold signature share for BLS12-381-G2 as Multisig +bls12_381-g2-share-msig, multisig, 0xd01305, draft, G2 threshold signature share for BLS12-381-G1 as Multisig +lamport-msig, multisig, 0xd01306, draft, Lamport signature as Multisig +lamport-share-msig, multisig, 0xd01307, draft, Lamport threshold signature share as Multisig +es256-msig, multisig, 0xd01308, draft, ECDSA P-256 Signature as Multisig +es384-msig, multisig, 0xd01309, draft, ECDSA P-384 Signature as Multisig +es521-msig, multisig, 0xd0130a, draft, ECDSA P-521 Signature as Multisig +rs256-msig, multisig, 0xd0130b, draft, RS256 Signature as Multisig +scion, multiaddr, 0xd02000, draft, SCION Internet architecture