Skip to content

Better UX for specifying a pubkey when adding keys with the CLI #10388

@shanev

Description

@shanev

Summary

Adding a key via a pubkey requires the user to know internal details of how a key is specified.

Problem Definition

Currently, a pubkey is specified with:

gaiad keys add [name] --pubkey "{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"AtObiFVE4s+9+RX5...\"}"

A user shouldn't have to read code and tests in order to figure this out (like I had to do) and manually enter escaped JSON into the command line.

Proposal

  • Take in a bech32 pubkey by default, just as a string (like before)
  • 99% of chains use secp256k1, so specifying the algo every single time doesn't make sense. It's safe to assume secp256k1 is the default.
  • Use the --algo option for exceptions, and if it exists assume the pubkey is raw. Do the heavy lifting in code. Don't make the user do it.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Labels

C:KeysKeybase, KMS and HSMs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions