How to build your own cryptocurrency wallet using Raspberry Pi

This guide is completely a part of Hard Fork. For getting the best out of your cryptocurrency, having cleared the concepts of Hard Fork is important. If you google Hard Fork, you will get thousands of tips, tricks, and guides about the cryptocurrency and the blockchain world.

Ever thought of building your own cryptocurrency wallet? Looking for cheap alternatives for cryptocurrency wallets? If yes, then Pavol Rusnak has done a brilliant job for you. For your knowledge, Pavol Rusnak is the co-founder of one of the most popular cryptocurrency wallets ‘Trezor‘.

He has shared a practical guide on how you can build your own cryptocurrency hardware wallet. For this, you will just need to use a Raspberry Pi and the Trezor Emulator.

In his guide, he has just used Raspberry Pi 3, an SD card, and a 3.5-inch RPi display. After getting all these parts, he loaded the contraption together with Raspbian. Later on, he installed the Trezor Emulator for getting the things done. Raspbian is nothing, but an OS for Raspberry Pi boards like Raspberry Pi 3 used in this guide.

Trezor Emulator code is totally open-source. So, you need not worry about its legitimacy. If you have any doubts, you can easily audit its script at Trezor’s GitHub page.

Using a Raspberry Pi for a Crypto Wallet

  • Raspberry Pi board
  • microSD card (8GB or more)
  • Power supply
  • Case (optional but recommended)
  • Keyboard and mouse
  • Compatible operating system (OS)
  • Crypto wallet software
  • External drive (optional)

Total cost: $60-100. You can get a Raspberry Pi kit complete with a case for around $50 or more.  Check NEXT PAGE for step by step instruction

You may wish to create just a Bitcoin wallet. To accomplish this, install the necessary dependencies:

Make a Raspberry Pi Bitcoin Wallet

You may wish to create just a Bitcoin wallet. To accomplish this, install the necessary dependencies:

sudo apt-get install python-qt4 python-pip -y

Then, run the Python installer to load Electrum:

sudo pip install https://download.electrum.org/2.5.2/Electrum-2.5.2.tar.gz

Proceed to launch the desktop:

startx

Finally, run Electrum:

electrum

Or, you may run Electrum from the menu:

Menu > Internet > Electrum Bitcoin Wallet

DIY Bitcoin Node on a Raspberry Pi

You can also run a full node. With Raspbian or another compatible OS installed, boot up your Pi. If you plan to run your node on an external drive such as a USB stick, configure your USB and create an automount. You’ll need your flash drive formatted as FAT32. This will create a full node and wallet.

Create a Bitcoin Data directory:

mkdir ~/bitcoinData

Next, plug in your USB drive and find its location:

sudo blkid

This will show you where your USB stick is mounted. To make your flash drive automount, open and edit the fstab file:

sudo nano /etc/fstab

Add a few lines to the bottom of the file with the proper location of your flash drive. Depending on how your Pi is configured, you may need to change some information. For instance, if you changed your username to something besides Pi, you’ll need to alter that in the code below. If your USB stick is located at /dev/sda1/ then enter:

/dev/sda1	/home/pi/bitcoinData	vfat	uid=pi,gid=pi,umask=0022,sync,auto,nosuid,rw,nouser	0	0

Now, save and exit:

CTRL + X, then confirm that you want to save by hitting Y. Once that’s complete, reboot:

sudo shutdown -r now

For those that wish to download the entire blockchain node on raspnode, enlarging the swap file may be beneficial. Because swap files add additional memory, you may avoid a Bitcoin core crash by adding swap. For this, you’ll need to edit the days-swap file:

sudo nano /etc/dphys-swapfile

Make the default size of 100 to 1000:

Old value:

CONF_SWAPSIZE=100

New value:

CONF_SWAPSIZE=1000

Save and exit (CTRL + X, Y). Now, run:

sudo dphys-swapfile setup

then

sudo dphys-swapfile swapon

With that completed, it’s time to download the Bitcoin core directory. Before you begin, it’s best to run an update:

sudo apt-get update
sudo apt-get upgrade -y

Now, download and install Bitcoin Core:

sudo apt-get install autoconf libevent-dev libtool libssl-dev libboost-all-dev libminiupnpc-dev -y

For those using Raspbian Jessie Lite, you’ll need to install git as well:

sudo apt-get install git -y

If you’d like to use the bitcoin-qt wallet and graphical user interface (GUI), you must download that on your Raspberry Pi:

sudo apt-get install qt4-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev -y

Next, create a directory for the files you’ll need to download:

mkdir ~/bin

And change directories into that folder:

cd ~/bin

The Berkeley database is required, so download, compile, and install it:

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make -j4

During the make -j4 step, this might take several minutes. Additionally, you may receive some errors, so if so, simply run: make:

sudo make install

Once that’s done, install Bitcoin:

cd ~/bin
git clone -b 0.13 https://github.com/bitcoin/bitcoin.git
cd bitcoin/
./autogen.sh

For use of bitcoin-Qt, run:

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default --with-gui

Alternatively, for a headless install, enter:

./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default

When you’re finished, run:

make -j2

This will take a few hours, so take a break and come back. If you get any errors, simply run:

sudo make install

After that installation, configure, then run Bitcoin core. Navigate into your USB directory and edit the bitcoin.conf file:

cd ~/bin/bitcoin
cd ~/bitcoinData
nano bitcoin.conf

You should see a username and password:

rpcuser=USERNAME HERE
rpcpassword=PASSWORD HERE

Enter a username and password. If you’re NOT using an external drive, the bitcoin.conf file should be in ~/.bitcoin as opposed to ~/bitcoinData

Then, run bitcoinid, specifying the USB drive that’s mounted for blockchain data storage:

bitcoind -datadir=/home/pi/bitcoinData -daemon

If you’d like to run bitcoin-Qt on initial launch, enter:

bitcoin-qt -datadir=/home/pi/bitcoinData

This will ensure that the blockchain is verified and synched properly. Make sure that your node is reachable via the network by running:

bitcoin-cli -datadir=/home/pi/bitcoinData getinfo

Make a Raspberry Pi Litecoin Wallet

You can create a Litecoin wallet on a Raspberry Pi as well. Begin by installing the necessary dependencies:

sudo apt-get install python-qt4 python-pip -y

Now, with the Python installer, download and install the Electrum wallet:

sudo pip install https://electrum-ltc.org/download/Electrum-LTC-2.3.2.2.tar.gz

After that, launch the desktop with:

startx

Finally, run Electrum using:

electrum-ltc

Alternatively, Electrum will be available in the Menu:

Menu > Internet > Electrum Litecoin Wallet

DIY Litecoin Node on a Raspberry Pi Litecoin

Depending on your needs, you may want to make a full Litecoin node with a wallet. Again, it’s good to increase your swap:

sudo nano /etc/dphys-swapfile

Make the default size of 100 to 1000:

Old value:

CONF_SWAPSIZE=100

New value:

CONF_SWAPSIZE=1000

Save and exit (CTRL + X, Y). Now, run:

sudo dphys-swapfile setup

then

sudo dphys-swapfile swapon

To install a Litecoin node, first, run an update:

sudo apt-get update
sudo apt-get upgrade -y

After that, download and install the packages required for Litecoin:

sudo apt-get install autoconf libtool libssl-dev libboost-all-dev libminiupnpc-dev -y

For those using litcoin-Qt which includes a wallet and GUI, enter:

sudo apt-get install qt4-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev -y

Create a directory for your downloaded files:

mkdir ~/bin
cd ~/bin

You’ll need to use Berkeley, so download and install it with:

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make -j4

As with the Bitcoin installation, the make step will take a few minutes. If it returns any errors, merely run:

sudo make install

Make a Raspberry Pi Ethereum Wallet

For an Ethereum wallet on the Raspberry Pi, you may use either the Go Ethereum app, Geth, or Python Ethereum app, Pyeth.

Geth

For You may wish to use an external drive. To accomplish this, make a mount point for your USB stick:

mkdir ~/ethData

Now, locate your flash drive:

sudo blkid

Locate the label for your external storage media, for example sda1. After that, edit your fstab to point to the USB drive:

sudo nano /etc/fstab

At the end of the file, add (if your flash drive location is something other than dev/sda1 then use that instead:

/dev/sda1	/home/pi/ethData	vfat	uid=pi,gid=pi,umask=0022,sync,auto,nosuid,rw,nouser	0	0

Save the file (CTRL + X, Y) and reboot:

sudo shutdown -r now

Begin by downloading the Ethereum Geth dependencies. First, perform an update:

sudo apt-get update
sudo apt-get upgrade -y

Install dependencies with:

sudo apt-get install libgmp3-dev -y

When that’s complete, make a directory for the build:

mkdir ~/bin
cd ~/bin

Then, download the Go tarball and extract it:

wget http://dave.cheney.net/paste/go1.4.linux-arm~armv7-1.tar.gz
tar -xzvf go1.4.linux-arm~armv7-1.tar.gz
export PATH=$PATH:/home/pi/bin/go/bin
export GOROOT=/home/pi/bin/go

Install Geth using (if you’re starting from a fresh terminal, make sure to change directory into ~/bin

git clone -b release/1.3.3 https://github.com/ethereum/go-ethereum.git
cd go-ethereum/
make geth
sudo cp build/bin/geth /usr/local/bin/

You may need to make a new account. If so, when you’ve finished, run (if you’re starting from a fresh terminal, make sure to change directory into ~/bin):

cd ~/
geth --datadir /home/pi/ethData account new

Then, enter:

geth account new

Run Geth with (assuming you’re using external storage):

geth --datadir /home/pi/ethData --ipcdisable --autodag console

If you’re NOT using an external drive, instead use:

geth --autodag console

Once you run Geth, you should see a notification that Block synchronization has begun. You can check on its status using:

eth.syncing

To run Geth in the background, enter (assuming you are using external storage):

geth --datadir /home/pi/ethData --autodag --verbosity 0 &

And for running Geth in the background without external drives:

geth --autodag --verbosity 0 &

Pyeth

Instead of Geth, you may use Pyeth instead. This is the Python Ethereum client and stores an entire Ethereum blockchain. Here, you may want to use an external drive since the full Ethereum blockchain is pretty large. Make a new directory:

mkdir ~/ethData

Find your USB drive with:

sudo blkid

Now, edit your

fstab

file:

sudo nano /etc/fstab

Add the proper line. If your USB stick is sda1 use that. Or if it’s sdb1 use that instead, and so on.

/dev/sda1	/home/pi/ethData	vfat	uid=pi,gid=pi,umask=0022,sync,auto,nosuid,rw,nouser	0	0

Close and save (CTRL X, Y). Then, reboot:

sudo shutdown -r now

Start installing Pyeth by obtaining dependencies. First, run an update:

sudo apt-get update
sudo apt-get upgrade -y

Install the Python module installer:

sudo apt-get install python-pip python-dev -y

After that, install PyEthApp:

sudo pip install pyethapp

Next, run PyEthApp:

pyethapp run

For those using external storage, you may store the blockchain on your flash drive:

pyethapp --data-dir /home/pi/ethData/ run

>>>Make a DIY Crypto Wallet with a Raspberry Pi: Final Thoughts<<<

Don’t use this wallet for storing cryptocurrency! Get a real one!

After connecting the device to the Trezor web wallet, you can start using the device like your own cryptocurrency hardware wallet. In terms of speed, this wallet cannot compete the actual Trezor wallet. But, it is a very good alternative.

Rusnak has strongly warned about using this wallet for testing purposes only. Do not transfer all your funds to this self-made wallet. Emulator is not a safe idea for storing any value. There are several other safer ways to store your cryptocurrency.

If you are interested in building your own hardware cryptocurrency wallet, you can visit Rusnak’s detailed step-by-step guide on his blog here.

startx

LEAVE A REPLY

Please enter your comment!
Please enter your name here