Bitcoin Forum

Bitcoin => Electrum => Topic started by: RapTarX on November 14, 2019, 03:37:29 PM



Title: What is Sweep in Electrum wallet?
Post by: RapTarX on November 14, 2019, 03:37:29 PM
I never noticed this "Sweep", just notice this while I was trying to learn some other stuffs. What is the use of "Sweep" in Electrum. I guess it's something related to Private key but I'm confused about its usage. It might be a very noob question but for me: It's something I can't figure out myself.

https://i.postimg.cc/j20Zc48s/Screenshot-5.png


Title: Re: What is Sweep in Electrum wallet?
Post by: DireWolfM14 on November 14, 2019, 03:43:40 PM
It allows you to input private keys from another wallet and create a transaction to "sweep" all the bitcoin from those keys, and send them to your current wallet.


Title: Re: What is Sweep in Electrum wallet?
Post by: TryNinja on November 14, 2019, 03:48:35 PM
It’s the same as importing the private keys you input and sending all their coins to an address on the current wallet. When sweeping, Electrum does that for you. It’s usually useful for people “redeeming” paper wallets.


Title: Re: What is Sweep in Electrum wallet?
Post by: RapTarX on November 14, 2019, 03:58:28 PM
Well, then what's the difference between importing private key and sweeping a private key? What's the need of sweeping in that case.
For instance;
I have private key of the public address "X"
I can import the public address in my wallet since I have the private key. Why do I need to sweep it?
I guess I am not messing up figuring it out.

Moreover, will there be a transaction from the address "X" to any of my address?


Title: Re: What is Sweep in Electrum wallet?
Post by: TryNinja on November 14, 2019, 04:05:12 PM
If you import the private key to make it part of your wallet, it won’t be restored along with the original addresses (of the wallet) if you ever restore it with the seed. Some people may forget this, discard the paper with the private key and lose the coins on that address.

The sweep option sends the coins from the address of the private key to one of the wallet’s address. It creates a transaction. Importing it doesn’t do anything on-chain.


Title: Re: What is Sweep in Electrum wallet?
Post by: DireWolfM14 on November 14, 2019, 04:18:02 PM
Import private key: No transaction is generated.  All the coins are still in that address, but now you can manage them through Electrum.

Sweep private key: A transaction is created that sweeps all the currency from the key(s) into an address in your current wallet.

Like TryNinja said; If you have a wallet backed up by a seed phrase, and then import a key, that key is not backed up by the seed phrase.  The currency on those imported keys is not backed up by your seed phrase.  If you ever needed to restore your wallet from seed, you would have to import the key again to access it's contents.  If you sweep the key all the coins are moved to your current wallet, and therefor backed up by the seed.



Title: Re: What is Sweep in Electrum wallet?
Post by: Saint-loup on November 14, 2019, 06:09:07 PM
I would add, the funds of your imported address won't be shown if you look at the xpub(or ypub, zpub) key of your wallet in a blockchain explorer.
If you send funds from an imported address, the change will be send back to this address in most of wallets.


Title: Re: What is Sweep in Electrum wallet?
Post by: pooya87 on November 15, 2019, 05:59:12 AM
If you import the private key to make it part of your wallet, it won’t be restored along with the original addresses (of the wallet) if you ever restore it with the seed. Some people may forget this, discard the paper with the private key and lose the coins on that address.

for a couple of years now, Electrum does not allow you to import private keys in a wallet that has a seed to prevent this exact issue. it forces the user to create a new wallet with that private key so that the new wallet won't have any seed and only contain that key (address) hence reducing the chance of the users thinking they can restore that wallet from their seed.


Title: Re: What is Sweep in Electrum wallet?
Post by: igor72 on November 15, 2019, 08:00:45 AM
I would add, the funds of your imported address won't be shown if you look at the xpub(or ypub, zpub) key of your wallet in a blockchain explorer.
If you were able to import key/address, it means that it is not a HD-wallet, so there is no extended key (xpub) in the wallet.


Title: Re: What is Sweep in Electrum wallet?
Post by: Pmalek on November 15, 2019, 10:25:55 AM
@RapTarX
You should read this: https://bitcointalk.org/index.php?topic=5106984.0
logfiles wrote a great thread discussing the differences between sweeping and importing and when you should sweep or import your keys.


Title: Re: What is Sweep in Electrum wallet?
Post by: Saint-loup on November 15, 2019, 11:03:48 AM
I would add, the funds of your imported address won't be shown if you look at the xpub(or ypub, zpub) key of your wallet in a blockchain explorer.
If you were able to import key/address, it means that it is not a HD-wallet, so there is no extended key (xpub) in the wallet.
It would be the same for the seed in this case... 
But I was talking about the software wallet : you can import keys in software wallets and web wallets that use HD wallet(s)


Title: Re: What is Sweep in Electrum wallet?
Post by: igor72 on November 15, 2019, 11:46:24 AM
I would add, the funds of your imported address won't be shown if you look at the xpub(or ypub, zpub) key of your wallet in a blockchain explorer.
If you were able to import key/address, it means that it is not a HD-wallet, so there is no extended key (xpub) in the wallet.
It would be the same for the seed in this case... 
But I was talking about the software wallet : you can import keys in software wallets and web wallets that use HD wallet(s)
We're talking about Electrum here. If the wallet is generated from seed, then it is not possible to import key/address into the wallet.


Title: Re: What is Sweep in Electrum wallet?
Post by: Saint-loup on November 15, 2019, 03:23:01 PM
I would add, the funds of your imported address won't be shown if you look at the xpub(or ypub, zpub) key of your wallet in a blockchain explorer.
If you were able to import key/address, it means that it is not a HD-wallet, so there is no extended key (xpub) in the wallet.
It would be the same for the seed in this case... 
But I was talking about the software wallet : you can import keys in software wallets and web wallets that use HD wallet(s)
We're talking about Electrum here. If the wallet is generated from seed, then it is not possible to import key/address into the wallet.
You don't understand what I mean I think(or you don't want to  ::)), you can import private keys in the software wallet Electrum. But of course it can't be imported in the HD wallet(s) of the software wallet...


Title: Re: What is Sweep in Electrum wallet?
Post by: TryNinja on November 15, 2019, 04:23:04 PM
You don't understand what I mean I think(or you don't want to  ::)), you can import private keys in the software wallet Electrum. But of course it can't be imported in the HD wallet(s) of the software wallet...
That's exactly what he said.

"If the wallet is generated from seed, then it is not possible to import key/address into the wallet."


Title: Re: What is Sweep in Electrum wallet?
Post by: AltcoinBuilder on November 27, 2019, 10:57:18 AM
sweep option create a transaction right? so what fee used for it? ???


Title: Re: What is Sweep in Electrum wallet?
Post by: Lucius on November 27, 2019, 11:31:15 AM
sweep option create a transaction right? so what fee used for it? ???
It is the same as when you sending a normal transactions, fee can be determined by user preference, depending on a current number of transactions in mempool, or how fast/slow you want to get confirmation. You adjust fee, then click on the preview button to check all details (check your address to avoid clipboard malware), and then just click on send.