Bitcoin Forum

Bitcoin => Electrum => Topic started by: bitcoinbitcoin on August 04, 2014, 09:14:00 PM



Title: How to "sweep" private key in electrum?
Post by: bitcoinbitcoin on August 04, 2014, 09:14:00 PM
For importing private key- Is the best way to import it, and then just spend it to one of your existing addresses? Even if u spend half the coin, the other half just goes to a change address in the same wallet right?

I never understood the big deal about "sweeping" privkeys.  Isn't my way just as secure?

You can do the same in Armory right?
I guess i would rather trust myself manually spending it & seeing the transaction, than adding another hidden "sweep" step to the process?  What is better about "sweeping" in armory, than just spending it to urself?


Title: Re: How to "sweep" private key in electrum?
Post by: Abdussamad on August 04, 2014, 11:05:41 PM
Sweeping is where all the bitcoins in the private key are sent to another address in your wallet. The private key is not added to your wallet and once it is swept it contains no more bitcoins. Reasons why it is considered better than importing:

- You don't have to worry about securing the private key anymore. It is now empty and you can throw it away if you don't expect to receive more bitcoins to its address.

- The address where the bitcoins have been swept to is generated deterministically from your wallet seed. So it is protected by the single paper backup you made when creating the wallet. An imported private key would not be protected by such a backup.

Electrum currently does not have a sweep option although it is being added to the next version.

When spending bitcoins from an imported private key in electrum the change is sent back to one of the input addresses which may well be the imported private key's address. So you have to backup the wallet file or you may loose bitcoins. You also have to make sure the imported private key does not leak out meaning you can't leave the paper wallet lying about.


Title: Re: How to "sweep" private key in electrum?
Post by: bitcoinbitcoin on August 05, 2014, 12:58:49 AM
"When spending bitcoins from an imported private key in electrum the change is sent back to one of the input addresses which may well be the imported private key's address."

I thought electrum uses a fresh deterministic address for all change?  You're saying if u spend half of an imported privkey, then the change MAY go back into the same privkey? i thought that was a privacy no-no that only mobile wallets make the mistake of doing.

So then what is the best way to "sweep" a private key into electrum?
You have to spend the whole amount or nothing?? (to prevent the possible reuse of addresses)
(i was thinking of testing with a small amount first)

thanks Abdussamad!


Title: Re: How to "sweep" private key in electrum?
Post by: Abdussamad on August 05, 2014, 04:54:42 AM
"When spending bitcoins from an imported private key in electrum the change is sent back to one of the input addresses which may well be the imported private key's address."

I thought electrum uses a fresh deterministic address for all change?  You're saying if u spend half of an imported privkey, then the change MAY go back into the same privkey? i thought that was a privacy no-no that only mobile wallets make the mistake of doing.

Electrum does it for transactions involving imported private keys only. For all other transactions a fresh change address is used.

Quote
So then what is the best way to "sweep" a private key into electrum?
You have to spend the whole amount or nothing?? (to prevent the possible reuse of addresses)
(i was thinking of testing with a small amount first)

thanks Abdussamad!

Yes, send the whole amount to a receiving address in your main account. Right click on the imported private key and use the send from option. Then in the amount field on the send tab enter exclamation point to have it automatically fill in the full amount you can send using that private key.


Title: Re: How to "sweep" private key in electrum?
Post by: bitcoinbitcoin on August 05, 2014, 06:10:07 AM
Thanks, u are an expert!


Title: Re: How to "sweep" private key in electrum?
Post by: torusJKL on October 10, 2014, 07:01:58 AM
[...]
When spending bitcoins from an imported private key in electrum the change is sent back to one of the input addresses which may well be the imported private key's address. So you have to backup the wallet file or you may loose bitcoins. You also have to make sure the imported private key does not leak out meaning you can't leave the paper wallet lying about.
Isn't this configurable with the "Use change addresses" checkbox?


Title: Re: How to "sweep" private key in electrum?
Post by: zetaray on October 10, 2014, 10:55:30 AM
Sweeping is just sending all fund in that address to another one in your wallet. You don't have to do it in electrum. You can use your old client and send everything over.


Title: Re: How to "sweep" private key in electrum?
Post by: Tafelpoot on October 16, 2014, 08:22:47 AM
Be careful with sweeping without storing the private key: you might have to prove ownership of the private keys by signing a message.
Example for claiming refunds or requesting a transfer of ownership to another address.


Title: Re: How to "sweep" private key in electrum?
Post by: reee on June 24, 2017, 03:58:50 PM
so there is no way to import a new address (and his private key) in electrum?


Title: Re: How to "sweep" private key in electrum?
Post by: Abdussamad on June 24, 2017, 10:07:22 PM
so there is no way to import a new address (and his private key) in electrum?

Yes. Create a new wallet using file > new/restore and when the keystore screen comes up choose "Use public or private keys". Then enter your private keys in the next screen.

Here are some screenshots:

https://bitcoinelectrum.com/creating-an-electrum-wallet/


Title: Re: How to "sweep" private key in electrum?
Post by: HCP on June 25, 2017, 01:06:13 AM
Those screenshots show creating a seeded HD wallet... you want to use the following option when you select "File" -> "New/Restore":

After selecting a name for your wallet... select "Standard Wallet":
https://talkimg.com/images/2023/11/15/z0qta.png

Then when it asks for the keystore, you want to select "Use public or private keys":
https://talkimg.com/images/2023/11/15/z00Lo.png

The next window will have a textbox where you can enter a list of private keys that you wish to import.




Title: Re: How to "sweep" private key in electrum?
Post by: reee on June 25, 2017, 09:03:17 AM
thanks


Title: Re: How to "sweep" private key in electrum?
Post by: Abdussamad on June 25, 2017, 01:23:11 PM
Those screenshots show creating a seeded HD wallet...
Then when it asks for the keystore, you want to select "Use public or private keys":

That's what I said.