KeyTypes: Record<KeyAlgorithm, { magicBytes: Uint8Array }>

Using the key type as the record property name (ie. string = key type)

The magic bytes are the code found in https://github.com/multiformats/multicodec/blob/master/table.csv encoded as a variable integer (more info about that at https://github.com/multiformats/unsigned-varint).

The key type is also found in that table. It's the name of the codec minus the -pub suffix.

Ed25519 public key Key type: "ed25519" Magic bytes: [ 0xed, 0x01 ]