Module 3: Wallets and Addresses in Bitcoin Core

Learning Objectives

By the end of this module, you will:

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


1.

Creating and Loading Wallets

Bitcoin Core supports multiple wallets.

Create a new wallet:

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:

List loaded wallets

Load an existing wallet manually:

Load an existing wallet

2.

Generating New Addresses

Once a wallet is loaded, generate a new address:

Generate a new address

To specify a label (more on this below):

Generate a new address with a label

To choose an address format:

Generate addresses with specific formats

3.

Address Formats: Bech32 vs Legacy

FormatCLI StringLooks LikePros
Bech32bech32bc1...Lower fees, native SegWit, modern
P2SHp2sh-segwit3...SegWit wrapped in P2SH
Legacylegacy1...High fees, no SegWit support

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


4.

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:

Import a watch-only address

Use listunspent or getbalance to see funds received to that address.


5.

Using Labels for Addresses

Labels help you track usage or assign context to addresses.

Get new address with a label

Now you can query:

Get addresses by label

Labels are stored per-wallet. Use them to track:

Payment types (e.g. salary, invoice)

Customer IDs

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:

Bonus activity commands
Did you find this page useful?