<h1>How to import private keys into Bitcoin Core (from a paper wallet or elsewhere)</h1>

<p>In Bitcoin Core, you can use the <code>importprivatekey</code> command.</p>

<p>Once you have your private key, guard it very carefully keeping it very secure and, do the following to import into Bitcoin Core:</p>

<ol>
<li>Open Bitcoin Core.</li>
<li>Go to Help --> Debug.</li>
<li>Go to the Console tab.</li>
<li>type: <code>importprivatekey "{private key}" "{label optional}"</code></li>
<li>Create a new wallet backup.</li>
</ol>

<p>Done. Note that you do not need to wait for Bitcoin Core to update before importing your private key. However, not all funds may show up in your wallet until it is completely up to date.</p>

<p>Hopefully, you have encrypted your wallet with a good passphrase that you will remember.</p>

<blockquote>
  <h2>Usage:</h2>
  
  <p>>importprivkey "privkey" ( "label" ) ( rescan )</p>
  
  <p>Adds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.</p>
  
  <p>Arguments:</p>
  
  <ol>
  <li>"privkey"          (string, required) The private key (see dumpprivkey)</li>
  <li>"label"            (string, optional, default="") An optional label</li>
  <li>rescan               (boolean, optional, default=true) Rescan the wallet for transactions</li>
  </ol>
  
  <p>Note: This call can take minutes to complete if rescan is true, during that time, other rpc calls
  may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.</p>
  
  <p>Examples:</p>
  
  <p>Dump a private key<br>
  > dumpprivkey "myaddress"</p>
  
  <p>Import the private key with rescan<br>
  > importprivkey "mykey"</p>
  
  <p>Import using a label and without rescan<br>
  > importprivkey "mykey" "testing" false</p>
  
  <p>Import using default blank label and without rescan<br>
  > importprivkey "mykey" "" false</p>
</blockquote>

CC BY-SA 3.0
2018-02-28T03:25:27.817Z
so when "importing" a new private key, it creates a totally new wallet file? why cant it add it to an existing wallet? Also does this "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx, and bc1xxx from a single private key?
Patoshi パトシ
CC BY-SA 3.0
2018-02-28T08:35:59.850Z
@Patoshi As Adam has noted in his answer, you need to ensure you are using the correct version of Bitcoin Core for bc1 addresses. The rescan (defaults to true) takes care of finding funds on addresses. No, not a new wallet file.
Willtech
CC BY-SA 3.0
2018-02-28T15:15:25.307Z
Don't have to worry about derivation path that generates an infinity of completely different address?
Patoshi パトシ
CC BY-SA 3.0
2018-02-28T17:43:21.000Z
@Patoshi as I mentioned in my answer "set address type to bech32 in your bitcoin.conf file" so you get bech32 address, not the legacy one. Try to import it and see if you see your Bitcoins. You will not lose anything.
Tailer
CC BY-SA 3.0
2018-02-28T02:51:21.047Z
2018-02-28T02:51:21.047Z
Willtech
<p>As Bitcoin core v0.16.0 released You can import Bech32 Segwit address as @Willtech Answer. </p>

<pre><code>importprivkey "privkey" ( "label" ) ( rescan )
</code></pre>

<p>First Make sure that you are running the correct bitcoin core version</p>

<p>using <code>getnetworkinfo</code></p>

<p><strong><code>bitcoin-cli getnetworkinfo</code></strong></p>

<pre><code>{
  "version": 160000,
  "subversion": "/Satoshi:0.16.0/",
  "protocolversion": 70015,
  "localservices": "000000000000040d",
  "localrelay": true,
  "timeoffset": 0,
  "networkactive": true,
  "connections": 5
}
</code></pre>

<p>Now set address type to bech32 in your bitcoin.conf file</p>

<pre><code>addresstype=bech32
</code></pre>

<blockquote>
  <p>so when "importing" a new private key, it creates a totally new wallet
  file? why cant it add it to an existing wallet? Also does this
  "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx,
  and bc1xxx from a single private key?</p>
</blockquote>

<ul>
<li>No it doesn't create an new wallet file, it will just add it to your existing wallet file.</li>
</ul>

<p>This way it should work 100% anyway if it didn't work. you still create your transaction manually and sign it using your private key. </p>

CC BY-SA 3.0
2018-02-05T22:33:56.633Z
seems like its not matured yet, as that tutorial seems pretty complicated.
Patoshi パトシ
CC BY-SA 3.0
2018-02-28T02:34:52.127Z
@Patoshi That tutorial is far more complicated than it needs to be for your question.
Willtech
CC BY-SA 3.0
2018-02-28T07:33:44.093Z
You were right guys, but that was before the release of Bitcoin 0.16.0 I made an edit.
Tailer
CC BY-SA 3.0
2018-02-05T22:08:20.360Z
2018-02-28T08:19:09.293Z
2018-02-28T08:19:09.293Z
Tailer
<p>Is there a easy tutorial on how to sweep a bc1 segwit address? I know electrum can sweep private keys, but has anyone ever really tried it and wrote a tutorial on it? </p>

<p>I'm afraid of sending some coins to a bc1 paper wallet. I'm just looking for a tutorial or even a video of someone actually sweeping it.</p>

<segregated-witness><bech32-address><sweep>
How do I sweep funds from my bc1 bech32 segwit address I generated from a paper wallet?
Patoshi パトシ
# How do I sweep funds from my bc1 bech32 segwit address I generated from a paper wallet?

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

Is there a easy tutorial on how to sweep a bc1 segwit address? I know electrum can sweep private keys, but has anyone ever really tried it and wrote a tutorial on it?

I'm afraid of sending some coins to a bc1 paper wallet. I'm just looking for a tutorial or even a video of someone actually sweeping it.

**Tags:** segregated-witness, bech32-address, sweep


---

## 2 answers

### Answer by username_1 on 2018-02-28. Score: 2

# How to import private keys into Bitcoin Core (from a paper wallet or elsewhere)

In Bitcoin Core, you can use the `importprivatekey` command.

Once you have your private key, guard it very carefully keeping it very secure and, do the following to import into Bitcoin Core:

1. Open Bitcoin Core.
2. Go to Help --> Debug.
3. Go to the Console tab.
4. type: `importprivatekey "{private key}" "{label optional}"`
5. Create a new wallet backup.

Done. Note that you do not need to wait for Bitcoin Core to update before importing your private key. However, not all funds may show up in your wallet until it is completely up to date.

Hopefully, you have encrypted your wallet with a good passphrase that you will remember.

> ## Usage:
>
> >importprivkey "privkey" ( "label" ) ( rescan )
>
> Adds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.
>
> Arguments:
>
> 1. "privkey" (string, required) The private key (see dumpprivkey)
> 2. "label" (string, optional, default="") An optional label
> 3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
>
> Note: This call can take minutes to complete if rescan is true, during that time, other rpc calls
> may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
>
> Examples:
>
> Dump a private key  
> > dumpprivkey "myaddress"
>
> Import the private key with rescan  
> > importprivkey "mykey"
>
> Import using a label and without rescan  
> > importprivkey "mykey" "testing" false
>
> Import using default blank label and without rescan  
> > importprivkey "mykey" "" false

> **Comments:**
> **username_0**: so when "importing" a new private key, it creates a totally new wallet file? why cant it add it to an existing wallet? Also does this "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx, and bc1xxx from a single private key?  
> **username_1**: @Patoshi As Adam has noted in his answer, you need to ensure you are using the correct version of Bitcoin Core for bc1 addresses. The rescan (defaults to true) takes care of finding funds on addresses. No, not a new wallet file.  
> **username_0**: Don't have to worry about derivation path that generates an infinity of completely different address?  
> **username_2**: @Patoshi as I mentioned in my answer "set address type to bech32 in your bitcoin.conf file" so you get bech32 address, not the legacy one. Try to import it and see if you see your Bitcoins. You will not lose anything.  

---

### Answer by username_2 on 2018-02-05. Score: 1

As Bitcoin core v0.16.0 released You can import Bech32 Segwit address as @username_1 Answer. 
importprivkey "privkey" ( "label" ) ( rescan )

First Make sure that you are running the correct bitcoin core version
using getnetworkinfo
bitcoin-cli getnetworkinfo
{
  "version": 160000,
  "subversion": "/Satoshi:0.16.0/",
  "protocolversion": 70015,
  "localservices": "000000000000040d",
  "localrelay": true,
  "timeoffset": 0,
  "networkactive": true,
  "connections": 5
}

Now set address type to bech32 in your bitcoin.conf file
addresstype=bech32


so when "importing" a new private key, it creates a totally new wallet
  file? why cant it add it to an existing wallet? Also does this
  "import" know to import the 3 derivatives of addresses? 1xxx, 3xxx,
  and bc1xxx from a single private key?


No it doesn't create an new wallet file, it will just add it to your existing wallet file.

This way it should work 100% anyway if it didn't work. you still create your transaction manually and sign it using your private key.

> **Comments:**
> **username_0**: seems like its not matured yet, as that tutorial seems pretty complicated.  
> **username_1**: @Patoshi That tutorial is far more complicated than it needs to be for your question.  
> **username_2**: You were right guys, but that was before the release of Bitcoin 0.16.0 I made an edit.  

---

