Malvarma: secure Monero cold wallet generation on the Raspberry Pi Zero
January 21, 2018
The safest way to store and hold funds with the Monero cryptocurrency is with a cold wallet. Yet, it is not easy to create one, and even less so if you want to do so in as secure a manner as possible.
I’ve come up with a solution to this problem: Malvarma, a Raspberry Pi Zero image that generates a Monero cold wallet upon boot.
Note: this isn’t an address I use, so don’t bother importing the keys ;)
Cold wallets must be generated and stored offline. This eliminates the risk, however small, of private keys being stolen by a remote attacker through the Internet. Yet almost all of our computers and phones are networked, which makes them less than ideal for this purpose.
One solution is to boot up a live OS and generate a cold wallet using pre-downloaded software. Taushet’s USB Monero Cold Wallet Generator is one example. Even though this method eliminates the risk of attacks through malware and the Internet, they are only safe if you trust that the hardware you use is secure. Unfortunately, recently discovered hardware vulnerabilities, such as security bugs in the Intel Management Engine, remind us that it is not necessarily prudent to blindly trust hardware.
The Usability/Security Trade-off
Ideally, you should minimise your attack surface through which an attacker can access your private keys, and maximise the usability of whatever method you use to generate them. This is usually a trade-off —good security is troublesome, and poor security is easy.
The Solution: Malvarma
I believe that I have found a way to overcome this trade-off. My solution is to use a non-wireless Raspberry Pi Zero to generate a cold wallet, write down the private keys, and then retire (or destroy) the device after use. I created a custom Raspberry Pi Zero image which makes it extremely easy to do this.
What Malvarma is
Malvarma is a Raspbian Lite image which comes packaged with software that generates a Monero cold wallet. There is nothing to configure. Just plug it in, wait three minutes, and write down the private keys that show up on your screen.
I made several modifications to the stock Raspbian Lite image to reduce its software attack surface in case someone uses it on a wireless-enabled Raspberry Pi. I also configured the device to only generate a cold wallet if the device can provide sufficient entropy. This ensures that the device will not create a wallet which can be easily brute-forced.
Don’t run Malvarma on a smart TV or any display that is connected to the Internet or a storage device.
Why use Malvarma?
This solution is more secure than using a live OS on a regular PC because the non-wireless version of the Pi Zero lacks any wireless chips. This makes its attack surface much smaller. It is also small and inexpensive, so it is practical to destroy it after use and thereby eliminate the possibility that the private key can be recovered from the hardware.
If you don’t want to destroy it, just make sure that you do not use it until the day comes when you move funds out of your cold wallet and no longer use that address.
It is also easy to set up and use. You only have to download and verify the Malvarma image file, flash it to a microSD card, and plug in the Pi Zero to a screen and USB power source. Wait three minutes, and write down the private keys on the screen. That’s it! These steps are comparable, if not only slightly more troublesome, than booting up a live OS.
The largest downside is just that you have to purchase a Pi Zero, which might take some time to ship. I believe that this is an acceptable trade-off for people who are particularly concerned about hardware attack surfaces.
Please refer to these instructions on how to download, verify, and use Malvarma.
I need your help
Malvarma is still alpha software as it has not gone though a security review. I would really appreciate more eyeballs on the source code. Please don’t store large amounts of funds on addresses Malvarma generates until enough people vet the code. If you find any bugs or vulnerabilities in it, please file a bug report.
Buy me a coffee?
If you find Malvarma helpful, please help me stay caffeinated by sending tips to my Monero address. Thank you!