Add output descriptors
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
@@ -47,6 +47,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced
ExtendedAccountZpub = wallet.KeyManager.ExtPubKey.ToZpub(network);
AccountKeyPath = $"m/{wallet.KeyManager.AccountKeyPath}";
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();
}
public string ExtendedAccountPublicKey { get; }
@@ -65,6 +71,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced
public string? ExtendedAccountZprv { get; }
+ public string PublicInternalOutputDescriptor { get; }
+ public string PublicExternalOutputDescriptor { get; }
+ public string PrivateInternalOutputDescriptor { get; }
+ public string PrivateExternalOutputDescriptor { get; }
+
public bool IsHardwareWallet { get; }
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
PrivacyModeEnabled="{Binding !ShowSensitiveData}" />
<Separator IsVisible="{Binding !!ExtendedAccountZprv}" />
+ <c:PreviewItem Icon="{StaticResource key_regular}"
+ Text="Public External Output descriptor"
+ CopyParameter="{Binding PublicExternalOutputDescriptor}">
+ <c:PrivacyContentControl Content="{Binding PublicExternalOutputDescriptor}" NumberOfPrivacyChars="38" />
+ </c:PreviewItem>
+ <c:PreviewItem Icon="{StaticResource key_regular}"
+ Text="Public Internal Output descriptor"
+ CopyParameter="{Binding PublicInternalOutputDescriptor}">
+ <c:PrivacyContentControl Content="{Binding PublicInternalOutputDescriptor}" NumberOfPrivacyChars="38" />
+ </c:PreviewItem>
+
+ <c:PreviewItem Icon="{StaticResource key_regular}"
+ Text="Private External Output descriptor"
+ CopyParameter="{Binding PrivateExternalOutputDescriptor}">
+ <c:PrivacyContentControl Content="{Binding PrivateExternalOutputDescriptor}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
+ </c:PreviewItem>
+ <c:PreviewItem Icon="{StaticResource key_regular}"
+ Text="Private Internal Output descriptor"
+ CopyParameter="{Binding PrivateInternalOutputDescriptor}">
+ <c:PrivacyContentControl Content="{Binding PrivateInternalOutputDescriptor}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
+ </c:PreviewItem>
+
<c:PreviewItem Icon="{StaticResource key_regular}"
Text="Extended Account Public Key"
CopyParameter="{Binding ExtendedAccountPublicKey}">
<c:PrivacyContentControl Content="{Binding ExtendedAccountPublicKey}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
+
<Separator />
<c:PreviewItem Icon="{StaticResource key_regular}"

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
using NBitcoin;
+using NBitcoin.Scripting;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -83,6 +84,20 @@ namespace WalletWasabi.Blockchain.Keys
ToFile();
}
+ public OutputDescriptor[] GetOutputDescriptors(string password, Network network)
+ {
+ var commonPart = $"[{MasterFingerprint}/{AccountKeyPath}]";
+ var publicDescriptor = $"{commonPart}{ExtPubKey.ToString(network)}";
+ var privateDescriptor = $"{commonPart}{GetMasterExtKey(password).ToString(network)}";
+ 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),
+ };
+ }
+
[JsonProperty(Order = 1)]
[JsonConverter(typeof(BitcoinEncryptedSecretNoECJsonConverter))]
public BitcoinEncryptedSecretNoEC EncryptedSecret { get; }

Add output descriptors