This is a bit advanced but if you follow the directions carefully, anyone can do this:
Principles:
- You've sent funds to a Bitcoin Core receiving address and then discovered that Bitcoin Core is NOT the wallet that you really want to use. Either because it takes a better part of a week to sync the blockchain or you just don't like the wallet.
- You don't want to wait for a full synchronization of the blockchain before transferring your funds
- Here is the procedure in a nutshell:
- Install a new bitcoin wallet (like BitPay)
- Open Bitcoin Core
- Open the debug console inside Bitcoin Core
- Gather some information
- Create a raw transaction
- Sign the raw transaction
- Broadcast the raw transaction
Steps:
- install a new wallet of choice, we recommend BitPay wallet, Electrum, or even Blockchain.info
- open a blank text file (in Notepad or TextEdit), we will be using this as a scratch pad
- cut and paste a RECEIVING address from your new wallet. It is essential that this address be a receiving address from your NEW wallet
- This is what a receiving address from BitPay’s Copay looks like:
- open Bitcoin Core (it is ok if it is not sync'ed)
- This is what Bitcoin Core looks like:
- find the address that had funds sent to it, you might only have a few addresses under the "Receive" section of Bitcoin Core. Those addresses might show up as "Recent payments history". You want to double click on each entry, then click "copy address".
- This is what the “Receive” section of Bitcoin Core looks like:
- Visit this web address: https://insight.bitpay.com. Paste each address into Insight to see if there are any unspent transactions to it. Unspent transactions is money that was sent to you that you haven't re-spent to someone else. Note, that the "(U)" means "Unspent" and "(S)" means "Spent". A spent output has another bitcoin transaction that came later that used that output as an input. The following screenshot will show you what an unspent transaction output looks like:
- if you found an address from your receiving window that has unspent funds, then proceed.
- copy and paste the transaction id of the transaction that has your unspent funds into your scratch file. Also note which output in the transaction has your funds and the amount of bitcoin in the scratch file (see the screenshot above)
- This is what the notepad looks like:
now, we need to get a piece of data from the internet about your last transaction. Go here: http://codebeautify.org/jsonviewer
- click the button that says "load url" and put in: https://insight.bitpay.com/api/tx/<txid> where txid is your transaction id
- This is what codebeautify.org looks like after you’ve pasted in the url for insight.bitpay.com:
- The resulting output in the right pane is what you want. Scroll down to the "vout" section. Look for the vout number (0 or 1 usually). Remember the vout index number is the one from the screenshot of the Insight Block Explorer above. If the output with your address and bitcoin amount was the first one listed in the transaction, then your vout is 0. If it was the second one, then your vout is 1 (the numbering is zero-based). Under the correct vout section (0 or 1 usually) in the JSON viewer look for "scriptPubKey". Under the scriptPubKey section, there is a "hex" section. Copy this to your scratch file along with the what vout your output was.
- This is what the scriptPubKey looks like after you’ve pasted it into the scratch pad:
- then again in Bitcoin Core, go to "Help" > "Debug Window", then click the "Console" tab
- you should see a white window with a text entry box at the bottom:
- This is what the debug window looks like:
- In this window, you are going to enter some commands and gather the output to your scratch text file (see step 2)
- first we are going to create a "raw transaction". This what a raw transaction looks like and the general format/template of what you will paste where the prompt “>” is:
- IMPORTANT!!! This value MUST be slightly less than the total amount that you noted in step 5. The reason for this that you need to include a transaction fee. Here is an example of what to do. If you were sent 1.0 BTC and you want to send ALL of that bitcoin away from Bitcoin Core's wallet, then take 1.0 and subtract a reasonable transaction fee
- createrawtransaction "[{\"txid\":\"f06feed8111dac8eebfd0f64157488e551a2d47f1c6679dbb0e77142c8f75290\",\"vout\":1}]" "{\"myeEsiV66AGaeoL8mQgDzJe8yQfCmNrtSX\":0.07}"
- BEFORE you paste this line, there are a couple of data items from your scratch file that you need to replace:
- replace the example txid, "f06feed8111dac8eebfd0f64157488e551a2d47f1c6679dbb0e77142c8f75290" with your transaction id
- replace the “vout” number 1 with your vout (vout's start at 0, then 1, etc.). Your vout will be 1 or 0, more than likely.
- replace the string, "myeEsiV66AGaeoL8mQgDzJe8yQfCmNrtSX" with your RECEIVING address from your NEW wallet. Be sure to retain the quote marks that surround the strings when replacing.
- Finally replace the 0.07 with the amount of bitcoin that you wish to send.
- Please consult this site for the correct fee: https://bitcoinfees.earn.com/ This is what this site looks like for the appropriate fee:
- You can see that the appropriate fee for a “normal” transaction is 106,220 satoshis or .00106220 BTC. At the time of this writing, this equates to $17.29. You can send the transaction with a lower fee, but the lower you make the fee, the less of a chance a Bitcoin miner will include the transaction in a block.
- It should go without saying that if the Bitcoin amount that you attempting to send is LESS THAN a reasonable fee, then don’t bother doing anything further until the fees on the Bitcoin decrease.
- When this string is altered, paste it into the console window and hit "enter". If all goes well, you will get a long string of characters representing a transaction.
- This is what it looks like when you paste your raw transaction string into the debug window:
- Paste this into your scratch text file. (this is an example): 01000000019052f7c84271e7b0db79661c7fd4a251e5887415640ffdeb8eac1d11d8ee6ff00100000000ffffffff01c0cf6a00000000001976a914c6d30435b954bc0c245a3b38ff62266abc8744ec88ac00000000
- If you get an error, you probably removed a quote mark or backslash accidentally. Check over your string carefully and try again.
- next, we will sign the transaction in preparation for broadcasting it. Copy the following line into the console after changing the key values:
- This is what it looks like after you’ve copied the raw transaction into the scratch pad:
- Now you will issue another command into the debug window:
- The command will consist of 3 parts:
- The command “signrawtransaction”
- The hex string you pasted in your scratch pad (the last item)
- An object consisting of the txid, vout, scriptPubKey of the transaction that originally sent the money (see below).
- This is a full example, be sure to substitute in the correct hex string raw transaction, txid, vout and scriptPubKey
- signrawtransaction "01000000019052f7c84271e7b0db79661c7fd4a251e5887415640ffdeb8eac1d11d8ee6ff00100000000ffffffff01c0cf6a00000000001976a914c6d30435b954bc0c245a3b38ff62266abc8744ec88ac00000000" "[{\"txid\":\"f06feed8111dac8eebfd0f64157488e551a2d47f1c6679dbb0e77142c8f75290\",\"vout\":1,\"scriptPubKey\":\"76a9146692dcd58018576f4fd8466c70ded8b65520df8d88ac\"}]"
- This is what it look like when you paste your string to sign:
- If there were no errors, you should have a signed transaction! This was the hard part. You just manually created a bitcoin transaction and used your private key to sign it. The output might look something like this: {"hex": "01000000019052f7c84271e7b0db79661c7fd4a251e5887415640ffdeb8eac1d11d8ee6ff0010000006b483045022100ded5b0407db31a8a807ea88200579afaeb3904b37dc59be1e5bd2c13be2bed04022073ea97ebb44182a721ebf610b7276ae8189eeeac43b665310643a8fa28f2c1d80121022a13f9cb0f5d9cf262afb16f7501b5f4eecbc87596189d8bbf4fe15745cc4ad6ffffffff01c0cf6a00000000001976a914c6d30435b954bc0c245a3b38ff62266abc8744ec88ac00000000", "complete": true}
- Common errors from this part include incorrectly choosing the scriptPubKey, missing a quote mark, or adding spaces in the string where there shouldn't be.
- In the case of errors, there will be an "errors" section in the output.
- An "unknown error" is indicative of not choosing the right scriptPubKey.
- This hex value can be sent directly to the Bitcoin network for inclusion in the blockchain. Copy that into your scratch text file.
- Finally, go to:, https://insight.bitpay.com/tx/send
- Paste in the hex string and click send transaction, this is what this looks like:
- You should then see a new incoming transaction in your new wallet
- You can repeat the process for each address sent to bitcoin core that has unspent outputs.
Comments
0 comments
Article is closed for comments.