MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.86k stars 844 forks source link

How to obtain xpub string representation from ExtPubKey #1098

Open driquelme opened 2 years ago

driquelme commented 2 years ago

Newbie here trying to extract a xpub key from a mnemonic. I already have an instance of an ExtPubKey, but I haven't been able to get a string representation of it, how can I do it?

driquelme commented 2 years ago

Never mind, I figured I could do this:

BitcoinExtPubKey seedMainNetPublickKey = derivedETHPublicKey.GetWif(Network.Main);
Console.WriteLine(seedMainNetPublickKey.ToString());