Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command for converting various Byron keys to their Shelley counterpart #1486

Merged
merged 7 commits into from
Jul 18, 2020

Conversation

intricate
Copy link
Contributor

@intricate intricate commented Jul 17, 2020

Add support for converting:

  • payment keys
  • genesis keys
  • genesis delegate keys

Support either verification or signing keys.

Support current or legacy (ie SL) formats.

Also add special conversion for Byron genesis verification keys in base64,
as they appear in the Byron genesis file as issuerPK.

@intricate intricate self-assigned this Jul 17, 2020
@intricate intricate marked this pull request as ready for review July 17, 2020 07:45
!Text
-- ^ Text representation of the parse error. Unfortunately, the actual
-- error type isn't exported.
| ShelleyKeyCmdDeserialiseByronVerKeyError
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like it'd be nicer to instead have something like ShelleyKeyCmdCborDecoderError !DecoderError.

cardano-cli/src/Cardano/CLI/Shelley/Run/Key.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

Looking good. A few further tweaks we could make.

cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs Outdated Show resolved Hide resolved
Comment on lines 291 to 295
<$> pITNKeyFIle
<*> pMaybeOutputFile

pITNKeyFile :: Parser ITNKeyFile
pITNKeyFile = pITNSigningKeyFile <|> pITNVerificationKeyFile
pITNKeyFIle :: Parser ITNKeyFile
pITNKeyFIle = pITNSigningKeyFile <|> pITNVerificationKeyFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Accidental name change ("I" vs "i").

cardano-cli/src/Cardano/CLI/Shelley/Run/Key.hs Outdated Show resolved Hide resolved
intricate and others added 6 commits July 17, 2020 14:27
Additionally, move key conversion commands such as "address convert" and
"stake-address convert-itn-key" under this new "key" command.
And consolodate the special-purpose parsers to be next to each other.
Extended ed25519 (bip32) key variants for stake keys, for genesis keys
and for genesis delegate keys.

The stake extended keys are useful for importing keys from HD wallets,
and for ITN extended keys.

The genesis and genesis delgate ones are useful for working with Byron
legacy keys, which all used extended signing keys (for no good reason).
The existing command supported Byron payment signing keys. Add
conversion support for Byron genesis and genesis delegate keys.
Also support both signing and verification keys. And also support the
legacy Byron format for the signing keys.

Adjust the existing special command for the base64 genesis verification
key to take the base64 as a flag rather than in a file.

Also adjust the ITN conversion to use the same types as the above.
@dcoutts dcoutts force-pushed the intricate/1467-convert-byron-keys branch from 07de813 to ee23c34 Compare July 17, 2020 22:28
@dcoutts dcoutts changed the title Add command for converting Byron genesis verification keys to their Shelley counterpart Add command for converting various Byron keys to their Shelley counterpart Jul 17, 2020
@dcoutts
Copy link
Contributor

dcoutts commented Jul 18, 2020

bors merge

@intricate
Copy link
Contributor Author

I can't approve since I originally opened this PR, but LGTM 💯

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 18, 2020

@iohk-bors iohk-bors bot merged commit 2c93acc into master Jul 18, 2020
@iohk-bors iohk-bors bot deleted the intricate/1467-convert-byron-keys branch July 18, 2020 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] - Convert byron delegation/genesis keys -> shelley delegation/genesis keys
2 participants