<p>To a private key corresponds a <strong>unique</strong> public key.</p>

<p>In your case,
16reZXagkyToongduimD25SEerXwP3MQ4n
is an address (the hash + encoding of a public key).</p>

CC BY-SA 3.0
2016-08-20T11:19:27.840Z
but what about: `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH` ? is it incorrect?
arman
CC BY-SA 3.0
2016-08-20T12:14:31.780Z
As the public key corresponding to the private key you included in your post (btw don't do that !!!) is '030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a', I don't know what 16..sdH is I must say
hartmut
CC BY-SA 3.0
2016-08-20T11:15:22.907Z
2016-08-20T11:15:22.907Z
hartmut
<p>The base58 number <code>16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH</code> is a base58Check encoding of the (compressed) public key:</p>

<p><code>030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a</code></p>

<p>which corresponds to<code>KwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh</code>, and whose address is <code>16reZXagkyToongduimD25SEerXwP3MQ4n</code>. Note that your private key is actually a bit more than a private key. It is a 38 bytes number which is a base58Check encoding of a number which contains <code>34</code> bytes (rather than just 32 for a secret key). There is an additional version byte <code>0x80</code> at the beginning which indicates that the private key is to be used for the main bitcoin network (rather than a testing network). There is an additional <code>0x01</code> suffix byte at the end (just before the 4 checksum bytes) which indicate that the public key associated with this private key is to be generated in compressed form (33 bytes) rather than uncompressed form (65 bytes). So while it is true that your WIF representation of your secret key leads to a unique address (one corresponding to a compressed key on the main network), the actual 32 bytes secret, can potentially lead to 4 addresses (depending on compression status of the public key and type of network). </p>

CC BY-SA 3.0
2016-08-20T20:12:15.310Z
thank you sir! so I am clear now! we can convert base58 of public key i.e `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH` to  address `16reZXagkyToongduimD25SEerXwP3MQ4n` with `BitcoinAddress` class of `Bitcoin.KeyCore` namespace! actually it is for human reading convenience. I like to vote up but can't!
arman
CC BY-SA 3.0
2016-08-20T13:43:09.333Z
2016-08-20T13:43:09.333Z
Sven Williamson
<p>I am generating public key from my private key. I did in Java script and C#.
but generated public keys are different.
My Code in c# (KeyCore.NET):</p>

<pre><code>PrivateKey pv = new PrivateKey(Globals.ProdDumpKeyVersion, "KwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh");
PublicKey pb = pv.PublicKey;
Console.WriteLine(pb.ToString());
</code></pre>

<p>result for C# code is <code>16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH</code>
and the result for javascript code is <code>16reZXagkyToongduimD25SEerXwP3MQ4n</code></p>

<p>I used <a href="https://github.com/Thashiznets/KeyCore.NET" rel="nofollow">KeyCore.NET</a> and <a href="https://github.com/pointbiz/bitaddress.org" rel="nofollow">bitaddress</a></p>

<bitcoin-core><private-key><public-key><c#><javascript>
Is the generated Public Key from Private Key Unique in Bitcoin?
arman
# Is the generated Public Key from Private Key Unique in Bitcoin?

(Asked by: username_0 on 2016-08-20)

I am generating public key from my private key. I did in Java script and C#.
but generated public keys are different.
My Code in c# (KeyCore.NET):

```
PrivateKey pv = new PrivateKey(Globals.ProdDumpKeyVersion, "KwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh");
PublicKey pb = pv.PublicKey;
Console.WriteLine(pb.ToString());

```

result for C# code is `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH`
and the result for javascript code is `16reZXagkyToongduimD25SEerXwP3MQ4n`

I used [KeyCore.NET](https://github.com/Thashiznets/KeyCore.NET) and [bitaddress](https://github.com/pointbiz/bitaddress.org)

**Tags:** bitcoin-core, private-key, public-key, c#, javascript


---

## 2 answers

### Answer by username_1 on 2016-08-20. Score: 2 | Accepted answer

To a private key corresponds a **unique** public key.

In your case,
16reZXagkyToongduimD25SEerXwP3MQ4n
is an address (the hash + encoding of a public key).

> **Comments:**
> **username_0**: but what about: `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH` ? is it incorrect?  
> **username_1**: As the public key corresponding to the private key you included in your post (btw don't do that !!!) is '030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a', I don't know what 16..sdH is I must say  

---

### Answer by username_2 on 2016-08-20. Score: 3

The base58 number `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH` is a base58Check encoding of the (compressed) public key:

`030d4018f164d58e41e0c5fb99eb5ec26b4f21fc8ad0db726d51a7cce60c75df0a`

which corresponds to`KwY7eRvXXFd7HPX4Zuv8STZMLsVSe2X22HkU24Av84W1Cb7Rd5Yh`, and whose address is `16reZXagkyToongduimD25SEerXwP3MQ4n`. Note that your private key is actually a bit more than a private key. It is a 38 bytes number which is a base58Check encoding of a number which contains `34` bytes (rather than just 32 for a secret key). There is an additional version byte `0x80` at the beginning which indicates that the private key is to be used for the main bitcoin network (rather than a testing network). There is an additional `0x01` suffix byte at the end (just before the 4 checksum bytes) which indicate that the public key associated with this private key is to be generated in compressed form (33 bytes) rather than uncompressed form (65 bytes). So while it is true that your WIF representation of your secret key leads to a unique address (one corresponding to a compressed key on the main network), the actual 32 bytes secret, can potentially lead to 4 addresses (depending on compression status of the public key and type of network).

> **Comments:**
> **username_0**: thank you sir! so I am clear now! we can convert base58 of public key i.e `16w4zZWjWnhfEasJcSbfDQeHJRk1LytPHF5ir1ZS9mtUD5adsdH` to  address `16reZXagkyToongduimD25SEerXwP3MQ4n` with `BitcoinAddress` class of `Bitcoin.KeyCore` namespace! actually it is for human reading convenience. I like to vote up but can't!  

---

