diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 2c008598b8f78..8f73916c11410 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -706,8 +706,13 @@ RPCHelpMan getblsctseed() const blsct::KeyMan& blsct_km = EnsureConstBlsctKeyMan(wallet); auto seed = blsct_km.GetMasterSeedKey(); + auto strSeed = seed.GetScalar().GetString(); - return seed.GetScalar().GetString(); + if (strSeed.length() < 64) { + strSeed.insert(0, 64 - strSeed.length(), '0'); + } + + return strSeed; }, }; } @@ -730,8 +735,18 @@ RPCHelpMan getblsctauditkey() const CWallet& wallet = *pwallet; const blsct::KeyMan& blsct_km = EnsureConstBlsctKeyMan(wallet); - return strprintf("%s%s", blsct_km.GetPrivateViewKey().GetScalar().GetString(), HexStr(blsct_km.GetPublicSpendingKey().GetVch())); - ; + auto strViewKey = blsct_km.GetPrivateViewKey().GetScalar().GetString(); + auto strSpendingKey = HexStr(blsct_km.GetPublicSpendingKey().GetVch()); + + if (strViewKey.length() < 64) { + strViewKey.insert(0, 64 - strViewKey.length(), '0'); + } + + if (strSpendingKey.length() < 96) { + strSpendingKey.insert(0, 96 - strSpendingKey.length(), '0'); + } + + return strprintf("%s%s", strViewKey, strSpendingKey); }, }; } diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 43f8c0577e55b..b03133cb5da0a 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -420,7 +420,6 @@ static RPCHelpMan createwallet() seed = ParseHex(request.params[9].get_str()); if (seed.size() == 80) { - seed = ParseHex(request.params[10].get_str()); type = blsct::IMPORT_VIEW_KEY; flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS; } else if (seed.size() != 32) {