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

[Bug]: Can't pass in empty passphrase when creating new keyring instance #21388

Closed
1 task done
xyz1hang opened this issue Aug 23, 2024 · 3 comments
Closed
1 task done
Assignees

Comments

@xyz1hang
Copy link
Contributor

xyz1hang commented Aug 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Unable to create a keyring instance that allows empty passphrase userinput.

Trying to create a keyring instance with BackendFile but it seems that there's no way to pass in empty passphrase

	emptyPassphraseReader := strings.NewReader("")

	kr, err := keyring.New(sdktypes.KeyringServiceName(), keyring.BackendFile, wallet.KeyringDir, emptyPassphraseReader, cdc)
	if err != nil {
		...
	}

The SDK always try to read it 3 times and ended up with io.EOF (which is also an "error") then exit with ErrMaxPassPhraseAttempts

image

image

Cosmos SDK Version

0.50.9

How to reproduce?

see description

@xyz1hang xyz1hang added the T:Bug label Aug 23, 2024
@xyz1hang xyz1hang changed the title [Bug]: [Bug]: Pass in empty passphrase when creating new keyring instance Aug 23, 2024
@xyz1hang xyz1hang changed the title [Bug]: Pass in empty passphrase when creating new keyring instance [Bug]: Can't pass in empty passphrase when creating new keyring instance Aug 23, 2024
@julienrbrt
Copy link
Member

Hey! Where are you reading that an empty passphrase is supported?
If you want to use a backend file you always need a passphrase. Otherwise, you should use the test backend.

@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
@julienrbrt julienrbrt self-assigned this Aug 23, 2024
@xyz1hang
Copy link
Contributor Author

xyz1hang commented Aug 23, 2024

Hey! Where are you reading that an empty passphrase is supported?
If you want to use a backend file you always need a passphrase. Otherwise, you should use the test backend.

@julienrbrt
Hey, I have a wallet on this Cosmo based chain https://axiomechain.org/

When I created the wallet it didn't ask for a passphrase but only a 5 digits pin.

I am trying to restore the wallet using seed phrase and Cosmo SDK, but the sdk requires password to be at least 8 characters

Could you point me to the right direction please 🥺

@julienrbrt
Copy link
Member

You could use the keys add --recover command from the node binary.
Otherwise in Go you just need to change the backend file to backend test. The keyring password is btw unrelated to the extra Word in mnemonics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

No branches or pull requests

2 participants