From 2d145196b5bbeac7e5640a6f14dd7e9babd2ed0b Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Sun, 2 Jun 2024 17:52:08 -0400 Subject: [PATCH] Move Multibase and Multihash sections into Data Model section. --- index.html | 170 ++++++++++++++++++++++++++--------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/index.html b/index.html index 70c9c30..1099631 100644 --- a/index.html +++ b/index.html @@ -1264,13 +1264,12 @@

Capability Delegation

- -
-

Multibase

+
+

Multibase

-

+

The [[?MULTIBASE]] specification has been dispatched at IETF and may be standardized there. There is active discussion on this initiative in the @@ -1281,70 +1280,70 @@

Multibase

alignment between the Multibase values used in this specification and the Multibase values defined by the current Multibase community and any potential future IETF Multiformats Working Group. -

+

-

+

A Multibase string includes a single character header which identifies the base and encoding alphabet used to encode a binary value, followed by the encoded binary value (using that base and alphabet). The common Multibase header values and their associated base encoding alphabets as provided below are normative: -

- - - - - - - - +

- - - - + + +
Multibase HeaderDescription
`u` + + + + + + + + + + + + - - - - + + + + - - -
Multibase HeaderDescription
`u` The base-64-url-no-pad alphabet is used to encode the bytes. The base-alphabet consists of the following characters, in order: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_` -
`z` +
`z` The base-58-btc alphabet is used to encode the bytes. The base-alphabet consists of the following characters, in order: `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz` -
+
-

+

Other Multibase encoding values MAY be used, but interoperability is not guaranteed between implementations using such values. -

+

-

+

To base-encode a binary value into a Multibase string, an implementation MUST apply the algorithm in Section [[[#base-encode]]] to the binary value, with the desired base encoding and alphabet from the table above, ensuring to prepend the associated Multibase header from the table above to the result. Any algorithm with equivalent output MAY be used. -

+

-

+

To base-decode a Multibase string, an implementation MUST apply the algorithm in Section [[[#base-decode]]] to the string following the first character (Multibase header), with the alphabet associated with the Multibase header. Any algorithm with equivalent output MAY be used. -

+

-
+
-
-

Multihash

+
+

Multihash

-

+

The [[?MULTIHASH]] specification has been dispatched at IETF and may be standardized. There is active discussion on this initiative in the @@ -1355,76 +1354,77 @@

Multihash

alignment between the Multihash values used in this specification and the Multihash values defined by the current Multihash community and any potential future IETF Multiformats Working Group. -

+

-

+

A Multihash value starts with a binary header, which identifies the specific cryptographic hash algorithm and parameters used to generate the digest, followed by the cryptographic digest value. The normative Multihash header values defined by this specification, and their associated output sizes and associated specifications, are provided below: -

- - - - - - - - - +

- - - - - + + +
Multihash IdentifierMultihash HeaderDescription
`sha2-256``0x12` + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - -
Multihash IdentifierMultihash HeaderDescription
`sha2-256``0x12` SHA-2 with 256 bits (32 bytes) of output, as defined by [[RFC6234]]. -
`sha2-384``0x20` +
`sha2-384``0x20` SHA-2 with 384 bits (48 bytes) of output, as defined by [[RFC6234]]. -
`sha3-256``0x16` +
`sha3-256``0x16` SHA-3 with 256 bits (32 bytes) of output, as defined by [[SHA3]]. -
`sha3-384``0x15` +
`sha3-384``0x15` SHA-3 with 384 bits (48 bytes) of output, as defined by [[SHA3]]. -
+
-

+

Other Multihash encoding values MAY be used, but interoperability is not guaranteed between implementations. -

+

-

+

To encode to a Multihash value, an implementation MUST prepend the associated Multihash header value to the cryptographic hash value. -

+

-

+

To decode a Multihash value, an implementation MUST remove the prepended Multihash header value, which identifies the type of cryptographic hashing algorithm as well as its output length, leaving the raw cryptographic hash value which MUST match the output length associated with the Multihash header. -

+

-
+
+

Contexts and Vocabularies