Testnet Mining Guide
Complete guide for setting up your BTQ wallet, running a node, and connecting to the mining pool on the BTQ testnet.
Testnet Mining Guide
Complete guide for setting up your BTQ wallet, running a node, and connecting to the mining pool.
Testnet quick reference:
- RPC port: 18332 — used by
btq-cliand applications to talk to your node - P2P port: 19333 — open this in your firewall to accept incoming peers
- Data directory:
~/.btq/test/— logs, wallet, and blockchain data - CLI flag: always pass
-testnettobtqdandbtq-cli
This guide builds on the Installation and Wallet Basics sections. Make sure you have BTQ Core built and installed before proceeding.
Prerequisites
Required Software
- BTQ Core daemon (
btqdandbtq-cli) — see Installation for build instructions and system requirements, or latest releases linked below. - BTQ-CCMiner (
ccminer) — available from the latest BTQ Releases. - Access to a BTQ mining pool — the public testnet pool is at pool.bitcoinquantum.com.
After downloading the binaries, you must change the file permissions to make them executable using chmod +x. See the Installation guide for details.
System Requirements
- Linux/WSL or UNIX environment (including macOS)
- NVIDIA GPU with CUDA 11 support (for GPU mining)
For full system requirements (RAM, disk, CPU), refer to the Installation page.
Starting BTQ Daemon
1. Create Configuration Directory
Create the BTQ data directory where configuration and blockchain data will be stored:
mkdir -p ~/.btq2. Create Configuration File
Create the BTQ configuration file at ~/.btq/btq.conf:
Testnet Configuration (Recommended for Testing)
cat > ~/.btq/btq.conf << EOF
# BTQ Configuration File
# Global settings
server=1
daemon=1
# Testnet-specific settings
[test]
rpcuser=btquser
rpcpassword=btqpass123
rpcallowip=127.0.0.1
rpcport=18332
rpcbind=127.0.0.1
port=19333
listen=1
gen=0
maxconnections=50
EOFMainnet Configuration
cat > ~/.btq/btq.conf << EOF
# RPC Settings
server=1
rpcuser=btquser
rpcpassword=btqpass123
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
# Network Settings
listen=1
# Other Settings
daemon=1
EOFSecurity Note: Change rpcuser and rpcpassword to strong, unique values in production! See the configuration section in Installation for more guidance on securing your node.
If you already maintain a btq.conf (for example from the Installation guide), add or adjust the [test] block instead of overwriting the entire file.
3. Start BTQ Daemon
Navigate to your BTQ Core directory and start the daemon:
For Testnet:
./btqd -daemon -testnetFor Mainnet:
./btqd -daemonFor Regtest (Local Testing):
./btqd -daemon -regtestSee the Running Modes section in Installation for more details on each network mode.
4. Verify Daemon is Synced & Running
Confirm the daemon is in sync with the blockchain network:
# Check blockchain info
./btq-cli -testnet getblockchaininfo
# Check network info
./btq-cli -testnet getnetworkinfo
# View debug log
tail -f ~/.btq/test/debug.logUse the debug log to watch for peer connections and stratum-related messages.
Creating a Wallet
For a comprehensive overview of wallet management, encryption, and key storage, refer to Wallet Basics. This section covers the essentials for creating a mining-focused wallet.
1. Create a New Wallet
For Testnet:
./btq-cli -testnet createwallet "dilithium_wallet"For Mainnet:
./btq-cli createwallet "my_mining_wallet"Expected output:
{
"name": "dilithium_wallet"
}2. Verify Wallet Creation
# List all wallets
./btq-cli -testnet listwallets
# Get wallet info
./btq-cli -testnet -rpcwallet=dilithium_wallet getwalletinfo3. Backup Your Wallet
# Backup wallet file
cp ~/.btq/test/wallets/dilithium_wallet/wallet.dat ~/wallet_backup_$(date +%Y%m%d).dat
# Or use built-in backup
./btq-cli -testnet -rpcwallet=dilithium_wallet backupwallet ~/wallet_backup.datCRITICAL: Store this backup in a secure location. Loss of this file means loss of funds! See the Backup section in Wallet Basics for detailed guidance on wallet backups and key storage.
Generating Mining Address
BTQ supports quantum-resistant Dilithium addresses. These are recommended for mining. For a full overview of Dilithium address types, key management, and import/export, see Wallet Basics — Generating Dilithium Addresses.
If you restarted the daemon since creating your wallet, load it first with your wallet.dat:
./btq-cli -testnet loadwallet "dilithium_wallet"Dilithium Address (Recommended for Mining)
Use getnewdilithiumaddress with no arguments. As of v0.4.2-testnet it returns a
P2MR (BIP360, witness v2) address — the single supported Dilithium receive type and the
correct mining payout target. See Dilithium Addresses for the full format.
For Testnet:
./btq-cli -testnet -rpcwallet=dilithium_wallet getnewdilithiumaddressFor Mainnet:
./btq-cli -rpcwallet=my_mining_wallet getnewdilithiumaddressThis RPC returns a JSON object, not a bare address string. Piping it straight into a file or
a shell variable captures the whole object — extract the address field:
./btq-cli -testnet -rpcwallet=dilithium_wallet getnewdilithiumaddress | jq -r '.address'Response shape:
{
"address": "tbtq1z...",
"p2mr_id": "...",
"scriptPubKey": "...",
"merkle_root": "..."
}P2MR addresses are Bech32m with witness version 2, so they read qbtc1z… on mainnet and
tbtq1z… on testnet — the 1z distinguishes them at a glance from ECDSA 1q SegWit addresses.
Do not pass "legacy" or "bech32". Since v0.4.2 the only accepted address_type is "p2mr";
anything else is rejected. Older guides showing getnewdilithiumaddress "" "legacy" or
getnewaddress "" "dilithium-bech32" refer to formats that are now historical or disabled.
Other Address Types
Legacy (Standard Bitcoin-style):
./btq-cli -rpcwallet=my_mining_wallet getnewaddress "" "legacy"Bech32 (Native SegWit):
./btq-cli -rpcwallet=my_mining_wallet getnewaddress "" "bech32"Save Your Address
# Export to a file for safekeeping (extract the address field)
./btq-cli -testnet -rpcwallet=dilithium_wallet getnewdilithiumaddress \
| jq -r '.address' > ~/my_btq_mining_address.txt
# View your address
cat ~/my_btq_mining_address.txtThis is where your mining rewards will be sent. Keep it safe!
Verify Address Ownership
Confirm the address belongs to your wallet before mining:
./btq-cli -testnet -rpcwallet=dilithium_wallet getaddressinfo YOUR_ADDRESSConnecting to Mining Pool
Mining Pool Details
| Detail | Value |
|---|---|
| Pool Address | 65.20.111.197 |
| Port | 3333 |
1. Prepare CCMiner
# Change permissions to executable
chmod +x ./ccminer
# Install prerequisites (if needed)
sudo apt-get update
sudo apt-get install -y libjansson42. Connect to Mining Pool
Basic Command:
./ccminer -a sha256d \
-o stratum+tcp://POOL_IP:PORT \
-u YOUR_BTQ_ADDRESS \
-p xExample with Actual Values:
./ccminer -a sha256d \
-o stratum+tcp://65.20.111.197:3333 \
-u n5KchJ9AJaiHRkLpKF7Bx8dbjsgt1CZdC4 \
-p x3. Expected Output
When successfully connected, you should see:
*** ccminer 2.3.1 for nVidia GPUs by tpruvot@github ***
Built with the nVidia CUDA Toolkit 11.5 64-bits
[2025-11-24 12:06:48] Starting on stratum+tcp://65.20.111.197:3333
[2025-11-24 12:06:48] NVML GPU monitoring enabled.
[2025-11-24 12:06:48] 1 miner thread started, using 'sha256d' algorithm.
[2025-11-24 12:06:49] Stratum difficulty set to 0.01
[2025-11-24 12:06:49] GPU #0: Intensity set to 25, 33554432 cuda threads
[2025-11-24 12:06:50] GPU #0: NVIDIA GeForce RTX 3090 Ti, 4196.47 MH/s
[2025-11-24 12:06:52] accepted: 1/1 (diff 2.369), 4207.80 MH/s yay!!!4. Advanced CCMiner Options
Use Specific GPU:
./ccminer -a sha256d \
-o stratum+tcp://65.20.111.197:3333 \
-u YOUR_ADDRESS \
-p x \
-d 0 # Use GPU 0Adjust Intensity (0-31):
./ccminer -a sha256d \
-o stratum+tcp://65.20.111.197:3333 \
-u YOUR_ADDRESS \
-p x \
-i 25 # Intensity 25Run in Background:
nohup ./ccminer -a sha256d \
-o stratum+tcp://65.20.111.197:3333 \
-u YOUR_ADDRESS \
-p x > miner.log 2>&1 &Stop background miners with pkill ccminer.
Monitoring Your Mining
Check Wallet Balance
# Check total balance
./btq-cli -testnet -rpcwallet=dilithium_wallet getbalance
# Check unconfirmed balance
./btq-cli -testnet -rpcwallet=dilithium_wallet getunconfirmedbalance
# List recent transactions
./btq-cli -testnet -rpcwallet=dilithium_wallet listtransactionsFor more wallet operations such as sending transactions and message signing, refer to Wallet Basics.
Understanding Mining Output
| Metric | Description |
|---|---|
MH/s | Mega-hashes per second (your mining speed) |
accepted | Number of valid shares submitted |
diff | Current difficulty level |
yay!!! | Successfully found a share/block |
Check Network Status
# Current block height
./btq-cli -testnet getblockcount
# Connection count
./btq-cli -testnet getconnectioncount
# Peer info
./btq-cli -testnet getpeerinfoTroubleshooting
Daemon Won't Start
# Check if already running
ps aux | grep btqd
# Kill existing process
killall btqd
# Check debug log for errors
tail -100 ~/.btq/debug.log
# Start with verbose logging
./btqd -daemon -debugSee the Troubleshooting section in Installation for additional build and runtime error guidance.
Can't Connect to Mining Pool
# Test connectivity
ping 65.20.111.197
telnet 65.20.111.197 3333
# Check firewall (if running pool)
sudo ufw status
sudo ufw allow 3333/tcpEnsure local firewalls permit outbound TCP/3333.
Wrong Network Mode
# Check current chain
./btq-cli getblockchaininfo | grep chain
# Stop daemon
./btq-cli stop
# Start in correct mode
./btqd -daemon # Mainnet
./btqd -daemon -testnet # Testnet
./btqd -daemon -regtest # RegtestRPC Authentication Errors
# Stop daemon
./btq-cli stop
# Edit config and fix credentials
nano ~/.btq/btq.conf
# Restart with explicit credentials
./btqd -daemon -rpcuser=btquser -rpcpassword=btqpass123Low Mining Performance
# Check GPU usage
nvidia-smi
# Check thermal throttling
nvidia-smi -q -d TEMPERATURE
# Increase intensity (try 25-28)
./ccminer -a sha256d -o ... -i 28Verify thermals and try higher intensity values gradually.
Mining Workflow
1. Confirm Node Readiness
Build and sync btqd using the Installation guide, then verify you can query getblockchaininfo.
2. Prepare Payout Wallet
Use Wallet Basics to create a Dilithium-enabled wallet and record the mining address.
3. Launch the Miner
Point ccminer at stratum+tcp://65.20.111.197:3333 with your address and chosen GPU settings.
4. Monitor Rewards
Watch miner.log, wallet balances, and debug logs to confirm accepted shares and payouts.
Quick Reference
Network Ports
| Network | P2P Port | RPC Port | Address Prefix |
|---|---|---|---|
| Mainnet | 9333 | 8332 | b, D, dbtc |
| Testnet | 19333 | 18332 | n, tdbt |
| Regtest | 19444 | 18443 | n, rdbt |
Common Commands
Wallet Operations:
# Create wallet
./btq-cli -testnet createwallet "wallet_name"
# Generate dilithium address (P2MR; returns a JSON object)
./btq-cli -testnet -rpcwallet=wallet_name getnewdilithiumaddress | jq -r '.address'
# Check balance
./btq-cli -testnet -rpcwallet=wallet_name getbalance
# List transactions
./btq-cli -testnet -rpcwallet=wallet_name listtransactions
# Backup wallet
./btq-cli -testnet -rpcwallet=wallet_name backupwallet ~/backup.datMining Operations:
# Start mining
./ccminer -a sha256d -o stratum+tcp://POOL:3333 -u ADDRESS -p x
# Mine in background
nohup ./ccminer -a sha256d -o stratum+tcp://POOL:3333 -u ADDRESS -p x > miner.log 2>&1 &
# Check mining log
tail -f miner.log
# Stop background miner
pkill ccminerNode Operations:
# Start daemon
./btqd -daemon -testnet
# Stop daemon
./btq-cli -testnet stop
# Get blockchain info
./btq-cli -testnet getblockchaininfo
# Get network info
./btq-cli -testnet getnetworkinfo
# View log
tail -f ~/.btq/test/debug.logKey Mining Pool Details
| Item | Value |
|---|---|
| Pool endpoint | stratum+tcp://65.20.111.197:3333 |
| Testnet RPC | 127.0.0.1:18332 |
| Testnet P2P | 0.0.0.0:19333 (listening) |
| Recommended address type | Dilithium (legacy) |
| Background miner log | ~/miner.log |
Security Best Practices
- Backup Your Wallet: Always keep encrypted backups in multiple locations. See Wallet Basics — Backup for details.
- Secure RPC: Use strong passwords and restrict RPC access to localhost.
- Firewall: Only open necessary ports (pool ports, P2P if running full node).
- Keep Private Keys Secure: Never share
wallet.dator private keys. - Update Regularly: Keep BTQ Core and mining software up to date.
- Monitor Access: Regularly check logs for unauthorized access attempts.
Need Help?
Join the BTQ Telegram community to get support, report bugs, and connect with other miners.
Wallet Basics
Step-by-step guide to setting up a BTQ wallet, generating Dilithium addresses, sending transactions, and managing keys in BTQ Core
Mining Difficulty
How BTQ difficulty retargeting holds up: the mathematics, a 293-trial Monte Carlo campaign, and live multi-node fork-resolution runs on regtest.