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

Cannot load keystore file which forc-wallet new generated #1289

Closed
mtroym opened this issue Mar 3, 2024 · 2 comments
Closed

Cannot load keystore file which forc-wallet new generated #1289

mtroym opened this issue Mar 3, 2024 · 2 comments
Assignees

Comments

@mtroym
Copy link

mtroym commented Mar 3, 2024

I used forc-wallet to generate new wallet under my project dir "project_root/.wallets/wallet_fuel.json" and encrypt with empty passphrase.

my wallet gen script:

mkdir -p .wallets

wallet_name=fuel
if [[ -n $1 ]]; then
  wallet_name=$1
fi

forc wallet --path=./.wallets/wallet_"$wallet_name".json new --force

and triple "Enter"s to get an encryped keystore json file under "project_root/.wallets/wallet_fuel.json"

Then I use Rust SDK to restore my wallet:

fn restore_wallets(password: &str, some_provider: Option<Provider>) -> Result<WalletUnlocked> {
    let dir = std::env::current_dir()?;
    let provider: Provider = some_provider.unwrap();
    let path = dir.join(".wallets/wallet_fuel_test.json");
    info!("The wallet info stored at {}", path.display());
    let _recovered_wallet = WalletUnlocked::load_keystore(
        path, password, Some(provider.clone()))?;
    Ok(_recovered_wallet)
}

The function panicked, and results in

Decrypted key should have a correct size: InvalidSecretKey

@mtroym mtroym changed the title Cannot load keystore file from forc-wallet new generated with empty password. Cannot load keystore file which forc-wallet new generated Mar 3, 2024
@MujkicA MujkicA self-assigned this Mar 7, 2024
@MujkicA
Copy link
Contributor

MujkicA commented Mar 7, 2024

Thanks for bringing this to our attention!

The issue seems to be theforc-wallet generating keys of variable length instead of 32 bytes.

I'll close this on the SDK side and you can refer to FuelLabs/forc-wallet#165 for further tracking of this issue.

@MujkicA MujkicA closed this as completed Mar 7, 2024
@mtroym
Copy link
Author

mtroym commented Mar 15, 2024

@MujkicA Thanks, I wanna contribute as well, any option could I reach out team?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants