H
H
hobzy2022-04-09 18:04:17
C++ / C#
hobzy, 2022-04-09 18:04:17

How to generate a public key and a wallet in c# using a private hex key?

How to obtain the public key (C) and a purse (C) of the private key hex:
1. Private Key Hex
2. Public Key
3. Wallet
0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => 0336074b50b9c9d54e613b096847420b486e4c8ff6c7b4e67b12f562da25615569 => 1HBQ45Ztv83msdZBEoTEmyTLQnTHbXKwPz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Teploukhov, 2022-04-10
@hobzy

Through the NBitcoin library and HDWallet.Terra for terra like this

var privKeyStr = Encoders.Hex.DecodeData(privateKey);
                Key key = new Key(privKeyStr);

                IAddressGenerator addressGenerator = new AddressGenerator();
                var actualAddress = addressGenerator.GenerateAddress(key.PubKey.ToBytes());

There, by analogy, I think you will understand

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question