Bitcoin Forum

Bitcoin => Electrum => Topic started by: hajo on November 07, 2015, 07:16:36 AM



Title: Migrating from Bitcoin core to Electrum
Post by: hajo on November 07, 2015, 07:16:36 AM
Apologies first, I know this must have been asked and answered a million times - I just failed to find comprehensive, up2date info. Hope you forgive me and do try to answer.

So I have significant (to me) amount of bitcoins in a wallet in Bitcoin core. They are stored there for quite a while - I lag some 1.5 years of blockchain download...

Now I want to move those to Electrum. What's my best course of action. I seem to have found 3 ways to do this:

a) Create a new wallet in Electrum. Sync the blockchain in Bitcoin core. Then transfer the Bitcoin over to the Electrum wallet. Seems the safest option, but will require me to wait for a long time until I have the blockchain. And my HDD will get quite full with data I only need for a short while.
b) Create a new wallet in Electrum. Then "Sweep" the Bitcoin core wallet. I think to understand there's no seed in Bitcoin core that I can enter in Electrum, but it seems the private keys (which can be dumped in Bitcoin core console) can be "sweeped" over? Then, important, transfer the Bitcoin in Electrum to a electrum wallet address. Correct?
c) Create a new wallet in Electrum. Then "import" the private keys of b) into Electrum. And then? Also transfer internally?

I'm not 100% confident with b) and c). Comments, please?

Finally, Step 2 - can I then erase all traces of my Bitcoin core wallet? Or maybe I keep a paper copy of the private/public key pairs - just in case someone still transfers Bitcoin into those? If that happens, above b) or c) could still access the funds? I guess there's no "revoke" system in Bitcoin as there is in e.g. PGP?

Again, sorry for the repeat questions.


Title: Re: Migrating from Bitcoin core to Electrum
Post by: torusJKL on November 07, 2015, 08:37:40 AM
I would go for option c.
1. export the private keys from bticoin core
2. import the private keys into electrum
3. transfer the bitcoins to a electrum address

Keep either the private keys or the wallet.dat save in case you get transaction on your old addresses or need to sign with one of them.

This is how you export the private key:
Code:
1. launch your bitcoin client as usual
2. click on 'help' in the menu bar (top right)
3. click on 'debug window'
4. select the 'console' tab
5. type: walletpassphrase "your walletpassphrase here" 600
6. type: dumpprivkey [your public key here]
    this will return the private key, you can copy it now; ensure you clear your clipboard/history afterwards
7. repeat 6 for all your addresses
8. type: walletlock


Title: Re: Migrating from Bitcoin core to Electrum
Post by: shorena on November 07, 2015, 09:53:33 AM
Id go for a, due to the lowest chance of making a mistake.

You cant revoke an address, no, so you should keep a backup of the wallet.dat just in case. The private keys might also be valueable for other coins like CLAM that base their initial coin distribution on the state of bitcoin (et al.) at a certain time in the past.

If you go for the route of exporting and sweeting or importing I suggest you dont use dumpprivkey <address>  but dumpwallet[1] as it will export all your keys with one command.

[1] https://bitcoin.org/en/developer-reference#dumpwallet


Title: Re: Migrating from Bitcoin core to Electrum
Post by: torusJKL on November 07, 2015, 01:13:20 PM
Id go for a, due to the lowest chance of making a mistake.

Maybe a combination of a and c.
First do c so that you have immediate access to the funds.
Then do a and check if your wallet is empty. If not transfer the bitcoins that you missed by doing c.

If you go for the route of exporting and sweeting or importing I suggest you dont use dumpprivkey <address>  but dumpwallet[1] as it will export all your keys with one command.

[1] https://bitcoin.org/en/developer-reference#dumpwallet
If I only had known this when I migrated :-)


Title: Re: Migrating from Bitcoin core to Electrum
Post by: hajo on November 07, 2015, 01:51:42 PM
Thx folks!

So c) seems possible - importing private keys. But what does it mean? Do I then "own" the private keys in the new wallet or do I still have to transfer the funds to keys of the Electrum wallet? I understand Electrum uses deterministic wallets, I.e. can those imported private keys be recovered from the wallet seed? If no, what's actually the difference between b) "sweep" and c) import?

The more I look into this, the more complicated it seems to get ;)


Title: Re: Migrating from Bitcoin core to Electrum
Post by: ranochigo on November 07, 2015, 02:00:58 PM
Thx folks!

So c) seems possible - importing private keys. But what does it mean? Do I then "own" the private keys in the new wallet or do I still have to transfer the funds to keys of the Electrum wallet? I understand Electrum uses deterministic wallets, I.e. can those imported private keys be recovered from the wallet seed? If no, what's actually the difference between b) "sweep" and c) import?

The more I look into this, the more complicated it seems to get ;)
Sweeping means that the amount will be sent into one of the address generated by the seed. Importing means that the private keys is imported into the wallet. This means that in sweeping mode, you have to only remember the seed but when you import, you need to remember both the seed and the  private key if you use the addresses generated by the seed.

IIRC, Electrum sends back the change into the input address if it is imported while it uses a new change address for seed addresses. Since you could use an address generated by the seed and imported address at the same time, the change would be sent to either of them. Correct me if I'm wrong.

Still, I don't recommend you to delete your private key in either of the mode.


Title: Re: Migrating from Bitcoin core to Electrum
Post by: torusJKL on November 07, 2015, 03:22:55 PM
I understand Electrum uses deterministic wallets, I.e. can those imported private keys be recovered from the wallet seed? If no, what's actually the difference between b) "sweep" and c) import?
No, the private keys from the Bitcoin Core client will not be part of the addresses that the seed can recover.
Thus you should transfer them to an electrum address in either case.

I like to be in control of how the bitcoins are transferred thus c.
In the end b and c give you the same result.


Title: Re: Migrating from Bitcoin core to Electrum
Post by: hajo on November 08, 2015, 02:33:51 PM
Thx again to all for the details! Since apparently the Bitcoin core blockchain download got much faster from version 0.10 onwards I decided to be a chicken and give some fees to miners - I transferred the funds manually. Worked well, I'll now archive the old Bitcoin core wallet somewhere and will happily use Electrum from here on. Hopefully :)

And yes, my paper copy of the seed is safely tucked away.