bitcoin-gui-rs
is a Proof of Concept (POC) for a standalone GUI application that interacts with Bitcoin Core using a Rust-based GUI framework (Tauri). Bitcoin Core's multiprocess feature separates its components into different executables (bitcoin-node
, bitcoin-wallet
, bitcoin-gui
), and each of them can be run as different processes, with the bitcoin-node
connected to the bitcoin network and the bitcoin-wallet
and bitcoin-gui
connected to the bitcoin-node
through a socket pair, using an IPC for communication between them everything through a capnp proton, but in this POC, the GUI is treated as an independent binary (bitcoin-node
) that communicates with Bitcoin Core via a Rust IPC interface.
You can check more about Bitcoin Multiprocess from this document by ryanofsky. This work was heavily inspired by His work.
- Standalone GUI built with Rust (Tauri).
- Communicates with Bitcoin Core through an IPC interface.
- Supports interactions with the Bitcoin Core Regtest network.
- Provides basic chain functionalities.
Ensure you have the following dependencies installed:
-
System Dependencies (Linux, macOS, Windows) - System Dependencies
-
Rust – Rust
-
Compile Bitcoin Core Build (with multiprocess enabled - PR #29409)
# Clone Bitcoin Core and checkout the PR git clone https://github.com/bitcoin/bitcoin.git cd bitcoin git fetch origin pull/29409/head:pr29409 git checkout pr29409 # Build dependencies with multiprocess support make -C depends HOST=aarch64-apple-darwin MULTIPROCESS=1 NO_QT=1 # Configure and build Bitcoin Core export HOST_PLATFORM="aarch64-apple-darwin" # Build (works for macOS) cmake -B multiprocbuild/ \ --toolchain=depends/$HOST_PLATFORM/toolchain.cmake \ -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3 \ -DOPENSSL_CRYPTO_LIBRARY=/opt/homebrew/opt/openssl@3/lib/libcrypto.dylib \ -DOPENSSL_SSL_LIBRARY=/opt/homebrew/opt/openssl@3/lib/libssl.dylib \ -DOPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3/include \ -DZLIB_ROOT=/opt/homebrew/opt/zlib \ -DZLIB_LIBRARY=/opt/homebrew/opt/zlib/lib/libz.dylib \ -DZLIB_INCLUDE_DIR=/opt/homebrew/opt/zlib/include # Final build process cmake --build multiprocbuild/ --parallel $(sysctl -n hw.logicalcpu)
Regtest (Regression Test Mode) allows local Bitcoin connect which is great for quickly testing out the bitcoin blockchain without connecting to the mainnet nor testnet.
-
Run two regtest nodes, one
bitcoind
and onebitcoin-node
Inorder to have a readily available funded wallet, we'll use a
bitcoind
with a regular Bitcoin Core wallet on it, connected to thebitcoin-node
node.Start the
bitcoind
node, create a wallet on it (I'll call it bene), and fund the wallet by mining some blocks:mkdir regular_bitcoind_wallet ./multiprocbuild/src/bitcoind -regtest -datadir=$PWD/regular_bitcoind_wallet -daemon ./multiprocbuild/src/bitcoin-cli -regtest -datadir=$PWD/regular_bitcoind_wallet createwallet bene ./multiprocbuild/src/bitcoin-cli -regtest -datadir=$PWD/regular_bitcoind_wallet -rpcwallet=bene generatetoaddress 110 $(./multiprocbuild/src/bitcoin-cli -regtest -datadir=$PWD/regular_bitcoind_wallet -rpcwallet=bene getnewaddress)
Alternatively, you can just start the
bitcoind
without a wallet using the command:bitcoind --regtest
Now start the
bitcoin-node
node in a different datadir, connected to the first node, with no JSONRPC server:mkdir datadir_bitcoin-node ./multiprocbuild/src/bitcoin-node -regtest -datadir=$PWD/datadir_bdk_wallet -server=0 -port=19444 -connect=127.0.0.1:18444 -ipcbind=unix -debug=ipc
Take note of the
-ipcbind=unix
to create the interface and optional-debug=ipc
to observe IPC messages.
- Clone this repository and navigate to the project directory:
# clone the repository
git clone https://github.com/GideonBature/bitcoin-gui-rs.git
# move into the project directory
cd bitcoin-gui-rs/bitcoin-gui
- Install dependencies:
npm install # or yarn install
- Rename
.env.example
to.env
and add the path to the socket file created by running bitcoin-node in regtest with multiprocess.
SOCKET_PATH="/path/to/bitcoin-core/socket/file.sock";
- Run the application:
npm run tauri dev
-
The bitcoin-gui will open with a dashboard as shown below:
For now only the some of the Blockchain functions have been implemented, others will still be added.
-
To check for some Blockchain Information, simply click on
Blockchain Information
button and you will be met with theBitcoin Information Dashboard
as shown in the image below: -
To check for Blockchain Tip Block Count, simply click on
Get Block Count
button and you will get theChain Tip Block Count
as shown in the image below: -
To check for Blockchain Tip Block Hash, simply click on
Get Best Block Hash
button and you will get theChain Tip Block Hash
as shown in the image below: -
To check for Blockchain Block Hash (by height), simply click on
Get Block Hash
button on theGet Block Hash (by Height)
component and you will get theBlock Hash
of any block at a height as shown in the image below: -
To check for Blockchain Block Information (by height), simply click on
Get Block
button on theGet Block (by Height)
component and you will get theBlock Information
of any block at a height as shown in the image below:
This project is in no way production ready, with some functions both from the bitcoin-node and bitcoin-wallet that are yet to be implemented. For now it is still in active development.
I found this bitcoin-ipc tool useful for generating a rust IPC interface for bitcoin core via rust-capnproto. Also, was inspired by pseudorandom's work on BlockTalk.
Feel free to open issues and pull requests to improve the project.