Skip to content

Instantly share code, notes, and snippets.

@donma
Created February 7, 2019 13:55
Show Gist options
  • Save donma/132dd314e5599563ae2577751f131407 to your computer and use it in GitHub Desktop.
Save donma/132dd314e5599563ae2577751f131407 to your computer and use it in GitHub Desktop.
Create Bitcoin Wallet By NBitcoin
var Key1 = new NBitcoin.Key();
var bitcoinPrivateKey = Key1.GetWif(NBitcoin.Network.TestNet);
NBitcoin.BitcoinEncryptedSecret encryptedBitcoinPrivateKey = bitcoinPrivateKey.Encrypt("your_pass_word");
Console.WriteLine("Your Address : " + bitcoinPrivateKey.GetAddress());
Console.WriteLine("Encrypted PrivateKey : " + bitcoinPrivateKey.ScriptPubKey.ToString());
//Result :
//Wallet A
//Your Address : mvJh993ZpnVFgX4Bs9jacjFLsKPhXj3nkj
//Encrypted PrivateKey: 6PYQBZhumqnrhETBXNvqW61XHpwYVefbTmZtM2BZcekPjunUbPgUPGe8H2
//Wallet B
//Your Address : mshr22VWpq7XTTA3EhAoqoizPuqRAvZfvi
//Encrypted PrivateKey: 6PYTsdNrmWyNTBJVMd7LqXnAM7ApFkTtG1GMA5RdqczYW8kuAaTwbvJENw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment