Menu
Bitcoin Beginner 8 min read

Bitcoin Test Networks

Guide to Bitcoin testnet, signet, and regtest for agent development. Free coins, testing environments, and best practices.

testnet signet regtest development testing

Bitcoin Test Networks

Never test with real bitcoins. Bitcoin provides multiple test networks for development and experimentation.

Network Comparison

NetworkCoinsBlock TimeStabilityUse Case
MainnetReal BTC~10 minStableProduction
Testnet3Free tBTC~10 minVariableIntegration testing
SignetFree sBTC~10 minStableReliable testing
RegtestGeneratedInstantLocalUnit testing

Testnet3

The primary public test network since 2012.

Characteristics

  • Address prefix: m or n (P2PKH), 2 (P2SH), tb1 (Bech32)
  • Genesis block: Different from mainnet
  • Difficulty: Resets if no block for 20 minutes
  • Coins: Free from faucets

API Access

# mempool.space testnet
curl https://mempool.space/testnet/api/blocks/tip/height

# Address info
curl https://mempool.space/testnet/api/address/{address}

Faucets

FaucetURL
coinfaucet.euhttps://coinfaucet.eu/en/btc-testnet/
mempool.cohttps://testnet-faucet.mempool.co/
bitcoinfaucethttps://bitcoinfaucet.uo1.net/

Limitations

  • Unstable difficulty: Long block times during low activity
  • Spam: Sometimes flooded with test transactions
  • Reorgs: More common than mainnet

Signet

A more reliable test network with signed blocks (BIP-325).

Characteristics

  • Address prefix: Same as testnet (tb1)
  • Block signing: Centralized signers (default: Bitcoin Core devs)
  • Predictable blocks: ~10 minutes, no difficulty resets
  • Coins: Free from faucets

Why Use Signet?

TestnetSignet
Unpredictable blocksConsistent 10-min blocks
Difficulty resetsStable difficulty
Anyone can mineSigned by authorities
More reorgsFewer reorgs

API Access

# mempool.space signet
curl https://mempool.space/signet/api/blocks/tip/height

Faucet

Configuration

# bitcoin.conf
signet=1
[signet]
signetchallenge=... # Default uses Bitcoin Core signet

Regtest (Regression Test)

Local, private test network for development.

Characteristics

  • No network: Runs locally only
  • Instant blocks: Generate on demand
  • Full control: You create all blocks and transactions
  • Perfect for: Unit tests, CI/CD

Setup

# Start regtest node
bitcoind -regtest -daemon

# Create wallet
bitcoin-cli -regtest createwallet "test"

# Generate address
bitcoin-cli -regtest getnewaddress

# Mine 101 blocks (100 for maturity + 1)
bitcoin-cli -regtest generatetoaddress 101 <address>

# Check balance
bitcoin-cli -regtest getbalance

Instant Transactions

# Send transaction
bitcoin-cli -regtest sendtoaddress <address> 1.0

# Mine block to confirm
bitcoin-cli -regtest generatetoaddress 1 <mining_address>

Network-Specific Settings

Address Prefixes

TypeMainnetTestnet/Signet
P2PKH1m or n
P2SH32
Bech32bc1tb1

Version Bytes

Key TypeMainnetTestnet
WIF0x800xef
xpub0x0488B21E0x043587CF
xprv0x0488ADE40x04358394

Agent Development Workflow

1. Unit Tests (Regtest)

# Fast, isolated tests
def test_transaction_creation():
    # Generate blocks for funds
    rpc.generatetoaddress(101, address)

    # Create and broadcast transaction
    txid = rpc.sendtoaddress(recipient, 0.1)

    # Mine to confirm
    rpc.generatetoaddress(1, address)

    # Verify
    tx = rpc.gettransaction(txid)
    assert tx['confirmations'] == 1

2. Integration Tests (Signet)

# Realistic testing with stable network
def test_payment_flow():
    # Get signet coins from faucet first

    # Test with real network conditions
    txid = broadcast_transaction(signed_tx)

    # Wait for confirmation (~10 min)
    wait_for_confirmations(txid, 1)

3. Staging (Testnet)

# Full integration before mainnet
def test_production_flow():
    # Test against testnet services
    # Verify third-party integrations
    # Load testing

Best Practices

Do

  • ✅ Always start development on regtest
  • ✅ Use signet for realistic testing
  • ✅ Test edge cases (reorgs, failures)
  • ✅ Keep testnet/mainnet code paths separate
  • ✅ Return testnet coins to faucets when done

Don’t

  • ❌ Never test with real BTC
  • ❌ Don’t assume testnet stability
  • ❌ Don’t hardcode network parameters
  • ❌ Don’t rely on testnet for production checks

Configuration Examples

JavaScript (bitcoinjs-lib)

const bitcoin = require('bitcoinjs-lib');

// Mainnet (default)
const mainnet = bitcoin.networks.bitcoin;

// Testnet
const testnet = bitcoin.networks.testnet;

// Regtest
const regtest = bitcoin.networks.regtest;

// Use network
const address = bitcoin.payments.p2wpkh({
  pubkey: publicKey,
  network: testnet
}).address;

Python (python-bitcoinlib)

from bitcoin import SelectParams

# Select network
SelectParams('testnet')  # or 'mainnet', 'regtest'

Machine-Readable Summary

{
  "topic": "bitcoin-test-networks",
  "networks": {
    "testnet": {
      "prefix_bech32": "tb",
      "api": "https://mempool.space/testnet/api"
    },
    "signet": {
      "prefix_bech32": "tb",
      "api": "https://mempool.space/signet/api"
    },
    "regtest": {
      "prefix_bech32": "bcrt",
      "local_only": true
    }
  },
  "faucets": {
    "testnet": ["https://coinfaucet.eu/en/btc-testnet/"],
    "signet": ["https://signetfaucet.com/"]
  }
}