<p><a href="https://bitcointalk.org/index.php?topic=2424484.0" rel="nofollow noreferrer">here</a> is very detailed tutorial on how to salvage your bitcoin gold coins from 2FA electrum wallet.</p>

CC BY-SA 3.0
2018-01-09T12:08:42.940Z
2018-01-09T12:08:42.940Z
scagbackbone
<p>Firstly, I really hope those private keys in your answer are not real private keys from your wallet, because posting real private keys on here will guarantee you will get your coins stolen.</p>

<p>Do your addresses in electrum all start with a 1 or a 3? I am assuming they start with a 1, because addresses which start with a 3 are P2SH addresses and are a bit more complicated to export/import.</p>

<blockquote>
  <p>However, I get Invalid private key encoding (code -5) error from bitcoin-qt when trying to import my master private key.( into bitcoin gold core wallet)</p>
</blockquote>

<p>I don't think there's a way to import a master private key into bitcoin core (or any forks of it) currently, you can only import individual address private keys. As a side note, be EXTREMELY careful when importing private keys into wallet software which has not necessarily been securely reviewed/tested (e.g. <a href="https://news.bitcoin.com/bitcoin-gold-wallet-stole-private-keys-scooped-3-3-million/" rel="nofollow noreferrer">https://news.bitcoin.com/bitcoin-gold-wallet-stole-private-keys-scooped-3-3-million/</a>).</p>

<blockquote>
  <p>Which private key is the one that I should get, so that I can import it to bitcoin-qt wallet? Is this even the right approach? I tried first two of mentioned 27 addresses but none of them worked.</p>
</blockquote>

<p>The private keys should be in Base58 encoded Wallet Import Format (WIF). From the <a href="https://en.bitcoin.it/wiki/Private_key" rel="nofollow noreferrer">bitcoin wiki</a>:</p>

<blockquote>
  <p>For private keys associated with uncompressed public keys, they are 51 characters and always start with the number 5 on mainnet (9 on testnet). Private keys associated with compressed public keys are 52 characters and start with a capital L or K on mainnet (c on testnet). This is the same private key in (mainnet) wallet import format</p>
</blockquote>

<p>So it appears your private keys in the question are not valid because they are only 51 characters long not 52. But if you did not get an error when importing, it is more likely that your private keys simply do not have a balance.</p>

CC BY-SA 3.0
2018-01-09T07:57:54.223Z
Nope, they're **not** my private keys. My problem was actually 2FA electrum wallet - meaning that my coins were trapped in multisig chamber.
scagbackbone
CC BY-SA 3.0
2018-01-09T08:09:43.483Z
@scagbackbone ah yep, I did wonder which is why I made a point about it starting with a 1 or a 3. If you've solved the problem please post how you did it so that the question is answered for the next person who reads it :)
meshcollider
CC BY-SA 3.0
2018-01-09T08:38:25.057Z
I already edited my question to point to a comprehensive tutorial. Thanks for contribution.
scagbackbone
CC BY-SA 3.0
2018-01-09T09:21:35.157Z
@scagbackbone please post it as an answer and accept your answer so that the question doens't remain unanswered though :)
meshcollider
CC BY-SA 3.0
2018-01-05T02:43:23.047Z
2018-01-05T02:43:23.047Z
meshcollider
<p>I have an electrum 2FA wallet. </p>

<p>When I list my addresses I get a list of around 30 addresses. (commnand below)</p>

<pre><code>electrum -w /path/to/my/wallet/file/default1 listaddresses
</code></pre>

<p>Then I use the below command to obtain private keys from a particular address:</p>

<pre><code>electrum getprivatekeys -w /path/to/my/wallet/file/default1 "myaddress"
</code></pre>

<p>Which private key is the one that I should get, so that I can import it to bitcoin-qt wallet? Is this even the right approach?</p>

<p>I tried first two of mentioned 27 addresses but none of them worked.</p>

<p>UPDATE:</p>

<p>Also when I export my master private key from electrum:</p>

<pre><code>electrum getmasterprivate -w /home/path/to/my/wallet
</code></pre>

<p>However, I get <strong>Invalid private key encoding (code -5)</strong> error from bitcoin-qt when trying to import my master private key.( into bitcoin gold core wallet)</p>

<p>UPDATE 2:</p>

<p>I tried to get private keys from all (27)addresses and then run this command to import them all:</p>

<pre><code>importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' false
importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' false
importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' true
</code></pre>

<p>output of command was 'null', yet my coins were not imported. Balance is still zero.</p>

<bitcoin-core><electrum>
which private key to export from electrum?
scagbackbone
# which private key to export from electrum?

(Asked by: username_0 on 2017-11-18)

I have an electrum 2FA wallet.

When I list my addresses I get a list of around 30 addresses. (commnand below)

```
electrum -w /path/to/my/wallet/file/default1 listaddresses

```

Then I use the below command to obtain private keys from a particular address:

```
electrum getprivatekeys -w /path/to/my/wallet/file/default1 "myaddress"

```

Which private key is the one that I should get, so that I can import it to bitcoin-qt wallet? Is this even the right approach?

I tried first two of mentioned 27 addresses but none of them worked.

UPDATE:

Also when I export my master private key from electrum:

```
electrum getmasterprivate -w /home/path/to/my/wallet

```

However, I get **Invalid private key encoding (code -5)** error from bitcoin-qt when trying to import my master private key.( into bitcoin gold core wallet)

UPDATE 2:

I tried to get private keys from all (27)addresses and then run this command to import them all:

```
importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' false
importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' false
importprivkey  L3285rshf9LgkMfaNogEARoJpGhGVMMKd1dQgRgrtGd7EQ8F4qW '' true

```

output of command was 'null', yet my coins were not imported. Balance is still zero.

**Tags:** bitcoin-core, electrum


---

## 2 answers

### Answer by username_0 on 2018-01-09. Score: 1 | Accepted answer

[here](https://bitcointalk.org/index.php?topic=2424484.0) is very detailed tutorial on how to salvage your bitcoin gold coins from 2FA electrum wallet.


---

### Answer by username_1 on 2018-01-05. Score: 0

Firstly, I really hope those private keys in your answer are not real private keys from your wallet, because posting real private keys on here will guarantee you will get your coins stolen.

Do your addresses in electrum all start with a 1 or a 3? I am assuming they start with a 1, because addresses which start with a 3 are P2SH addresses and are a bit more complicated to export/import.

> However, I get Invalid private key encoding (code -5) error from bitcoin-qt when trying to import my master private key.( into bitcoin gold core wallet)

I don't think there's a way to import a master private key into bitcoin core (or any forks of it) currently, you can only import individual address private keys. As a side note, be EXTREMELY careful when importing private keys into wallet software which has not necessarily been securely reviewed/tested (e.g. <https://news.bitcoin.com/bitcoin-gold-wallet-stole-private-keys-scooped-3-3-million/>).

> Which private key is the one that I should get, so that I can import it to bitcoin-qt wallet? Is this even the right approach? I tried first two of mentioned 27 addresses but none of them worked.

The private keys should be in Base58 encoded Wallet Import Format (WIF). From the [bitcoin wiki](https://en.bitcoin.it/wiki/Private_key):

> For private keys associated with uncompressed public keys, they are 51 characters and always start with the number 5 on mainnet (9 on testnet). Private keys associated with compressed public keys are 52 characters and start with a capital L or K on mainnet (c on testnet). This is the same private key in (mainnet) wallet import format

So it appears your private keys in the question are not valid because they are only 51 characters long not 52. But if you did not get an error when importing, it is more likely that your private keys simply do not have a balance.

> **Comments:**
> **username_0**: Nope, they're **not** my private keys. My problem was actually 2FA electrum wallet - meaning that my coins were trapped in multisig chamber.  
> **username_1**: @username_0 ah yep, I did wonder which is why I made a point about it starting with a 1 or a 3. If you've solved the problem please post how you did it so that the question is answered for the next person who reads it :)  
> **username_0**: I already edited my question to point to a comprehensive tutorial. Thanks for contribution.  
> **username_1**: @username_0 please post it as an answer and accept your answer so that the question doens't remain unanswered though :)  

---

