Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Allow import/export of public keys only #79

Closed
alessio opened this issue Apr 1, 2018 · 6 comments
Closed

Allow import/export of public keys only #79

alessio opened this issue Apr 1, 2018 · 6 comments
Labels

Comments

@alessio
Copy link
Contributor

alessio commented Apr 1, 2018

Hi,

I'd like go-crypto to allow import/export public keys only, more or less a-la-GPG.
This is because of https://github.com/tendermint/clearchain's requirements:

  • Only ClearingHouse admin accounts can create foreign entities admin accounts.
  • It'd be quite unsafe if a ClearingHouse admin generated a private-public key pair and handed it to the foreign entity admin. I'd expect the admins wanting to generate a key pair themselves, to then hand only the public key to a ClearingHouse admin.
  • Afterwards, the ClearingHouse admin sends a CreateAdminTx to create a new admin account with the given public key for the foreign entity,

@jaekwon @ebuchman @adrianbrink Please give me a shout if need more clarifications, I'm happy to help out with this.

Thanks for considering

@jaekwon
Copy link
Contributor

jaekwon commented Apr 2, 2018

I'm in favor of a unified keystore system that can also track public keys that works on all Cosmos zones.

@alessio
Copy link
Contributor Author

alessio commented Apr 2, 2018

Yes @jaekwon, I am happy to help out. In my view, the keys command should feature the following subcommands:

  • generate, delete and update - like current create, delete and update, without the name parameter as it's quite useless.
  • delete command should support a --public-key-only option.
  • import - import full key pairs and public keys only; it should support both binary and ASCI-armored formats.
  • export - export full key pairs and public keys only; it should support both binary and ASCI-armored formats.
  • list - pretty much like the current list command, with a cli output format [1] that should be something like the following:
Address Type Algo
BB6ED743F539D32F82521AADFC800AF7C6D6CC1F private Ed25519
CDF7C8C084233059B2F54BC801052698F661F09B public Secp256k1
244D8856929BD4AB0F36E02EAE2CED2E0D386780 public Ed25519

Keys that are listed as public indicates that the store holds the public key only.

[1] An output format, it'd be nice to support machine parseable output (e.g. json, yaml) for all commands.

@ebuchman
Copy link
Contributor

ebuchman commented Apr 5, 2018

I don't quite understand - what's the use case for having just the public key in the keybase ?

@alessio
Copy link
Contributor Author

alessio commented Apr 5, 2018 via email

@ebuchman
Copy link
Contributor

ebuchman commented Apr 5, 2018

What about that requires that the public key be added alone to the keybase though ? Sounds like all you need is a way to how the public key for a given key ... we have that already with the --output json flag, though looks like that output needs some cleaning up!

Once you have that pubkey, it just needs to be included in a transaction, but doesn't really seem important important to stick it in the keybase.

I know that GPG keeps pubkeys so you can check signatures based on them but I'm not sure that's what we want the keybase to be used for, since we already have a blockchain for that kind of thing ...

@alessio
Copy link
Contributor Author

alessio commented Apr 5, 2018 via email

ebuchman added a commit that referenced this issue May 30, 2018
Add import/export of public keys #79
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants