near / near-cli

General purpose command line tools for interacting with NEAR Protocol
https://docs.near.org
MIT License
195 stars 94 forks source link

Add ability to generate secp256k1 keys. #855

Open mikedotexe opened 3 years ago

mikedotexe commented 3 years ago

Is your feature request related to a problem? Please describe. As a user, I want to add an secp256k1 key to my account, but cannot generate a key using the command line interface.

Describe the solution you'd like Add the ability, including whatever library is needed for the generation.

Additional context See how it's hardcoded here? This should be a flag, and ed25519 can be the default if there's no additional flag. https://github.com/near/near-cli/blob/b14d8d9802c4afb9f1303fa6e02c78e9fd89375e/commands/generate-key.js#L47

Note that we already have this in the Rust SDK: https://github.com/near/near-sdk-rs/blob/2e979934cca7c87a5ca5d7dcb62e4b3cbe809afc/near-sdk/src/types/public_key.rs#L10

and

https://github.com/near/near-sdk-rs/blob/1a706b2eb0dd3e96e2ba4f6e74b0ef972c4bbbdf/sys/src/lib.rs#L38

and

https://github.com/near/nearcore/blob/a20c12ec02d7f22550139da38838efd1fba75ede/runtime/near-vm-logic/src/logic.rs#L976

mikedotexe commented 7 months ago

As we get into the chain signatures narrative, I believe this ticket is becoming more important.