<p>It looks like doing such a conversion is not well supported, nor is instantiating a private key as uncompressed unless you do so with a WIF key.</p>

<p>However, you can change the compressed-ness by doing:</p>

<pre><code>key._public_key = key._pk.public_key.format(compressed=False)
</code></pre>

<p>But this requires you do to this immediately after instantiation as otherwise precomputed properties such as <code>.address</code> will not be recomputed.</p>

CC BY-SA 4.0
2020-01-13T19:35:11.990Z
Note that there generally is no reason you'd want to use uncompressed public keys.
Pieter Wuille
CC BY-SA 4.0
2020-01-13T17:37:21.770Z
2020-01-13T17:37:21.770Z
Ava Chow
<p>I am new in programming and BTC. I want to make some BTC address with private keys. Till now I learn that we have compressed and uncompressed private keys. But I get only compressed private keys and address. How I can get uncompressed private key and adress with bit module? This number is just for example. I don't use them for my address. Please do the same. It's not safe to use it for your address. I made this code till now</p>

<pre><code>from bit import Key
dec=115792089237316195423570985008687907852837564279074904382605163141518156494336
key = Key.from_int(dec)
print(key.address)
print(key.to_wif())
</code></pre>

<p>I get this results 1A7o1vWzF4fx1yqmA1NzFbhnP97P9uYQ2Q L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6FfU2GppfKbjNXRE2Ge</p>

<p>I use this module <a href="https://pypi.org/project/bit/" rel="nofollow noreferrer">https://pypi.org/project/bit/</a></p>

<p>If you know someone who can help please share with me. You can see code here <a href="https://pastebin.com/6gk1Ua2b" rel="nofollow noreferrer">https://pastebin.com/6gk1Ua2b</a></p>

CC BY-SA 4.0
2020-01-13T17:23:04.077Z
Why would you want to use uncompressed points?
Claris
CC BY-SA 4.0
2020-01-13T17:26:17.293Z
maybe this will help? https://github.com/ofek/bit/issues/52
JBaczuk
<private-key><python>
How to get uncompressed BTC address and private key from bit module for Python?
Pijes
# How to get uncompressed BTC address and private key from bit module for Python?

(Asked by: username_0 on 2020-01-13)

I am new in programming and BTC. I want to make some BTC address with private keys. Till now I learn that we have compressed and uncompressed private keys. But I get only compressed private keys and address. How I can get uncompressed private key and adress with bit module? This number is just for example. I don't use them for my address. Please do the same. It's not safe to use it for your address. I made this code till now
from bit import Key
dec=115792089237316195423570985008687907852837564279074904382605163141518156494336
key = Key.from_int(dec)
print(key.address)
print(key.to_wif())

I get this results 1A7o1vWzF4fx1yqmA1NzFbhnP97P9uYQ2Q L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6FfU2GppfKbjNXRE2Ge
I use this module https://pypi.org/project/bit/
If you know someone who can help please share with me. You can see code here https://pastebin.com/6gk1Ua2b

**Tags:** private-key, python

> **Comments:**
> **username_1**: Why would you want to use uncompressed points?  
> **username_2**: maybe this will help? https://github.com/ofek/bit/issues/52  

---

## 1 answers

### Answer by username_3 on 2020-01-13. Score: 1 | Accepted answer

It looks like doing such a conversion is not well supported, nor is instantiating a private key as uncompressed unless you do so with a WIF key.
However, you can change the compressed-ness by doing:
key._public_key = key._pk.public_key.format(compressed=False)

But this requires you do to this immediately after instantiation as otherwise precomputed properties such as .address will not be recomputed.

> **Comments:**
> **username_4**: Note that there generally is no reason you'd want to use uncompressed public keys.  

---

