I have noticed the entropy for system public key generation is prefixed with patterns like
- Is there a documented standard for the length or format of these prefixes?
- What is the purpose of the trailing underscores?
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.Sign up to join this community
Everything in the line you are referring to gets hashed:
let entropy = (b"modlpy/proxy____", who, height, ext_index, proxy_type, index) .using_encoded(blake2_256);
So there is no difference here what prefix is used. Just something unique enough that it is unlikely to be duplicated somewhere else by accident.
For other instances of
struct PalletId, this is specifically defined as:
/// A pallet identifier. These are per pallet and should be stored in a registry somewhere. #[derive(Clone, Copy, Eq, PartialEq, Encode, Decode, TypeInfo)] pub struct PalletId(pub [u8; 8]);
So you will find in another places, this is specifically truncated or extended to 8 characters.
I have no context as to why this struct and pattern was not used here.