Using Grin Wallet on Termux via Proot-Distro (Debian Emulation) – Full Guide



This guide explains how to run the Grin cryptocurrency wallet on your Android device using Termux and Proot-Distro with a full Debian environment. It covers compiling the wallet from source, setting up scripts for Termux integration, and accessing your wallet securely — all CPU-based, no root required.


⚙️ 1. Prepare your Termux environment

First, make sure Termux is updated and has the necessary tools installed. Open Termux and run:

pkg update && pkg upgrade -y
pkg install -y proot-distro git curl wget tar build-essential

This installs Proot-Distro (for running a full Debian environment) and build tools required to compile Grin.


🧩 2. Install a Debian environment

Install Debian via Proot-Distro:

proot-distro install debian

Once installed, log into Debian:

proot-distro login debian

Inside the Debian shell, update packages and install dependencies needed for Rust and Grin:

apt update && apt upgrade -y
apt install -y git build-essential cmake pkg-config libssl-dev libncurses5-dev libsqlite3-dev curl wget

🧠 3. Install Rust (for compiling Grin)

Grin is written in Rust, so we need Rust installed in Debian:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup default stable

Verify Rust installation:

rustc --version
cargo --version

🧪 4. Clone and compile Grin Wallet

Clone the Grin repositories:

cd ~
git clone https://github.com/mimblewimble/grin-wallet.git
git clone https://github.com/mimblewimble/grin.git

Compile Grin:

cd grin
cargo build --release

Compile Grin Wallet:

cd ~/grin-wallet
cargo build --release

After compilation, the executables will be in:

~/grin/target/release/grin
~/grin-wallet/target/release/grin-wallet

You can verify it:

~/grin/target/release/grin --version
~/grin-wallet/target/release/grin-wallet --version

🔧 5. Create a Termux wrapper script

To use grin-wallet conveniently from Termux, create a script that launches it inside the Debian environment.

  1. Create a folder for scripts:

mkdir -p ~/scripts
  1. Create the Grin Wallet script:

nano ~/scripts/grin-wallet.sh

Add the following content:

#!/data/data/com.termux/files/usr/bin/bash
# Launch Grin Wallet inside Debian Proot
proot-distro login debian -- bash -c "/root/grin-wallet/target/release/grin-wallet $*"

Save (CTRL+O, Enter, CTRL+X) and make it executable:

chmod +x ~/scripts/grin-wallet.sh

⚡ 6. Make grin-wallet a Termux command

Add an alias to your .bashrc:

echo "alias grin-wallet='bash ~/scripts/grin-wallet.sh'" >> ~/.bashrc
source ~/.bashrc

Now you can run:

grin-wallet info
grin-wallet address
grin-wallet listen

All commands execute inside Debian, using your compiled wallet binary.


🔑 7. Access your existing wallet

If you already have a Grin wallet:

  1. Place your wallet files in the Debian home directory (/root/.grin/main/wallet_data).

  2. Run:

grin-wallet info

You will be prompted for your wallet password. After entering it, your wallet status and balance will display.


🖥️ 8. Running the Grin Node

Although Termux only needs the wallet wrapper, you can start the Grin node directly in Debian:

cd ~/grin
./target/release/grin server run

Leave it running in a separate Debian session or tmux session. The wallet will connect to the node automatically.


🔁 9. Optional: Organize scripts cleanly

  • Keep all Termux scripts in ~/scripts.

  • Make separate scripts if needed for grin or other tools.

  • Use aliases to integrate into your shell, so Termux commands feel native.


✅ 10. Summary

Component Description
Environment Termux + Proot-Distro (Debian)
Wallet grin-wallet (compiled from source)
Node grin (optional, compiled from source)
Script path ~/scripts/grin-wallet.sh
Termux command grin-wallet
Access Existing wallet files placed in Debian home
Password Required for wallet commands

⚙️ Example workflow

# Start Debian if not already
proot-distro login debian

# Start Grin node (optional)
~/grin/target/release/grin server run

# In Termux, check wallet
grin-wallet info

# Generate a new address
grin-wallet address

🚀 Optional improvements

  • Use tmux inside Debian to keep the node running in background.

  • Automate launching node and wallet via shell scripts.

  • Mount external storage to store wallet backups.


After completing these steps, your Android device can fully run Grin Wallet in Termux using a Debian environment — CPU-only, no rooting required, and fully reproducible on any device supporting Termux and Proot-Distro.

This blog post is written with the help of ChatGPT, but the content, workflow, and tested steps were developed by the blog owner.


Comentarios

Entradas populares