I am trying to add keys to a named account on my concordium client using the below command.
concordium-client config account add-keys --account BRAVE_TEST --keys ./brave-account-keys.json
but I keep getting this error
Error: Cannot decode keys: Error in $.environment: parsing Word8 failed, Failed reading: takeWhile1.
The command add-keys
is only a local command. How are you generating the brave-account-keys.json file?
The format should be something like
{
"3": {
"0": {
"schemeId": "Ed25519",
"verifyKey": "hex-encoding of the public key",
"encryptedSignKey": {
"cipherText": "base 64 encoding of the secret key",
"metadata": {
"encryptionMethod": "AES-256",
"initializationVector": "G1hgeB0U+VlFpYXXGDWc0A==",
"iterations": 100000,
"keyDerivationMethod": "PBKDF2WithHmacSHA256",
"salt": "YDGBiXcR+Z6tC6OvdpulMw=="
}
},
}
}
}
where the encryptedSignKey
is the encryption of the private key of the account, using AES.
I exported the keys from the wallet.
% concordium-client config account name 4LSGZxtaHZi7BKeoJMNgttES2bN2nkSRouyDC5sfDFdUTcCAkC --name TEST1
Account reference 4LSGZxtaHZi7BKeoJMNgttES2bN2nkSRouyDC5sfDFdUTcCAkC was successfully named 'TEST1'.
concordium-client config account add-keys --account 4LSGZxtaHZi7BKeoJMNgttES2bN2nkSRouyDC5sfDFdUTcCAkC --keys brave-account-keys.json
Cannot decode keys: Error in $.environment: parsing Word8 failed, Failed reading: takeWhile1.
Are you just trying to import the exported keys into concordium-client?
The command for that is
concordium-client config account import --name 'NAME FOR YOUR ACCOUNT' /path/to/.export/eilf