Saturday, February 23, 2013

Super-Easy Offline Bitcoin Wallets

In a previous post, I discussed Bitcoin brain wallets and described a way to generate them offline using the Casascius Bitcoin Address Utility.

Since then, I have learned about a much easier way to create brain wallets (and paper wallets) offline, by downloading a tool called BitAddress.org.  In this post I describe, step-by-step, how to download and use this tool offline.

Now, you can also just use BitAddress.org right there in your web browser while online.  But, the potential risk there is that if there was some malware on your computer (or if the BitAddress.org page itself were corrupted), it might send your secret brain-wallet passphrase or private key over the Internet to some attacker who might later steal any Bitcoins you later transfer into the accounts that you created while online.

To prevent this, you can download the source code to BitAddress.org, disconnect your computer from the Internet entirely, and then run the code offline to generate all the brain wallets and/or randomly-generated paper wallets that you need without any network exposure.

After you have printed out any backup copies you want, saved them to encrypted virtual drives on USB sticks, or what-not, you can then reboot your computer (or to be really, really safe, wipe its hard disk and reinstall its O/S), and then safely reconnect it to the Internet without having to worry about your private keys (and your Bitcoins) potentially getting stolen.

Thankfully, BitAddress.org makes it super-easy to run its code offline.  Here's how you do it:
  1. While connected to the Internet, go to http://bitaddress.org in your web browser.  
  2. Near the lower-right corner of the page, there is a link to "GitHub Repository."  Click it.
  3. The resulting page shows two files, a README text file, and a file called bitaddress.org.html which contains the HTML and embedded JavaScript source code.  Click the latter filename, and you will see a listing of the file contents (with line numers).
  4. Now click the "Raw" button, and you will see the raw (unformatted) source file (with no line numbers or any other page decorations).
  5. Right-click on any blank (whitespace) area in that raw listing and select "Save As..." (in Chrome; or the equivalent action in your browser).  
  6. In the save dialog, navigate to a convenient save location - your Desktop will do for now, although you might want to make an archival copy of the file somewhere else for later use.
  7. After the file is downloaded, disconnect your computer entirely from the internet.
  8. Then, drag-and-drop the file onto your web browser (onto an open window or the browser application icon).  Or you can select "Open File..." within the browser's menus and navigate to the file.  The browser should open a new tab pointing at a "file://" URL and load the page contents.
  9. Now, you are running the BitAddress.org page entirely offline!  Wiggle your mouse around a little bit right away, to generate some random bits to seed the random-number generator.
The page contents will then look something like this (although with different random data, of course):
BitAddress.org page (online or offline), after wiggling mouse to generate randomness.

Now, if you want to create a brain wallet, simply click the "Brain Wallet" tab.  Click the "Show" checkbox (for ease of typing - but make sure no one is spying on your first), type your passphrase, and click View to see the public address and private key for that brainwallet account.  For example:

Brain Wallet generation tab, after typing a passphrase and clicking the View button.

When satisfied, you can click the "Print" button to make a paper printout for safekeeping.  You can also  scan the QR codes into your smartphone, or just write down the public address and/or private key.  Or, you could just write down your passphrase - since you can always regenerate the private key from it.  Note that if you REALLY trust your memory for your passphrase, you might not need to record anything at all right now, except for the public Bitcoin address, which you will require in order to receive any Bitcoins into this brainwallet.  (You will have to give that address to whoever is sending you the Bitcoins.)

Another very useful feature of BitAddress.org which you can use offline is its paper wallet generation feature.  Click the "Paper Wallet" tab, and it will auto-generate for you several new Bitcoin accounts represented as beautiful "bit-bills."  They look like this:

A "bit-bill" generated by BitAddress.org's "paper wallet" option.

Isn't that just beautiful?  You can print these out, as many as you want, and make multiple photocopies of them as backups.  You could also cut out the credit-card sized left third ("Load & Verify" part, with the Bitcoin Address) of one of your copies, and carry it around with you, so that you can give that address out to people that you want to receive Bitcoins from.  At any time, you can receive Bitcoins to the address on the left, then write down how many you received in the "Amount" field, and whenever you are ready to spend, you can import the private key on the right into your favorite Bitcoin client to spend it.  (I recommend Blockchain.info and Electrum for casual users.)  And, even before you're ready to spend, you can import the address into a client like Blockchain.info as a "watch-only" address, to securely monitor the contents of the account (without risk of losing them).  

These kinds of private keys, generated offline using a high-quality, non-repeatable random source, and subsequently stored only on paper, are utterly (at least, until you import them into a client to spend them) unhackable by any electronic means.  (And actually, for added security, you can even spend coins in an offline manner by following the instructions here.)  These offline Bitcoins could only be stolen by physically stealing (or copying, or photographing) the private key.  You can keep them in safes, safety deposit boxes, bury them in your back yard, behind a brick in your Mom's basement, wherever you like.  You can make them as safe from accidental discovery or theft as you want them to be.  You can burn all paper copies and keep just a brainwallet passphrase in your brain (if you trust your memory that well; for good security your brainwallet passphrase must be VERY LONG).

One caveat:  To be totally confident in the security, you might want to examine the source code in the bitaddress.org.html file, to convince yourself that it is really using high-quality nonrepeatable random numbers, and that it isn't storing a copy of your private information on the computer's hard drive (in a browser cookie, say) where it might be retrieved later.  (As I mentioned earlier, if you're worried about the second possibility, you could always wipe your hard drive after generating your brainwallet or paper wallet.)

If you do keep a brain wallet, for maximum security it should ideally contain a full 256 bits' worth of true randomness.  This Facebook note describes a method that can be used for memorizing that amount of random data.  But for max security, you should probably generate your random data offline.  Here is one method for doing that using dice.

4 comments:

  1. I'v made a Dr. Evil version of paper wallet generator based on bitadddress.org: http://evilwallet.wordpress.com/

    ReplyDelete
  2. Hi Mike, Your technique is (slightly) improved using a computer that does not have and therefore cannot use a network driver. I have an old laptop that I use. It still has a wireless card, and my installation of Ubuntu keeps asking for the key to connect, but always cancel it. My fear is that something on that laptop still has the data I used to generate my private key. Hopefully no one ever connects it to the Internet, or, if they do, the data isn't available. But I'm extra paranoid!

    ReplyDelete
  3. Top 5 ERC20 Wallets To Store Your Ethereum Based Tokens. Guides, tutorials, tips aand tricks, how-to materials.

    ReplyDelete
  4. According to Stanford Medical, It's indeed the ONLY reason this country's women live 10 years longer and weigh 19 kilos less than we do.

    (And by the way, it is not about genetics or some hard exercise and really, EVERYTHING to do with "HOW" they are eating.)

    BTW, I said "HOW", and not "WHAT"...

    CLICK this link to determine if this little questionnaire can help you discover your real weight loss possibilities

    ReplyDelete