Over the last week, I was tidying up some old IT equipment and found a
hard-drive that I hadn’t plugged in for a while. I took a quick look and within
one of the directories was a dump of my old home directory from an Ubuntu 12.04
installation. Within this directory was a hidden .bitcoin
directory which
appeared to be an old wallet.
Given the price of bitcoin today (floating between $50k and $60k) compared to the last time I used this wallet in early 2013 (around $20) it was definitely worth the time getting in and checking if there was any remaining value.
Looking at the logs in this directory, I found that the wallet was originally
created using Bitcoin Core with a version of v0.8.1.0-g34d62a8-beta
. I
figured that it was likely best to see if I could get a version of Ubuntu 12.04
running and then install Bitcoin Core at that version, but as I should have
expected, this was actually quite difficult as 8 year old versions of programs
tend to be lost to the sands of internet time very easily. The repository
which this particular version belonged to continued to flake out and so I
pivoted to trying a different approach.
I eventually found github.com/jackjack-jj/pywallet which appeared to be quite promising. I decided to try this package out within a docker container to see if it could read the addresses and private keys within the wallet.
I copied the wallet.dat
file into a spare directory and then started the
docker container running the following command in that directory:
docker run -it -v $(pwd):/data python /bin/bash
Once the container had started, I installed the dependencies for pywallet.
apt-get update && apt-get install build-essential python-dev python-twisted python-bsddb3 python-ecdsa
Then pywallet itself.
git clone https://github.com/jackjack-jj/pywallet.git .
Once this was complete, it was just a case of running pywallet to read the
wallet.dat
file like so:
python2 pywallet.py --dumpwallet --dumpwithbalance --wallet=/data/wallet.dat
This command returns a keys
list which contains objects in the following form:
{
"addr": "",
"balance": "0",
"compressed": true,
"hexsec": "",
"private": "",
"pubkey": "",
"reserve": 1,
"sec": "",
"secret": ""
}
Of main interest here is the balance property. My particular wallet had a
large number of entries and so the balance property after the first few entries
in the list returned error code: 1015
. I assume is related to throttling from
some upstream provider or similar, so I went through these entries checking
manually with the site https://bitref.com/.
The result, zero balance on all entries. Definitely worth the time checking though, as $200 of forgotten coins in early 2013 would be worth over half a million today. There is a part of me which wishes I was smarter and thought a little more about putting a few thousand into BTC back then, that would have been a fantastic decision.