<p>Addresses beginning with a 3 generated using <code>addwitnessaddress</code> are called P2SH-P2WPKH addresses. That means it is a Pay-to-Witness-Public-Key-Hash (P2WPKH) script embedded in a Pay-to-Script-Hash (P2SH) address, which starts with a 3. To back up this type of address, you need to back up the private key used in the P2WPKH part. If you know which address you used when you called <code>addwitnessaddress</code>, you can call <code>dumpprivkey</code> on that address. </p>

<p>To restore from that private key, you should be able to just import the key into your wallet and call <code>addwitnessaddress</code> on it again. Note that <code>addwitnessaddress</code> is an experimental RPC call so the method to restoring may change in future, but you can always generate the corresponding public key hash (address) from they key, create a P2WPKH witness script for it, and wrap it in P2SH if you have the key so it should be a sufficient backup</p>

CC BY-SA 3.0
2017-11-17T12:00:16.613Z
Now I understand what I'm gonna do! Thanks!
bitcoinlearner
CC BY-SA 3.0
2017-11-17T11:15:03.670Z
2017-11-17T11:15:03.670Z
meshcollider
<p>I've received my balance to my addresss that starts with 3 which is after 'addwitnessaddress' command.</p>

<p>I'd like to know that how do I properly backup my balance to keep safety.</p>

<p>Bitcoin Core has a function that called backup wallet to the 'wallet.dat', but there is a in unexpectable case by file corruption.</p>

<p>I tried keep it save by using 'dumpprivkey ' to get my priv key.</p>

<p>But the console says, "Address does not refer to a key". So I googled it and found it has related with something called P2SH.</p>

<p>It's little bit hard to understand for me to use Bitcoin.</p>

<p>Can some help me out to backup my balance only using by Bitcoin Core client instead of 'wallet.dat'?</p>

<p>Thanks!</p>

<bitcoin-core><segregated-witness><backup><p2sh><private-key-export>
How to properly backup a address with private key after 'addwitnessaddress' command
bitcoinlearner
# How to properly backup a address with private key after 'addwitnessaddress' command

(Asked by: username_0 on 2017-11-17)

I've received my balance to my addresss that starts with 3 which is after 'addwitnessaddress' command.

I'd like to know that how do I properly backup my balance to keep safety.

Bitcoin Core has a function that called backup wallet to the 'wallet.dat', but there is a in unexpectable case by file corruption.

I tried keep it save by using 'dumpprivkey ' to get my priv key.

But the console says, "Address does not refer to a key". So I googled it and found it has related with something called P2SH.

It's little bit hard to understand for me to use Bitcoin.

Can some help me out to backup my balance only using by Bitcoin Core client instead of 'wallet.dat'?

Thanks!

**Tags:** bitcoin-core, segregated-witness, backup, p2sh, private-key-export


---

## 1 answers

### Answer by username_1 on 2017-11-17. Score: 1 | Accepted answer

Addresses beginning with a 3 generated using `addwitnessaddress` are called P2SH-P2WPKH addresses. That means it is a Pay-to-Witness-Public-Key-Hash (P2WPKH) script embedded in a Pay-to-Script-Hash (P2SH) address, which starts with a 3. To back up this type of address, you need to back up the private key used in the P2WPKH part. If you know which address you used when you called `addwitnessaddress`, you can call `dumpprivkey` on that address.

To restore from that private key, you should be able to just import the key into your wallet and call `addwitnessaddress` on it again. Note that `addwitnessaddress` is an experimental RPC call so the method to restoring may change in future, but you can always generate the corresponding public key hash (address) from they key, create a P2WPKH witness script for it, and wrap it in P2SH if you have the key so it should be a sufficient backup

> **Comments:**
> **username_0**: Now I understand what I'm gonna do! Thanks!  

---

