<p>Your wallet is probably old enough that uncompressed public keys are used instead of compressed public keys. Segwit only works with compressed public keys so you cannot currently use segwit with your addresses.</p>

<p>However you can upgrade your wallet to using compressed keys. To do so, first start Bitcoin Core with the <code>-upgradewallet</code> option. That will upgrade your wallet to use compressed keys by default. Then you will need to call <code>getnewaddress</code> ~1000 times in order to get to addresses using compressed public keys keys. I don't believe that there is a way to regenerate the keypool without emptying it by requesting all of the addresses from the keypool.</p>

CC BY-SA 3.0
2017-10-21T01:29:12.747Z
Yes my wallet is from 2012.  So the "getnewaddress" command will give me about 1000 receive address.  Is there a way to delete some of my receive address?  Thanks for you replay
Patrick Brusky
CC BY-SA 3.0
2017-10-21T01:30:14.177Z
No, addresses cannot be deleted.
Ava Chow
CC BY-SA 3.0
2017-10-21T01:54:44.007Z
Seems like it would be best if I would backup my wallet.dat and delete form the from "C:\Users\user\AppData\Roaming\Bitcoin" folder and have it create a new one.  The new then should be able to create segwit address.
Patrick Brusky
CC BY-SA 3.0
2017-10-21T02:33:17.473Z
Yes. You can move all of your coins there by getting some addresses from the new wallet and sending your Bitcoin to those addresses from your old wallet. This also has the benefit of migrating your wallet to the HD wallet type where one backup can theoretically backup all of your private keys ever, although periodic backups are still recommended.
Ava Chow
CC BY-SA 3.0
2017-10-21T00:44:14.197Z
2017-10-21T00:44:14.197Z
Ava Chow
<p>I'm unable to create a segwit address in Bitcoin Core 15.0.1 64-bit Windows
I have tried multiple times but keep getting the same error.  The following is the output from the console</p>

<pre><code>$ getnewaddress
1KxN5zBSMqCiMfaXpbgpbDipo3fdrWmWnF
$ addwitnessaddress 1KxN5zBSMqCiMfaXpbgpbDipo3fdrWmWnF
Public key or redeemscript not known to wallet, or the key is uncompressed (code -4)
</code></pre>

<p>I have also tried changing my encryption password but it did not help.  I do not want to create a whole new wallet.  What else can I do?  Thanks</p>

CC BY-SA 3.0
2017-10-21T00:19:10.590Z
Can you post the output of the `getwalletinfo` command? The address likely corresponds to an uncompressed public key so it cannot be witnessified.
Ava Chow
<bitcoin-core><segregated-witness><error>
Segwit address creation
Patrick Brusky
# Segwit address creation

(Asked by: username_0 on 2017-10-20)

I'm unable to create a segwit address in Bitcoin Core 15.0.1 64-bit Windows
I have tried multiple times but keep getting the same error. The following is the output from the console

```
$ getnewaddress
1KxN5zBSMqCiMfaXpbgpbDipo3fdrWmWnF
$ addwitnessaddress 1KxN5zBSMqCiMfaXpbgpbDipo3fdrWmWnF
Public key or redeemscript not known to wallet, or the key is uncompressed (code -4)

```

I have also tried changing my encryption password but it did not help. I do not want to create a whole new wallet. What else can I do? Thanks

**Tags:** bitcoin-core, segregated-witness, error

> **Comments:**
> **username_1**: Can you post the output of the `getwalletinfo` command? The address likely corresponds to an uncompressed public key so it cannot be witnessified.  

---

## 1 answers

### Answer by username_1 on 2017-10-21. Score: 5

Your wallet is probably old enough that uncompressed public keys are used instead of compressed public keys. Segwit only works with compressed public keys so you cannot currently use segwit with your addresses.

However you can upgrade your wallet to using compressed keys. To do so, first start Bitcoin Core with the `-upgradewallet` option. That will upgrade your wallet to use compressed keys by default. Then you will need to call `getnewaddress` ~1000 times in order to get to addresses using compressed public keys keys. I don't believe that there is a way to regenerate the keypool without emptying it by requesting all of the addresses from the keypool.

> **Comments:**
> **username_0**: Yes my wallet is from 2012.  So the "getnewaddress" command will give me about 1000 receive address.  Is there a way to delete some of my receive address?  Thanks for you replay  
> **username_1**: No, addresses cannot be deleted.  
> **username_0**: Seems like it would be best if I would backup my wallet.dat and delete form the from "C:\Users\user\AppData\Roaming\Bitcoin" folder and have it create a new one.  The new then should be able to create segwit address.  
> **username_1**: Yes. You can move all of your coins there by getting some addresses from the new wallet and sending your Bitcoin to those addresses from your old wallet. This also has the benefit of migrating your wallet to the HD wallet type where one backup can theoretically backup all of your private keys ever, although periodic backups are still recommended.  

---

