<p>The first two commands extract private keys from the electrum wallet. So you can simply pass on your private key (wif) and destination address to electrum sweep. </p>

<p><strong>However</strong>, if your private key isn’t listed in electrum wallet, it may not know/hasn’t indexed which utxos this specific key can spend, which is necessary information for sweeping funds controlled by that private key. I am not sure if electrum indexes by all addresses(incl. those spendable by your private key), that will be critical to your ability to sweep.</p>

CC BY-SA 4.0
2018-12-01T08:40:40.980Z
2018-12-01T08:40:40.980Z
James C.
<p>From Electrum's documentation, the following should sweep all private keys to a new address:</p>

<pre><code>electrum listaddresses --funded | electrum getprivatekeys - | jq 'map(.[0])' | electrum sweep - [destination address]
</code></pre>

<p>Is there any way to enter a WIF key into the command line to specify it directly?  The address I'm wanting to sweep isn't in my Electrum.</p>

<p>For example, let's say this is the private key (never use this):  <code>L3ei8Zdu3eVRxMifD8XFN14jofv25ME51AhTzJr999dazxrWZMrZ</code></p>

<p>And this is the address I want the coins swept to: <code>1KdcMcRXNTBYT5BnHcmFHuYvvdWGsPnnwb</code></p>

<p>Assume that neither the sending nor receiving address is in my Electrum wallet.</p>

<p>What would I need to enter in Electrum command-line?</p>

<electrum>
Sweeping Private Key With Electrum
ShadowAccount
# Sweeping Private Key With Electrum

(Asked by: username_0 on 2018-12-01)

From Electrum's documentation, the following should sweep all private keys to a new address:

```
electrum listaddresses --funded | electrum getprivatekeys - | jq 'map(.[0])' | electrum sweep - [destination address]

```

Is there any way to enter a WIF key into the command line to specify it directly? The address I'm wanting to sweep isn't in my Electrum.

For example, let's say this is the private key (never use this): `L3ei8Zdu3eVRxMifD8XFN14jofv25ME51AhTzJr999dazxrWZMrZ`

And this is the address I want the coins swept to: `1KdcMcRXNTBYT5BnHcmFHuYvvdWGsPnnwb`

Assume that neither the sending nor receiving address is in my Electrum wallet.

What would I need to enter in Electrum command-line?

**Tags:** electrum


---

## 1 answers

### Answer by username_1 on 2018-12-01. Score: 0 | Accepted answer

The first two commands extract private keys from the electrum wallet. So you can simply pass on your private key (wif) and destination address to electrum sweep.

**However**, if your private key isn’t listed in electrum wallet, it may not know/hasn’t indexed which utxos this specific key can spend, which is necessary information for sweeping funds controlled by that private key. I am not sure if electrum indexes by all addresses(incl. those spendable by your private key), that will be critical to your ability to sweep.


---

