How to Use the Bismuth Tornado Wallet on Android Using Termux

The Bismuth Tornado Wallet can be used on an Android mobile phone in combination with Termux. This document describes how to get the wallet running under this setup. First, find Termux in the Play Store and install it as shown in the screenshot on the left.

Once installed, start Termux and type in the following commands (except the lines starting with #, which are comments):

pkg install python wget clang
# default wget doesn’t handle https
# pycryptodomex doesn’t seem to build unless clang is installed manually
# [maybe optional] needed hash -r to force use of newly installed wget because it kept using old
hash -r
# replace the link below if there is a newer version
wget https://github.com/bismuthfoundation/TornadoWallet/archive/v0.1.0.tar.gz
tar -zxf v0.1.0.tar.gz
cd TornadoWallet-0.1.0
pip install -r requirements.txt
cd wallet
python wallet.py
# wait a little while and open web browser at localhost:8888

If localhost:8888 shows an error or timeout, it means that the wallet has not booted yet. In this case wait a bit more and retry.

The instructions above will create a new wallet.json file. If you already have a wallet created on a PC which you would also like to use on your phone, you need to transfer the following file from your PC to the phone (replace username with your own):

C:\Users\username\bismuth-private\wallet.json

First, make sure that your wallet on the PC is encrypted and protected by a password. Then, the file wallet.json can be transferred to the phone, for example by email or by using a cloud storage such as Dropbox, Google Drive, etc. You can then use Termux to transfer the wallet.json file to the correct location:

# Stop the Tornado wallet (using ctrl+c) before copying wallet.json
# Allow phone to access the storage area (answer Allow)
termux-setup-storage
cd $HOME/bismuth-private
# Make a backup of existing wallet, if it exists
mv wallet.json wallet-backup.json
# Copy wallet from the phone’s download folder
cp /storage/emulated/0/Download/wallet.json .
cd ..
python wallet.py
# wait a little while and open web browser at localhost:8888

The screenshot below shows the phone’s web browser after wallet.py has been restarted with an encrypted wallet.json file successfully copied from a PC to the phone’s bismuth-private folder. Note that the wallet decryption takes some time on the phone, especially if wallet.json contains multiple addresses.

Credits go to Discord users bizzy and heavens for working out how to use the Tornado wallet with Termux.

heavens also provided the following script, which can be used to start the wallet and automatically launch the web-browser:

#!/bin/bash
cd /data/data/com.termux/files/home/TornadoWallet-0.1.0/wallet
(sleep 7;am start −−user 0 -a android.intent.action.VIEW -d http://localhost:8888) &
python wallet.py

This script can be written directly on the phone, for example using the nano text editor:

nano mystart

Then use CTRL+O to save and CTRL+X to return to the terminal window. To make the script executable:

chmod u+x mystart

and to run it:

./mystart

Termux Widget is an addon available at Google Play or F-droid (both Termux and the Widget need to be installed from the same source, you cannot mix). Widget provides an easy way to start small scriptlets from the home screen of the phone. The script “mystartup” needs to be moved to the $HOME/.shortcuts directory, see https://wiki.termux.com/wiki/Termux:Widget.

After that, add Termux:Widget to your phone’s home screen and select to launch the “mystartup” script. The home screen should then look as shown below. The Bismuth Tornado Wallet can now be launched on Android with one simple touch.