Select Page

You have dived into the world of crypto, traded in cryptocurrency exchanges, used different wallets, staked tokens, sold NFT art or played NFT games.  But you haven’t really find the time to learn where it all began — Bitcoin, the first cryptocurrency. It’s like you learned a new programming language without ever visiting the language’s official website to begin your journey.

Whether you want to learn deeper understanding, contribute to the Bitcoin development or start your own cryptocurrency project in the future, it is always a great idea to go back to the basics.

Where else should you begin but from the Bitcoin’s official website https://bitcoin.org . For developers, everything you need is in the GitHub repository. Personally before I get a deep dive on any source codes, I prefer getting the software first so I can see for myself what the product can do.

In this tutorial, I documented how I was able to create the Bitcoin Core Wallet installer for Windows from scratch. It was compiled from the latest source code downloaded from Github. As of writing, this how a Bitcoin Core software look like. To be more specific this is Bitcoin Core v22.99.0-f1ce67f09fba

Time to create the installer: 2 hours+

Time to synchronize Bitcoin Wallet: 56 hours+

PART 1 Installing Windows Subsystem for Linux

PART 2 Installing Ubuntu

PART 3 Installing Bitcoin Compilation dependencies

PART 4 Downloading latest source codes

PART 5 Building the source codes

PART 6 Publishing the executable file (EXE)

PART 7 Copying the executable file from Ubuntu to Windows

PART 8 Installing Bitcoin Core Wallet executable file for Windows

PART 1 Installing Windows Subsystem for Linux

Step 1. BItcoin has 4 repositories in Github. We will need repository for Bitcoin Core integration/staging tree. As with any software product, we begin by reading the README file. From the directory doc click README.md. Look for the Windows Build Notes. It will lead you to open build-windows.md

Step 2. The requirement is you must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11. Check your Windows version. Follow the instructions on how to install Windows for Linux (WSL) from the Microsoft website.

PART 2 Installing Ubuntu

Step 3. Go to the Ubuntu WSL installer https://ubuntu.com/wsl

Step 4. Click Get button. This opens the Microsoft Store application.

Step 5. Click the Install button. This will download the Ubuntu installer to your computer.

Step 6. While waiting for the installation to finish, do the encircled instructions in the Description.

Step 6a. If you prefer to use the PowerShell prompt, search for Windows PowerShell on the Windows Search bar. Right-click on the Best match result. Click Run as administrator.

Step 6b. Run Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Step 6c. Restart your computer. Make sure the Install button changed into Open button. This means that the Ubuntu installer was downloaded.

Step 7. Return to Microsoft Store, click Open button to continue with the installation.

Step 8. If you have NOT restarted your computer after enabling Windows for Linux Subsystem, you will not be able to proceed with Ubuntu installation. Restart your computer then return to Step 3.

If you have restarted your machine, you will be asked to provide a user name password. Take note of the password as you will be using this later when you run sudo commands.

PART 3 Installing Bitcoin Compilation dependencies

Step 9. Update and upgrade Ubuntu. Install the dependencies from build-windows.md

sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
sudo apt install nsis

Step 10. Install the dependencies from build-unix.md

  • sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
  • sudo apt-get install libevent-dev libboost-dev
  • sudo apt install libsqlite3-dev
  • sudo apt-get install libzmq3-dev
  • sudo apt install systemtap-sdt-dev
  • sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools

PART 4 Downloading latest source codes

Step 11. Now we can get the Bitcoin source codes by running:

git clone https://github.com/bitcoin/bitcoin.git

To confirm if the source codes were downloaded, run in Ubuntu command line:

ls

There should be a directory called bitcoin.

PART 5 Building the source codes

Step 12. After downloading the latest source codes, we have to install a tool chain dependency that will compile Bitcoin codes on Linux but for use on Windows.

sudo apt install g++-mingw-w64-x86-64

Step 13. Then we may begin building the source codes. Make sure you are inside bitcoin directory, where you have cloned the source codes from Github.

cd bitcoin

To confirm, run pwd on the Ubuntu command line.

Step 14. Run the following commands one at a time in Ubuntu command line:

  • PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
  • sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status"
  • cd depends
  • make HOST=x86_64-w64-mingw32
  • cd ..
  • ./autogen.sh
  • CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
  • make
  • sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status"




PART 6 Publishing the output into executable file

Step 15. Run the command to copy compiled executable files to a Windows directory.

make install DESTDIR=/mnt/c/workspace/bitcoin

To confirm, a directory in your Windows filesystem will be created and files will be in the C:\workspace\bitcoin

Step 16. Run this command to publish the output into an executable file named bitcoin-{version}-win64-setup.exe

make deploy

PART 7 Copying executable file from Ubuntu to Windows

Step 17. Copy the installer into a Windows directory. In my example I copied the executable file to c:\temp\mount\bitcoin . Using the Ubuntu command line, on directory bitcoin run this command:

cp -R ./bitcoin-22.99.0-win64-setup.exe /mnt/c/temp/mount/bitcoin/

To confirm, open Windows Explorer. There should be C:\temp\mount with directory called bitcoin.

PART 8 Installing Bitcoin Core Wallet executable file for Windows

Step 18. Double-click on the exe file. Accept all defaults.

Open the Bitcoin Core software. The bottom panel will display the amount of data your wallet needs to be synchronized with the entire blockchain. It displayed 14 years behind when I started synchronizing. It took 56 hours to download the entire blockchain to my computer.

When the bottom panel is clicked, the below information will be displayed:

Step 19 (optional). If you want to use the Bitcoin Core (testnet), it was included when the Wallet was installed. It is accessible from the Start Menu.

REFERENCE: