This article documents the steps I took to verify I obtained the correct code to install and start using gbw-node, the online component of Gales Bitcoin Wallet, authored by Jacob F. Welsh (WoT : jfw) which he documented on Fixpoint through his work with JWRD Computing in a 1 2 3 4 5 6, count'em, 6 article series.
For maximal key security, the software is structured in two components : the node gbw-node and the signer gbw-signer. gbw-node is written in Python 2 and gbw-signer is written in Jacob's anti-Thompsonistic, almost-R5RS-plus-extensions Scheme implementation, Gales Scheme. This design facilitates use over an airgapped system. Such a system would be composed of at least one online computer where gbw-node collects information from the Bitcoin network and broadcasts transactions and an offline computers where gbw-signer is used to generate Bitcoin keys and sign transactions. Usage instructions for gbw-signer will come in an article to follow.
Before we dive in head first here, if you find yourself glossing over the instructions below as if written in hieroglyphics, take heart that it's only ASCII and the command line is not too hard to learn with some dedication to consistent practice and a good guide to walk you through the process. The other side of acquiring the skill is you're equipped with a new set of eyes that allows you to, among other things, enforce ownership over your money. Jacob and I have created training curriculum and hardware packages along with software like Gales Bitcoin Wallet to help our clients do just that and which you may read more about here. Alright, dive at will.
The pre-requisites to verify sources, compile, install and run are :
- The machine I used has 2 cores, 4 GB RAM and 500 GB SSD.
- V. I used Jacob's V in Perl with keksum starter kit.
- a Unix-like OS. I used a fresh, minimalist install of Gales Linux, which comes with the Gnu C Compiler (GCC) 4.7.4 ; musl C Library ; Busybox userland ; and Linux Kernel. Gales also comes with "gport" build scripts for Perl, Python 2 and SQLite. Perl is required for my V selection and and Python 2 and SQLite are required for gbw-node.
- GnuPG (GPG). I used the gport build in Gales Linux.
- The Real Bitcoin (TRB). I pressed my install here to Jacob's
bitcoin_system_compiler.vpatch
.
2020/07/01 Update : As Diana Coman kindly pointed out in the comments, if you already have a TRB node in operation, you may skip directly to step 18 for all gbw-node functionality apart from the push command. For push to work, you need Jabob's bitcoin_rawtx_get_send.vpatch.
Commands issued(i) to download and install complete orchestra from Gales Linux base install :
Add the following IPs to /etc/hosts
:
198.199.70.97 fixpoint.welshcomputing.com
96.43.130.234 deedbot.org
1. Build and install GnuPG.
cd /var/build/gales/gports/gnupg ; gbuild ; gpkg-install -f gnupg-0.0-1.4.21.sh.gz ; mv gnupg-0.0-1.4.21.sh.gz /gales/dist/pkg/
2. Build and install Perl.
cd ../perl ; gbuild ; gpkg-install -f perl-10.1-5.24.2.sh.gz ; mv perl-10.1-5.24.2.sh.gz /gales/dist/pkg/
3. Build and install Python.
cd ../python ; gbuild ; gpkg-install -f python-0.3-2.7.13.sh.gz ; mv python-0.3-2.7.13.sh.gz /gales/dist/pkg/
4. Build and install SQLite and its docs.
cd ../sqlite ; gbuild ; gpkg-install -f sqlite-3.0-3.21.0.sh.gz ; mv sqlite-3.0-3.21.0.sh.gz /gales/dist/pkg ; cd ../sqlite-doc ; gbuild ; gpkg-install -f sqlite-doc-3.0-3.21.0.sh.gz ; mv sqlite-doc-3.0-3.21.0.sh.gz /gales/dist/pkg
5. Acquire the keys for the seals you intend to verify. In this case, jfw, diana_coman, spyked and mod6.
mkdir /root/keys ; cd /root/keys ; wget wot.deedbot.org/{0CBC05941D03FD95C3A47654AE0DF306025594B3,E72DCCB73A5E06694C5CD781D5196EE6390F999E,0x541A976BB5FC4B455D7FBC61BDAE9D051A3D3B95,027A8D7C0FB8A16643720F40721705A8B71EADAF}.asc
6. Prepare the V build tree.
mkdir -p /var/build/v/{v,trb,gbw-node}/{.seals,.wot,patches} ; cd /var/build/v/v/.wot ; ln -s ~/keys/0CBC05941D03FD95C3A47654AE0DF306025594B3.asc jfw.asc ; ln -s ~/keys/E72DCCB73A5E06694C5CD781D5196EE6390F999E.asc diana_coman.asc ; ln -s ~/keys/0x541A976BB5FC4B455D7FBC61BDAE9D051A3D3B95.asc spyked.asc
7. Acquire jfw's V.pl Keksum starter kit.
cd .. ; wget http://fixpoint.welshcomputing.com/code/v/v-pl-keksum-starter-v2.tar.gz ; wget http://fixpoint.welshcomputing.com/code/v/v-pl-keksum-starter-v2.tar.gz.asc
8. Import his key on your gnupg key ring and verify the tarball with his signature.
gpg --import .wot/jfw.asc ; gpg --verify v-pl-keksum-starter-v2.tar.gz.asc
9. Extract the tarball, poke around to your content(ii) and run the install script.
tar xzf v-pl-keksum-starter-v2.tar.gz ; cd v-pl-keksum-starter-v2 ; sh install.sh
10. Acquire the vpatches and seals to press your V tree with the installed starter.
cd .. ; wget -P patches http://fixpoint.welshcomputing.com/v/v/{v_strict_headers,v_keksum_busybox_r2,v_fixes_vpatch_sync,v_keccak_vtools,v_mod6_99993,v_mod6_genesis,v_fix_exptimes_paths_etc}.vpatch ; wget -P .seals http://fixpoint.welshcomputing.com/v/v/{v_strict_headers.vpatch.{diana_coman,jfw},v_keksum_busybox_r2.vpatch.jfw,v_fixes_vpatch_sync.vpatch.{diana_coman,jfw,spyked},v_keccak_vtools.vpatch.{diana_coman,jfw,spyked},v_mod6_99993.vpatch.{diana_coman,jfw,spyked},v_mod6_genesis.vpatch.{diana_coman,spyked},v_fix_exptimes_paths_etc.vpatch.jfw}.sig
11a. Issue a flow.
v.pl f
v_mod6_genesis.vpatch (diana_coman, spyked)
v_mod6_99993.vpatch (diana_coman, jfw, spyked)
v_keccak_vtools.vpatch (diana_coman, jfw, spyked)
v_fixes_vpatch_sync.vpatch (diana_coman, jfw, spyked)
v_strict_headers.vpatch (diana_coman, jfw)
v_fix_exptimes_paths_etc.vpatch (jfw)
v_keksum_busybox_r2.vpatch (jfw)
11b. Press your V tree, install the binary on your path and give it execute permission.
v.pl p v_keksum_busybox_r2 v_keksum_busybox_r2.vpatch ; cd /local/bin/ ; ln -s /var/build/v/v/v_keksum_busybox/v/v.pl v.pl ; chmod +x /local/bin/v.pl
12a. Acquire the vpatches for your press of The Real Bitcoin Vtree.
cd /var/build/v/trb/ ; wget -P patches http://fixpoint.welshcomputing.com/v/bitcoin/{asciilifeform-kills-integer-retardation,asciilifeform_add_verifyall_option,asciilifeform_aggressive_pushgetblocks,asciilifeform_tx-orphanage_amputation,asciilifeform_and_now_we_have_eatblock,asciilifeform_dnsseed_snipsnip,asciilifeform_lets_lose_testnet,asciilifeform_maxint_locks_corrected,asciilifeform_orphanage_thermonuke,asciilifeform_ver_now_5_4_and_irc_is_gone_and_now_must_give_ip,asciilifeform_zap_hardcoded_seeds,bitcoin-asciilifeform.1,mod6_phexdigit_fix,mod6_der_high_low_s,asciilifeform_and_now_we_have_block_dumper_corrected,asciilifeform_dns_thermonyukyoolar_kleansing,asciilifeform_zap_showmyip_crud,bitcoin-asciilifeform.2-https_snipsnip,bitcoin-asciilifeform.3-turdmeister-alert-snip,bitcoin-asciilifeform.4-goodbye-win32,bitcoin-v0_5_3-db_config.6,bitcoin-v0_5_3_1-rev_bump.7,bitcoin-v0_5_3_1-static_makefile_v002.8,bitcoin_rawtx_get_send,bitcoin_system_compiler,genesis,makefiles,mod6_excise_hash_truncation,mod6_fix_dumpblock_params,mod6_manifest,mod6_privkey_tools,mod6_whogaveblox,programmable-versionstring,rm_rf_upnp,malleus_mikehearnificarum,bitcoin-asciilifeform.3-turdmeister-alert-snip}.vpatch
12b. Acquire the seals of your choice.
wget -P .seals http://fixpoint.welshcomputing.com/v/bitcoin/{mod6_manifest.vpatch.{mod6,jfw},asciilifeform-kills-integer-retardation.vpatch.mod6,asciilifeform_add_verifyall_option.vpatch.{jfw,mod6},asciilifeform_aggressive_pushgetblocks.vpatch.mod6,asciilifeform_and_now_we_have_block_dumper_corrected.vpatch.mod6,asciilifeform_and_now_we_have_eatblock.vpatch.mod6,asciilifeform_dns_thermonyukyoolar_kleansing.vpatch.jfw,asciilifeform_dns_thermonyukyoolar_kleansing.vpatch.mod6,asciilifeform_dnsseed_snipsnip.vpatch.jfw,asciilifeform_dnsseed_snipsnip.vpatch.mod6,asciilifeform_lets_lose_testnet.vpatch.jfw_unchecked,asciilifeform_lets_lose_testnet.vpatch.mod6,asciilifeform_maxint_locks_corrected.vpatch.mod6,asciilifeform_orphanage_thermonuke.vpatch.mod6,asciilifeform_tx-orphanage_amputation.vpatch.mod6,asciilifeform_ver_now_5_4_and_irc_is_gone_and_now_must_give_ip.vpatch.mod6,asciilifeform_zap_hardcoded_seeds.vpatch.{jfw,mod6},asciilifeform_zap_showmyip_crud.vpatch.mod6,bitcoin-asciilifeform.1.vpatch.{jfw,mod6},bitcoin-asciilifeform.2-https_snipsnip.vpatch.{jfw,mod6},bitcoin-asciilifeform.3-turdmeister-alert-snip.vpatch.mod6,bitcoin-asciilifeform.4-goodbye-win32.vpatch.{jfw,mod6},bitcoin-v0_5_3-db_config.6.vpatch.mod6,bitcoin-v0_5_3_1-rev_bump.7.vpatch.{jfw,mod6},bitcoin-v0_5_3_1-static_makefile_v002.8.vpatch.{jfw,mod6},bitcoin_rawtx_get_send.vpatch.jfw,bitcoin_system_compiler.vpatch.jfw,genesis.vpatch.mod6,makefiles.vpatch.{jfw,mod6},malleus_mikehearnificarum.vpatch.{jfw,mod6},mod6_der_high_low_s.vpatch.mod6,mod6_excise_hash_truncation.vpatch.{jfw,mod6},mod6_fix_dumpblock_params.vpatch.mod6,mod6_phexdigit_fix.vpatch.{jfw,mod6},mod6_privkey_tools.vpatch.mod6,mod6_whogaveblox.vpatch.mod6,programmable-versionstring.vpatch.mod6,rm_rf_upnp.vpatch.mod6}.sig
12c. Populate your .wot directory.
cd .wot ; ln -s ~/keys/027A8D7C0FB8A16643720F40721705A8B71EADAF.asc mod6.asc ; ln -s ~/keys/0CBC05941D03FD95C3A47654AE0DF306025594B3.asc jfw.asc ; cd ..
13a. View your flow.
v.pl flow
genesis.vpatch (mod6)
bitcoin-asciilifeform.1.vpatch (jfw, mod6)
rm_rf_upnp.vpatch (mod6)
bitcoin-asciilifeform.3-turdmeister-alert-snip.vpatch (mod6)
bitcoin-asciilifeform.2-https_snipsnip.vpatch (jfw, mod6)
bitcoin-asciilifeform.4-goodbye-win32.vpatch (jfw, mod6)
asciilifeform_dnsseed_snipsnip.vpatch (jfw, mod6)
asciilifeform_zap_hardcoded_seeds.vpatch (jfw, mod6)
asciilifeform-kills-integer-retardation.vpatch (mod6)
asciilifeform_zap_showmyip_crud.vpatch (mod6)
asciilifeform_dns_thermonyukyoolar_kleansing.vpatch (jfw, mod6)
asciilifeform_and_now_we_have_block_dumper_corrected.vpatch (mod6)
mod6_fix_dumpblock_params.vpatch (mod6)
bitcoin-v0_5_3_1-static_makefile_v002.8.vpatch (jfw, mod6)
bitcoin-v0_5_3_1-rev_bump.7.vpatch (jfw, mod6)
asciilifeform_ver_now_5_4_and_irc_is_gone_and_now_must_give_ip.vpatch (mod6)
asciilifeform_orphanage_thermonuke.vpatch (mod6)
asciilifeform_and_now_we_have_eatblock.vpatch (mod6)
bitcoin-v0_5_3-db_config.6.vpatch (mod6)
asciilifeform_tx-orphanage_amputation.vpatch (mod6)
asciilifeform_maxint_locks_corrected.vpatch (mod6)
asciilifeform_lets_lose_testnet.vpatch (mod6)
asciilifeform_add_verifyall_option.vpatch (jfw, mod6)
programmable-versionstring.vpatch (mod6)
mod6_der_high_low_s.vpatch (mod6)
malleus_mikehearnificarum.vpatch (jfw, mod6)
makefiles.vpatch (jfw, mod6)
asciilifeform_aggressive_pushgetblocks.vpatch (mod6)
mod6_privkey_tools.vpatch (mod6)
mod6_manifest.vpatch (jfw, mod6)
mod6_phexdigit_fix.vpatch (jfw, mod6)
mod6_excise_hash_truncation.vpatch (jfw, mod6)
mod6_whogaveblox.vpatch (mod6)
bitcoin_rawtx_get_send.vpatch (jfw)
bitcoin_system_compiler.vpatch (jfw)
13b. Press when ready.
v.pl p bitcoin_system_compiler bitcoin_system_compiler.vpatch
14. Acquire Bitcoin's dependencies. The deps/Makefile invokes curl
, which isn't present out of the box on Gales Linux. Instead I ran wget
by hand.
cd bitcoin_system_compiler/bitcoin/deps/ ; wget -O boost_1_52_0.tar.bz2.asc http://deedbot.org/deed-422651-1.txt ; wget -O db-4.8.30.tar.gz.asc http://deedbot.org/deed-422651-3.txt ; wget -O openssl-1.0.1g.tar.gz.asc http://deedbot.org/deed-422651-4.txt ; cd ..
15. Ensure mod6's key is in your gpg key ring(iii) and compile the code with the make script :
gpg --import ../../.wot/mod6.asc ; make
16. Install the bitcoind binary to the preferred location on your preferred user's path, e.g. :
cp -a build/bitcoind /path/to/user/path/
17a. Configure bitcoind. Some select flags from ~/.bitcoin/bitcoin.conf. You'll also want to set the addnode
flag a few times to the IP of trusted nodes.
logtimestamps=1
verifyall
lows=1
caneat=1
17b. Run bitcoind and sync your local copy of the Bitcoin block chain.
bitcoind & tail -f ~/.bitcoin/debug.log | grep SetBestChain
18. Acquire the vpatch and seal for gbw-node.
cd /var/build/v/gbw-node/.wot ; ln -s ~/keys/0CBC05941D03FD95C3A47654AE0DF306025594B3.asc jfw.asc ; cd .. ; wget -p patches http://fixpoint.welshcomputing.com/v/gbw-node/gbw-node_genesis.vpatch ; wget -p .seals http://fixpoint.welshcomputing.com/v/gbw-node/gbw-node_genesis.vpatch.jfw.sig
19. Press and install Gales Bitcoin Wallet Node.
v.pl p gbw-node gbw-node.vpatch ; cd /package ; ln -s /var/build/v/gbw/gbw-node/gbw-node-1/ gbw-node-1 ; cd gbw-node-1 ; sh package/install
20. Configure gbw-node by making the hidden directory and redirecting the gbw-node's SQL schema into the database file.
mkdir ~/.gbw ; sqlite3 ~/.gbw/db </package/gbw-node/library/schema-node.sql
21a. Game time. Ask for help.
gbw-node help
Usage: gbw-node COMMAND [ARGS]
Available commands (can be abbreviated when unambiguous):
help
scan
reset
tags
addresses
unspent-outs
watch
push
balance
register
unlock-wallet
21b. Watch a list of addresses, identified by a tag. In this case, one of the more historic financial transactions to be recorded which marked the end of an era and the start of a new era. Enter your list of addresses separated by enter, press control d to send python the end of file signal and exit gracefully.
gbw-node watch mps-bitcoin-berkshire-bet
16u2LKbGwAARwsWEXKTjBu8XMghnVMcFEi
21c. Print your tags and addresses.
gbw-node tags
mps-bitcoin-berkshire-bet
gbw-node addresses
16u2LKbGwAARwsWEXKTjBu8XMghnVMcFEi
21d. Scan the Bitcoin block chain for transactions sent and received by your watched addresses. (This took approximately 24 hrs to scan from the genesis block to approximately block height 634,000.
gbw-node scan
...
block 290841 new-outs 0 spent-outs 0
block 290842 new-outs 1 spent-outs 0
block 290843 new-outs 0 spent-outs 0
...
21e. Print the history of your transactions and the change in your balance. Can add an optional tag parameter to filter if you have multiple tags.
gbw-node register
290842 2 1000.00000000 0.00000000 1000.00000000
21f. Print your balance. Can add an optional tag parameter to filter if your have multiple tags.
gbw-node balance
1000.00000000
21g. Print the list of spendable transactions, a.k.a. unspent transactions outputs (utxo), available to your watched addresses. The output of this command is formatted how gbw-signer expects its wallet/transactions file to be formatted. It's best practice to run multiple independent trb + gbw-node instances to ensure the transactions you're being fed from the online machine are the ones you actually you want to sign.
gbw-node unspent-outs
16u2LKbGwAARwsWEXKTjBu8XMghnVMcFEi 1000.00000000 227d88033f4a26f60285462254f23c521bff96975f58ff60eadbeb62dca68578 1 #blk 290842 tx 2
And there you have it. Enjoy ! And the next time a central bank doubles their digital money supply or restricts transactions cause one of their friends has their panties in a bunch, recall that while time waits for no man, Bitcoin will be there, hardening.
- I've presented the command flow as root user throughout for simplicity. In practice, only the install commands require root privilege. [^]
- I modified the BINDIR variable to /local/bin/ since that's an element in the default execution $PATH on Gales Linux. [^]
- His signature is on the deeded dependencies. [^]
For those who already have a TRB-compatible node running and up to date, it may help a notice at the very beginning that they can basically just skip all the way to step 18 - and from there it all gets quite clear and simple anyway!
In other words, GBW-node itself is straightforward to install and use but it assumes a TRB-compatible node and the process for getting *that* part up and running is currently quite convoluted, to say the least.
Comment by Diana Coman — July 1, 2020 @ 20:13
That is absolutely correct and thanks for pointing it out. I've updated the article with a note close to the top. TRB remains a bit convulted, but at least the prior buildroot dependency has now been removed with Gales Linux + the bitcoin_system_compiler.vpatch.
Comment by Robinson Dorion — July 1, 2020 @ 20:35
In step 18 the links are missing a _genesis suffix:
http://fixpoint.welshcomputing.com/v/gbw-node/gbw-node_genesis.vpatch
http://fixpoint.welshcomputing.com/v/gbw-node/gbw-node_genesis.vpatch.jfw.sig
Comment by whaack — July 7, 2020 @ 22:25
[...] was able to show a balance for an address that had received some bitcoins. Dorion had done a similar exercise, except he scanned up to block 634,000 which took about 24 [...]
Pingback by How To Test gbw-node By Viewing The First Ever Transaction Containing a p2pkh Address « whaack — July 8, 2020 @ 18:45
Thank you! Updated.
Comment by Robinson Dorion — July 13, 2020 @ 20:45
The links are broken for Jacob's articles 2-6 on GBW-node as they are published in 2020, not in 2019.
Comment by Diana Coman — July 18, 2020 @ 08:31
Thank you, fixed.
Comment by Robinson Dorion — July 18, 2020 @ 14:57
[...] F2A85M motherboard. I added the Samsung SSD because I also plan to test syncing a Bitcoin node and GBW-node with this set [...]
Pingback by A JWRD desktop aiming for open graphics « Dorion Mode — November 1, 2020 @ 20:36
[...] A full walk through a rather manual sort of GBW node installation process from zero. [...]
Pingback by Gales Bitcoin Wallet (re)release « Fixpoint — December 3, 2021 @ 08:53
[...] most clearly when I found myself surprised when a recipe Robinson posted a few weeks later featured needless typing out of voluminous, error-prone and unmemorable magic strings at the CLI. The idea with our training program is to expand your mind and options; this necessarily involves [...]
Pingback by The simplest way yet to fetch Bitcoin code « Fixpoint — February 4, 2022 @ 00:19