Be Your Own Bank

Setting up a self-hosted Bitcoin node

Accompanied by the research report for the Shaping Digital Life course at the Master's program Information Studies at the University of Amsterdam, a 'science communication artifact' was created to communicate the content of the research report.

The research report investigates blockchain, more concretely the impact of digital currencies (cryptocurrencies) through an inclusive lens focusing on the accessibility of cryptocurrencies in relation to 'traditional' financial services based on prediction Nº 7; The Internet will become ‘the Internets’ as access, systems, and principles are renegotiated as stated in the article titled Digital Life in 2025 by the Pew Research Center.

For this study an interactive prototype of a Bitcoin node was created using a microcontroller with a storage device and blockchain software was installed to create a working Bitcoin node to receive and store transactions. This build log shows the process of setting up the prototype of the node.

Created by Danny de Vries. Due to privacy concerns and the possibility of exposing personal details (such as transaction IDs, and wallet addresses) parts of images are blurred and screenshots taken during the set-up are intentionally not part of this build log.

Download the full research report

Table of Contents

Gathering the hardware

To run a full Bitcoin node two main hardware components are needed. A microcontroller using an ARM chipset that has wifi capabilities. A popular option, and the microcontroller we will be using for this project, is a Raspberry Pi Model 4 B with at least 4GB of RAM. This microcontroller is a great balance between cost (around 40 euros), processing power, and connection ports. This microcontroller will run the node software. The second main hardware component is a hard drive (preferably an SSD) with around 1TB of storage. This will be used to store the complete blockchain ledger of Bitcoin to date.

Figure 1: Overview of all hardware

Additionally, some other hardware components are needed to make a fully operating node. A power supply to power the microcontroller, an SD card to install the software, and an ethernet cable to connect the node to the internet.

A full node is likely to operate 24/7, the Raspberry PI is able to handle this workload but it is recommended to cool the CPU to make it not overheat. For this reason, a 3D printed enclosure (credits to Thingiverse user Malolo for the design) for the Raspberry Pi with active fan cooling was printed.

Figure 2: Final hardware setup with 3D printed enclosure

Installing the software

Several software packages exist for hosting a Bitcoin full node (e.g. Umbrel, Voltage, Start9) but after researching the projects RaspiBlitz suited this prototype the most. It's completely open-source, easy to install if you know you're way around the terminal, has a decent user interface and it's completely self-hosted. You are not reliant on any third-party cloud service.

The focus of the project is also entirely Bitcoin and Lightning so many additional services (e.g. BTCPay) can be installed as plugins. The goal of the RaspiBlitz is mainly targeted at learning how to run your own node decentralized from home. There are 168 contributors working on the project and receiving regular updates. v1.8 was released in November 2022 and has been running stably since then, no security breaches to date.

Figure 3: Flashing the SD card

To install the software, it is downloaded from the GitHub release page which gives a .img file. To verify the software a quick verification of the image was performed by using the shasum command on the downloaded image shasum -a 256 raspiblitz-v1.8.0c-2022-11-01.img.gz.

Now the image can be flashed to the MicroSD Card. For this Balena Etcher was used. You select the image, select the storage device (SD Card), and hit flash. After 10 minutes or so (the image is around 3GB) this process is completed and you have the software installed on the SD card.

Setting up the Node

Now it's time to actually setup the node. The SD card is inserted into the microcontroller, connected to power, and ethernet and the storage device for the ledger is connected using USB. Only thing left to do is to give it a proper spot in a closed at home.

Figure 4: Node running in my homelab

After the device is connected and powered on it is reachable over a home network by using the terminal and SSH. The IP address of the Raspberry Pi can be found in the network software of the home router. Using the ssh admin@[xxxxx] command with the correct IP and password RaspiBlitz you are logged into the device and prompted with a set up screen. The steps are described in the readme.md file of the RaspiBlitz project on GitHub so going into detail here is unnecessary but the setup process basically guides you through two things:

Creating a lightning wallet: the set up screen asks to set up a password for the web interface and your wallets. After that, the layer-2 lightning wallet is created a seed phrase will be shown which is important to write down. This gives access to the funds if the hardware fails. It allows you to recover your wallet.

Copying the full Blockchain ledger to the hard drive: self-validating all the blocks to the hard drive takes around 8-9 days so for the prototype the option was picked to copy the bitcoin core from my laptop which took about 12h.

That's it! After rebooting and logging back in the full node is up and running!

Testing Transactions

The software provided a nice web-based user interface for connecting to the node and making transactions to the wallet. To test the workings of the wallet a small amount was deposited to the account.

First, we need to have Bitcoin. Many options can be considered in getting the first bitcoin. Running mining software, having a friend who already owns Bitcoin make a transaction but probably the route most users will go through is buying Bitcoin with Fiat currency on an exchange such as Bitvavo or a spot website such as Bitonic. For this prototype, we will be using Bitonic. The downside of these exchanges and spot websites are that they are required by law to do a Know Your Customer (KYC) process making your transaction in theory not completely private.

Figure 4: Keys and seed words after install

On the Bitonic website, 100 euro was transferred using iDeal which at its current valuation price is roughly 0.00392426 BTC or 392426 Satoshis (fractions of Bitcoin). The Bitcoin amount is sent to the BTC address that corresponds with a Nano Ledger S cold wallet.

Figure 5: Ledger cold wallet connected

Once the funds were added to the Nano cold wallet a transaction was made to the node running in the Homelab. This was done using an on-chain transaction with Ride the Lightning which can be installed as a plugin in RaspiBlitz. In the Ride the Lightning dashboard an on-chain address can be created to send funds too. Since the Nano Ledger doesn't fully support lightning transactions it's good practice to first transfer the funds to a lighting-optimized 'hot wallet' such as a smartphone wallet which can be installed through the iOS app store. For this prototype, the Blue Wallet was downloaded. So in short:

  1. BTC was bought on Bitonic
  2. Send to the Nano Ledger
  3. Part of the funds sent to the Blue Wallet
  4. From the Blue Wallet to the self-hosted Node

Once the transaction is made the transaction gets an ID which you can view in the Mempool waiting for confirmations of blocks in the blockchain. After around 3 confirmations the ledger approved the transaction and the funds are on the wallet of the node!

Figure 6: Sample screenshot of the RaspiBlitz UI

Now the sky is the limit! Everything is in place to send and receive BTC and Lightning transactions.

Conflicts of Interest

The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article and received no financial support for the research. The author(s) has no affiliation with any of the companies and organizations mentioned in this article.