Bitcoin Forum
May 09, 2024, 12:51:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Sweeping key  (Read 499 times)
exabb (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
March 20, 2017, 09: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?
1715259090
Hero Member
*
Offline Offline

Posts: 1715259090

View Profile Personal Message (Offline)

Ignore
1715259090
Reply with quote  #2

1715259090
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
AgentofCoin
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
March 20, 2017, 10: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).

I support a decentralized & unregulatable ledger first, with safe scaling over time.
Request a signed message if you are associating with anyone claiming to be me.
numismatist
Legendary
*
Offline Offline

Activity: 1245
Merit: 1004



View Profile
March 20, 2017, 10: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.

unholycactus
Legendary
*
Offline Offline

Activity: 1078
Merit: 1024



View Profile WWW
March 20, 2017, 10: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.
AgentofCoin
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
March 20, 2017, 10: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.

I support a decentralized & unregulatable ledger first, with safe scaling over time.
Request a signed message if you are associating with anyone claiming to be me.
numismatist
Legendary
*
Offline Offline

Activity: 1245
Merit: 1004



View Profile
March 21, 2017, 02:35:52 AM
 #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.

odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
March 21, 2017, 05: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.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
AgentofCoin
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
March 21, 2017, 07: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.

I support a decentralized & unregulatable ledger first, with safe scaling over time.
Request a signed message if you are associating with anyone claiming to be me.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!