<p>I've been looking around I can't understand or find a complete explanation of how to accomplish this, I've tried multiple way even this link <a href="https://bitcoin.stackexchange.com/questions/25024/how-do-you-get-a-bitcoin-public-key-from-a-private-key">How do you get a Bitcoin Public Key from a Private Key</a> which is a similar question but still does not return the same uncompressed public key I create with NBITCOIN, can anyone help, thanks in advance</p>

CC BY-SA 3.0
2016-01-12T13:24:26.030Z
Post your code and results.  Currently this question is to open-ended to be answerable.  As an aside, if all you want to do is generate Pubkey/Privkey pairs, you could role your own address generator.  See "How to Create Bitcoin Address" here: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
RLH
CC BY-SA 3.0
2016-01-12T13:27:38.837Z
Oh, one more thing. If you make your own C# address generator, you can verify each step of the creation process by using the example provided in the link I mentioned.  If your implementation (or NBitcoin's implementation in your app) is broken, you can inspect which step the app is failing on, and ask more specific questions from there.
RLH
CC BY-SA 3.0
2016-01-12T13:36:00.060Z
Note that creating private/public keys yourself is riddled with dangers and is not advisable. Random number generator problems are common. Edge cases where public keys do not match the private key. And many other situations that can cause loss of money. It's a good exercise to try to do, but think twice before putting anything in production. You're probably better off using an existing library, for example like libpsecp256k1 that Bitcoin Core uses.
Jannes
CC BY-SA 3.0
2016-01-13T19:16:38.647Z
Thank you all for your responses, my problem is really creating the Public Key from the Private key which I'm able to create by converting the random value to Hex inserting "80" in front of it and  doing Sha256 twice to get the checksum and add it to the end of the private key and version then I get the WIF by the Base58Encode. But  can't find any good explanation on how to calculate the public Key, any ideas will be greatly appreciated, Thanks in advance
user31889
<public-key><c#>
Creating publicKey from random programtically in c#
user31889
# Creating publicKey from random programtically in c#

(Asked by: username_0 on 2016-01-12)

I've been looking around I can't understand or find a complete explanation of how to accomplish this, I've tried multiple way even this link [How do you get a Bitcoin Public Key from a Private Key](https://bitcoin.stackexchange.com/questions/25024/how-do-you-get-a-bitcoin-public-key-from-a-private-key) which is a similar question but still does not return the same uncompressed public key I create with NBITCOIN, can anyone help, thanks in advance

**Tags:** public-key, c#

> **Comments:**
> **username_1**: Post your code and results.  Currently this question is to open-ended to be answerable.  As an aside, if all you want to do is generate Pubkey/Privkey pairs, you could role your own address generator.  See "How to Create Bitcoin Address" here: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses  
> **username_1**: Oh, one more thing. If you make your own C# address generator, you can verify each step of the creation process by using the example provided in the link I mentioned.  If your implementation (or NBitcoin's implementation in your app) is broken, you can inspect which step the app is failing on, and ask more specific questions from there.  
> **username_2**: Note that creating private/public keys yourself is riddled with dangers and is not advisable. Random number generator problems are common. Edge cases where public keys do not match the private key. And many other situations that can cause loss of money. It's a good exercise to try to do, but think twice before putting anything in production. You're probably better off using an existing library, for example like libpsecp256k1 that Bitcoin Core uses.  
> **username_0**: Thank you all for your responses, my problem is really creating the Public Key from the Private key which I'm able to create by converting the random value to Hex inserting "80" in front of it and  doing Sha256 twice to get the checksum and add it to the end of the private key and version then I get the WIF by the Base58Encode. But  can't find any good explanation on how to calculate the public Key, any ideas will be greatly appreciated, Thanks in advance  

---

## 0 answers

