Skip to content

Bitcoin

Bitcoin is the first and largest cryptocurrency. Running a Bitcoin node supports network decentralization and gives you private, trustless access to the chain. Bitcoin Core (BTC Core) is the reference implementation.


FeatureValue
ConsensusProof of Work (SHA-256)
Block Time~10 minutes
Block Size1-4 MB (SegWit/weight units)
FinalityProbabilistic — confirmations build confidence over time
TokenBTC

TypeDescription
Full NodeDownloads and validates the entire chain (~600+ GB, growing)
Pruned NodeRuns the same validation but keeps only the last ~550 MiB-5 GB of blocks
Lightweight (SPV)Headers-only + Merkle proofs, trusts full nodes for data

How Initial Sync Works: Headers-First + AssumeValid

Section titled “How Initial Sync Works: Headers-First + AssumeValid”

Bitcoin Core does headers-first sync:

┌─────────────────────────────────────────────────────────────┐
│ INITIAL BLOCK DOWNLOAD (IBD) │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. Download ALL block headers first (cheapest part) │
│ → compute the header chain, detect forks │
│ │
│ 2. Walk an "assumed valid" checkpoint (assumevalid=...): │
│ at that height, transactions are NOT fully re-validated │
│ (they were already considered valid); blocks after it │
│ are fully validated │
│ │
│ 3. Swap to normal validation as the tip approaches │
│ │
└─────────────────────────────────────────────────────────────┘

-assumevalid (a hash in the release binary) trades a tiny amount of historical re-validation for massively faster IBD — the node still validates the UTXO set, policy, and every block after the checkpoint.


Terminal window
# Install dependencies (bsdmainutils is no longer needed on modern Ubuntu —
# it was removed from the dependency list in recent Bitcoin Core releases)
sudo apt-get install build-essential libtool autotools-dev \
automake pkg-config python3 libevent-dev libboost-dev
# Clone and build
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
./autogen.sh
./configure --with-gui=no
make -j$(nproc)
sudo make install
Terminal window
mkdir -p ~/.bitcoin
nano ~/.bitcoin/bitcoin.conf
# bitcoin.conf
server=1
rpcuser=user
rpcpassword=change-this-long-random-string
rpcbind=127.0.0.1
rpcport=8332
prune=550 # MiB — minimum is 550; on a pruned node no txindex
# txindex=1 # enable FULL tx index (required for getrawtransaction by txid
# # on historical txs; incompatible with pruning)
# blocksonly=1 # only announce blocks, never relay mempool txs
daemon=1

⚠️ Use a long random rpcpassword — the RPC server is unauthenticated-by-default and a weak password invites theft (a classic Bitcoin node attack).


Terminal window
# Start daemon (reads ~/.bitcoin/bitcoin.conf; --daemon forks to background)
bitcoind
# Or explicit pruning
bitcoind -prune=550
Terminal window
# Sync/chain status (the go-to health check)
bitcoin-cli getblockchaininfo
# → { "chain": "main", "blocks": N, "headers": M, "verificationprogress": 0.9999, ... }
# Get block count
bitcoin-cli getblockcount
# Network + peers
bitcoin-cli getnetworkinfo
bitcoin-cli getpeerinfo | jq 'length'
# Mempool size
bitcoin-cli getmempoolinfo
# Balance (if watching a wallet)
bitcoin-cli getbalance
# Send transaction
bitcoin-cli sendtoaddress "address" amount

Reading the health output: verificationprogress → 1.0 means fully synced; blocks vs headers gap means the node is still downloading headers/blocks.

PortPurpose
8333 (TCP)P2P — mainnet (public)
8332 (TCP)JSON-RPC — mainnet (localhost only!)
18333 / 18332Testnet P2P / RPC
18444 / 18443Regtest P2P / RPC
# bitcoin.conf — deterministic connectivity:
addnode=1.2.3.4:8333 # keep a connection to this peer, both directions
# connect=1.2.3.4:8333 # ONLY connect to these (isolated/private setups)

  • IBD time: on modern hardware + assumevalid + fast NVMe, mainnet IBD is ~1-2 days (was weeks before headers-first + assumevalid).
  • Disk: prune to save space (-prune=550 is the floor); full archive grows faster than storage costs (Chapter 30/pruning principles apply).
  • Privacy: run -onlynet=onion + Tor if you want to avoid revealing your IP; trim -rpcbind to loopback.
  • Monitoring: Bitcoin Core metrics: getblockchaininfo (tip/progress), getmempoolinfo, getpeerinfo; alert when verificationprogress < 1 for too long, peers drop to 0, or disk fills — same alerting model as Chapter 38.

  • Bitcoin uses PoW; finality is probabilistic (confirmations)
  • Headers-first IBD + assumevalid make initial sync practical
  • Full node ~600 GB+; pruned node validates identically with far less disk
  • Secure the RPC (rpcpassword, loopback-only), keep P2P 8333 open
  • Health = getblockchaininfo (progress + tip) + getpeerinfo

This completes the Blockchain Node Guide. Review the chapters and practice the hands-on tasks before your interview!


Last Updated: 2026-09-28