This article is intended for sysadmins interested in bitcoin and advanced linux users. By chaining all these commands together in different ways, you can do maintain a wallet, work with deterministic keys, generate QR codes and so on. This tutorial was created for Debian Linux and Ubuntu Linux, but other platforms should work too. A list of bitcoin command line utillities:
- bitcoin native (very good, but wont be discussed here)
- qrencode
- sx
qrencode
The qrencode application is a tool to quickly produce qrcodes. Generating a QR code, a type of matrix barcode, for a bitcoin address from the command line :
$ sudo apt-get install qrencode
$ qrencode 125tQCeg89h8d3ccgBsipbjGUJpqx4c3H1 -o qrcode.png
$ display qrcode.png (optional, display it)
This will output a QR code image of 111×111 pixels. You can change the size of the dots, thus making the image larger using the -s command.
$ qrencode 125tQCeg89h8d3ccgBsipbjGUJpqx4c3H1 -s 6 -o qrcode.png
$ display qrencode.png
sx tools
sx is a set of modular Bitcoin commandline utilities. First clone libbitcoin from https://github.com/libbitcoin/libbitcoin#debianubuntu and run
cd libbitcoin-version2
sudo install.sh
Installing command line tool sx :
wget https://github.com/spesmilo/sx/raw/master/install-sx.sh
sudo apt-get install bignum
sudo apt-get install sudo apt-get install libgmp-dev
chmod 755 install-sx.sh
sudo bash ./install-sx.sh
Installation will take a while, expect around 30 minutes installation time. It will download a lot of packages and compile them from source. This should work on latest versions of Debian Linux or Ubuntu Linux.
If that did not work try to download the packages into your /Downloads/ directory.
- libbitcoin 2.0
- libwallet 0.4
- Obelisk 1.0
Open a console and for each of the packages type
$ bzip2 -d filename.tar.bz2
$ tar xvf filename.tar
$ cd filename
$ autoreconf -i
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
( You might need sudo apt-get -f install libzmq-dev and sudo apt-get install libcrypto* )
Finally download sx from here:
- sx 1.0
Run the commands:
sh ./install-sx.sh
If you get an error about leveldb_blockchain, this error to be exact:
initchain.cpp:19:5: error: ‘leveldb_blockchain’ was not declared in this scope
leveldb_blockchain chain(pool);
Then add the line
#include
to the file src/initchain.cpp using your favourite editor such as vim. . Then run make, sudo make install.
Now that you have sx tools installed you can use it to run all kind of bitcoin related commands.
Converting BTC to satoshi, and satoshi to BTC
$ sx btc 90000
0.00090000
$ sx satoshi 0.00090000
90000
Create an experimental wallet
sx newseed > wallet.seed
cat wallet.seed
sx wallet wallet.seed
Convert from hexadecimal to base58
sx base58-encode CAFEBABE
See http://sx.dyne.org/ for a full list.