4

I have noticed the entropy for system public key generation is prefixed with patterns like modlpy/proxy____.

  1. Is there a documented standard for the length or format of these prefixes?
  2. What is the purpose of the trailing underscores?

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.