Bitcoin Forum
December 29, 2025, 02:27:05 PM *
News: Latest Bitcoin Core release: 30.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Easiest Offline Wallet (key-pair) Generation on GUI-less Linux [BASH]  (Read 63 times)
apogio (OP)
Legendary
*
Offline Offline

Activity: 1022
Merit: 2296



View Profile WWW
March 05, 2025, 06:56:48 PM
 #1

Background:
I 've already implemented BASH21 - A simple BASH paper wallet generator.

Yesterday, I wanted to see what would be the easiest way to generate a paper wallet on a GUI less linux machine.

Prerequisites:
1. Any machine running linux offline.
2. An internet connected computer.
3. A usb.

Preparation:
1. On your internet connected computer, download libbitcoin-explorer from here: https://github.com/libbitcoin/libbitcoin-explorer/releases/download/v2.2.0/bx-linux-x64-mainnet. Obviously, you can build it from scratch, but this wouldn't be the easiest way. You can also verify the binary file, which is, for me, a mandatory step.

2. Put the binary in the USB.

3. Turn on the offline Linux machine and put on the USB.

4. Open up a terminal.

5. Mount the USB.

Code:
lsblk

This will return something like:
Code:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
...
sdb           8:16   0  14.8G  0 disk
`-sdb1      8:17   0  14.8G  0 part
...

So we need to mount the USB from our /dev/sdb1 onto our file system's mount-point.

Let's create the mount-point and mount the USB there.

Code:
sudo mkdir -p /media/mount-usb
sudo mount /dev/sdb1 /media/mount-usb

6. We need to copy the binary from the USB to our filesystem, let's say onto ~/easy-paper/. We 'll also change the name to a simple bx.

Code:
sudo mv /media/mount-usb/bx-linux-x64-mainnet ~/easy-paper/bx

7. Let's make it executable.

Code:
cd ~/easy-paper
chmod u+x bx

Actual Wallet Creation:
Code:
openssl rand -hex 32 | ./bx ec-new | ./bx ec-to-wif | tee /dev/tty | ./bx wif-to-public | ./bx ec-to-address

The output will look like this:
Code:
L2pUQKGAaqZuMoU77kZpLyeM5cpM4Z6x2tFFUkuxLDzEACrrKZDS
1NhDJheRUGH3RgYYvQAajbRuv6kVBryjq7


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!