Skip to main content

Learning objectives

  • Create and load Bitcoin Core wallets via the CLI
  • Generate Bech32 and legacy-style addresses
  • Understand the difference between active and watch-only wallets
  • Use labels to track address purposes or user flows

Creating and loading wallets

Bitcoin Core supports multiple wallets. Create a new wallet:
This:
  • Creates a directory at ~/.bitcoin/regtest/wallets/user_wallet
  • Initializes a keypool and metadata
  • Loads the wallet into memory automatically
List currently loaded wallets:
Load an existing wallet manually:
Wallets must be loaded to interact with them (e.g. send, getbalance, generate addresses).

Generating new addresses

Once a wallet is loaded, generate a new address:
To specify a label (more on this below):
To choose an address format:
Caution: Wallets must be loaded to interact with them (e.g. send, getbalance, generate addresses).

Address formats: Bech32 vs legacy

In production, always prefer Bech32 unless interacting with legacy systems.

Watching vs active wallets

Active wallets:
  • Contain private keys
  • Can sign and spend
Watch-only wallets:
  • Only store addresses (public keys)
  • Cannot spend, used for audit or monitoring
Add a watch-only address. Bitcoin Core’s descriptor wallets need a wallet with private keys disabled:
Use listunspent or getbalance to see funds received to that address.

Using labels for addresses

Labels help you track usage or assign context to addresses.
Now you can query:
Labels are stored per-wallet. Use them to track:
  • Payment types (e.g. salary, invoice)
  • Customer IDs
  • Internal routing (e.g. swap_funding)

Activity

Run the following:
  1. Create a wallet: demo_wallet
  2. Load it if needed: loadwallet demo_wallet
  3. Generate one Bech32 and one legacy address.
  4. Add a watch-only address for a friend’s wallet (replace <friends_address> with an actual address).
  5. Label two addresses: one for merchant, one for salary.
Bonus: