forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 05, 2022, 04:40 am

Title: Generate address of 'private key' from user input
Post by: Bitcoin on Feb 05, 2022, 04:40 am
Generate address of 'private key' from user input

I want to take a private key as input from the user and convert it to a wallet address using C#.


I have seen this in a tutorial to generate a random key:


Key privateKey = new Key();
PubKey publicKey = privateKey.PubKey;
Console.WriteLine(publicKey.GetAddress(ScriptPubKeyType.Legacy, Network.Main));

How do I convert a private key string from the user to a wallet address for main net?


Source: Generate address of 'private key' from user input (https://bitcoin.stackexchange.com/questions/100121/generate-address-of-private-key-from-user-input)