The Identity Book: Legacy Labels vs. Modern Address Management
6. The Identity Book: Legacy Labels vs. Modern Address Management
In the early days of Bitcoin, the wallet used a system called "Accounts." You could create an account named "Coffee" and another named "Rent," and the wallet would try to keep your coins separate. However, this system was fundamentally flawed. It was complex, prone to accounting errors, and did not reflect the underlying reality of the UTXO model. In the modern Bitcoin Core, "Accounts" have been discarded and replaced by a much simpler and more powerful system: Labels. Labels are "Metadata Tags" that you can attach to addresses and transactions without changing the physical logic of the coins. It is the "Address Book of the Sovereign."
Understanding the shift from Accounts to Labels is the key to maintaining "Wallet Hygiene." Labels allow you to keep track of who sent you money and why, without falling into the trap of assuming that your balance is a single pool of funds. They provide the "Human Context" required to manage a sovereign bank. In the source code, this is managed by the address book logic, which maps a "Destination" to a human-readable name.
Analyzing the Identity Map: CAddressBookData
In the wallet database, each address you interact with is stored with associated data. This data includes the label you gave it and the "Purpose" for which the address was created (e.g., "send" or "receive"). This mapping is stored locally and is never broadcast to the network.
/**
* This structure holds the metadata for an entry in the wallet's address book.
*/
struct CAddressBookData
{
// 1. The Human Name (e.g., "Alice" or "Exchange").
std::string name;
// 2. The "Purpose" of the address. This tells the GUI how to display it.
// Common values are "send" for contacts and "receive" for your own addresses.
std::string purpose;
// 3. DestData: A map for additional extensions, such as payment URIs.
std::map<std::string, std::string> destdata;
};
Explaining the Identity Book: The Private Ledger
-
name(The Label): Think of your wallet as a "Private Contact List." When you receive money from a friend, you can label their address with their name. This label is purely for your own "Internal Accounting." The person who sent you the money never sees your label, and the blockchain doesn't know it exists. It is the "Organization of the Sovereign," allowing you to search your history for "Alice" and see every payment you've exchanged. -
purpose: Bitcoin Core automatically categorizes addresses. If you generate an address to receive money, its purpose is marked as "receive." If you add an address to your book to send money, its purpose is "send." This "Categorization" helps the wallet show you the right addresses at the right time. It is the "Intelligence of the Book." -
destdata: This is an "Extensible Map" that allows the wallet to store extra information without breaking the main logic. This might include things like "Payment Request IDs" or "Merchant Notes." Because this data is stored in yourwallet.dat, it is protected by your own encryption. No one can "Hack" your address book unless they have access to your machine. It is the "Security of the Identity."
The Power of Labeling: Clarity and Privacy
Good labeling is the foundation of Coin Control. If you label your coins correctly (e.g., "From My Employer" vs. "From Anonymous Friend"), you can then use those labels to decide which coins to spend in the future. This allows you to avoid "Mixing" your identities, which is the most important part of Bitcoin privacy. Labels are the "Intelligence of the Sovereign," the tool that allows you to manage your financial "Digital Shadows" with precision. You are the "Clerk of the Identity Book," the one who ensures your bank’s records are organized, clear, and private.
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: