did-method-key
did-method-key copied to clipboard
Clarify Multicodec Identifiers
The draft spec says that the Multibase step is a base58 encoding of "a concatenation of the Multicodec [MULTICODEC] identifier for the public key type and the raw bytes". The multicodec table it references is here, and doesn't seem to match the examples in the spec. For instance, for an ed25519 pub key (line 85 in the csv), the Multicodec identifier is listed as 0xed, but the example keys all begin with 0xed01. This extra 01 is also present in the Secp256k1 examples (0xe7 in the list, 0xe701 in the example). The extra 01 byte should either be dropped, or the spec should be clarified to make it clear why these don't match the cited multicodec list.
I just came through the same thought process. Have a look here: https://github.com/multiformats/unsigned-varint https://lists.w3.org/Archives/Public/public-credentials/2021Mar/0042.html
That explains it. Thank you for the information, I was unaware of the strange way multicodec handles integers. This should be clarified in the spec.
Yes, I agree as well, it's pretty unintuitive and makes it hard to read the codec as the values in the csv are stored as "real" ints and not varints. You got to live with that or choose others like JWK+base64 or similar
How can I help to address this concern?
Had same trouble as above when I was trying to figure out mapping from key (z6Mkp...
) to publicKeyBase58 (B12NY...
).
@OR13 , I think an example showing the hex of the public key, and then the steps to add 0xED01
(0xED
for ed25519 per multicodec table, 0x01
due to integer encoding) then to base58, then add z.
yes, i have also struggled with this.... I agree with the proposed approach:
define a table, include the public key bytes, public key kty / crv, multicodec prefix, base58 encoding.
provide an example for all supported multicodec public keys.