Demo Bitcoin wallet project with a local Bitcoin Core regtest node for development and testing.
This project combines a Flutter wallet app with a local Bitcoin Core node running in regtest mode.
The local node is intended for development, wallet experiments, and reproducible demos without relying on public testnet infrastructure.
docker/bitcoin.confdefines the tracked node configuration forregtest.docker/Dockerfiledefines the thin project image built on top of a pinned upstream Bitcoin Core base image (tag + SHA256 digest).Makefileis the single source of truth for all infrastructure constants and provides commands for node lifecycle, wallet, transaction, and UTXO operations.- The project-managed Docker container is named
bitcoin-wallet-regtest. - The container runs from the project image
bitcoin-wallet-regtest:<version>, uses baked-in config fromdocker/bitcoin.conf, and stores chain state in the named volumebitcoin-wallet-regtest-data.
- Install and start Docker.
- Clone the repository and open the project root.
- Run
make btc-upto build the thin project image if needed and start the local Bitcoin Core node. - Run
make btc-wallet-readyto load the demo wallet or create it if missing. - Run
make btc-mineto mine 101 blocks and fund the wallet. - Run
make btc-balanceormake btc-utxosto inspect wallet funds.
The app reads Bitcoin RPC settings from Dart defines. The tracked local
development config lives in config/dev.env.
- VS Code launch configs already pass
--dart-define-from-file=config/dev.env. - Run from CLI with
flutter run --dart-define-from-file=config/dev.env. - Run tests with
flutter test --dart-define-from-file=config/test.env. - If you start the app without the define file, startup fails fast with a configuration error.
Typical local flow:
- Start the node with
make btc-up. - Prepare the wallet with
make btc-wallet-ready. - Mine blocks with
make btc-mine. - Inspect wallet state with
make btc-balanceandmake btc-utxos. - Create specific address types with
make btc-address-legacy,make btc-address-bech32, ormake btc-address-taproot. - Send funds with
make btc-send ADDRESS=<bcrt-address> AMOUNT=0.5. - Inspect a specific output with
make btc-utxo TXID=<txid> VOUT=0.
- Run
make helpfor the full list of commands (also seeMakefile). - See
docs/README.mdfor the documentation index and workflow notes. - Use
make btc-docker-stateto inspect only this project's Bitcoin Docker artifacts. - Use
make btc-clean-runtimeto remove the container and runtime state while keeping the project image. - Use
make btc-clean-allfor a full cold start cleanup, including the project image and versioned upstream base cache.
- The node runs in
regtest, notmainnetand nottestnet. - Chain data is stored in the named Docker volume
bitcoin-wallet-regtest-data, so it survives container recreation. - The tracked config from
docker/bitcoin.confis baked into the project image at build time. - The upstream base image is pinned by both tag and SHA256 digest for full reproducibility. To upgrade Bitcoin Core, update
BITCOIN_CORE_VERSIONand the digest inMakefile:docker buildx imagetools inspect ruimarinho/bitcoin-core:<new-version> | grep Digest
- The first startup needs network access to pull the upstream base image and build the project image.
- If Docker commands fail, make sure Docker Desktop or the Docker daemon is running.
- If the first
make btc-upis slow, Docker may still be fetching the versioned upstream base image before building the project image. - If a wallet command fails after restart, run
make btc-wallet-readyto load or recreate the wallet. - If you want a clean
regtestchain, runmake btc-reset-data.