Add zpub zpriv
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoView.xaml
<controls:ExtendedTextBox Text="{Binding ExtendedMasterPrivateKey}" Classes="selectableTextBlock" />
</StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Extended Master zpriv: " />
+ <controls:ExtendedTextBox Text="{Binding ExtendedMasterZpriv}" Classes="selectableTextBlock" />
+ </StackPanel>
+
<StackPanel Orientation="Horizontal">
<TextBlock Text="Extended Master Public Key: " />
<controls:ExtendedTextBox Text="{Binding ExtendedMasterPublicKey}" Classes="selectableTextBlock" />
</StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Extended Master zpub: " />
+ <controls:ExtendedTextBox Text="{Binding ExtendedMasterZpub}" Classes="selectableTextBlock" />
+ </StackPanel>
+
<StackPanel Orientation="Horizontal">
<TextBlock Text="Account Key Path: " />
<controls:ExtendedTextBox Text="{Binding AccountKeyPath}" Classes="selectableTextBlock" />
<controls:ExtendedTextBox Text="{Binding ExtendedAccountPrivateKey}" Classes="selectableTextBlock" />
</StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Extended Account zpriv: " />
+ <controls:ExtendedTextBox Text="{Binding ExtendedAccountZpriv}" Classes="selectableTextBlock" />
+ </StackPanel>
+
<StackPanel Orientation="Horizontal">
<TextBlock Text="Extended Account Public Key: " />
<controls:ExtendedTextBox Text="{Binding ExtendedAccountPublicKey}" Classes="selectableTextBlock" />
</StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Extended Account zpub: " />
+ <controls:ExtendedTextBox Text="{Binding ExtendedAccountZpub}" Classes="selectableTextBlock" />
+ </StackPanel>
+
<StackPanel Margin="0 10 0 0" Spacing="10" Orientation="Horizontal">
<controls:NoparaPasswordBox Password="{Binding Password}" Watermark="Password" UseFloatingWatermark="True" MinWidth="173" MaxWidth="173" />
<DockPanel VerticalAlignment="Top" LastChildFill="True">

MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
using NBitcoin.Crypto;
+using NBitcoin.DataEncoders;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -180,5 +181,25 @@ namespace NBitcoin
public static SchnorrPubKey GetSchnorrPubKey(this Signer signer) => new SchnorrPubKey(signer);
public static uint256 BlindMessage(this Requester requester, uint256 messageHash, SchnorrPubKey schnorrPubKey) => requester.BlindMessage(messageHash, schnorrPubKey.RpubKey, schnorrPubKey.SignerPubKey);
+
+ public static string ToZpub(this ExtPubKey extPubKey, Network network)
+ {
+ var data = extPubKey.ToBytes();
+ var version = (network == Network.Main)
+ ? new byte[] { (0x04), (0xB2), (0x47), (0x46) }
+ : new byte[] { (0x04), (0x5F), (0x1C), (0xF6) };
+
+ return Encoders.Base58Check.EncodeData(version.Concat(data).ToArray());
+ }
+
+ public static string ToZPriv(this ExtKey extKey, Network network)
+ {
+ var data = extKey.ToBytes();
+ var version = (network == Network.Main)
+ ? new byte[] { (0x04), (0xB2), (0x43), (0x0C) }
+ : new byte[] { (0x04), (0x5F), (0x18), (0xBC) };
+
+ return Encoders.Base58Check.EncodeData(version.Concat(data).ToArray());
+ }
}
}

Add zpub zpriv