• Converts a cryptographic key to a multibase identifier.

    Parameters

    • params: RequireOnly<KeyWithMulticodec, "keyBytes">

      The parameters for the conversion.

    Returns string

    The multibase identifier as a string.

    Remarks

    This method provides a way to represent a cryptographic key as a multibase identifier. It takes a Uint8Array representing the key, and either the multicodec code or multicodec name as input. The method first adds the multicodec prefix to the key, then encodes it into Base58 format. Finally, it converts the Base58 encoded key into a multibase identifier.

    Example

    const key = new Uint8Array([...]); // Cryptographic key as Uint8Array
    const multibaseId = keyBytesToMultibaseId({ key, multicodecName: 'ed25519-pub' });