private static void CreateNewWallet() { PrintTitle(); var wallet = BitcoinWallet.CreateNew(); ShowDetails(wallet); Console.ReadLine(); }
private static void ImportExistingWallet() { PrintTitle(); Console.WriteLine(); Console.Write("Enter WIF: "); var wif = Console.ReadLine(); try { var wallet = BitcoinWallet.Import(wif); ShowDetails(wallet); } catch { Console.WriteLine("Failed to read wallet"); } Console.ReadLine(); }
private static void ShowDetails(BitcoinWallet wallet) { var privateKeyBytes = wallet.GetPrivateKey(); var privateKeyWif = wallet.GetWif(); var publicKeyBytes = wallet.GetFullPublicKey(); var publicKeyCompressed = wallet.GetCompressedPublicKey(); var walletAddress = wallet.GetAddress(); Console.WriteLine(); Console.WriteLine("Wallet details"); Console.WriteLine(); Console.WriteLine("Private key hex: {0}", ToHexadecimal(privateKeyBytes)); Console.WriteLine("Private key wif: {0}", privateKeyWif); Console.WriteLine(" : {0}", SeparateGroups(privateKeyWif, 3)); Console.WriteLine(); Console.WriteLine("Public key hex : {0}", ToHexadecimal(publicKeyBytes)); Console.WriteLine("Compressed : {0}", ToHexadecimal(publicKeyCompressed)); Console.WriteLine(); Console.WriteLine("Wallet address : {0}", walletAddress); Console.WriteLine(" : {0}", SeparateGroups(walletAddress, 4)); Console.WriteLine(); }