Skip to content
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
2 commits merged into from
Apr 29, 2021
Merged

subkey: display SS58 encoding of public key #8674

2 commits merged into from
Apr 29, 2021

Conversation

tomusdrw
Copy link
Contributor

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

@tomusdrw tomusdrw added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Apr 27, 2021
@nuke-web3
Copy link
Contributor

Thanks for this @tomusdrw ! 🙇🏼

I will update the devhub once this lands.

Will this also apply to nodes CLI key sub-command utility for Polkadot (and other) substrate nodes? If not, can it?

…utput (#8694)

* Update Cargo.toml

* update cargo, readme for subkey

Co-authored-by: Dan Shields <danwshields@gmail.com>
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt :D

@bkchr
Copy link
Member

bkchr commented Apr 29, 2021

bot merge

@ghost
Copy link

ghost commented Apr 29, 2021

Trying merge.

@ghost
Copy link

ghost commented Apr 29, 2021

Bot will approve on the behalf of @bkchr, since they are a team lead, in an attempt to reach the minimum approval count

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants