Compute private descriptors
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
@@ -49,10 +49,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced
MasterKeyFingerprint = wallet.KeyManager.MasterFingerprint.ToString();
var descriptors = wallet.KeyManager.GetOutputDescriptors(wallet.Kitchen.SaltSoup(), network);
- PublicExternalOutputDescriptor = descriptors[0].ToString();
- PublicInternalOutputDescriptor = descriptors[1].ToString();
- PrivateExternalOutputDescriptor = descriptors[2].ToString();
- PrivateInternalOutputDescriptor = descriptors[3].ToString();
+ PublicExternalOutputDescriptor = descriptors[0];
+ PublicInternalOutputDescriptor = descriptors[1];
+ PrivateExternalOutputDescriptor = descriptors[2];
+ PrivateInternalOutputDescriptor = descriptors[3];
}
public string ExtendedAccountPublicKey { get; }

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -84,17 +84,25 @@ namespace WalletWasabi.Blockchain.Keys
ToFile();
}
- public OutputDescriptor[] GetOutputDescriptors(string password, Network network)
+ public string[] GetOutputDescriptors(string password, Network network)
{
- var commonPart = $"[{MasterFingerprint}/{AccountKeyPath}]";
- var publicDescriptor = $"{commonPart}{ExtPubKey.ToString(network)}";
- var privateDescriptor = $"{commonPart}{GetMasterExtKey(password).ToString(network)}";
+ var accountKey = GetMasterExtKey(password).Derive(AccountKeyPath);
+ var privateDescriptor = $"[{MasterFingerprint}/{AccountKeyPath}]{accountKey.ToString(network)}";
+
+ var internalRepo = new FlatSigningRepository();
+ var externalRepo = new FlatSigningRepository();
+ var internalDescriptor = OutputDescriptor.Parse($"wpkh({privateDescriptor}/1/*)", network, false, internalRepo);
+ var externalDescriptor = OutputDescriptor.Parse($"wpkh({privateDescriptor}/0/*)", network, false, externalRepo);
+
+ externalDescriptor.TryGetPrivateString(externalRepo, out var externalPrivate);
+ internalDescriptor.TryGetPrivateString(internalRepo, out var internalPrivate);
+
return new[]
{
- OutputDescriptor.Parse($"wpkh({publicDescriptor}/0/*)", network),
- OutputDescriptor.Parse($"wpkh({publicDescriptor}/1/*)", network),
- OutputDescriptor.Parse($"wpkh({privateDescriptor}/0/*)", network),
- OutputDescriptor.Parse($"wpkh({privateDescriptor}/1/*)", network),
+ externalDescriptor.ToString(),
+ internalDescriptor.ToString(),
+ externalPrivate ?? "",
+ internalPrivate ?? "",
};
}

Compute private descriptors