Skip to content

[GOAL2-513] [GOAL2-775] GOAL account export. Clarify info messages for seed import/export.#36

Merged
derbear merged 6 commits intoalgorand:masterfrom
EvanJRichard:evan/account_export
Jun 18, 2019
Merged

[GOAL2-513] [GOAL2-775] GOAL account export. Clarify info messages for seed import/export.#36
derbear merged 6 commits intoalgorand:masterfrom
EvanJRichard:evan/account_export

Conversation

@EvanJRichard
Copy link
Copy Markdown
Contributor

Summary

Previously one could only import an account's seed mnemonic (for example, from algokey), and not export it. This PR proposes to add a new command goal account export, which recovers a stored account's mnemonic. This allows, for example, for a user to export a mnemonic for import into mobile wallets.

Additionally, the help language around key import and export is hopefully clarified somewhat.

Testing

Tested this by creating an account with algokey, importing it, destroying it, and then recovering it on TestNet.

Evan Richard added 5 commits June 14, 2019 14:49
…ly this functionality was not mirrored in account seed mnemonics: one could only import an account's mnemonic (for example, from algokey), and not export it. This PR proposes to add a new command `goal account export`, which recovers a stored account's mnemonic.

Additionally, the distinctions between wallet mnemonics and account mnemonics are clarified somewhat.

Testing: Tested this by destroying and then recovering an account on TestNet.
Comment thread cmd/goal/account.go Outdated

// export flags
exportCmd.Flags().StringVarP(&accountAddress, "address", "a", "", "Address of account to export")
exportCmd.MarkFlagRequired("addr")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MarkFlagRequired("address")

Comment thread cmd/goal/account.go Outdated
var importCmd = &cobra.Command{
Use: "import",
Short: "Import an account key from mnemonic",
Long: "Import an account key from a mnemonic generated by the export command or by algokey (NOT a mnemonic from the goal wallet command). The imported account will be listed alongside your wallet-generated accounts, but will not be tied to your wallet mnemonic.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"will not be tied to your wallet mnemonic" sounds odd/misleading. Maybe just "will not be tied to your wallet" is better IMO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you disagree that's fine, I don't have the strongest opinion; though we should probably revisit the language around mnemonics at some point (UX)

Comment thread cmd/goal/account.go Outdated
reportErrorf(errorRequestFail, err)
}
// response.PrivateKey is (seed||PK), want just the seed
seed := response.PrivateKey[:len(response.PrivateKey)/2]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use crypto.SecretKeyToSeed function

Comment thread cmd/goal/messages.go Outdated
infoNoAccounts = "Did not find any account. Please import or create a new one."
infoRenamedAccount = "Renamed account '%s' to '%s'"
infoImportedKey = "Imported %s"
infoExportedKey = "Imported key for account %s: \"%s\""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Exported key for account"?

@derbear derbear merged commit 909b436 into algorand:master Jun 18, 2019
Karmastic pushed a commit that referenced this pull request Jun 20, 2019
It is possible to go to/from a wallet recovery mnemonic, but previously this functionality was not mirrored in account seed mnemonics: one could only import an account's mnemonic (for example, from algokey), and not export it. This PR proposes to add a new command `goal account export`, which recovers a stored account's mnemonic.

Additionally, the distinctions between wallet mnemonics and account mnemonics are clarified somewhat.

Testing: Tested this by destroying and then recovering an account on TestNet.
pzbitskiy pushed a commit to pzbitskiy/go-algorand that referenced this pull request Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants