2

I'm trying to move my bitcoins from Bitcoin Core to Electrum in order to not have to store the blockchain. My starting position is a fully synced Bitcoin Core and a newly created standard Electrum wallet (without any imports).

I'm using the debug console in Bitcoin Core to execute walletpassphrase to unlock my wallet, and dumpprivkey together with the address obtained from File > Receiving addresses...

Once Bitcoin Core spits out a private key I'm following the instructions here http://docs.electrum.org/en/latest/faq.html#can-i-sweep-private-keys-from-other-bitcoin-clients and pasting into the sweep input box and leaving the default address intact.

The exact error message I receive is:

No inputs found. (Note that inputs need to be confirmed)

Am I doing something stupid here? Is this even the best migration procedure?

3
  • 1
    The process looks okay. Not all receiving the addresses will necessarily have a current balance if that is what Electrum means to tell you. It is not necessarily necessary to use Sweep if your Bitcoin Core wallet addresses are not compromised (and your private keys continue to be protected in the future) then you can just use Import which will save paying transaction fees, although, if you do use sweep it is better to put all private keys in the box, one per line with enter in between, so that only one transaction is necessary. – Willtech Mar 12 '18 at 12:25
  • what version of bitcoin core are you using? can you share the address and transaction? – Adam Mar 12 '18 at 21:30
  • @willtech sweeping is better because you can easily backup your wallet by writing down the seed. – Abdussamad Mar 14 '18 at 12:02
1

Take a look at the private keys from your Bitcoin Core client. They should look like mine (the following are keys from the testnet):

cQHjhLkGQHQZUZFZYHfXjsXkfdNPoAd2X58sa2x95vEWssrvpPLi 
cVXThnV4XgJP7q1v3aVQacTkxHq96BpyoSCGPqMAyyJcVaGn93Zh 
cVCAYjR4E5qvzCa3f6VYZhsZNCgWQUDikfFCg4Fom6fnecRXxKM5 

Now go to your Electrum and take a look at your keys there (Wallet>>Private keys>>Export, you will find them to the right from your addresses). The should look more or less like mine:

p2wpkh:cNs6rHM6cd7iY3YizmpG2GHxctjKxFtLV9WANCLgtcCRzcQ8AC1b
p2wpkh:cSGaa8sWKSvSty6bR36XZzEQsMr5bNW78XYCaTs3h4xqbsoLGghx
p2wpkh:cTERSrc4euSox7Wtk75vVFwLBpf7oqbpwQPTxNGoEjLxjwL8JrMJ

They look like of a different type than the ones from your Bitcoin Core wallet. A single private key can lead to different addresses, depending on the script it is used in - these include p2pkh, p2wpkh, p2sh-p2wpkh. To realize that it is true create a new wallet in Electrum (File>>New/Restore>>Create..,choose option Import Bitcoin addresses or private keys) paste the unprepended private key from your Bitcoin Core wallet. Electrum should create a new non-HD wallet for you with only one address. This adrress will be a different one from the one from which you derrived your private key in Bitcoin Core client Electrum prepends the script type to the private key during export and import so that it knows which address to derive and check for outputs on.

Before sweeping prepend the private key from your Bitcoin Core wallet, that you got from the output of dumpprivkey "address", with p2wpkh:, like so: p2wpkh:cNbxok3SkFuSsbiiTqLj56Hp6bAhr2uJtr8aTkViBB3ghBMzQH3Y. Such prepended key paste into the sweep box and follow the instructions. You can replace the address given to you by Electrum with the one of your choice - it will work as well.

What is convenient in sweeping is that it will work even if you do not have any Bitcoin in your destination wallet. The fee will be taken from the source, in your case the UTXO from the address of your Bitcoin Core client.

2

Your coins are likely in a change address. You could do a dumpwallet in bitcoin core and then sweep all the private keys. But this is going to be slow going in electrum and you're going to have to do it in batches. Instead I suggest extracting the addresses which have unspent outputs in them by using the listunspent command in bitcoin core and then sweeping only those addresses' private keys. You can also do this via the cli and then use standard text processing commands to extract the addresses (jq, grep). To get it via the cli run bitcoind -daemon and then use bitcoin-cli listunspent

3
  • Why would the coins being in the change address matter? Do I have to have a balance in Electrum in order to pay the fee? Or can the key be subtracted from the Bitcoin Core's UTXOs? – Jerzy Brzóska Jul 18 at 16:39
  • @JerzyBrzóska Change addresses don't show up under receiving addresses in the GUI which is what the OP was using. The fee will come from the bitcoin core UTXOs. – Abdussamad Jul 19 at 18:30
  • Change addresses may not be given to the user when they do in the GUI: Receive>>New Address. Nevertheless, they are readily available for the user in the Addresses tab, below receiving addresses. Nevertheless, if the swiping attempted by @h0dges succeded he would not have received No inputs found. from Electrum, and the transaction would have increased their wallet's balance. From my understanding of their question none of the two was the case. – Jerzy Brzóska Jul 20 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.