A lightweight Bitcoin blockchain explorer built in Go using Bitcoin Core JSON-RPC. This project was developed in a step-by-step bootcamp style, progressively building from basic RPC calls to a full blockchain inspection tool.
This project connects to a Bitcoin Core regtest node and allows you to:
- Query wallet balances
- List wallet transactions
- Decode raw transactions
- Inspect blocks
- Fetch blockchain metadata
- Interact with multiple wallets (alice, bob, etc.)
It acts as a minimal blockchain explorer backend.
Fetch balances for specific wallets:
getbalance
View wallet transaction history:
listtransactions
Includes:
- Category (receive/send/mining)
- Amount
- Transaction ID
- Confirmations
Decode raw transactions:
getrawtransaction
Shows:
- VIN (inputs)
- VOUT (outputs)
- CoinBase detection (mining rewards)
- Address extraction
Handles both:
addresses[]- fallback
address
Fetch network status:
getblockchaininfo
Displays:
- Chain type (regtest/testnet/mainnet)
- Block height
- Difficulty
Inspect blocks using:
getblockhashgetblock
Features:
- Auto-fetch best block if no hash provided
- Block height
- Timestamp
- Transaction count
- Transaction list
Go Application
↓
RPC Client (HTTP + JSON)
↓
Bitcoin Core (regtest)
↓
Blockchain Data
All blockchain interactions go through a reusable RPC wrapper:
- Handles authentication (rpcuser / rpcpassword)
- Supports wallet-specific routing
- Decodes JSON responses into Go structs
- Start Bitcoin Core in regtest:
bitcoind -regtest -daemon- Create/load wallets:
bitcoin-cli -regtest createwallet "alice"
bitcoin-cli -regtest createwallet "bob"- Run the Go app:
go run .=== Wallet: alice ===
Balance: 89.9999859 BTC
=== Transactions for alice ===
IN +50.00000000 BTC | 9 confs
TXID: dbe6ff95...
OUT -10.00000000 BTC | 1 confs
TXID: a4171cb8...
=== BLOCK INFO ===
Height: 102
Hash: 000000...
Time: 1710000000
Tx count: 1
- JSON-RPC communication with Bitcoin Core
- Methods like
getblock,getbalance,listtransactions
- Loading wallets into memory
- Using
/wallet/<name>RPC routing
- VIN / VOUT model (UTXO system)
- ScriptPubKey decoding
- Coinbase transactions
- Struct mapping to JSON
- Error handling patterns
- Reusable RPC client design
- Wallet not loaded errors → solved via
loadwallet - Multiple wallet selection → solved via
/wallet/<name> - JSON mismatches (address vs addresses[])
- Regtest configuration issues
- RPC authentication setup
- Go 1.18+
- Bitcoin Core (regtest mode enabled)
- RPC enabled in
bitcoin.conf
Example config:
server=1
regtest=1
rpcuser=place_username_here
rpcpassword=place_password_here
- REST API wrapper
- Mempool explorer
- UTXO tracker
- Frontend dashboard
- Real-time block updates (WebSockets)
- Transaction graph visualization
Built as part of a Bitcoin RPC bootcamp project — evolving from basic RPC calls to a full blockchain inspection tool in Go.