• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Generate address of 'private key' from user input

Started by Bitcoin, Feb 05, 2022, 04:40 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

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