aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Feature Request] Add hexseed-derived account address generator to `aptos` CLI

Open alnoki opened this issue 3 years ago • 4 comments

Per recent discussion with @gregnazario , the aptos CLI does not offer the ability to generate an account address from a hexseed. Since account addresses are required for workflows such as on-chain publication, it is suggested that the CLI incorporate an account address generator. This could take several forms:

  1. Generate an additional file, with the account address corresponding to the generated hexseed, when running aptos key generate
  2. Add a command that returns (prints to terminal, outputs to file, etc.) the account address corresponding to a private key file or string input
  3. Add a command that, when building, if Move.toml has an address set to a generic _, only requires a private key file/string input, then derives an account address and substitutes it appropriately into the --account field (this could be complimented by a publication command that similarly only required a private key as an input, thus relieving the user of the burden of tracking two values instead of just one)

alnoki avatar Aug 26 '22 23:08 alnoki

Something similar to you want I believe is being worked on here https://github.com/aptos-labs/aptos-core/pull/3438

gregnazario avatar Sep 03 '22 03:09 gregnazario

There is now a command that will print the account address corresponding to a public key see aptos account lookup-address.

What kind of derivation were you looking for in the generated hex seed?

The CLI does support replacing the _ with --named-addresses using profiles. So if you add the key via aptos init you should be able to just say --named-addresses NamedAddress=profile-name and it will fill it in for you

gregnazario avatar Sep 14 '22 06:09 gregnazario

Got it, I'll be on the lookout for the official release so I can try out the new command.

If I am understanding your question about derivation correctly, I have been creating hex seeds via aptos key generate, so whatever the standard options are there.

I have been using the _, but as for the aptos init I've been shying away from that just to not get in the habit of storing a key in plain text in a config file.

alnoki avatar Sep 14 '22 16:09 alnoki

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Nov 07 '22 06:11 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Dec 24 '22 01:12 github-actions[bot]