This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
subkey: display SS58 encoding of public key #8674
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In case of sr25519 and ed25519 crypto, the account id matches public key, hence SS58 encoded account-id address is the same as SS58 public key encoding.
In case of ECDSA, we blake2 the public key to get the address (due to size difference 33 vs 32 bytes), so the SS58 encoding was different.
Why is SS58 encoding of public key necessary at all?
Default Ser/De implementation for public keys is using SS58 encoding, hence every time we use public keys in encoded form we are going to need it's SS58 encoding. A notable case is chain spec JSON file and encoding of session keys (most importantly BEEFY).
This PR adds display of SS58 encoding of raw public key to make it easy to add BEEFY keys to chain spec json file.
CC @nukemandan