“Using Bitcoin” can mean different things to different people. It’s a spectrum.
Some would say that simply having any exposure to Bitcoin is “using Bitcoin”. That could be with a Coinbase account, or “holding” GBTC in the Greyscale Bitcoin Trust.
But neither of these options provide the individual with “the point” of Bitcoin.
I don’t want to speak for everyone, but in my view, “the point” of bitcoin is “self sovereign money”. Holding, spending, and receiving money with as little trust as possible placed into other people, governments, and institutions.
This blog series will show you how to set up your own usable Bitcoin Stack, so that you can hold, spend, and receive bitcoin, trusting only in the software that you’re running on your own hardware.
Bitcoin Core Full Node <- we are here
Lightning Network Daemon Node
After the above stack is installed and running on a computer in your network, you will be able to:
For this tutorial, you need to have a computer on your network that’s running a Linux system based off of Debian. I’m no Linux expert, and Ubuntu seemed pretty user-friendly, so that’s what I went with on my own server.
If you have an old laptop or desktop computer, this is a great option to put it back to work. I had a tower full of hardware that I built a decade ago that is currently running my bitcoin stack. There’s no monitor hooked up to it, it just sits in the corner, serving all of my bitcoin needs for me.
Get a fresh Ubuntu. I choose Ubuntu Server, and only interact with it via SSH from my laptop. Ubuntu Server has no window system, you only interact with it via Terminal prompts. This guide is going to be 100% text-based, no visual elements.
You can also install Ubuntu Desktop. I suggest you do, if you’re installing this on a laptop, cause it’ll be nice to look at something other than your Terminal when you open it up.
Log into your Ubuntu machine, and let’s make a new folder for downloading the Bitcoin Core binary.
Next let’s download the latest linux version of Bitcoin Core. We can see which version that is if we use a browser to navigate to https://bitcoincore.org/en/download/. At the time of writing, this is Bitcoin Core version 0.19.1.
Let’s verify that this downloaded file hasn’t been corrupted. Download the list of cryptographic checksums, and use them to check the file.
You should see an output with at least one line saying:
As long as you see that, all good. You can safely ignore any warnings.
Finally, let’s make sure these checksums were actually signed by the Bitcoin Core release team (to verify that every bit of this file was signed-off)
You should see a line that says:
and another line that says:
If you’d like, you can read more about this verification process here: https://bitcoincore.org/en/download/#verify-your-download
Phew! All that, and the only thing we’ve done so far was download a compressed file.
Let’s unpack that tarball
This will result in a new folder in <code>btc-bin<code> called <code>bitcoin-0.19.1<code>. If you navigate in there, there’s a folder called <code>bin<code>, and inside there is an executable file called <code>bitcoind<code>! That’s what we’re after. Let’s go in there.
In order to be able to execute <code>bitcoind<code>, we need to add it to our <code>PATH<code>. Let’s do that by creating a symlink in <code>/usr/local/bin<code>.
Excellent! Now, anywhere on your system, you have access to run the <code>bitcoind<code> Bitcoin Core Daemon Full Node. Let’s test that by heading back to your home folder and checking the version of <code>bitcoind<code>.
You should see output that starts with this line:
Congratulations! 🎉 You now have a copy of the Bitcoin Core program on your machine, ready to sync with the network.
As alluded to at the start of this guide, there are many ways to use Bitcoin. Due to the way that we are setting up our Bitcoin stack here, we need to configure our version of Bitcoin Core a bit, so that the other pieces of software in our stack can interact with it properly.
Here’s how to do that.
We’ll tell Bitcoin Core to look for a configuration file at <code>~/.bitcoin/bitcoin.conf<code>, so we just need to make that (folder and) file
and then fill it with the following content (using your favorite text editor, like <code>vim<code> or <code>nano<code>, or a graphical one if you’re using Ubuntu Desktop)
Be sure to change the values of <code>rpcuser<code> and <code>rpcpassword<code>.
On your router, open up port 8333 and forward it to your computer where Bitcoin Core will be running.
We want this stack to be as foolproof as possible.
If your computer restarts, you shouldn’t have to do anything. Bitcoin Core needs to start up on it’s own and get re-synced with the network.
Thankfully we can use <code>systemd<code> for that. We can basically tell Ubuntu, that whenever the system turns on, it needs to run a script, and we can have that script simply be “start the <code>bitcoind<code> executable”.
Make a file with the following content:
And save it at <code>/etc/systemd/system/<code> with a filename of <code>bitcoind.service<code>
You’ll need to provide <code>sudo<code> access to save this file into the <code>/etc/systemd/system/ directory<code>.
Be sure to update that file with your actual Ubuntu username wherever you see <code><user><code>.
The last thing you need to do is create a file called <code>bitcoind.pid<code> in <code>~/.bitcoin/<code>, right next to your <code>bitcoin.conf<code> file.
Once this file is created at <code>/etc/systemd/system/bitcoind.service<code>, we need to reload the <code>systemd<code> daemon, then enable the service (so that it starts automatically after the system is rebooted), then start the service (so that it starts right now).
Bitcoin Core is now running on your computer!
In a new terminal window, we can follow the logs to make sure it’s syncing properly.
Hopefully you see all kinds of logs indicating that Bitcoin Core is starting up, connecting to peers, and syncing the blockchain.
Now we play the waiting game. In a day or two or three you’ll see the <code>progress<code> indicator value in the logs creep closer and closer to <code>1.000000<code>, and when that happens, you’re fully synced!
That’s all for now.
If you’ve followed this guide all the way here, you’ve got Bitcoin Core installed and syncing on a computer that you control. This lays the groundwork for all kinds of other fun services and softwares that we’ll install next, which GREATLY increase the actual usability of your full node.
This is my blockchain. There are many like it, but this one is mine.
I’ll include a link to Part 2: ElectrumX Server here, when that’s ready.
Follow me on Twitter: https://twitter.com/trainface
We are always interested in connecting with people who want to fund, innovate
or work in the open financial system.