<p>I don't know much about c++ or libbitcoin, but I found a public method in the bc::wallet::ec_public class</p>

<pre><code>bool to_uncompressed(ec_uncompressed&amp; out) const;
</code></pre>

<p>So I guess you can probably convert your <code>ec_public</code> to <code>ec_uncompressed</code>(which is just a <code>byte_array</code>) by</p>

<pre><code>ec_uncompressed uncomp;
&lt;public key&gt;.to_uncompressed(uncomp);
std::cout &lt;&lt; "Uncompressed: " &lt;&lt; uncomp &lt;&lt; std::endl;
</code></pre>

CC BY-SA 3.0
2018-02-25T00:40:58.193Z
2018-02-25T00:40:58.193Z
Rod Lin
<p>I need to derive public key from my private key in uncompressed form. I know how to create compressed one with <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/code/addr.cpp" rel="nofollow noreferrer">libbitcoin</a>, but I can't find appropriate method for uncompressed form there.</p>

<p>Are there any other libraries in C++ which can do that?</p>

CC BY-SA 3.0
2018-02-25T12:20:36.107Z
There is this: https://bitcointalk.org/index.php?topic=644919.msg7205689#msg7205689 (not really C++), and here a discussion of the underlying: https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated/69366?noredirect=1#comment80625_69366
pebwindkraft
<private-key><public-key><cryptography><c++><libbitcoin>
How can I create uncompressed public key in C++?
30mb1
# How can I create uncompressed public key in C++?

(Asked by: username_0 on 2018-02-24)

I need to derive public key from my private key in uncompressed form. I know how to create compressed one with [libbitcoin](https://github.com/bitcoinbook/bitcoinbook/blob/develop/code/addr.cpp), but I can't find appropriate method for uncompressed form there.

Are there any other libraries in C++ which can do that?

**Tags:** private-key, public-key, cryptography, c++, libbitcoin

> **Comments:**
> **username_1**: There is this: https://bitcointalk.org/index.php?topic=644919.msg7205689#msg7205689 (not really C++), and here a discussion of the underlying: https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated/69366?noredirect=1#comment80625_69366  

---

## 1 answers

### Answer by username_2 on 2018-02-25. Score: 1 | Accepted answer

I don't know much about c++ or libbitcoin, but I found a public method in the bc::wallet::ec\_public class

```
bool to_uncompressed(ec_uncompressed& out) const;

```

So I guess you can probably convert your `ec_public` to `ec_uncompressed`(which is just a `byte_array`) by

```
ec_uncompressed uncomp;
<public key>.to_uncompressed(uncomp);
std::cout << "Uncompressed: " << uncomp << std::endl;

```


---

