-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Context
When using the library it was reported by several users in private communication that is not so seamless to convert between bech32 and hex as it could be. They stressed that it would be nice to have (a) uniform support through key command and also (b) separately be able to convert both ways.
Decision
Let's create command that accepts any key through STDIN
cardano-address key convert --hex
cardano-address key convert --bech32 prefix
Here also, for public keys --with-chain-code and without-chain-code.
For private keys -signing-key and chain-code.
Additionally we can adopt the approach done aleeady for private keys:
$ cardano-address key private --signing-key < drep.xsk
drep_sk1vpdsm49smzmdwhd4kjmm2mdyljjysm746rafjr7r8kgfanj849psw8pfm305g59wng0akw3qzppmfh6k5z7gx66h2vppu022m4eqajg5xmwma
$ cardano-address key private --signing-key --hex < drep.xsk
605b0dd4b0d8b6d75db5b4b7b56da4fca4486fd5d0fa990fc33d909ece47a943071c29dc5f4450ae9a1fdb3a201043b4df56a0bc836b5753021e3d4add720ec9
$ cardano-address key private --chain-code < drep.xsk
5a1df4df66655a4a9e5157d9212173b8e993b493baa5cf2db5a3c7dc98d8df3c
ie. add everywhere in key command ability of --hex and support additionally --bech32 prefix.And do this for all key commands and make sure the support is uniform. If those options are missing then bech32 prefix as according to CIP will be provided.