## Cannot access my bitcoins because my wallet is still synchronising. What can I do to spend them immediately?

16

3

I have purchased bitcoins and have downloaded Bitcoin-QT, but my wallet is taking forever to synchronize to the network.

I can't access my wallet because it is still in the sync process. I have the record of me paying for the Bitcoins, the confirmation email, etc., and the address it has been sent to. I desperately want to start spending them. What can I do to gain access immediately without waiting for the synchronization to run its course?

– Murch – 2015-08-20T12:16:54.387

possible duplicate: My client stopped synchronizing, how can I access my wallet?

– Murch – 2015-08-20T12:20:13.557

@Murch But what is the goal in this question? As in, is the goal to make synchronization faster so coins show up, or to get the coins out of the wallet that is synchronizing and into a different wallet? I think it would be helpful if the question specified this. – morsecoder – 2015-08-20T13:39:18.387

@StephenM347: "I desperately want to start spending them" was key for me, but you are correct, it should be made clearer. Since the asker hasn't been here for more than 2.5 years, I think we can shape this question to our needs... What do you think about this version? – Murch – 2015-08-20T13:55:37.267

I had to do this once for a Dogecoin wallet that was way out of sync, and I didn't feel like waiting for it to catch up. I'll write an answer tonight or tomorrow describing what I did and maybe even giving a script to help do it. – morsecoder – 2015-08-21T14:23:30.397

8

One solution is to export (in your privacy) the private key connected to the address on which you received your Bitcoins (or simply all private keys). This can be done using a command line tool known as pywallet.

Then, you can import this key (or all your keys) into another wallet. Browser-based wallets such as https://blockchain.info/wallet do not require syncing. Hence you can immediately spent your coins. For the bĺockchain.info wallet the procedure is described on their website.

how do i find out my private key? i have encrypted my wallet.i have looked on the net for CLI interface but i dont understand. i have created a new online wallet and am hoping to export the bitcoins to that wallet if i can – Alex Jackson – 2013-01-08T12:44:11.933

2

@AlexJackson instructions for exporting private keys from bitcoin-qt are here http://bitcoin.stackexchange.com/a/5933/2531

– Don Park – 2013-01-08T17:41:18.527

4

I had to do this for a Dogecoin wallet that was very out of sync once. I will outline the steps that worked for me. My example will be for Bitcoin, though, since that's probably what most people will need.

Caution: this is a bit technical, but it works. Expect this to take probably 10-30 minutes. This also assumes you are using a standard Pay-To-Pubkey-Hash address (for bitcoin, this just means an address that starts with a 1).

1.

Obtain the address that you were sent coins to. This is an address that the unsynced Bitcoin-QT wallet previously generated. For this example, I will use

13x1ZipMJJbVawV7voCtW5qSoBUTwx13Nr


as my address that I need to get coins out of.

2.

Find the transaction TXID, output index, and amount of the coins you are trying to spend from the block explorer.

• To get the transaction ID, use the hex code at the top of the transaction box.
• To get the output index, count the transaction outputs from zero until you find your address. For example, in the transaction shown below, my 13x... address received coins in the first output, which means index zero. If it were in the second output, it would be index 1, etc.
• To get the amount, make sure you select "BTC" as the website units (in the top right). Then copy the amount from the output where you see your address receiving coins.

So for me, the important information here is:

txid:   83a1007401a6acb656668afc137b9c02ca023ae274e0f12abbc79395a89b6b79
index:  0
amount: 0.00231499


3.

The other piece of information that we need is the scriptPubKey. This is basically just a more low-level encoding of the address.

To get this, click the "+" icon to the left of the TXID (still on the same insight page as before). Under your address, it will say something like:

OP_DUP OP_HASH160 205799b3b8bdba5824b0129eec27450b0cfde7eb OP_EQUALVERIFY OP_CHECKSIG


Now the scriptPubKey that you want is using those middle 40 hex characters, plus a few more. The basic formula is:

scriptPubKey = "76a914" concat {{ hex chars from above }} concat "88ac"


So for my example, we have:

scriptPubKey: 76a914205799b3b8bdba5824b0129eec27450b0cfde7eb88ac


4.

Almost done!

Get the address you want to send the coins too. I will use

1PwFdFxP7uXrun8sToCrWXxVdpeDeX6dfq.


5.

Now we are going to create a transaction and send it out to the network.

Open up the unsynced Bitcoin-QT wallet (or start the bitcoind daemon), and go to the Help menu, and select Debug Console. In the window that opens, replace the appropriate fields, and then type:

createrawtransaction '[{ "txid": "{{ your txid }}", "vout": {{ your index }} }]' '{ "{{ your address from step 4 }}": {{ amount - fee }} }'


Typically, a fee of about 0.0001 applies.

So, for me this looks like:

createrawtransaction '[{ "txid": "83a1007401a6acb656668afc137b9c02ca023ae274e0f12abbc79395a89b6b79", "vout": 0 }]' '{"1PwFdFxP7uXrun8sToCrWXxVdpeDeX6dfq": 0.00221499}'


And the result is

0100000001796b9ba89593c7bb2af1e074e23a02ca029c7b13fc8a6656b6aca6017400a1830000000000ffffffff013b610300000000001976a914fb9570085ff3acfef21eac307223eaa499e1e21188ac00000000


Now we just have to sign it. This has to be done on the same daemon that generated the address, so that you have the private keys. Replace with your appropriate fields and then execute:

signrawtransaction {{ hex from createrawtransaction step above }} '[{ "txid": "{{ your txid }}", "vout": {{ your index }}, "scriptPubKey": "{{ your scriptPubKey }}" }]


So, for me this looks like:

signrawtransaction 0100000001796b9ba89593c7bb2af1e074e23a02ca029c7b13fc8a6656b6aca6017400a1830000000000ffffffff013b610300000000001976a914fb9570085ff3acfef21eac307223eaa499e1e21188ac00000000 '[{ "txid": "83a1007401a6acb656668afc137b9c02ca023ae274e0f12abbc79395a89b6b79", "vout": 0, "scriptPubKey": "76a914205799b3b8bdba5824b0129eec27450b0cfde7eb88ac" }]'


The result looks like:

0100000001796b9ba89593c7bb2af1e074e23a02ca029c7b13fc8a6656b6aca6017400a183000000006a4730440220000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000000012102e25c37498e9e62b2ebcc85780e10949eaacd29826b5ca97a1031ee22e55f0ab5ffffffff013b610300000000001976a914fb9570085ff3acfef21eac307223eaa499e1e21188ac00000000


6.

Using the final result of step 5, go to

https://live.blockcypher.com/btc-testnet/pushtx/

And enter the raw transaction hex. Select the "Bitcoin" network, hit the "Broadcast Transaction" button, and you will have successfully removed your coins from the unsynced wallet!

(I don't have any affiliation with any of the services used here, I just found them useful for this answer.)

3

Open the console on Bitcoin Core. Type dumpprivkey and the public address. It will give you the private key. Then import the private key to whatever thin client you want.

1You could even send the transaction from that same wallet if you create, sign and broadcast a raw transaction from the console. It is not something for someone wanting to make his first payment, but worth mentioning anyway. – Fernando Gutierrez – 2016-05-06T15:30:55.557

1

Find the wallet.dat file with generated public-private key pairs and run bitcoin client with the file on other machine.

1This is a good answer, but it should be explained a bit better. E.g. it should contain a warning to make a backup of the other wallet on the computer that has already synchronized. – Murch – 2015-12-22T09:49:07.863