Understanding Spend and Change Addresses in Bitcoin

9 replies 402 views
planktonHero Member
Posts: 1287 · Reputation: 2049
#1Nov 12, 2023, 04:01 PM
Hey everyone. Got a quick question about bitcoin transactions. If I send 1 bitcoin from my 10, does it create three entries? Like one for spending, one for you, and one for my change?
8 Reply Quote Share
cobra51Newbie
Posts: 100 · Reputation: 31
#2Nov 12, 2023, 07:09 PM
Well, not exactly. Addresses are a bit abstract. Blockchain just has unspent outputs. You don’t create three entries, just one transaction showing the unspent output being spent and the new ones being created.
13 Reply Quote Share
0x4lphaFull Member
Posts: 524 · Reputation: 509
#3Nov 12, 2023, 10:54 PM
It's true, but the terminology can be misleading. Those are just terms we use to explain what’s happening. It’s one transaction with inputs and outputs, not three separate entries.
11 Reply Quote Share
planktonHero Member
Posts: 1287 · Reputation: 2049
#4Nov 12, 2023, 11:04 PM
So, the spend and change addresses have their own private keys? I thought they came from the same one. How does that work in hardware wallets like Ledger?
9 Reply Quote Share
cobra51Newbie
Posts: 100 · Reputation: 31
#5Nov 13, 2023, 01:23 AM
Not entirely. P2PKH has been around for a while, but the concept of addresses evolved. They’re hashed versions of public keys now. And HD wallets can generate many pairs from a master key.
8 Reply Quote Share
planktonHero Member
Posts: 1287 · Reputation: 2049
#6Nov 13, 2023, 10:57 AM
Got it, thanks for clarifying. I didn’t know about the master public key in HD wallets. Really helpful info!
7 Reply Quote Share
0xChadNewbie
Posts: 514 · Reputation: 3
#7Nov 13, 2023, 01:54 PM
Just a quick note, in those HD wallets, the addresses follow specific paths like m/purpose'/coin'/account'/chain_index/address_index. Each change address is derived from an internal chain.
5 Reply Quote Share
gang2015Member
Posts: 693 · Reputation: 62
#8Nov 13, 2023, 05:53 PM
Good point about mentioning transaction fees in your talk. It’s not cheap to send bitcoin sometimes.
5 Reply Quote Share
0xNodeMember
Posts: 680 · Reputation: 80
#9Nov 14, 2023, 11:36 AM
Right. Those entries are all part of the same transaction. It’s about inputs and outputs. And it’s scripts, not addresses, that the blockchain directly interacts with.
9 Reply Quote Share
Posts: 187 · Reputation: 37
#10Nov 14, 2023, 03:58 PM
True that. We've had some crazy times with transaction fees lately. They're calming down now, but I don't think we'll see super low fees anytime soon.
12 Reply Quote Share

Related topics