To trade crypto, you need a crypto wallet, and each wallet comes with a public key. The XPUB key is like the master key, capable of generating child public keys for every new crypto transaction. Let’s explain with some more context what XPUBs are.
Crypto Wallets at a Glance
Every crypto user must have a cryptocurrency wallet to conduct crypto transactions. You can think of the crypto wallet as a digital purse for storing the cryptocurrencies you own. You reach into your wallet whenever you want to send crypto to another user or to receive additional funds to add to it. From a practical point of view, it’s okay to imagine crypto wallets like this. However, the background story of how a crypto wallet works is different.
Your wallet doesn’t actually store cryptocurrencies like Bitcoin (BTC). Instead, they’re kept in the blockchain ledger. A Bitcoin wallet, for example, is software built to interact with the Bitcoin blockchain. It holds your private key and public address but not the crypto coins.
A cryptocurrency wallet must have a private key, a public key, and a public address, which are nothing other than random strings of numbers and letters. The private key is like a password you use to access data and resources in your wallet. A wallet owner must never share it with anyone because access to the private key enables a user to send funds to other crypto wallets.
On the other hand, you share the public key with other users to transact with your crypto funds. You can think of a public key as an account number. Only your private key can decrypt information that is encrypted with your public key. So, when someone sends crypto to a public key, only the wallet’s owner’s private key can access it.
The public address is a shorter series of numbers and letters derived from your private key. It specifies the location of your cryptocurrency wallet on the blockchain.
Common cryptocurrency wallets include custodial wallets, mobile wallets, desktop wallets, and hardware wallets. Each of them has a unique use case and safety profile.
What is an XPUB?
XPUB stands for Extended Public Key, a particular type of public key that serves to generate child public keys for crypto wallets. The Bitcoin Improvement Proposal (BIP32), established in 2012, introduced the XPUB standard to Bitcoin. But let’s see what’s the purpose of having an XPUB.
In doing transactions, blockchains rely on the concept of UTXOs or unspent transaction outputs. Suppose a user wants to send X amount of crypto to another wallet. In that case, the blockchain moves the total amount by dividing it between the receiving wallet (X amount) and a brand new wallet address (the remaining funds).
For example, you have 100 BTC and want to send 90 BTC to wallet address A. This means that 90 BTC will reach wallet address A, and 10 BTC will go to a newly created wallet address. The purpose of using a new address for every transaction is mainly to protect the user’s privacy.
But this poses another problem. The wallet address will keep changing with every transaction. How do other users know which address to transact with if they want to send you funds, for example? Crypto wallets employ the Hierarchical Deterministic (HD) framework, a method for generating and managing addresses. Every new public address comes from XPUB. Whenever you receive crypto funds, XPUB will create a new receiving address.
XPUB holds information about public keys only, but not private keys. As such, it can’t grant you access to your wallet’s funds. However, it allows you to view the transaction activities of your wallet. Simply put, an XPUB is like a Read Only form of all the balances and transactions of your wallet from the very first day it became active. Each of your wallet assets has its own XPUB, for example, one XPUB for Bitcoin, one for Ethereum, one for Litecoin, and so on.
Safeguarding your XPUBs
We highly discourage crypto users from sharing or showing their XPUBs to other users. If a third party knows your XPUB, it enables them to track your wallet’s payment history and possibly cause disruptions that can block access to your crypto funds.
On some occasions, you may be asked to reveal your XPUB. For example, if you use crypto tax software, it may request your wallet’s transactions to do the tax calculations. In this case, you can safely grant the software access to your transaction information while withholding full access to your wallet’s digital assets.
Even though a new Bitcoin cash address doesn’t become invalid after generation and can be used for receiving other payments, we strongly recommend that you use a new address for every transaction. Using a single address for all your transactions makes it easier for malicious users to track your payment history.
Main Takeaways
XPUBs are part of the complex cryptographic processes that take place behind the scenes of crypto wallets’ operation. A crypto wallet doesn’t store your crypto assets. It’s simply a user interface that interacts with the underlying blockchain, which actually stores the crypto coins.
Each wallet has a private and a public key. Unlike bank account numbers, your wallet’s public address should change with each new crypto transaction. Not reusing the same address provides better security and privacy of your transaction history. XPUBs are the master key that generates new addresses and provides access to a wallet’s full transaction history.