When I made use of an offchain signed extrinsic to send a transaction to a chain, I copied a snippet from others, which is like this:
use sp_core::crypto::KeyTypeId;
pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"xkey");
pub mod crypto {
use super::KEY_TYPE;
use sp_runtime::app_crypto::{app_crypto, sr25519};
app_crypto!(sr25519, KEY_TYPE);
}
pub type AuthorityId = crypto::Public;
There is a KeyTypeId
in the snippet, which is defined by b"xkey"
. In the runtime code I used this KeyTypeId
and it works. But I am not quite sure about what the KeyTypeId
means. I just know that the KeyTypeId
bounds with a private key which is associated with an account. Who can tell me the background knowledge of all of this?