Skip to main content

Learning objectives

  • Understand what it means to run a full Bitcoin node
  • Know the difference between bitcoind and bitcoin-cli
  • Identify where Bitcoin Core stores data (blocks, wallets, mempool)
  • Understand how RPC access works and how to secure it

Lesson outline

What is a full node?

A full node:
  • Validates every block and transaction
  • Stores a full copy of the blockchain
  • Participates in network consensus rules
  • Enforces transaction policy (fees, size, etc.)
When you run bitcoind with default settings (mainnet), it:
  • Connects to the peer-to-peer Bitcoin network
  • Downloads and verifies all ~800GB of block data
  • Stores this in a dedicated data directory
In regtest or testnet, it simulates this behavior on a smaller scale.
Full nodes are essential for decentralization, they enforce the rules of Bitcoin without trusting any third party.

bitcoind vs bitcoin-cli

bitcoind: the daemon that runs the full Bitcoin node. bitcoin-cli: the command-line client used to send RPC commands to bitcoind. In regtest or testnet, it simulates this behavior on a smaller scale. Example interaction:
  • bitcoind -regtest -daemon
  • bitcoin-cli -regtest getblockchaininfo
bitcoin-cli is just a frontend. It doesn’t do any validation. All the logic lives in the running bitcoind instance. Tip: Think of bitcoind as the server, and bitcoin-cli as your terminal-based admin tool. Example interaction:

Bitcoin Core data directory structure

By default:
  • Linux: ~/.bitcoin/
  • Regtest: ~/.bitcoin/regtest/
  • Testnet: ~/.bitcoin/testnet3/
Key folders & files:

Understanding the mempool

The mempool is Bitcoin Core’s memory-based pool of unconfirmed transactions. It grows when blocks are full or fee pressure is high. Use getrawmempool to view TXs in the pool:
In regtest, the mempool clears instantly when you mine blocks, useful for testing.

Wallets in Bitcoin Core

Bitcoin Core now supports multi-wallet mode: Each wallet has its own balance, address pool, and UTXOs. Wallets are stored in: ~/.bitcoin/wallets/ You can create or load a wallet like this:
Wallets must be loaded to access balances or send transactions.

Permissioning and RPC ports

Default RPC Port:
  • Mainnet : 8332
  • Testnet : 18332
  • Regtest : 18443
Authentication: By default, Bitcoin Core uses .cookie file auth (preferred for security). Or you can manually set rpcuser and rpcpassword in bitcoin.conf. Example bitcoin.conf:
Security best practices:
  • Never expose RPC to the public internet
  • bitcoind serves RPC over plain HTTP, so use an SSH tunnel or VPN if accessing over a network
  • For Docker or remote CLI use: restrict to localhost or use SSH port forwarding

Activity

Inspect your Bitcoin data directory:
  1. Navigate to ~/.bitcoin/regtest/
  2. List and describe what’s in blocks/, chainstate/, and wallets/
  3. Run: