8

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...

5

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.
  • 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 Dec 5 '13 at 1:06
  • 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 Dec 5 '13 at 1:28
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.

  • 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 Dec 5 '13 at 0:59
  • @user10113 I corrected my answer. – Abdussamad Dec 5 '13 at 11:48

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.