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

Generate multiple keypairs for mnemonic #1718

Open
nikkolasg opened this issue May 24, 2022 · 7 comments
Open

Generate multiple keypairs for mnemonic #1718

nikkolasg opened this issue May 24, 2022 · 7 comments
Labels
C-anvil Command: anvil C-cast Command: cast D-easy Difficulty: easy good first issue Good for newcomers T-feature Type: feature

Comments

@nikkolasg
Copy link

Component

Anvil

Describe the feature you would like

It would be nice to have the ability to ask Anvil to spit out the private keys into a JSON file or stg as to enable programmatic interaction with it (instead of manually copy paste the key(s)).

Additional context

No response

@nikkolasg nikkolasg added the T-feature Type: feature label May 24, 2022
@nikkolasg nikkolasg changed the title Anvil: spit out private keys in file if requested Anvil: write out private keys in file if requested May 24, 2022
@mattsse
Copy link
Member

mattsse commented May 25, 2022

I'm not in favor of support this via rpc calls or anything that needs to interact with a running node, but I agree that would be a nice feature to have.

we have the cast wallet command which generates single keypairs, I'd propose we add support for mnemonic key generation, I don't think we have something like this yet, right @onbjerg ?

something like cast wallet mnemonic "...." with an --anvil flag to dump the default keys?

@mattsse mattsse added C-cast Command: cast C-anvil Command: anvil labels May 25, 2022
@nikkolasg
Copy link
Author

nikkolasg commented May 25, 2022

I'm not in favor of support this via rpc calls or anything that needs to interact with a running node

Oh no I was thinking stg far more simpler like anvil --secrets-to keys.json when you start anvil or stg. That way, when you start anvil you can programmatically get the already-funded private keys easily (instead of doing the parsing yourself).

@mattsse
Copy link
Member

mattsse commented May 25, 2022

right,

anvil --secrets-to keys.json that makes sense, but will also need some additional arguments, like mnemonic, hdpath, index perhaps, (same that anvil supports)

I think this would be useful on its own and is not limited to anvil.

we could add this to cast wallet which is more fitting I believe, but could then reuse this for anvil as well.

@nikkolasg
Copy link
Author

anvil --secrets-to keys.json that makes sense, but will also need some additional arguments, like mnemonic, hdpath, index perhaps, (same that anvil supports)

I guess in the end, what this feature is about is get all the info anvil prints out in a easily parsable fashion instead of handwriting regexp, so maybe anvil --info-out info.json or stg to also add the mnemonics etc.
Also a good idea for cast wallet for sure yeah !

@mattsse mattsse changed the title Anvil: write out private keys in file if requested Generate multiple keypairs for mnemonic May 25, 2022
@mattsse mattsse added the D-easy Difficulty: easy label May 25, 2022
@onbjerg
Copy link
Member

onbjerg commented May 27, 2022

Currently cast wallet only operates on a single JSON keystore, but it is also a bit broken last time I tried it. The details are in another issue related to keystores: #926

@gakonst
Copy link
Member

gakonst commented Jun 6, 2022

@robertabbott check this out

gakonst pushed a commit that referenced this issue Jun 7, 2022
* Adds config_out option to anvil

* Write config data to file with config_out option provided

* format

* Remove extra info from config out

because the whole point is to make it easy to
interact with the config programatically

* Address comments - make code more idiomatic
@onbjerg onbjerg added the good first issue Good for newcomers label Jul 1, 2022
@PatrickAlphaC
Copy link

Additional context: #3818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil C-cast Command: cast D-easy Difficulty: easy good first issue Good for newcomers T-feature Type: feature
Projects
No open projects
Status: Todo
Development

No branches or pull requests

5 participants