Reverse byte order
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -111,7 +111,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
var json = JObject.Parse(jsonString);
var xpubString = json["ExtPubKey"].ToString();
var mfpString = json["MasterFingerprint"].ToString();
- HDFingerprint mfp = NBitcoinHelpers.BetterParseHDFingerprint(mfpString);
+ HDFingerprint mfp = NBitcoinHelpers.BetterParseHDFingerprint(mfpString, reverseByteOrder: true);
ExtPubKey extPubKey = NBitcoinHelpers.BetterParseExtPubKey(xpubString);
Logger.LogInfo<LoadWalletViewModel>("Creating new wallet file.");
var walletName = Global.GetNextHardwareWalletName();

MODIFY
WalletWasabi/Helpers/NBitcoinHelpers.cs
WalletWasabi/Helpers/NBitcoinHelpers.cs
@@ -75,7 +75,7 @@ namespace WalletWasabi.Helpers
return epk;
}
- public static HDFingerprint BetterParseHDFingerprint(string hdFingerPrintString)
+ public static HDFingerprint BetterParseHDFingerprint(string hdFingerPrintString, bool reverseByteOrder = false)
{
hdFingerPrintString = Guard.NotNullOrEmptyOrWhitespace(nameof(hdFingerPrintString), hdFingerPrintString, trim: true);
@@ -88,7 +88,15 @@ namespace WalletWasabi.Helpers
catch
{
// Try hex, Old wallet format was like this.
- hdfp = new HDFingerprint(ByteHelpers.FromHex(hdFingerPrintString));
+ var bytes = ByteHelpers.FromHex(hdFingerPrintString);
+ if (reverseByteOrder)
+ {
+ hdfp = new HDFingerprint(bytes.Reverse().ToArray());
+ }
+ else
+ {
+ hdfp = new HDFingerprint(bytes);
+ }
}
return hdfp;
}

Reverse byte order