Skip to content

goal: non-interactive wallet creation with "wallet new --unencrypted --no-display-seed" #6160

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

Merged

Conversation

tasosbit
Copy link
Contributor

Adds this option to goal wallet new:

-n, --non-interactive
Create the new wallet without prompting for password or displaying the seed phrase

Skipping the password prompt is useful in scripted KMD creation.

The password prompt method for goal wallet new, which hides the input from the console, doesn't work with piping (unlike goal account import, which accepts echo apple apple apple ... | goal account import)

@tasosbit tasosbit mentioned this pull request Oct 31, 2024
@jannotti
Copy link
Contributor

jannotti commented Oct 31, 2024

I don't quite understand what this is doing, so I assume users will be in the same boat. Does it create a account that can be used without a password? Or with the empty password? Is there a distinction between those two things? Or perhaps it creates an account that kmd can't use, and the seed phrase must be used to recover it?

(a few minutes pass)

Having read some kmd source code, I think it makes an unencrypted wallet. I think the argument and the help text should be directed at telling the user that, rather than simply saying "skip password". Something like --unencrypted (and I would simply not have a short option, to make this less tempting for users who don't really want it.)

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.

Project coverage is 56.26%. Comparing base (eff5fb4) to head (f2c89e7).
Report is 81 commits behind head on master.

Files with missing lines Patch % Lines
cmd/goal/wallet.go 14.28% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6160      +/-   ##
==========================================
- Coverage   56.29%   56.26%   -0.03%     
==========================================
  Files         494      494              
  Lines       69958    69964       +6     
==========================================
- Hits        39381    39366      -15     
- Misses      27907    27921      +14     
- Partials     2670     2677       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tasosbit
Copy link
Contributor Author

tasosbit commented Nov 4, 2024

Having read some kmd source code, I think it makes an unencrypted wallet. I think the argument and the help text should be directed at telling the user that, rather than simply saying "skip password". Something like --unencrypted (and I would simply not have a short option, to make this less tempting for users who don't really want it.)

Correct, the idea is to create a wallet without prompting for password. I agree that unencrypted is a much better/clearer label than non-interactive. I will change this.

Will also split the unencrypted feature from the no-display-seed one

Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Agree with JJ - use --unencrypted for suppressing the password prompt only. This should not affect the mnemonic output since a master key used for account key generation and orthogonal to wallet passwords.

algorandskiy
algorandskiy previously approved these changes Feb 21, 2025
gmalouf
gmalouf previously approved these changes Feb 21, 2025
@algorandskiy algorandskiy dismissed stale reviews from gmalouf and themself via 57e6518 February 21, 2025 23:02
@algorandskiy algorandskiy changed the title goal: added "wallet new -n" non-interactive wallet creation goal: added "wallet new --unencrypted --no-display-seed" non-interactive wallet creation Feb 21, 2025
@algorandskiy
Copy link
Contributor

Removed shorthand options

@algorandskiy algorandskiy changed the title goal: added "wallet new --unencrypted --no-display-seed" non-interactive wallet creation goal: non-interactive wallet creation with "wallet new --unencrypted --no-display-seed" Feb 21, 2025
algorandskiy
algorandskiy previously approved these changes Feb 22, 2025
Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

I suggested some UI wording changes, but otherwise happy to approve.

Co-authored-by: John Jannotti <jannotti@gmail.com>
@algorandskiy
Copy link
Contributor

Applied suggestions

algorandskiy
algorandskiy previously approved these changes Feb 24, 2025
jannotti
jannotti previously approved these changes Feb 24, 2025
@algorandskiy algorandskiy dismissed stale reviews from jannotti and themself via f2c89e7 February 24, 2025 15:17
@algorandskiy
Copy link
Contributor

Fixed formatter

@algorandskiy algorandskiy merged commit ad57857 into algorand:master Feb 24, 2025
19 checks passed
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