Author

Topic: Sweeping key (Read 519 times)

legendary
Activity: 1092
Merit: 1001
March 21, 2017, 02:55:36 PM
#8
There may be some confusion in terminology.

If you "import" a private key, you are giving a copy of the private key to the new wallet to use. The old wallet still holds its copy of the private key. If two wallets hold the same private key, they both have control over the bitcoins, and both wallets will report the bitcoins as belonging to them.

If you "sweep" a private key, the new wallet sends the bitcoins to a new address that it controls (using the private key you provide). The old wallet no longer has the bitcoins.

Importing a private key can cause confusion and may create a security risk, so it is generally better for newbies to sweep a private key.

Yes, I agree with the above comment.
If someone chooses to IMPORT over SWEEP, the privatekey will be in both the old and new wallets.

It is very recommended to transfer or sweep your funds, than import the privatekey into multiple wallets.
legendary
Activity: 4466
Merit: 3391
March 21, 2017, 12:40:30 PM
#7
There may be some confusion in terminology.

If you "import" a private key, you are giving a copy of the private key to the new wallet to use. The old wallet still holds its copy of the private key. If two wallets hold the same private key, they both have control over the bitcoins, and both wallets will report the bitcoins as belonging to them.

If you "sweep" a private key, the new wallet sends the bitcoins to a new address that it controls (using the private key you provide). The old wallet no longer has the bitcoins.

Importing a private key can cause confusion and may create a security risk, so it is generally better for newbies to sweep a private key.
legendary
Activity: 1245
Merit: 1004
March 20, 2017, 09:35:52 PM
#6
@AgentofCoin how can I delete/remove a privkey from a wallet.dat ?
After extraction and backup somewhere else, of course.
Seen a lot of detail documentation but never stumbled upon that API call. Using plain core wallet.

I do not think there is an API to delete an address/privatekey, but I'm not 100%.
Forum users in the past have stated to use "pywallet" to edit the wallet.dat, but I
don't know anything about it personally (make sure you have a backup).

My understanding is that if you need to delete an address, it is probably appropriate
to dump all your keys and import them into a new wallet.dat without the address
you wish to delete.


Sounds logical. Doing it that way, the privkey is not "gone" but instead "never even existed" in the new wallet.dat.
Maybe version 0.15.0 will get new API calls, or a patch can be supplied for the adventurous.

Some project out there stated there are more than just 1 privkey pointing at a single address. This math stuff still refutes my mind.
legendary
Activity: 1092
Merit: 1001
March 20, 2017, 05:57:22 PM
#5
@AgentofCoin how can I delete/remove a privkey from a wallet.dat ?
After extraction and backup somewhere else, of course.
Seen a lot of detail documentation but never stumbled upon that API call. Using plain core wallet.

I do not think there is an API to delete an address/privatekey, but I'm not 100%.
Forum users in the past have stated to use "pywallet" to edit the wallet.dat, but I
don't know anything about it personally (make sure you have a backup).

My understanding is that if you need to delete an address, it is probably appropriate
to dump all your keys and import them into a new wallet.dat without the address
you wish to delete.
legendary
Activity: 1078
Merit: 1024
March 20, 2017, 05:46:44 PM
#4
Sweeping a key means transferred all the funds to another address.
You pay the miner fee.

The first wallet will be empty and funds will be sent to the second one with a normal transaction.
legendary
Activity: 1245
Merit: 1004
March 20, 2017, 05:17:56 PM
#3
@AgentofCoin how can I delete/remove a privkey from a wallet.dat ?
After extraction and backup somewhere else, of course.
Seen a lot of detail documentation but never stumbled upon that API call. Using plain core wallet.
legendary
Activity: 1092
Merit: 1001
March 20, 2017, 05:06:48 PM
#2
...
Is the first wallet empty?
Are the Bitcoins now in the second wallet?
Did it "cost" anything to a third party?

Addresses: Contain your bitcoins (controlled by it's privatekey).
Wallets: Contain your addresses.

If you have an address with bitcoins controlled by privatekey ("PK1") in one wallet ("W1"),
and then you create a second wallet ("W2") and sweep your first address ("PK1"),
your second wallet will transfer your PK1 coins and place them into a new address ("PK2")
within your new wallet ("W2").

After this happens, W1 no longer have the bitcoins in PK1, they are now in W2's PK2.
It does not cost anything other than the miner's fee to sweep those coins. Depending
on the mempool at that time, could be cheap or costly.

Depending on the circumstances, it may be better to IMPORT your PK1, into your W2, if you
do not wish to pay a miners fee to sweep. But it is always recommend to transfer coins to new
addresses since using the same privatekey on multiple wallets whether online or software increases
chances of compromising it (since your privatekey is in more than one location).
newbie
Activity: 8
Merit: 0
March 20, 2017, 04:31:22 PM
#1
This is a general question to understand how keys and the sweep system works:

1. I create a wallet of some kind, online, offline, or paper.
2. I transfer some Bitcoins to this wallet, and note the Private Key
3. I create a second wallet of some kind, online or offline.
4. I sweep the key from the first wallet into the second.

What is the status now please:

Is the first wallet empty?
Are the Bitcoins now in the second wallet?
Did it "cost" anything to a third party?
Jump to: