diff --git a/src.ts/wallet/json-keystore.ts b/src.ts/wallet/json-keystore.ts index 0a53bbc922..53b7a887bb 100644 --- a/src.ts/wallet/json-keystore.ts +++ b/src.ts/wallet/json-keystore.ts @@ -91,7 +91,11 @@ function getAccount(data: any, _key: string): KeystoreAccount { assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); + const decryptedPrivateKey = decrypt(data, key.slice(0, 16), ciphertext); + + const privateKey = decryptedPrivateKey.startsWith("0x00") + ? decryptedPrivateKey.replace("0x00", "0x") + : decryptedPrivateKey; const address = computeAddress(privateKey); if (data.address) {