<p>Install electrum on the offline system and import the private key into that. Then run the deseed command to create a watch only version of the wallet: </p>

<pre><code>electrum deseed
</code></pre>

<p>(You can also explicitly specify a wallet file using the -w switch)</p>

<p>Then you move the seedless wallet to an online system and create a transaction there, save it to a USB drive, open it up and sign it on the offline system and save the signed transaction on the USB drive for broadcast using the online system. Yes it is convoluted but it works.</p>

CC BY-SA 3.0
2013-12-05T00:59:08.660Z
After installing electrum on the offline system and importing the key, `mktx` reports "Not enough funds", which is fair enough since the offline client has no way of knowing how much is available on the corresponding address. So this doesn't work.
user10113
CC BY-SA 3.0
2013-12-05T11:48:39.410Z
@user10113 I corrected my answer.
Abdussamad
CC BY-SA 3.0
2013-12-04T18:15:21.717Z
2013-12-05T11:48:01.750Z
2013-12-05T11:48:01.750Z
Abdussamad
<p>Creating a manual offline transaction isn't super difficult, you just need to be careful and think about what you're doing.</p>

<p>Make sure you have the public bitcoin address and the private key before continuing.</p>

<p>Here's what I do (This assumes you are sending some BTC to one address, some back to yourself as change and some as a transaction fee)</p>

<ol>
<li>Create a bootable Live linux CD</li>
<li>Download <a href="https://github.com/brainwallet/brainwallet.github.com/archive/master.zip" rel="noreferrer">https://github.com/brainwallet/brainwallet.github.com/archive/master.zip</a> and save it to a USB memory stick.</li>
<li>Open <a href="https://blockchain.info/unspent?address=1publicbitcoinaddress" rel="noreferrer">https://blockchain.info/unspent?address=1publicbitcoinaddress</a> and pasted it into a text editor</li>
<li>This (from 3) is a list of all the unspent transactions for the bitcoin address, I like to manually pick the transactions I want to use as inputs.  eg. if I want to send 1 bitcoin, I might reference a 0.5 and an 0.6 BTC transaction rather than a 5BTC transaction.</li>
<li>Remember that the transactions are in 1/100,000,000ths of a bitcoin.</li>
<li>Remove the transactions you don't want to use as inputs, to do this, delete the transaction from the text editor including the "{" and the "},"</li>
<li>If you removed the last transaction in the list, check that there isn't a comma after the last transaction.</li>
<li>Save the contents of this text file to the USB stick with the brainwallet code.</li>
<li>Shut Down, disconnect your computer from the network, disconnect the hard drive(s) and boot into the live linux CD.</li>
<li>Open the brainwallet code in an internet browser</li>
<li>If your private key starts with a 5 (uncompressed) or an L (compressed), skip onto step 15.</li>
<li>You need to convert your private key to a format which starts with a 5 or an L.</li>
<li>If it's a 64 character hex code, type it into the "secret exponent" section of the generator tab and copy the private key.</li>
<li>If it's a brainwallet (passphrase), type your passphrase into the "passphrase" section of the generator tab and copy the private key</li>
<li>Go to the transactions tab</li>
<li>Type in the private key, click Cancel when asked to download the transaction history (it won't work as you're air gapped anyway).</li>
<li>Verify that the "Source address" is your bitcoin address</li>
<li>Click "Edit Inputs" and paste in the test of the unspent transactions.</li>
<li>The BTC box next to source address will update to show the value of the transactions you've selected - This is the number of bitcoins you will loose if you mess up transaction fees, so be careful.</li>
<li>Take the number of bitcoins from 19 and subtract your transaction fee (eg: 0.0003) - The result is the number of BTC you need to spend (including change).</li>
<li>Edit the Destination address to be the address you want to pay and set the amount.</li>
<li>Click the [+] button to add another destination address and enter your bitcoin address (for change) and set the amount to be the result from 20 minus the payment to your destination.</li>
<li>Now, on a calculator, add up the two payment amounts and add in your transaction fee.  This should perfectly match the amount in the reference transactions from step 19.</li>
<li>Scroll to the bottom and click Re-sign.  This signs the transaction.</li>
<li>Copy the contents of "Raw Transaction" to a text editor and save it to a USB stick</li>
<li>Shut down, reconnect hard drives, networks and boot up.</li>
</ol>

<p>You now have a signed transaction which is not yet on the bitcoin network.  You now need to push it onto the bitcoin network.</p>

<p>We will do a final test of the transaction.</p>

<ol>
<li>Visit <a href="https://blockchain.info/decode-tx" rel="noreferrer">https://blockchain.info/decode-tx</a> (title should be <em>Decode Raw</em> Transaction)</li>
<li>Paste in the raw transaction and click "Submit Transaction"</li>
<li>Scroll to the bottom of the result and check the following:</li>
<li>vout_sz is the number of destination addresses (it does not include transaction fees)</li>
<li>hash is the transaction hash which will be searchable on blockchain.info, etc (once submitted)</li>
<li>vin_sz is the number of input transactions you referenced</li>
<li>out contains sections (per destination address), so check the "address" values are what you expected to pay coins to.</li>
<li>Also add up the "value" sections and divide them by 100,000,000 to get the total bitcoins to be sent (the difference between this and all the referenced inputs will be paid as mining fees)</li>
</ol>

<p>If you are completely happy with the above checks, you can now broadcast the transaction.</p>

<ol>
<li>Go to <a href="https://blockchain.info/pushtx" rel="noreferrer">https://blockchain.info/pushtx</a> (Title is <em>Broadcast</em> Transaction)</li>
<li>Paste in the raw transaction and click Submit.</li>
<li>It should say "Transaction accepted" if all was good.</li>
</ol>

CC BY-SA 3.0
2013-12-05T01:06:37.317Z
Thank you for this detailed answer. I'm still scared because none of these steps show the bitcoin value, and forgetting a zero will result in 90% of my transfer being offered as a fee... Plus, blockchain's decode-tx doesn't show the fee amount :(  I do hope I can multiply/divide by 100,000,000 without messing it up though :)
user10113
CC BY-SA 3.0
2013-12-05T01:28:32.330Z
You don't need to remove the unused input transactions, but most tools, including the brainwallet tool will reference all the transactions rather than the most relevant ones.
John
CC BY-SA 3.0
2013-12-04T20:26:34.197Z
2013-12-04T20:26:34.197Z
John
<p>Armory supports offline transactions nicely, but doesn't support compressed keys.</p>

<p>A number of other ways exist for creating offline transactions, but all of them - every single one I've seen - requires one to manually create a raw transaction. This has previously resulted in accidentally sending a huge fee, and I've seen people say <strong>"do <em>NOT</em> create a raw transaction unless you're a bitcoin expert"</strong>.</p>

<p>I'm no bitcoin expert, that's for sure. How do I make sure I create a "safe" transaction offline? I've seen Brainwallet's and Coinbase's services, are these foolproof? They show some JSON but I'm not exactly sure I would spot if something was amiss in that JSON...</p>

<offline>
How to safely spend from a compressed key offline?
user10113
# How to safely spend from a compressed key offline?

(Asked by: username_0 on 2013-12-04)

Armory supports offline transactions nicely, but doesn't support compressed keys.

A number of other ways exist for creating offline transactions, but all of them - every single one I've seen - requires one to manually create a raw transaction. This has previously resulted in accidentally sending a huge fee, and I've seen people say **"do *NOT* create a raw transaction unless you're a bitcoin expert"**.

I'm no bitcoin expert, that's for sure. How do I make sure I create a "safe" transaction offline? I've seen Brainwallet's and Coinbase's services, are these foolproof? They show some JSON but I'm not exactly sure I would spot if something was amiss in that JSON...

**Tags:** offline


---

## 2 answers

### Answer by username_2 on 2013-12-04. Score: 5 | Accepted answer

Creating a manual offline transaction isn't super difficult, you just need to be careful and think about what you're doing.

Make sure you have the public bitcoin address and the private key before continuing.

Here's what I do (This assumes you are sending some BTC to one address, some back to yourself as change and some as a transaction fee)

1. Create a bootable Live linux CD
2. Download <https://github.com/brainwallet/brainwallet.github.com/archive/master.zip> and save it to a USB memory stick.
3. Open <https://blockchain.info/unspent?address=1publicbitcoinaddress> and pasted it into a text editor
4. This (from 3) is a list of all the unspent transactions for the bitcoin address, I like to manually pick the transactions I want to use as inputs. eg. if I want to send 1 bitcoin, I might reference a 0.5 and an 0.6 BTC transaction rather than a 5BTC transaction.
5. Remember that the transactions are in 1/100,000,000ths of a bitcoin.
6. Remove the transactions you don't want to use as inputs, to do this, delete the transaction from the text editor including the "{" and the "},"
7. If you removed the last transaction in the list, check that there isn't a comma after the last transaction.
8. Save the contents of this text file to the USB stick with the brainwallet code.
9. Shut Down, disconnect your computer from the network, disconnect the hard drive(s) and boot into the live linux CD.
10. Open the brainwallet code in an internet browser
11. If your private key starts with a 5 (uncompressed) or an L (compressed), skip onto step 15.
12. You need to convert your private key to a format which starts with a 5 or an L.
13. If it's a 64 character hex code, type it into the "secret exponent" section of the generator tab and copy the private key.
14. If it's a brainwallet (passphrase), type your passphrase into the "passphrase" section of the generator tab and copy the private key
15. Go to the transactions tab
16. Type in the private key, click Cancel when asked to download the transaction history (it won't work as you're air gapped anyway).
17. Verify that the "Source address" is your bitcoin address
18. Click "Edit Inputs" and paste in the test of the unspent transactions.
19. The BTC box next to source address will update to show the value of the transactions you've selected - This is the number of bitcoins you will loose if you mess up transaction fees, so be careful.
20. Take the number of bitcoins from 19 and subtract your transaction fee (eg: 0.0003) - The result is the number of BTC you need to spend (including change).
21. Edit the Destination address to be the address you want to pay and set the amount.
22. Click the [+] button to add another destination address and enter your bitcoin address (for change) and set the amount to be the result from 20 minus the payment to your destination.
23. Now, on a calculator, add up the two payment amounts and add in your transaction fee. This should perfectly match the amount in the reference transactions from step 19.
24. Scroll to the bottom and click Re-sign. This signs the transaction.
25. Copy the contents of "Raw Transaction" to a text editor and save it to a USB stick
26. Shut down, reconnect hard drives, networks and boot up.

You now have a signed transaction which is not yet on the bitcoin network. You now need to push it onto the bitcoin network.

We will do a final test of the transaction.

1. Visit <https://blockchain.info/decode-tx> (title should be *Decode Raw* Transaction)
2. Paste in the raw transaction and click "Submit Transaction"
3. Scroll to the bottom of the result and check the following:
4. vout\_sz is the number of destination addresses (it does not include transaction fees)
5. hash is the transaction hash which will be searchable on blockchain.info, etc (once submitted)
6. vin\_sz is the number of input transactions you referenced
7. out contains sections (per destination address), so check the "address" values are what you expected to pay coins to.
8. Also add up the "value" sections and divide them by 100,000,000 to get the total bitcoins to be sent (the difference between this and all the referenced inputs will be paid as mining fees)

If you are completely happy with the above checks, you can now broadcast the transaction.

1. Go to <https://blockchain.info/pushtx> (Title is *Broadcast* Transaction)
2. Paste in the raw transaction and click Submit.
3. It should say "Transaction accepted" if all was good.

> **Comments:**
> **username_0**: Thank you for this detailed answer. I'm still scared because none of these steps show the bitcoin value, and forgetting a zero will result in 90% of my transfer being offered as a fee... Plus, blockchain's decode-tx doesn't show the fee amount :(  I do hope I can multiply/divide by 100,000,000 without messing it up though :)  
> **username_2**: You don't need to remove the unused input transactions, but most tools, including the brainwallet tool will reference all the transactions rather than the most relevant ones.  

---

### Answer by username_1 on 2013-12-04. Score: 0

Install electrum on the offline system and import the private key into that. Then run the deseed command to create a watch only version of the wallet:

```
electrum deseed

```

(You can also explicitly specify a wallet file using the -w switch)

Then you move the seedless wallet to an online system and create a transaction there, save it to a USB drive, open it up and sign it on the offline system and save the signed transaction on the USB drive for broadcast using the online system. Yes it is convoluted but it works.

> **Comments:**
> **username_0**: After installing electrum on the offline system and importing the key, `mktx` reports "Not enough funds", which is fair enough since the offline client has no way of knowing how much is available on the corresponding address. So this doesn't work.  
> **username_1**: @username_0 I corrected my answer.  

---

