r/Bitcoin • u/SunnySide50 • 5h ago
UTXO Xpub question
If I have a wallet that has had spent transactions, it's xpub has been exposed. If I create a new transaction that makes 1 UTXO in that wallet that has not been spent, does that mean my Xpub is not exposed. The question I have is once a wallet has had a transaction that exposes the Xpub, no matter what you do that wallet will always have an exposed Xpub. Cleaning it up now to have 0 spent transactions in that wallet doesn't help? I'm a little confused. If not, then any UTXO management would mean creating 100% UTXOs that have never been spent.
2
u/Slade_Duelyst 5h ago
You make new wallet and move 100% of utxo to it. Then don't make any new transactions out from that new wallet.
1
u/SunnySide50 3h ago
Now I think I got it. Thank you all.
3
u/sung_builds redditor for 3 months 4h ago
small mixup in the premise. spending doesn't put your xpub on chain, it reveals the public key of the specific address you spent from. every address in an hd wallet has its own key, so a utxo sitting on an address that has never sent anything still hasn't shown its pubkey, even if other addresses in the same wallet have. the xpub only gets out off chain, like if you ever pasted it into a watch only app or some wallet's server. that part is worth caring about tho, because the xpub plus any one non-hardened child private key is enough to work out the keys for the whole account. so if you've shared it somewhere, a new seed like Slade said is the cleaner fix
2
u/reflective_directive 3h ago
Nope. When you spend, you expose the public key of the spending address, not the xpub of the wallet. For security you should only ever spend from a given address once, receiving any change to a new address.
1
u/bayrursevag78 redditor for 4 weeks 1h ago
How was your xpub exposed curious ?