Bitcoin
Chapter 53: Bitcoin Nodes
Section titled “Chapter 53: Bitcoin Nodes”Overview
Section titled “Overview”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.
53.1 Bitcoin Basics
Section titled “53.1 Bitcoin Basics”| Feature | Value |
|---|---|
| Consensus | Proof of Work (SHA-256) |
| Block Time | ~10 minutes |
| Block Size | 1-4 MB (SegWit/weight units) |
| Finality | Probabilistic — confirmations build confidence over time |
| Token | BTC |
53.2 Node Types
Section titled “53.2 Node Types”| Type | Description |
|---|---|
| Full Node | Downloads and validates the entire chain (~600+ GB, growing) |
| Pruned Node | Runs 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.
53.3 Running Bitcoin Core
Section titled “53.3 Running Bitcoin Core”Install
Section titled “Install”# 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 buildgit clone https://github.com/bitcoin/bitcoin.gitcd bitcoin./autogen.sh./configure --with-gui=nomake -j$(nproc)sudo make installConfiguration
Section titled “Configuration”mkdir -p ~/.bitcoinnano ~/.bitcoin/bitcoin.conf# bitcoin.confserver=1rpcuser=userrpcpassword=change-this-long-random-stringrpcbind=127.0.0.1rpcport=8332prune=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 txsdaemon=1⚠️ Use a long random
rpcpassword— the RPC server is unauthenticated-by-default and a weak password invites theft (a classic Bitcoin node attack).
53.4 Commands
Section titled “53.4 Commands”Start Node
Section titled “Start Node”# Start daemon (reads ~/.bitcoin/bitcoin.conf; --daemon forks to background)bitcoind
# Or explicit pruningbitcoind -prune=550RPC Commands
Section titled “RPC Commands”# Sync/chain status (the go-to health check)bitcoin-cli getblockchaininfo# → { "chain": "main", "blocks": N, "headers": M, "verificationprogress": 0.9999, ... }
# Get block countbitcoin-cli getblockcount
# Network + peersbitcoin-cli getnetworkinfobitcoin-cli getpeerinfo | jq 'length'
# Mempool sizebitcoin-cli getmempoolinfo
# Balance (if watching a wallet)bitcoin-cli getbalance
# Send transactionbitcoin-cli sendtoaddress "address" amountReading the health output: verificationprogress → 1.0 means fully synced; blocks vs headers gap means the node is still downloading headers/blocks.
| Port | Purpose |
|---|---|
| 8333 (TCP) | P2P — mainnet (public) |
| 8332 (TCP) | JSON-RPC — mainnet (localhost only!) |
| 18333 / 18332 | Testnet P2P / RPC |
| 18444 / 18443 | Regtest P2P / RPC |
Pinning Peers
Section titled “Pinning Peers”# 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)53.5 Operational Notes
Section titled “53.5 Operational Notes”- 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=550is 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-rpcbindto loopback. - Monitoring: Bitcoin Core metrics:
getblockchaininfo(tip/progress),getmempoolinfo,getpeerinfo; alert whenverificationprogress < 1for too long, peers drop to 0, or disk fills — same alerting model as Chapter 38.
Summary
Section titled “Summary”- Bitcoin uses PoW; finality is probabilistic (confirmations)
- Headers-first IBD +
assumevalidmake 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
End of Guide
Section titled “End of Guide”This completes the Blockchain Node Guide. Review the chapters and practice the hands-on tasks before your interview!
Last Updated: 2026-09-28