Bitcoin Forum

Bitcoin => Electrum => Topic started by: sccrfreak9 on June 03, 2015, 11:03:46 AM



Title: Electrum Private Key
Post by: sccrfreak9 on June 03, 2015, 11:03:46 AM
Because of the up and coming fork I want to export my private keys so I can use them on both chains and not get messed about and lose money so what is the command for exporting private keys?


Title: Re: Electrum Private Key
Post by: Muhammed Zakir on June 03, 2015, 11:16:25 AM
You only need to backup mnemonic seed. If you backup it, you are safe.


Title: Re: Electrum Private Key
Post by: shorena on June 03, 2015, 11:30:34 AM
You only need to backup mnemonic seed. If you backup it, you are safe.

True, but in case of a fork electrum might only work for one of the possible bitcoin forks[1].

With Electrum 1.9.8. you click Wallet -> Private Keys -> Export -> "enter password" -> OK -> "read warning" -> OK -> save

It will create an unencrypted(!) .csv file with all private keys and corresponding addresses.


[1] Add for clarity: Im referring to the possible split into two distinct coins Bitcoin and Bitcoin XT here, not a fork within the same coin.


Title: Re: Electrum Private Key
Post by: btchris on June 03, 2015, 04:23:55 PM
If your wallet was generated by Electrum 2.x, an alternative to dealing with individual private keys would be export your one master private key ("xprv"), and import it into another wallet.

Unfortunately, you're limited in your other wallet options. The only one I'm aware of that this would work with is Mycelium for Android.

(How to export your xprv from Electrum: http://bitcoin.stackexchange.com/questions/36839/electrum-2-0-non-bip39-32-standardisation-complicates-matters-immensely-why/36945#36945 (http://bitcoin.stackexchange.com/questions/36839/electrum-2-0-non-bip39-32-standardisation-complicates-matters-immensely-why/36945#36945))


Title: Re: Electrum Private Key
Post by: Quickseller on June 10, 2015, 03:05:08 AM
You only need to backup mnemonic seed. If you backup it, you are safe.

True, but in case of a fork electrum might only work for one of the possible bitcoin forks.

With Electrum 1.9.8. you click Wallet -> Private Keys -> Export -> "enter password" -> OK -> "read warning" -> OK -> save

It will create an unencrypted(!) .csv file with all private keys and corresponding addresses.
Although it is possible that no version of electrum will work on the "accepted" fork in the event of a fork, the private keys that will get exported will not change depending on the time that  you export them. In other words, you will incur the same output if you export the private keys today, tomorrow or 10 years from today (you will likely receive additional keys the later you export them because the chances are that you will use more addresses as time progresses, however this fact should be ignored for this argument). As a result it does not matter when you export the private keys, as if the keys are valid for the fork you wish to use, then they will always be valid regardless of when they are exported.

As you somewhat pointed out, holding an unencrypted version of your private keys is very dangerous, and many bad things can happen to them, and the risk of loss is significantly greater if you are storing an unencrypted version of your private keys somewhere (especially if you are storing them in some cloud storage service).

I would say the best practice would be to store you seed and/or backup of your wallet in a secure manner and then only export your private keys in the event that you absolutely need to.


Title: Re: Electrum Private Key
Post by: Cryptowatch.com on June 15, 2015, 07:05:06 AM
Some brute CLI solutions:

Generate commands for moving all privkeys to another electrum wallet:
Code:
echo walletpassword | python electrum dumpprivkeys 2>/dev/null | grep -v WARNING | grep -v Exposing | grep -v "In particular" | grep \" |cut -d "\"" -f2 | xargs -L 1 echo python electrum importprivkey



Generate code for inserting all electrum wallet privkeys to bitcoind:
Code:
echo walletpassword | python electrum dumpprivkeys 2>/dev/null | grep -v WARNING | grep -v Exposing | grep -v "In particular" | grep \" |cut -d "\"" -f2 | xargs -L 1 echo bitcoin-cli importprivkey | awk '{print  false $0" false &&"}' | xargs | sed 's/.\{2\}$//'

Run commands from the electrum directory, and when done, simply copy the output and paste it in another terminal window. Please ensure, you're sitting in the relevant directory for electrum


Title: Re: Electrum Private Key
Post by: ThomasV on June 15, 2015, 09:01:24 AM
True, but in case of a fork electrum might only work for one of the possible bitcoin forks.

that's not true. The Electrum client will not be affected by the max block size change.


Title: Re: Electrum Private Key
Post by: shorena on June 17, 2015, 10:23:40 AM
True, but in case of a fork electrum might only work for one of the possible bitcoin forks.

that's not true. The Electrum client will not be affected by the max block size change.

Maybe I was not clear. I was referring to the scenario where Bitcoin XT emerges as an alt different from Bitcoin, with an identical historical blockchain. In this case I would assume you (and others running Electrum servers) would have to decide which coin to follow.

Is this a wrong assumption?


Title: Re: Electrum Private Key
Post by: zebedee on June 19, 2015, 12:54:57 PM
True, but in case of a fork electrum might only work for one of the possible bitcoin forks.

that's not true. The Electrum client will not be affected by the max block size change.

Maybe I was not clear. I was referring to the scenario where Bitcoin XT emerges as an alt different from Bitcoin, with an identical historical blockchain. In this case I would assume you (and others running Electrum servers) would have to decide which coin to follow.

Is this a wrong assumption?
It doesn't matter.  All you need is your seed; your coins are on both forks.

If a server is following the wrong chain, switch to a different server.  In the impossible situation everyone is following the wrong chain, export your private keys to another client.

However that scenario makes no sense, since your coins, from before the fork, are valid on both forks, so it really doesn't matter which fork your server is following, unless you're receiving coins more than 100 blocks after a fork.

People need to chill out, a fork isn't the end of the world some people want to make it seem.


Title: Re: Electrum Private Key
Post by: a_cat_named_joe on July 30, 2017, 09:57:21 PM
True, but in case of a fork electrum might only work for one of the possible bitcoin forks.

that's not true. The Electrum client will not be affected by the max block size change.

Maybe I was not clear. I was referring to the scenario where Bitcoin XT emerges as an alt different from Bitcoin, with an identical historical blockchain. In this case I would assume you (and others running Electrum servers) would have to decide which coin to follow.

Is this a wrong assumption?
It doesn't matter.  All you need is your seed; your coins are on both forks.

If a server is following the wrong chain, switch to a different server.  In the impossible situation everyone is following the wrong chain, export your private keys to another client.

However that scenario makes no sense, since your coins, from before the fork, are valid on both forks, so it really doesn't matter which fork your server is following, unless you're receiving coins more than 100 blocks after a fork.

People need to chill out, a fork isn't the end of the world some people want to make it seem.

ALERT - Claiming BCC using an Electrum wallet - only private keys might work

There has been a suggestion from a r/btc source (https://www.reddit.com/r/btc/comments/6qiak7/bcc_clients_are_listed_here/) that Bitcoin Cash (BCC/BCH) wallets might not recognise Electrum seeds i.e. private keys need to be imported into Bitcoin Cash wallets. Here's the latest advice from Electrum, which acknowledges that either seeds, or private keys will have to be used:

"BCC wallets will require you to import your seed or your private keys,
which can be exported from Electrum. Doing so will expose all your
Bitcoin funds associated with that seed to the BCC wallet you decide
to use.

Therefore, *after* the BCC fork, but *before* you enter a seed or
private key
in a BCC wallet, you should move all your funds to a new
Electrum wallet, with a new seed. You will still be able to use the
old seed or private key with BCC, because BCC has replay
protection. Wait until your funds are confirmed in your new Bitcoin
wallet, before you enter the old private key in a BCC wallet. This
will protect your BTC funds from rogue/untrusted software."


In the event that private keys have to be used to claim BCC/BCH in a Bitcoin Cash wallet, how exactly should one proceed?
I know how to use the export private keys function in Electrum to generate unencrypted .csv, or .json files showing addresses and their associated private keys.
Does simply copying and pasting those addresses and private keys into the import function of a Bitcoin Cash wallet do the trick?
Do you import your private keys with their corresponding addresses individually, or all together?

Step-by-step, how should this be done? Expert opinion please!


Title: Re: Electrum Private Key
Post by: kolloh on July 30, 2017, 11:22:43 PM
In the event that private keys have to be used to claim BCC/BCH in a Bitcoin Cash wallet, how exactly should one proceed?
I know how to use the export private keys function in Electrum to generate unencrypted .csv, or .json files showing addresses and their associated private keys.
Does simply copying and pasting those addresses and private keys into the import function of a Bitcoin Cash wallet do the trick?
Do you import your private keys with their corresponding addresses individually, or all together?

Step-by-step, how should this be done? Expert opinion please!

You can simply copy and paste each private key to be imported into a Bitcoin Cash wallet. You would do each address individually or they might allow you to import multiple at the same time. Either way would work.

Just be sure to move your Electrum funds to a new wallet with a new seed after the fork to ensure their safety.


Title: Re: Electrum Private Key
Post by: a_cat_named_joe on July 31, 2017, 12:55:47 AM
Thanks Kolloh. Very reassuring with all the conflicting information around. I didn't want to experiment with my Bitcoin wallet with just hours to go before the BIP148 UASF/SegWit implementation and the subsequent hard fork.

So let me get this right - the sequence of securing Bitcoin Cash would be something like this:
1) After the fork install a new Electrum wallet and send all your existing BTC from your old wallet to it;
2) Install a BCC wallet (or BCH as it is now being called);
3) In your old wallet, click on the 'Wallet' tab > 'Private Keys' tab > 'Export' tab to reveal the private keys and addresses;
4) Copy and paste each private key individually and import them one-by-one into the BCC wallet using the 'Import' function;
5) Copy and paste each address individually and import them one-by-one into the BCC wallet using the 'Import' function;

or copy and paste the whole lot in one go straight into the BCC wallet, if that wallet allows it. Have I got it right?

For anyone who is interested, here's a list of links leading to wallets recognising BCC from the https://www.bitcoincash.org/ website:
Bitcoin ABC https://www.bitcoinabc.org/
Bitcoin Classic https://bitcoinclassic.com/downloads/bcc/
Bitcoin Unlimited https://www.bitcoinunlimited.info/download
Bitcoin XT https://bitcoinxt.software/
Electron Cash http://www.electroncash.org/
BTC.com https://wallet.btc.com/#/setup/register
Freewallet https://freewallet.org/
Coinomi https://coinomi.com/ ... and the
Ledger https://www.ledgerwallet.com/  and
Trezor https://wallet.trezor.io/#/  hard wallets

I understand Jaxx is also working on a BCC wallet http://decentral.ca/jaxx-statement-bitcoin-cash-bch/

Any recommendations for ease in importing private keys and addresses, or even any that simply use the seed words to access BCC?


Title: Re: Electrum Private Key
Post by: kolloh on July 31, 2017, 01:42:23 AM
Thanks Kolloh. Very reassuring with all the conflicting information around. I didn't want to experiment with my Bitcoin wallet with just hours to go before the BIP148 UASF/SegWit implementation and the subsequent hard fork.

So let me get this right - the sequence of securing Bitcoin Cash would be something like this:
1) After the fork install a new Electrum wallet and send all your existing BTC from your old wallet to it;
2) Install a BCC wallet (or BCH as it is now being called);
3) In your old wallet, click on the 'Wallet' tab > 'Private Keys' tab > 'Export' tab to reveal the private keys and addresses;
4) Copy and paste each private key individually and import them one-by-one into the BCC wallet using the 'Import' function;
5) Copy and paste each address individually and import them one-by-one into the BCC wallet using the 'Import' function;

or copy and paste the whole lot in one go straight into the BCC wallet, if that wallet allows it. Have I got it right?

For anyone who is interested, here's a list of links leading to wallets recognising BCC from the https://www.bitcoincash.org/ website:
Bitcoin ABC https://www.bitcoinabc.org/
Bitcoin Classic https://bitcoinclassic.com/downloads/bcc/
Bitcoin Unlimited https://www.bitcoinunlimited.info/download
Bitcoin XT https://bitcoinxt.software/
Electron Cash http://www.electroncash.org/
BTC.com https://wallet.btc.com/#/setup/register
Freewallet https://freewallet.org/
Coinomi https://coinomi.com/ ... and the
Ledger https://www.ledgerwallet.com/  and
Trezor https://wallet.trezor.io/#/  hard wallets

I understand Jaxx is also working on a BCC wallet http://decentral.ca/jaxx-statement-bitcoin-cash-bch/

Any recommendations for ease in importing private keys and addresses, or even any that simply use the seed words to access BCC?

Yep, those steps are accurate. Although step 5 likely won't be necessary as importing the private keys should import the corresponding addresses as well.

I'm not sure which BCC wallet I'll try to use yet, it looks like Electron Cash is still Coming Soon.


Title: Re: Electrum Private Key
Post by: HCP on July 31, 2017, 04:33:25 AM
I'm not sure which BCC wallet I'll try to use yet, it looks like Electron Cash is still Coming Soon.
They have their github up: https://github.com/fyookball/electrum

Personally, I just copied my Bitcoin Core blockchain folder and installed a copy of BitcoinABC and set it up to use the copy of the blockchain folder. I'll probably end up pruning it to save some harddrive space :P


Title: Re: Electrum Private Key
Post by: Flanagan on July 31, 2017, 10:14:43 AM
Supposing one doesn't want to take any risks at all, EVEN if they don't gain any Bitcoin Cash nor wish to risk doing any transactions with BCC at all, not even selling them to increase BTC amount.

- Would just keeping the current Electrum wallet that contains BTC without doing anything until situation clears in the next few days, weeks or months be a sure way not to lose any BTC ?
By current Electrum wallet I mean not transferring to a new wallet or anything, just having wallet as it is with the nmemonic key and password safely stored in paper ? Not doing any sending or receiving at all during that time.

This is a "minimalist strategy to keep your btc safe on Electrum on and after August 1st". Please give me your opinion/feedback, thanks.


Title: Re: Electrum Private Key
Post by: HCP on July 31, 2017, 11:02:43 AM
- Would just keeping the current Electrum wallet that contains BTC without doing anything until situation clears in the next few days, weeks or months be a sure way not to lose any BTC ?
Assuming that your computer isn't compromised by malware etc, then yes, that would work... If you have no interest in BCC, then you don't need to do anything out of the ordinary. Your BTC will remain safe in Electrum.

And, in the, highly unlikely, event that something happens to the Electrum network, you have easy access to your private keys and can move your keys to another BTC wallet.


Title: Re: Electrum Private Key
Post by: a_cat_named_joe on July 31, 2017, 11:07:06 AM
After all this effort in trying to be ultra-precautious, now this: https://www.reddit.com/r/Bitcoin/comments/6qk64y/fired_up_electrum_idly_clicked_on_console_got_this/ (https://www.reddit.com/r/Bitcoin/comments/6qk64y/fired_up_electrum_idly_clicked_on_console_got_this/) and this: https://cointelegraph.com/news/bitcoin-wallets-trezor-electrum-issue-contradictory-statements-regarding-bitcoin-cash (https://cointelegraph.com/news/bitcoin-wallets-trezor-electrum-issue-contradictory-statements-regarding-bitcoin-cash)

Bitcoin Cash servers in Electrum! "From the official team who are managing Electrum, someone has taken the source code on GitHub and altered it to support Bitcoin Cash." Apparently, as reassurance, Electrum won't recognise Bitcoin Cash headers after the fork. On Reddit Etmetm posted this advice: "This is not a problem. Electrum 2.9 has fork detection and this cash node will not work after the fork as the headers will be refused ... Even pre-2.9 will refuse the headers of Bitcoin Cash (once difficulty is adjusted prematurely), so nothing to worry about ... In fact the author of electrumx (the most widely used server backend) has also implemented quick splitting, so the cash nodes should not appear in the server list of electrum much longer after the fork ... If you've manually connected to a node running bitcoin-abc (Bitcoin Cash) it should not accept your transaction and show an error. You'd then need to connect to a different server. Auto-connect will not keep you connected to a bitcoin-abc node post fork as the headers don't match up."

To be on the safe side, if that's possible, I'm going to manually connect to a non-Bitcoin Cash server from now on with my pre-2.9 wallet. Maybe this should be the focus of a new thread. And here's a warning to avoid installing the Electron Cash wallet on the same computer as your Electrum wallet: https://twitter.com/electrumwallet/status/891935330235973633 ... and the latest Electrum instructions on how to redeem Bitcoin Cash - July 31st: https://electrum.org/bcc2.txt ... it seems that you can safely use your seed in Electron Cash if you follow these instructions.


Title: Re: Electrum Private Key
Post by: fedoros on July 31, 2017, 01:21:05 PM
Guys , need your help urgently, please. I have downloaded electrum 2.9.0 portable for Windows(since standrat exe version crashes after launch). When i was creating a wallet i only entered password for wallet encryption, no seed, no 2fa was shown to me.
Right now, i have moved all my coins from exchange to my electrum portable wallet and i am unable to export private keys.

I tried doing Wallet -> Private Keys -> Export {enter password}, but after i enter password nothing happens. No files in my electrum wallet dir.

There are 6 different addresses for all my btc holdings. What do i do now to be safe for 1 August and to be sure i get my BCC with private keys? Do i need to download another wallet that is capable of giving me my private keys ?

I have read a warn announce about moving BTC before importing private keys to BCC wallets, thanks a lot for that tip. Is that true ? Where can i read about replay protection ?


Title: Re: Electrum Private Key
Post by: Wandika on July 31, 2017, 01:24:50 PM
I thought electrum will support BCC and BTC at the same time and storing my bitcoin there will guarantee the safety of my assets. I only save my seed for my wallet. Is there a chance that my BTC will stuck in my electrum wallet??


Title: Re: Electrum Private Key
Post by: Flanagan on July 31, 2017, 04:15:10 PM
- Would just keeping the current Electrum wallet that contains BTC without doing anything until situation clears in the next few days, weeks or months be a sure way not to lose any BTC ?
Assuming that your computer isn't compromised by malware etc, then yes, that would work... If you have no interest in BCC, then you don't need to do anything out of the ordinary. Your BTC will remain safe in Electrum.

And, in the, highly unlikely, event that something happens to the Electrum network, you have easy access to your private keys and can move your keys to another BTC wallet.


Thanks very much for your guidance !
My Desktop Electrum is on a Linux PC and as from now am not connecting it again to check balances or anything (had to do so a while ago today to make sure had confirmed -more than 30 confirmations- receipt of what I withdrew, ALL BTC, from exchanges). The PC will remain disconnected completely, and the wallet file is also on an usb stick and deleted in the PC itself. Of course I have nmemonic key and password on paper. Crossing my fingers...I don't care if I don't make any money fooling around with my private keys and BCC, if that entails ANY sort of risk for my BTC long term HODL HODL HODL position.


Title: Re: Electrum Private Key
Post by: Flanagan on July 31, 2017, 04:19:44 PM
Guys , need your help urgently, please. I have downloaded electrum 2.9.0 portable for Windows(since standrat exe version crashes after launch). When i was creating a wallet i only entered password for wallet encryption, no seed, no 2fa was shown to me.
Right now, i have moved all my coins from exchange to my electrum portable wallet and i am unable to export private keys.

I tried doing Wallet -> Private Keys -> Export {enter password}, but after i enter password nothing happens. No files in my electrum wallet dir.

There are 6 different addresses for all my btc holdings. What do i do now to be safe for 1 August and to be sure i get my BCC with private keys? Do i need to download another wallet that is capable of giving me my private keys ?

I have read a warn announce about moving BTC before importing private keys to BCC wallets, thanks a lot for that tip. Is that true ? Where can i read about replay protection ?

I know of the desktop version in Linux that when you first create a wallet you always are given a random series of words, which I think is called the wallet seed, and you are asked to enter them again before the next step which is you creating a password which you will need to use when you want to do anything with the wallet. If this hasn't happened in your mobile version you will need to look into the FAQ at the Electrum site and also the section on these forums for Electrum. But you SHOULD have that seed, that series of words which allows you to recover your wallet from scratch in case you delete the wallet file.


Title: Re: Electrum Private Key
Post by: HCP on August 01, 2017, 02:04:33 AM
I thought electrum will support BCC and BTC at the same time and storing my bitcoin there will guarantee the safety of my assets. I only save my seed for my wallet. Is there a chance that my BTC will stuck in my electrum wallet??
No... ThomasV put support in Electrum for multiple forks... but BCC devs put replay protection in BCC network that effectively makes it IMPOSSIBLE to generate a transaction in Electrum that will broadcast on BCC network. The transactions need to be made in a different way. ThomasV does not want to include BCC funtionality in Electrum: https://electrum.org/bcc.txt

There is no chance that your BTC will be stuck in Electrum. It will continue to operate properly with BTC.

If you want to get BCC, you need to get a BCC wallet and use your seed/private keys there... but I would suggest you follow ThomasV's suggestion and move all your BTC to a new seed/private keys first, and use your OLD seed/private keys in BCC wallet (just in case BCC wallet is "bad"™ and tries to steal your seed/private keys): https://electrum.org/bcc2.txt


Title: Re: Electrum Private Key
Post by: shakeyman on August 03, 2017, 05:17:27 PM
Did anybody succeed in claiming the BCC so far??

I didnīt manage to do so
Hereīs what I did.

- Waited till the fork was confirmed.
- Moved all my BTC from exodus to another wallet to keep them safe (waited for at least 10 confirmations)
- exported the private key from the exodus wallet
- installed bitcoin abc -> downloaded the whole blockchain which took 24h
- imported my private exodus key via console (importprivkey)
- waited another 30mins
- there are just transactions found before august 1st
- my balance is 0 bcc

any idea what to do?
Tried electron cash as well didnīt work


Title: Re: Electrum Private Key
Post by: HCP on August 04, 2017, 07:33:39 AM
Then you don't have the correct private key(s)... When you moved all the BTC from exodus to another wallet... you should be able to see the Public Address(es) that controlled the coins that were used as input(s) to that transaction.

If the private key(s) that you are attempting to import are NOT the key(s) matching the Public Address(es) used in that transaction, then your BCC will not show up.

Also, you might like to check the input addresses here: http://blockdozer.com/insight/ or here: https://blockchair.com/bitcoin-cash/blocks and see if the BCC is still showing as being associated with the addresses.

Finally, what block did your BTC transaction get confirmed in? It needed to be in block 478559 or later.


Title: Re: Electrum Private Key
Post by: russianjohn on September 02, 2017, 08:42:16 AM
So, does the export of private keys work? I click export, inter password and nothing happens. I use last version Electrum portable on Windows 10. One month ago everything worked.


Title: Re: Electrum Private Key
Post by: 2dMoond on March 08, 2018, 08:08:39 AM
Hey , guys!
Does anyone know how to export private key from Electrum OFFLINE wallet?
I can easily dump all 26 pre-generated addresses, but not the one that BTC is currently stored. Had many transaction already...


Title: Re: Electrum Private Key
Post by: HCP on March 08, 2018, 08:48:23 AM
You need to force Electrum to generate addresses until you find the want you want...

In the console tab ("View -> Show console") try the following command:
Code:
for x in range(0, 10): print(wallet.create_new_address(False))

That will generate another 10 "receive" addresses... if you don't see the address you need/want, then try:
Code:
for x in range(0, 10): print(wallet.create_new_address(True))

That will generate another 10 "change" addresses... if you still don't see the address you need/want, then alternate between the "False" and "True" commands until you find it ;) (or change the number to 100 to bulk generate addresses! :P)


Title: Re: Electrum Private Key
Post by: 2dMoond on March 08, 2018, 10:27:02 AM
You need to force Electrum to generate addresses until you find the want you want...

In the console tab ("View -> Show console") try the following command:
Code:
for x in range(0, 10): print(wallet.create_new_address(False))

That will generate another 10 "receive" addresses... if you don't see the address you need/want, then try:
Code:
for x in range(0, 10): print(wallet.create_new_address(True))

That will generate another 10 "change" addresses... if you still don't see the address you need/want, then alternate between the "False" and "True" commands until you find it ;) (or change the number to 100 to bulk generate addresses! :P)

WOW! It worked out! Thanks for such a brilliant answer.
Give me please a console command to dump a privkey of a certain wallet address.


Title: Re: Electrum Private Key
Post by: Abdussamad on March 08, 2018, 11:53:43 AM
it would be easier to just right click on the address on the addresses tab and choose the option to view the private key. if the addresses tab isn't visible go to view menu > show addresses.

you can search for the address on the addresses tab using ctrl+f


Title: Re: Electrum Private Key
Post by: bob123 on March 08, 2018, 05:33:11 PM
Give me please a console command to dump a privkey of a certain wallet address.

After you have generated all the addresses which have a balance,
you can use this (slightly more elegant) command to dump all the private keys which contain some coins:

Code:
dumpprivkeys( map(lambda x:x.get('address'), listunspent()) )