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.
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:
- While connected to the Internet, go to http://bitaddress.org in your web browser.
- Near the lower-right corner of the page, there is a link to "GitHub Repository." Click it.
- 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).
- Now click the "Raw" button, and you will see the raw (unformatted) source file (with no line numbers or any other page decorations).
- Right-click on any blank (whitespace) area in that raw listing and select "Save As..." (in Chrome; or the equivalent action in your browser).
- 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.
- After the file is downloaded, disconnect your computer entirely from the internet.
- 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.
- 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.
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.
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.