From 9557385eed39185607396aa0412704d88ffdea52 Mon Sep 17 00:00:00 2001 From: rachid Date: Sun, 5 Nov 2023 23:08:31 +0100 Subject: [PATCH] chore: better password message --- cmd/blobstream/keys/evm/evm.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/blobstream/keys/evm/evm.go b/cmd/blobstream/keys/evm/evm.go index 5c84e09b..4df2cd93 100644 --- a/cmd/blobstream/keys/evm/evm.go +++ b/cmd/blobstream/keys/evm/evm.go @@ -92,6 +92,9 @@ func Add(serviceName string) *cobra.Command { } } + fmt.Printf("\nThe provided password is **not** BIP39 passphrase but the store encryption.\n" + + "The account can be retrieved using the mnemonic only, without using this password.\n\n") + // read entropy seed straight from tmcrypto.Rand and convert to mnemonic entropySeed, err := bip39.NewEntropy(mnemonicEntropySize) if err != nil { @@ -103,8 +106,9 @@ func Add(serviceName string) *cobra.Command { return err } - // get the private key - ethPrivKey, err := MnemonicToPrivateKey(mnemonic, passphrase) + // get the private key using an empty passphrase so that only the mnemonic + // is enough to recover the account + ethPrivKey, err := MnemonicToPrivateKey(mnemonic, "") if err != nil { return err } @@ -458,6 +462,9 @@ func ImportMnemonic(serviceName string) *cobra.Command { return errors.New("invalid mnemonic") } + fmt.Printf("\n\nThe provided password is **not** BIP39 passphrase but the store encryption.\n" + + "The account can be retrieved using the mnemonic only, without using this password.\n\n") + // get the passphrase to use for the seed passphrase := config.EVMPassphrase // if the passphrase is not specified as a flag, ask for it.