private static string PrivateKey2Wif(byte[] privateKey)
{
//#An excellent way for us to store our keys is in Wallet Import Format. Let us convert now.
//#https://en.bitcoin.it/wiki/Wallet_import_format
var privKeyAnd80 = ((byte)0x80).Concatenate(privateKey);
byte[] hash;
using (var sha256 = new SHA256Managed())
hash = sha256.ComputeHash(sha256.ComputeHash(privKeyAnd80));
var checksum = new byte[4];
Array.Copy(hash, checksum, 4);
return privKeyAnd80.Concatenate(checksum).ByteArrayToBase58();
}