Creating & Importing Paper Wallets

[size=16pt]The current version of this guide is now available on DevToMe.
Go here to find this article specifically.
Go here to see a list of articles I’ve written for DevToMe.
This tutorial, as presented below, may not be current, the DevToMe link is.
[/size]

How to Make an Offline Paper Wallet

Offline wallets are considered the most secure way to store digital cryptocurrency. But there seems to be much confusion about how to go about using them, this is my attempt to rectify that situation.

This guide is aimed at peercoin users, but it can be applied to any cryptocurrency forked from bitcoin for which you can find an offline wallet generator.
Securely generating an offline paper wallet

The reason paper wallets are considered the most secure is because they can be generated on a fresh, trusted operating system, without ever touching the internet.

The first step is to find which paper wallet you want to use. Where peercoin is concerned, I’ve found two available options.

FuzzyBear’s and this one.

I haven’t used either of these. The one I used to use is now defunct, so I can’t guarantee that either of these will work.

Test them with a small amount, and use at your own risk!

If I were to recommend one, I would go with FuzzyBear’s because he is a trusted long time member of the community, but he concedes that he just came up with this, and that it hasn’t been thoroughly tested.

That said…
Saving the Wallet as an HTML File

You’re going to save the html file located at whichever of the above websites you choose to your hard drive.

File > Save Page As (or Ctrl + S) – this is for Firefox. If you use a different browser the command may be worded differently.

Name it, it will end in .html, and remember where you stored it.

The next step is to put the html file you just saved on some form of media, so that it can be used when we turn off the internet. Most likely a flash drive. You’ll need your CD or DVD drive to boot up the Live CD later, but if you have two drives you could opt for a CD instead.

This is fundamental computing, but if you need help with this step send me a PM on bitcointalk or peercointalk forums username: Merockstar
Making a Live-CD

Make a Live-CD. I recommend any recent version of Ubuntu, but any trusted linux distribution should do.

Download the appropriate ISO file, and burn it to a CD.

Most CD burning programs have this capability.

Now you have your flashdrive/other media with the html file on it and a CD with a fresh, trusted operating system on it.
Learning how to boot from a cd and Going Offline

In preparation for the step after this, you need to know how to boot from a CD. This varies from computer to computer. If you don’t know how, you should google for instructions to boot from a CD for the specific computer that you own. Many computers default to the CD if it sees a CD it can boot from in the drive when you start it up. Some computers require you to go into the BIOS and change media boot preference. Some computers all you to do it by tapping an F-key, escape, del, or tab when starting up.

Now you’re going to go offline. Turn off your computer, you may want to open your CD tray and put your boot disk in it before you power off. If you forget to do this, every CD drive has a little hole in it that if you insert a paperclip will manually eject the tray. If you have a laptop, unplug it and remove the battery for a couple minutes. If your desktop computer has a switch on the back next to the power supply turn it off for a couple minutes as well, as you proceed to the next step.

Once this is done, disconnect your router and modem.
Booting into the Live-CD

Time to boot into your live cd linux distribution.

Put your battery back into your laptop, and/or switch your power supply back on if necessary. Put the CD in the tray if necessary and turn your computer on following the steps anticipated in step 3. It will take longer than normal operating system does to boot because the computer takes longer to pull information from the CD than it does from the hard drive.

Eventually you’ll get a popup asking if you want to try, or install Ubuntu. You want to try it.
Generating the Wallet

Once Ubuntu is loaded into your system’s memory plug in your flashdrive/other media (don’t use a cell phone for the other media). Ubuntu should pick it up right away. It will most likely pop up with an option to open a folder to view the contents of the flashdrive, but if not there should be a new icon for it on the left side of the screen in the launcher. Click that.

Double clicking the html file you saved will bring up a new firefox window, with the wallet website. From here you can generate a new storage address, and corresponding private key for accessing it later. Single address, on the first tab, is fine unless you wanna get fancy. I like to hit generate new key a few times just for added random. You do not want to lose this private key if you send money to the corresponding address, if you do, you’ve lost the money!!!

At this point you can plug in a printer. For the paranoid, you’ll want to make sure its a simple, or older printer, in this case cheap is better, for once in your life as it potentially could save the information it prints and malware could pick it up from your printer when you reboot your regular OS. This is likely way too paranoid, but not impossible. But for that reason some people prefer to write the information down. It’s a lot of information to be written down though. I would like it if someone more knowledgeable than I could comment on this point.

Once you have the information generated and stored on paper to your liking. You’re good to go.

Power off, remove your boot disk and your flash drive, and remove the battery from your laptop again (or switch off power supply again).

Go ahead and plug your modem and router back in. You now have a freshly generated paper wallet for storing peercoin that nobody on the internet has ever even had the opportunity to potentially lay eyes on.
Importing a paper wallet back into the QT client

There are two ways to import your paper wallet back into QT, from a console, and from a command prompt.

Preparation:

DO NOT REUSE A PAPER WALLET THAT YOU’VE IMPORTED INTO QT – AFTER FOLLOWING THE STEPS BELOW THE ADDRESS AND PAPER WALLET YOU GENERATED ABOVE ARE NOW DEAD TO YOU, DO NOT TRY TO REUSE THEM, FOLLOW THE ABOVE STEPS AGAIN AND MAKE A NEW COLD STORAGE WALLET IF YOU WANT TO SPEND SOME OF THE COIN AND PUT THE REST BACK INTO STORAGE. Google “change addresses bitcoin” to learn more about why this is.
From Console

This assumes you have a working QT client, if not there are other tutorials for that. You’ll want to load the whole blockchain first, if it’s not already caught up.
Run the client.

Click on the Help Menu > Go to debug Window, and click on the console tab. On different operating systems this may be located also in either the tray icon, or a different help menu screen, but it will likely be somewhere in the help menu screen. just look for the word console.

For some reason, some installations of qt clients either do not offer this option, or there’s a glitch to where it’s not visible. Not to worry, more than one way to do this.
Unlocking your Wallet (if not using a fresh one)

Is your wallet encrypted? If not, skip this part, if so, you’ll need to unlock it temporarily first.

Put the following in the console:

walletpassphrase yourpassphraseITSASECRET 120

NOTE: If it was not encrypted, and you import money from a paper wallet that you don’t immediately spend, you’ll want to then encrypt it with a password. Also send it yourself from a new address that you generated, in case the piece of paper you made falls into the wrong hands

The little lock in the lower right hand corner will now look unlocked. The 120 means you have 120 seconds to do this, you can add more time if you need, just don’t leave it unlocked for too long if you have money in your wallet.

If you have all your money in cold storage, and none in your client, you can just delete your wallet.dat file, and start fresh, with an unencrypted wallet, and spare yourself the walletpassphrase part.
Importing your private key:

In the console, the following is the command to import your private key into an unlocked wallet:

importprivkey yourPrivateKeyItsAHugeSecretAsLongAsTheresMoneyOnIt,

This will take a couple minutes.

It’s kind of a long thing to type, so I usually scan the QR code with my phone using an app like qr droid. You could probably find some program to do this with a webcam too if you want.

If your wallet wasn’t encrypted, encrypt it. If it was already, you can relock it with:

walletlock

By this point, even though your wallet.dat file now has the address you generated, it should be considered compromised, and you should generate a new address under the “receive coins” tab in QT, and send all your coin to yourself at the new address. I recommend labeling the address in the receive tab with something like “DO NOT USE”

Possible errors: If you get code 4, it probably means you haven’t unlocked your wallet. Code 2 (if I recall correctly) probably means you already imported the wallet, and the blockchain just needs rescanned.

In the event it seems like you imported your key, and the address shows up in “receive coins,” but the coins do not, you’ll want to close qt, and start it again, but with -rescan flag added.
From a command prompt

If the above method doesn’t work for you, there is one more way to do this.

This method involves using a command prompt, which, for the uninitiated, is a way of telling the computer what you want it to do using your words. Old school.

Peercoin-qt is a GUI for peercoind. In the newest version of qt, they come integrated by the above described console.

There may be instances, for whatever reasons, that you have to use the older method of doing this.

This entails running the GUI, and then using ppcoind from the commandline to communicate to the daemon that you want it do to things that the GUI doesn’t have options for yet.
Operating system specific instructions

Windows I abandoned windows a long time ago so let me know if I need to alter this slightly

Open an explorer window. Either run explorer.exe from the start menu, or just click on “My Documents” or “My Computer,” then click on the address bar (if it were a web browser it’d be where you put the website address).

In most windows installations the data files (where your wallet.dat is kept) are kept in something like:

C:\Documents and Settings\username\Application Data\Ppcoin

This may vary from system to system. Instead of putting the location in directly, and easy way to tell your computer where you want it to go is to paste the following into the address bar:

%APPDATA%\PPCoin\

This will bring you to your data directory.

Linux

Click on the Ubuntu logo in your dash, and type terminal.

enter the following:

sudo gedit $HOME/.ppcoin/ppcoin.conf

Do you have a ppcoin.conf file?

For Windows users: If yes, right click it and select “open with notepad,” or some such. If that option is greyed out, you will have to open notepad by running notepad.exe from start menu (or just clicking it in your Programs list), then go to File > Open > and Navigate to your PPcoin data directory, as described above (you should be able to copy paste the path there from the address bar of the explorer window you just opened, if need be).

For Linux users the step above already has you looking at either a blank notepad-like file, or your ppcoin.conf file.

Mac users, your data directory will look something like /Users/username/Library/Application Support/ppcoin/ppcoin.conf, easily referred to this way:

$HOME/Library/Application Support/ppcoin/

Windows users: Do you not have a ppcoin.conf file? You’ll have to make one. Right click, new text file, name it ppcoin.conf, and open it.
Making or altering the .conf file

All operating systems should be on the same page by this point in the tutorial. You’re either looking at your .conf file, or a blank notepad screen.

Copy and paste the following into it (if it doesn’t already exist, if it does, alter it so it looks like this):

server=1
rpcuser=makeYouUpAuserNameAnyWillDo
rpcpassword=makeYouUpApassWordMakeItLongAsHellandRandomOrYouWillGetRobbedUseNumbersAndSymbols
rpcport=9902
rpcconnect=127.0.0.1

Make up a username. Any will do.

Change the password line! DO NOT USE THE ONE I PROVIDED. Make it super hard to guess, use lowercase, uppercase, numbers, symbols, and plenty of random. Doesn’t even have to be real words, you’ll never have to use it or remember it for any reason.

Save it. Usually Ctrl + S or File > Save.
Finding your Command Prompt

With your new .conf file. Start your wallet again.

At this point you’re going to need a command prompt.

In Windows, start menu > cmd.exe

In Linux Ubuntu Icon on dash > terminal
Using the Command Prompt to import your Key (Windows)
Finding where the daemon lives

Windows users: figure out where ppcoind lives. It’s probably going to be either C:\Program Files\PPCoin\daemon or C:\Program Files (x86)\PPCoin\daemon – you can confirm this by navigating around using explorer (as described in the above instructions) and looking for bitcoind, or maybe use windows search feature.

Then, at your command prompt, copy and paste the appropriate command:

cd /d C:\Program Files\PPCoin\daemon

or

cd /d C:\Program Files (x86)\PPCoin\daemon

or the same command with the correct path, if windows conventions changed without me knowing.

You should now be in the same directory in your terminal as your bitcoind program, with your graphical wallet client still running.
Unlocking your Wallet

If your wallet is locked, you’ll want to unlock it for enough time to import your wallet:

ppcoind walletpassphrase yourpassphraseDONOTPOSTITHERE 120

Importing the key

Now import your wallet:

ppcoind importprivkey yourPrivateKeyGoesHereForGodSakesDoNotPostIt

Locking it again if necessary

Finally, either encrypt it through the gui, if you used an unlocked wallet, or relock it like this:

ppcoind walletlock

Using the Command Prompt to import your private key (Linux users)
Finding where the daemon lives

Change to your ppcoind directory (press the tab button where I put tab):

cd /home/yourLinuxUsername/
cd ppcoi[TAB]
cd bin
cd 32 or 64 (depending on your system)

Unlocking the wallet (if necessary)

./ppcoind walletpassphrase yourpassphraseDONOTPOSTITHERE 120

Importing the Private Key

./ppcoind importprivkey yourPrivateKeyGoesHereAgainABigSecretIfItContainsMoney

Importing your private key takes a couple minutes.
Relocking Wallet if necessary

./ppcoind walletlock

Cleaning up a little

history -c && history -w && clear

I’m going to repeat this last part again, for emphasis

By this point, even though your wallet.dat file now has the address you generated, it should be considered compromised, and you should generate a new address under the “receive coins” tab in QT, and send all your coin to yourself at the new address. I recommend labelling the address in the receive tab with something like “DO NOT USE”

DO NOT REUSE A PAPER WALLET THAT YOU’VE IMPORTED INTO QT – AFTER FOLLOWING THE STEPS ABOVE THE ADDRESS AND PAPER WALLET YOU GENERATED ABOVE ARE NOW DEAD TO YOU, DO NOT TRY TO REUSE THEM, FOLLOW THE ABOVE STEPS AGAIN AND MAKE A NEW COLD STORAGE WALLET IF YOU WANT TO SPEND SOME OF THE COIN AND PUT THE REST BACK INTO STORAGE. Google “change addresses bitcoin” to learn more about why this is.

I love you all.

I’m a broke joke. Seriously. I don’t have a college education. I’m a low paid corporate slave. Odds are if you live respectably, and this tutorial helped you, you probably have more crypto than I do right now. If this helped you, I wouldn’t object to you checking out my signature :slight_smile: This ended up taking a lot longer to type out than I thought it would, and remembering/looking up windows conventions are a bitch when you haven’t used it in forever.

I’ll probably be back to edit this but right now my brain hurts from making this.

This is a fantastic guide :slight_smile: thank you for doing this, a PPC tip will be coming your way :smiley:

Fuzzybear

You now have the RPC console in the windows Qt version for all Peercoin Version 0.3.1.

Binaries can be found here http://builds.peercointalk.org/

Any problems with the builds please let me know

Fuzzybear

[quote=“FuzzyBear, post:3, topic:1780”]You now have the RPC console in the windows Qt version for all Peercoin Version 0.3.1.

Binaries can be found here http://builds.peercointalk.org/

Any problems with the builds please let me know

Fuzzybear[/quote]

excellent! ill get that corrected very soon.

A bit I do not understand. At the end of the Tutorial, it says:

“By this point, even though your wallet.dat file now has the address you generated, it should be considered compromised, and you should generate a new address under the “receive coins” tab in QT, and send all your coin to yourself at the new address …”

With regards to the first 14 words of the above quote, which wallet.dat address is being referred to - the client address - or the paper wallet address?

Thanks

[quote=“RobertLloyd, post:5, topic:1780”]A bit I do not understand. At the end of the Tutorial, it says:

“By this point, even though your wallet.dat file now has the address you generated, it should be considered compromised, and you should generate a new address under the “receive coins” tab in QT, and send all your coin to yourself at the new address …”

With regards to the first 14 words of the above quote, which wallet.dat address is being referred to - the client address - or the paper wallet address?

Thanks[/quote]

At the end of the tutorial, you will have imported a paper wallet address into the client.

You actually could use it, but to be safe, I threw that warning up there so the garbage man doesn’t steal peoples coin. And it wouldn’t be a paper wallet anymore, if you continued using it, youd have to make sure you backedup up your wallet.dat

Bump